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

WordPress Trac noreply at wordpress.org
Fri Apr 10 03:28:26 UTC 2020


#49824: Site Health instantiation prevents use of some hooks by plugins.
---------------------------+------------------------
 Reporter:  peterwilsoncc  |       Owner:  whyisjake
     Type:  defect (bug)   |      Status:  accepted
 Priority:  normal         |   Milestone:  5.4.1
Component:  Site Health    |     Version:  5.4
 Severity:  normal         |  Resolution:
 Keywords:                 |     Focuses:
---------------------------+------------------------

Comment (by peterwilsoncc):

 [attachment:"49824.diff"] to bring the PR to the trac.

 @whyisjake I tested as with the following and it worked as expected:

 * Deleted transients from options table `wp transient delete --all`
 * Emptied the Cron option in the options table `wp option delete cron`
 * Logged in and hit the WP Dashboard
 * Confirmed the cron job was added to the cron option `wp option get cron`
 * Hit the site health page, waited for completion
 * Back to the WP Dashboard to confirm the widget was operating as
 expected.

 I also added this to a plugin to confirm the hook was being hit, it's
 rather blunt:

 {{{#!php
 <?php

 add_filter(
         'pre_get_scheduled_event',
         function ( $pre, $hook ) {
                 if ( 'wp_site_health_scheduled_check' === $hook ) {
                         var_dump( 'hehehe' );
                         exit;
                 }
                 return $pre;
         },
         10,
         2
 );
 }}}


 As always a logic check from another committer or a component maintainer
 would be dandy.

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


More information about the wp-trac mailing list