[wp-trac] [WordPress Trac] #47864: Provide filters for Site Health Check results

WordPress Trac noreply at wordpress.org
Sun Aug 11 13:24:44 UTC 2019


#47864: Provide filters for Site Health Check results
-------------------------+-----------------------------
 Reporter:  Clorith      |      Owner:  (none)
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  Site Health  |    Version:  5.2
 Severity:  normal       |   Keywords:
  Focuses:               |
-------------------------+-----------------------------
 Currently, there's a filter to modify which PHP extensions are checked
 for, and even which tests to run, but nothing for the actual results.

 There are scenarios where someone might want to extend the results, either
 by providing a more involved description for a given scenario, or maybe
 even to provide additional actions.

 An example might be a hosting provider, PHP extensions are missing, so
 they add in an action link to the PHP extension manager of their control
 panel.
 Perhaps they wanted to be more direct, they wanted the PHP version check,
 which recommends the user update, they add in an ajax button that'll
 switch the PHP version for them on the spot.

 Basically, there are many possibilities here, and it would be nice if we
 offered them up on a nice silver platter.

 There is one limitation I'm thinking of though; asynchronous tests.

 While direct tests run on the spot, and thus have traditional filters
 available to them, the asynchronous ones run after the fact via
 JavaScript. Since we don't have a wrapper for the tests, they rely on
 whatever added the test creating their own admin-ajax action to capture
 them.

 Are JavaScript filters the way to go for these, or does that create an odd
 separation between the two?

 ---

 As for the proposed filter it self, using something like `apply_filters(
 'site_status_test_result', call_user_func( $test['test'] ), $test_key )`
 is what I'm looking at, where `$test_key` is the array key given in the
 `WP_Site_Health::get_tests()` list of tests, and can then be used as a
 reference.

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


More information about the wp-trac mailing list