On sites running WordPress 2.9, we’ve noticed a small bug appear on a few installations. After the upgrade it appears the timezone settings get misconfigured AND scheduled posts don’t publish on time. If the timezone was manually set (e.g. using UTC +/-), after the upgrade it would reset to a value one lower/higher and on certain server configurations scheduled posts simply wouldn’t publish.
There were a few other bugs, such as Josh Gans’ personal pet peeve, square buttons in the administration panels. The beta for WordPress 2.9.1 is already out but if you can’t wait a day or two, keep reading for fixes to the timezone and scheduled posts bugs.
In this blog we’re in the UTC -5 timezone [Eastern Standard Time], but after the upgrade the timezone was listed as UTC -4, throwing off the local time by one hour.
The fix for the timezone is easy, go into Settings –> General –> Timezone and choose a city that’s in the same timezone as you rather than using a manual offset. Yes Bostonians, that means you’ll have to swallow a small bit of pride and choose New York as your timezone.
On some WP 2.9 installs, this quick fix took care of scheduled posts not publishing. On others, we had to take a few extra steps.
Scheduled Posts Missed Fix
Scheduled posts are a great feature of WordPress, allowing you to write articles in advance and set them to publish automatically. Unfortunately, in WordPress 2.9 a small change in the cron code (cron is the process which publishes your posts for you, it’s a part of your Unix based server, not WordPress) causes scheduled posts to fail on some setups.
Important Note: If you’re hosted by The 42nd Estate, you should not experience this bug. If you do, please let us know!
The above timezone fix may also fix your scheduled posts error (it did on this install of wordpress), but if you’re on a very slow shared server or missing certain functions cron.php requires, it may not. If you’re scheduled posts are still not working after re-adjusting the timezones you’ll have to make a minor tweak to a core WordPress file to get scheduled posts working.
In your wp-includes folder, open up cron.php. On line 229 (or around there), you’ll see the below line:
$cron_url = get_option( 'siteurl' ) . '/wp-cron.php?doing_wp_cron'; wp_remote_post( $cron_url, array('timeout' => 0.01, 'blocking' => false, 'sslverify' => apply_filters('https_local_ssl_verify', true)) ); </pre>
Change it to:
$cron_url = get_option( 'siteurl' ) . '/wp-cron.php?doing_wp_cron'; wp_remote_post( $cron_url, array('timeout' => 5, 'blocking' => false, 'sslverify' => apply_filters('https_local_ssl_verify', true)) ); </pre>
Basically, we changed the timeout setting to a larger number. From reading through some of the Trac tickets out there, the cause may be due to a slow server, improperly configured server, or a bug in Curl. You can change the 5 to anything above 1, it seems some servers would round .01 down to zero, in effect causing an infinite loop that never got resolved.
The awesome WordPress team is already hard at work cranking out version 2.9.1 that’ll fix these issues and a few other errors. If you have a few minutes please download and install the 2.9.1 beta to help the WordPress team debug the latest release and confirm that any issues from 2.9 are resolved.