[wp-trac] [WordPress Trac] #49824: Site Health instantiation prevents use of some hooks by plugins.

WordPress Trac noreply at wordpress.org
Sun Apr 5 22:33:45 UTC 2020


#49824: Site Health instantiation prevents use of some hooks by plugins.
---------------------------+--------------------
 Reporter:  peterwilsoncc  |      Owner:  (none)
     Type:  defect (bug)   |     Status:  new
 Priority:  normal         |  Milestone:  5.4.1
Component:  Site Health    |    Version:  5.4
 Severity:  normal         |   Keywords:
  Focuses:                 |
---------------------------+--------------------
 As the `WP_Site_Health` class is instantiated prior to plugins being
 required and the `plugins_loaded` hook being fired, it prevents plugins
 from using the following hooks in the functions called by
 `maybe_create_scheduled_event()`.

 That is, each of the hooks in these functions:

 * `update_option` (relating to cron array)
 * `get_option` (cron array)
 * `wp_get_scheduled_event`
 * `wp_schedule_event`
 * `wp_load_alloptions`

 Scanning the code, it looks like this has the potential to lead to false
 reports in `WP_Site_Health::wp_cron_scheduled_check()`.

 Is it possible to move the instantiation so it follows `plugins_loaded`
 (or even `after_setup_theme` to account for themes using features)?

 I've moved this to the 5.4.1 milestone for consideration and visibility,
 sorry I didn't catch this during the release cycle.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/49824>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list