Ever since the upgrade to WordPress 2.9, I’ve been having a problem in the scheduled posts in WordPress. Everytime I set a post to be scheduled in the future, it used to miss the scheduled time and never get posted. When I checked the status of these posts in the posts admin area, each of these posts had the status “Missed Schedule” next to them.
There were some blog posts on the net asking me to get some file from the older version of WordPress and copy it over, but I wasn’t too comfortable doing that, in case that broke anything in the new version of WordPress. After a lot more digging I found a solution which fixed the problem using a minor edit in wp-includes/cron.php, where a timeout was set to too small an amount, causing the cron to timeout before the posts are actually published.
To fix this problem, you need to edit the cron.php file which is present in the wp-includes folder. Open the file in your favorite text editor and head over to line 229 (in WordPress 2.9, the exact line number may change depending on your version). Look for the following line:
wp_remote_post( $cron_url, array('timeout' => 0.01, 'blocking' => false, 'sslverify' => apply_filters('https_local_ssl_verify', true)) );
Change that line to increase the timeout to 20 so the line should look like this:
wp_remote_post( $cron_url, array('timeout' => 20, 'blocking' => false, 'sslverify' => apply_filters('https_local_ssl_verify', true)) );
Remember that you’ll have to make this change manually with each update to WordPress till they fix this issue –
it seems the same issue is present from WordPress 2.7 onwards and triggers when the server is slow to process the cron.php file. Update: It seems it’s a bug which triggers due to a certain version of PHP’s Curl extension on the server, and will be fixed in the 2.9.1 maintenance release (via)
If you are uncomfortable going and editing this file to fix the problem, you can also try out this plugin which should work for you – Scheduled MIAs plugin.