Make WordPress Core

Ticket #47869: 47869.2.patch

File 47869.2.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(),
    … …  
    155154                        );
    156155                }
    157156        }
     157
     158        public function test_wp_automatic_updates_is_disabled() {
     159                if ( ! class_exists( 'WP_Automatic_Updater' ) ) {
     160                        require_once( ABSPATH . 'wp-admin/includes/class-wp-automatic-updates.php' );
     161                }
     162
     163                $auto_updatesa = new WP_Automatic_Updater();
     164
     165                if ( ! $auto_updatesa->is_disabled() ) {
     166                        return false;
     167                }
     168
     169                return array(
     170                        'description' => __( 'All automatic updates are disabled.' ),
     171                        'severity'    => 'fail',
     172                );
     173        }
    158174
    159175        /**
    160176         * Check if automatic updates have tried to run, but failed, previously.