好几次在使用 定时发布 (wordpress Schedule)日志功能后,到了预订的发布时间后,结果后台显示“计划任务丢失”(Missed schedule),使用关键词 “wordpress Schedule” 在 google上搜索,问题还真的普遍存在,终于在一个英文博客上《How to fix the missed schedule bug in WordPress 2.9》找到了答案,经测试,有效,原来是调用 cron.php 中 timeout 值设置得太短了,将这个数值相应改大之后,就能解决这个问题了,希望 wordpress 能尽快解决这个BUG。

解决办法:讲/wp-includes/cron.php 文件中的timeout 修改为10.00即可,当然了,这个值并非一定要等于10.00。

wp_remote_post( $cron_url, array('timeout' => 0.01, 'blocking' => false, 'sslverify' => apply_filters('https_local_ssl_verify', true)) );
wp_remote_post( $cron_url, array('timeout' => 0.01, 'blocking' => false, 'sslverify' => apply_filters('https_local_ssl_verify', true)) );

根据麦叔本人实测,以上修改后确实能解决定时发布中出现的 “计划任务丢失” 问题。
另外几点说明:
1、如果也有类似问题,修改cron.php之后,记得实测一下,确认定时发布功能是否正常。
2、定时发布功能的时间是参照Wordpress所在的服务器时间,所以使用国外主机的朋友,可能在测试的时候,与自己电脑上的时间对不上。

原英文博客文章链接《How to fix the missed schedule bug in WordPress 2.9

转自:麦麦的不老阁 http://www.uncle.ws/2010/04/wordpress-post-missed-schedule/

update: 刚刚找到一个插件貌似很好用,能修复这个问题
WP Missed Schedule Fix Failed Scheduled Future Posts
http://wordpress.org/extend/plugins/wp-missed-schedule/

最后修改:2011 年 03 月 17 日 02 : 11 PM