[wp-trac] [WordPress Trac] #52135: False positive on `WP_Site_Health_Auto_Updates`

WordPress Trac noreply at wordpress.org
Mon Jan 18 22:52:06 UTC 2021


#52135: False positive on `WP_Site_Health_Auto_Updates`
--------------------------+------------------------
 Reporter:  audrasjb      |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  5.6.1
Component:  Site Health   |     Version:  5.6
 Severity:  normal        |  Resolution:
 Keywords:  needs-patch   |     Focuses:  multisite
--------------------------+------------------------

Comment (by maxpertici):

 Hello, I reproduced the bug well and did some tests.
 I did two quick tests to see the result and modify the condition, the
 error persists.

 For example with


 {{{
 if ( ! is_network_admin() || wp_doing_ajax() ) {
         return;
 }

 }}}

 or

 {{{

 if ( ! is_admin() || wp_doing_ajax() ) {
         return;
 }
 }}}


 The error is still displayed in the Site Health.

 I am attaching a patch where this time the wp_version_check test is run
 only for the main site if site is multisite.

 I updated the test_wp_version_check_attached() function class-wp-site-
 health-auto-updates.php.


 {{{
 public function test_wp_version_check_attached() {
         if ( ( ! is_multisite() || ( is_main_site() && is_network_admin()
 ) ) && ! has_filter( 'wp_version_check', 'wp_version_check' ) ) {
                 return array(
                         'description' => sprintf(
                                 /* translators: %s: Name of the filter
 used. */
                                 __( 'A plugin has prevented updates by
 disabling %s.' ),
                                 '<code>wp_version_check()</code>'
                         ),
                         'severity'    => 'fail',
                 );
         }
 }
 }}}

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


More information about the wp-trac mailing list