[wp-trac] [WordPress Trac] #47869: Missmatch between actual check and warning message for Background Updates

WordPress Trac noreply at wordpress.org
Tue Aug 13 13:07:29 UTC 2019


#47869: Missmatch between actual check and warning message for Background Updates
--------------------------+-----------------------------
 Reporter:  kraftner      |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Site Health   |    Version:
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 The site health check currently might sometimes have a mismatch between
 wording and the actual checks performed. It is reporting disabled
 background updates while they actually work.

 Let me elaborate the setup:

 1. `DISALLOW_FILE_MODS` is set to true to disable plugin/theme editor,
 manual updates, installation,...
 2. But since the auto-update functionality is still desired the
 `file_mod_allowed` filter is used to re-enable **automatic** updates:
 {{{#!php
 <?php
 add_filter('file_mod_allowed', function($file_mod_allowed, $context){

     if($context === 'automatic_updater'){
         return true;
     }

     return $file_mod_allowed;
 },10,2);
 }}}
 3. The actual check being performed in
 `WP_Site_Health::check_wp_version_check_exists` though is
 `current_user_can( 'update_core' )` which is way broader than actually
 checking for a working background update.
 4. Even if we'd get past that check having `DISALLOW_FILE_MODS` set to
 `true` also reports as an error, while actually the check should probably
 be for `wp_is_file_mod_allowed( 'automatic_updater' )` just like inside
 `WP_Automatic_Updater::is_disabled`.

 ----
 I see two possible courses of action:

 - This is a bug in the check and the check needs to be fixed.
 - This is a wording issue for the site health page.

 Looking for feedback on how to proceed.

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


More information about the wp-trac mailing list