Make WordPress Core

Changeset 46276

Timestamp:
09/23/2019 08:51:38 PM (5 years ago)
Author:
SergeyBiryukov
Message:

Site Health: Use WP_Automatic_Updater::is_disabled() to check whether automatic updates are disabled.

The previous check for DISALLOW_FILE_MODS and AUTOMATIC_UPDATER_DISABLED constants didn't always provide accurate results.

Props Clorith, kraftner, afragen.
Fixes #47869.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-site-health-auto-updates.php

    r46231 r46276  
    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
    3433            $this->test_if_failed_update(),
    3534            $this->test_vcs_abspath(),
     
    160159
    161160    /**
     161
     162
     163
     164
     165
     166
     167
     168
     169
     170
     171
     172
     173
     174
     175
     176
     177
     178
     179
     180
     181
     182
     183
     184
    162185     * Check if automatic updates have tried to run, but failed, previously.
    163186     *
    164187     * @since 5.2.0
    165188     *
    166      * @return array|bool The test results. false if the auto updates failed.
     189     * @return array|bool The test results. alse if the auto updates failed.
    167190     */
    168191    function test_if_failed_update() {
     
    309332     * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass.
    310333     *
    311      * @return array|bool The test results. false if they're not writeable.
     334     * @return array|bool The test results. alse if they're not writeable.
    312335     */
    313336    function test_all_files_writable() {
     
    389412     * @since 5.2.0
    390413     *
    391      * @return array|bool The test results. false if it isn't a development version.
     414     * @return array|bool The test results. alse if it isn't a development version.
    392415     */
    393416    function test_accepts_dev_updates() {
Note: See TracChangeset for help on using the changeset viewer.