[wp-trac] [WordPress Trac] #23133: Display a warning in the admin if cron tasks fail due to blocked HTTP requests

WordPress Trac noreply at wordpress.org
Fri Nov 18 03:21:55 UTC 2016


#23133: Display a warning in the admin if cron tasks fail due to blocked HTTP
requests
------------------------------------+-----------------------------
 Reporter:  prb22public@…           |       Owner:
     Type:  enhancement             |      Status:  new
 Priority:  normal                  |   Milestone:  Future Release
Component:  Cron API                |     Version:  3.5
 Severity:  major                   |  Resolution:
 Keywords:  dev-feedback has-patch  |     Focuses:
------------------------------------+-----------------------------

Comment (by goldsounds):

 As a side note, in my experience for some hosts alternate cron is broken
 too. Yes, I know it seems crazy. So I'm not 100% sure about using it as an
 automatic fallback.

 In addition, some hosts may have defined an external cron and that, too,
 might be broken - and the user still ought to be informed.

 A technique which might work is to schedule a cron job to run once every
 12 hours. The cron job sets a timestamp, and if that timestamp becomes
 stale (say, 48 hours old) then we let the user know that cron might be
 broken, and give them a link to click.

 The link brings them to a page which checks the loopback functionality,
 and lets the user choose from available options, like:

 If they have `DISABLE_WP_CRON` enabled:

 "You have disabled WordPress' scheduler, but your external scheduler
 doesn't appear to be working. Would you like to fix this?"

 - No, I know what I'm doing, everything is fine
 - Whoops, this was a mistake - I will remove the line
 `define('DISABLE_WP_CRON', true);` from wp-config.php

 If they have `ALTERNATE_WP_CRON` enabled, but we can tell that Loopback
 works fine.

 "You have enabled `ALTERNATE_WP_CRON` but it doesn't appear to be working.
 Our tests indicate you can safely disable this flag and use WordPress'
 default scheduler. Would you like to do this?"

 - No, I know what I'm doing, everything is fine
 - Yes, I will fix this by removing the line `define('ALTERNATE_WP_CRON',
 true);` from wp-config.php

 If they have `ALTERNATE_WP_CRON` enabled, AND loopback is failing.

 "WordPress has detected that scheduled tasks aren't being run, and we
 can't figure out why. Please visit [link] for information on
 troubleshooting this issue"

 Something like that would give us coverage of all the scenarios I can
 think of.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/23133#comment:18>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list