Make WordPress Core

Ticket #47869: 47869.3.patch

File 47869.3.patch, 1.4 KB (added by Clorith, 7 years ago)
  • src/wp-admin/includes/class-wp-site-health-auto-updates.php

     
    2626         */
    2727        public function run_tests() {
    2828                $tests = array(
    29                         $this->test_constants( 'DISALLOW_FILE_MODS', false ),
    30                         $this->test_constants( 'AUTOMATIC_UPDATER_DISABLED', false ),
    3129                        $this->test_constants( 'WP_AUTO_UPDATE_CORE', true ),
    3230                        $this->test_wp_version_check_attached(),
    3331                        $this->test_filters_automatic_updater_disabled(),
     32                        $this->test_wp_automatic_updates_is_disabled(),
    3433                        $this->test_if_failed_update(),
    3534                        $this->test_vcs_abspath(),
    3635                        $this->test_check_wp_filesystem_method(),
    … …  
    157156                        );
    158157                }
    159158        }
     159
     160        public function test_wp_automatic_updates_is_disabled() {
     161                if ( ! class_exists( 'WP_Automatic_Updater' ) ) {
     162                        require_once( ABSPATH . 'wp-admin/includes/class-wp-automatic-updates.php' );
     163                }
     164
     165                $auto_updates = new WP_Automatic_Updater();
     166
     167                if ( ! $auto_updates->is_disabled() ) {
     168                        return false;
     169                }
     170
     171                return array(
     172                        'description' => __( 'All automatic updates are disabled.' ),
     173                        'severity'    => 'fail',
     174                );
     175        }
    160176
    161177        /**
    162178         * Check if automatic updates have tried to run, but failed, previously.