WordPress.org

Make WordPress Core

Opened 6 years ago

Last modified 4 months ago

#24160 reopened defect (bug)

ALTERNATE_WP_CRON runs wp_cron() too early

Reported by: r-a-y Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version: 3.4
Component: Cron API Keywords: has-patch early
Focuses: Cc:
PR Number:

Description (last modified by SergeyBiryukov)

See #19818 for full details.

Then, read my comment in that ticket. Was advised to create a new ticket.

We need to run 'wp_cron' later than the default priority of 10 to allow plugins that run on this hook to properly initialize.

In the patch, I've bumped the priority to 99. Let me know what you think.

Attachments (1)

24160.01.patch (522 bytes) - added by r-a-y 6 years ago.

Download all attachments as: .zip

Change History (13)

@r-a-y
6 years ago

#1 @SergeyBiryukov
6 years ago

  • Milestone changed from Awaiting Review to 3.6

#2 @SergeyBiryukov
6 years ago

  • Summary changed from ALTERNATE_WP_CRON runs 'init' too late to ALTERNATE_WP_CRON runs 'init' too early

#3 @SergeyBiryukov
6 years ago

  • Summary changed from ALTERNATE_WP_CRON runs 'init' too early to ALTERNATE_WP_CRON runs wp_cron() too early

#4 @r-a-y
6 years ago

Thanks for correcting the ticket title, Sergey!

And thanks for the feedback from the previous ticket.

#5 @prettyboymp
6 years ago

To match where it runs with a normal cron, the hook should probably be changed to 'wp_loaded'.

#6 @ryan
6 years ago

  • Milestone changed from 3.6 to Future Release

#7 @SergeyBiryukov
5 years ago

  • Description modified (diff)
  • Keywords 4.1-early added

#8 @chriscct7
4 years ago

  • Keywords 4.1-early removed

#9 @chriscct7
4 years ago

  • Keywords early added

#11 @peterwilsoncc
9 months ago

  • Milestone set to Future Release
  • Status changed from new to reopened

This is worth some investigation so I'm reopening this and putting it down for a future release. The Cron component has a bit of a backlog, so I won't give a timeframe for now as it would set a false expectation.

#12 @peterwilsoncc
9 months ago

#37542 was marked as a duplicate.

#13 @peterwilsoncc
9 months ago

From #37542:

This can be an issue for sites registering custom taxonomies. Taxos can not be registered prior to the init hook but using the default priority causes the taxo to be registered after the cron hook fires when using alternative cron.

Note: See TracTickets for help on using tickets.