Make WordPress Core

Opened 6 years ago

Last modified 11 months ago

#20537 reviewing defect (bug)

Don't spawn cron requests for suspended blogs — at Version 3

Reported by: ryan Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version: 3.3.1
Component: Cron API Keywords: has-patch needs-testing
Focuses: multisite Cc:

Description (last modified by ryan)

For multisite, spawning cron requests is wasteful and unnecessary. wp_cron()/spawn_cron()/wp-cron.php should check the blog's status and bail if the blog is suspended.

Change History (4)

#1 @ryan
6 years ago

Cribbing from ms_site_check(), the conditions to check:

if ( '1' == $current_blog->deleted || '2' == $current_blog->deleted || '1' == $current_blog->archived || '1' == $current_blog->spam )

Or from get_blogs_of_user():

if ( $blog->archived || $blog->spam || $blog->deleted )
Last edited 6 years ago by ryan (previous) (diff)

6 years ago

#2 @nacin
6 years ago

I think spawning is unnecessary. wp-cron.php should still be able to be triggered, though. Someone somewhere is surely doing something weird with regards to this.

I think it would be best if bailed early in spawn_cron() and didn't hook wp_cron() directly into sanitize_comment_cookies. That would allow for wp_cron() and wp-cron.php to still execute.

I could also just be overly careful.

#3 @ryan
6 years ago

  • Description modified (diff)

I can see it being good and bad, at least when considering core events. A hard freeze prevents future posts from accidentally getting published and pingbacks from accidentally going out from a blog that should be dead. The blog and the cron queue are frozen. Then again, there could be some events that should still be processed. This was requested by some wp.com folks to shut up zombie blogs. How dead is dead enough?

Note: See TracTickets for help on using tickets.