WP_Site_Health_Auto_Updates::run_tests() WordPress Method

The WP_Site_Health_Auto_Updates::run_tests() method is used to automatically update WordPress installations. This method will first check if the WordPress installation is up to date, and if not, it will update the installation.

WP_Site_Health_Auto_Updates::run_tests() #

Run tests to determine if auto-updates can run.


Return

(array) The test results.


Top ↑

Source

File: wp-admin/includes/class-wp-site-health-auto-updates.php

	public function run_tests() {
		$tests = array(
			$this->test_constants( 'WP_AUTO_UPDATE_CORE', array( true, 'beta', 'rc', 'development', 'branch-development', 'minor' ) ),
			$this->test_wp_version_check_attached(),
			$this->test_filters_automatic_updater_disabled(),
			$this->test_wp_automatic_updates_disabled(),
			$this->test_if_failed_update(),
			$this->test_vcs_abspath(),
			$this->test_check_wp_filesystem_method(),
			$this->test_all_files_writable(),
			$this->test_accepts_dev_updates(),
			$this->test_accepts_minor_updates(),
		);

		$tests = array_filter( $tests );
		$tests = array_map(
			static function( $test ) {
				$test = (object) $test;

				if ( empty( $test->severity ) ) {
					$test->severity = 'warning';
				}

				return $test;
			},
			$tests
		);

		return $tests;
	}


Top ↑

Changelog

Changelog
VersionDescription
5.2.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.