Updating servers at once in web cluster

I don’t think the database schema ever changes so drastically that the versions of wordpress on box 2 + 3 would be prevented from reading from the DB after you’ve updated on box 1, however it depends what version you are upgrading from. Why not set a similar environment locally and test upgrading site 1, … Read more

Force Cron to run only on one server

I would create a constant in the wp_config.php defining which Server you are on. So far so good, not really magic. The tricky part, as you mentioned is to get the cron running for sure, and not aborting if it’s accidentally the wrong server. Try the function like this: function my_cron_callback() { if ( MY_SERVER_SETUP … Read more

WordPress Permalinks on Mac OSX Server 5 (El Capitan)

I’d check a few things Apache2 logs open a terminal Check error logs at tail -f /var/log/apache2/error_log Check access logs at tail -f /var/log/apache2/access_log WordPress Check .htaccess has correct rules for basic setup enable wp debugging to see if you can log further errors when the redirect happens this is how you enable WP logging … Read more

How to clear WordPress Cache from Server/FTP/Remote location

WordPress has no native page source output caching. In vanilla installation changes to templates should show up immediately. If that doesn’t happen there are several possible reasons: there is static page cache plugin installed, which serves stale version (the specific implementation of cache would depend on a plugin); there is a caching layer between the … Read more

WordPress hangs when I publish or update a post [closed]

Initially this sounds like a hosting problem and not a WordPress issue. Where are you hosted? Shared? Dedicated? php version? mysql version? Run through a typical wp hack protocol and check for base64 code in wp-config.php, any theme files and akismet plugin files… also any other php files. Database hacks are sometimes hard to find … Read more

how to add new .webm mime types

The WebM file format isn’t known to WordPress by default, you have to add it. add_filter( ‘upload_mimes’, ‘custom_mimes’ ); function custom_mimes( $mimes ){ $mimes[‘webm’] = ‘video/webm’; return $mimes; } The .ogg file format is known to WordPress as audio/ogg, if you’re wanting to do video with it, the correct extension is .ogv.

How Restrict access to admin dashboard by specific static ip?

By the time admin_init rolls around you should know if you’re doing AJAX or not. If you’re not, then check the IP. Keep in mind that anyone can fake that number. add_action(‘admin_init’, function() { if(defined(‘DOING_AJAX’) && DOING_AJAX) { return; // ignore ajax }; $ip = $_SERVER[ ‘REMOTE_ADDR’ ]; if($ip !== ‘10.0.0.0’) { wp_die(__(‘You are not … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)