WP_Site_Health_Auto_Updates::test_check_wp_filesystem_method() WordPress Method

The WP_Site_Health_Auto_Updates::test_check_wp_filesystem_method() method is used to check the WordPress filesystem method. This is used to see if the WordPress filesystem can be accessed using the direct method.

WP_Site_Health_Auto_Updates::test_check_wp_filesystem_method() #

Check if we can access files without providing credentials.


Return

(array) The test results.


Top ↑

Source

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

	public function test_check_wp_filesystem_method() {
		// Make sure the `request_filesystem_credentials()` function is available during our REST API call.
		if ( ! function_exists( 'request_filesystem_credentials' ) ) {
			require_once ABSPATH . '/wp-admin/includes/file.php';
		}

		$skin    = new Automatic_Upgrader_Skin;
		$success = $skin->request_filesystem_credentials( false, ABSPATH );

		if ( ! $success ) {
			$description  = __( 'Your installation of WordPress prompts for FTP credentials to perform updates.' );
			$description .= ' ' . __( '(Your site is performing updates over FTP due to file ownership. Talk to your hosting company.)' );

			return array(
				'description' => $description,
				'severity'    => 'fail',
			);
		}

		return array(
			'description' => __( 'Your installation of WordPress does not require FTP credentials to perform updates.' ),
			'severity'    => 'pass',
		);
	}


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.