How to speed up installing plugins and upgrading WordPress

As you’re using a VPS with SSH access, give WP-CLI a try http://wp-cli.org/ can work wonderfully http://centminmod.com/nginx_configure_wordpress_ffpc_plugin.html#installwp for example to install limit login attempts plugin just run this command from SSH within your wordpress install directory wp plugin install limit-login-attempts –activate –allow-root full list of command line options at http://wp-cli.org/commands/ updating plugins http://wp-cli.org/commands/plugin/ & http://wp-cli.org/commands/plugin/update/ … Read more

URL RewriteRule doesn’t work when using WP Database Participants in my WordPress website

I’d try changing the order of your rules. Once the default WP rules run, your URL will be rewritten and your last rule won’t work. SetEnv no-gzip dont-vary RewriteEngine On RewriteRule ^produse/piese-schimb-utilaje-agricole/([0-9]+)/?$ ^produse/piese-schimb-utilaje-agricole/?listpage=$1&search_field=none&value=&operator=LIKE&sortBy=denumire&ascdesc=asc&submit=&sortstring=denumire&orderstring=asc#participants-list [NC,L] # Turn mod_rewrite on RewriteEngine On RewriteBase / RewriteRule ^index\.php$ – [L] # add a trailing slash to /wp-admin RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ … Read more

Translating wordpress plugin

You get the current language of the install with the function get_locale(). WordPress save the language in theoptions table, option_name is WPLANG. But inside the Multisite install is in the table sitemeta. But is not important. You should use the default functions to load a language file inside the theme template or the plugin. Theme: … Read more

WordPress plugin – multiple php files

In most cases you shouldn’t access your plugin’s PHP files directly. By itself file is just a file, it has no way of knowing it is part of WordPress installation. Even purposely loading WP core from arbitrary file is very challenging to do in a generic and reliable way. What you should be doing is … Read more

How to redirect from plugin page

Added hook to process all form values and than redirecting as per process result: Added below PHP code in theme/functions.php: function process_form(){ //code goes here } add_action( ‘admin_post_appointment_form_process’, ‘process_form’ ); And added/updated below html to form: <form name=”frm1″ id=”frm1″ action=”<?php echo home_url()?>/wp-admin/admin-post.php” method=”post”> <input type=”hidden” name=”action” value=”appointment_form_process”> Thanks for @Milo comment.

how to open image gallery in a post/page?

Whenever you create a gallery, in the gallery settings (right side of the Edit Gallery screen), you have the option Link to: Link to attachment page Link to media file Nothing Link to media file will open the image. Be advised that without some form of Lightbox plugin, the image will NOT open in an … Read more

Media Playlist Plugin

Here’s a quick example showing how you would pass php data to your script. First, we hook our function to the wp_enqueue_scripts action. Inside, we enqueue the script that contains the player and initialization code (this is probably two separate files, but I’ve condensed it to a single file in this example). Next, we call … Read more

WordPress Plugin Localization

The filter comes with the text domain as second argument. So you could do this: function wpdev_170138_plugin_locale( $locale, $domain ) { if ( $domain === ‘myplugin’ ) { return get_option( ‘jezik’ ); } return $locale; } add_filter( ‘plugin_locale’, ‘wpdev_170138_plugin_locale’, 10, 2 ); Now only your plugin’s locale is changed.