Make WordPress Core

Opened 10 years ago

Last modified 6 years ago

#29581 new defect (bug)

Scheduled Posts do not work in WordPress 4.0

Reported by: pro99's profile pro99 Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.0
Component: Cron API Keywords:
Focuses: Cc:

Description

The post says "missed schedule" after the scheduled time has passed. We have to manually force the publishing by changing the date and updating from the admin. We've done it on installs with no conflicting plugin and replicated the issue on different installs as well. All show the same behavior. This was not the case through 3.9.2.

Change History (6)

#1 @SergeyBiryukov
10 years ago

  • Component changed from General to Cron API
  • Summary changed from Scheduled Posts do not work in Wordpress 4.0 to Scheduled Posts do not work in WordPress 4.0

There were no changes to Cron API in 4.0.

  • Does the site actually get visited in order for the cron task to run in time (see comment:4:ticket:17888)?
  • Make sure your host does not block local HTTP requests (see #23133).
  • Try using ALTERNATE_WP_CRON as a workaround.
  • Another option is to add DISABLE_WP_CRON to your wp-config.php file and set up an external cron job on the server to hit wp-cron.php every 1, 5, or 10 minutes, or whatever you prefer.

#2 @pro99
10 years ago

Thanks Sergey. Yes the sites do get regular visits, about 100 per day for the ones we tested first. We upgraded our production sites from not needing scheduled posts today, which get 1.5MM page views. As for the host all sites are on the Rackspace Cloud, Cloud Sites to be precise. I opened a ticket with them asking for their engineers to look into this since you're mentioning the cron API is intact. Could be something else interfering? I'm guessing other site owners will see this behavior... unless it's just us. One other thing I can think of: we are using CloudFlare. Do scheduled posts and the cron function run internally, or does it go over the internet and back into the site? CloudFlare security rules might be intercepting it, thinking it's an attack.

#3 @SergeyBiryukov
10 years ago

By default, spawn_cron() needs to be able to submit local HTTP requests back to the site in order to run scheduled jobs. This can be changed by using ALTERNATE_WP_CRON or setting up an external cron job to hit wp-cron.php.

My test snippet from comment:7:ticket:23133 would probably help to determine if that's the issue, also your site might be using a different transport than cURL (you can check it with the Core Control plugin).

Version 2, edited 10 years ago by SergeyBiryukov (previous) (next) (diff)

#4 @JG Visual
10 years ago

This issue seems to have increased for a number of folks after upgrading to WordPress 4.0. You can see some folks with this problem at https://wordpress.org/support/topic/wordpress-40-missed-schedule-posts?replies=17. Is there a reason in particular that WordPress doesn't have an internal system to publish missed posts via cron?

#5 @DrewAPicture
10 years ago

#31382 was marked as a duplicate.

This ticket was mentioned in Slack in #core by kaiser. View the logs.


10 years ago

Note: See TracTickets for help on using tickets.