--- a/wp/wp-admin/includes/class-wp-site-health-auto-updates.php Wed Sep 21 18:19:35 2022 +0200
+++ b/wp/wp-admin/includes/class-wp-site-health-auto-updates.php Tue Sep 27 16:37:53 2022 +0200
@@ -41,7 +41,7 @@
$tests = array_filter( $tests );
$tests = array_map(
- function( $test ) {
+ static function( $test ) {
$test = (object) $test;
if ( empty( $test->severity ) ) {
@@ -156,7 +156,7 @@
*
* @return array|false The test results. False if the auto-updates failed.
*/
- function test_if_failed_update() {
+ public function test_if_failed_update() {
$failed = get_site_option( 'auto_core_update_failed' );
if ( ! $failed ) {
@@ -226,7 +226,7 @@
// Search all directories we've found for evidence of version control.
foreach ( $vcs_dirs as $vcs_dir ) {
foreach ( $check_dirs as $check_dir ) {
- // phpcs:ignore
+ // phpcs:ignore WordPress.CodeAnalysis.AssignmentInCondition,Squiz.PHP.DisallowMultipleAssignments
if ( $checkout = @is_dir( rtrim( $check_dir, '\\/' ) . "/$vcs_dir" ) ) {
break 2;
}
@@ -272,7 +272,7 @@
*
* @return array The test results.
*/
- function test_check_wp_filesystem_method() {
+ 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';
@@ -292,7 +292,7 @@
}
return array(
- 'description' => __( "Your installation of WordPress doesn't require FTP credentials to perform updates." ),
+ 'description' => __( 'Your installation of WordPress does not require FTP credentials to perform updates.' ),
'severity' => 'pass',
);
}
@@ -306,7 +306,7 @@
*
* @return array|false The test results. False if they're not writeable.
*/
- function test_all_files_writable() {
+ public function test_all_files_writable() {
global $wp_filesystem;
require ABSPATH . WPINC . '/version.php'; // $wp_version; // x.y.z
@@ -391,7 +391,7 @@
*
* @return array|false The test results. False if it isn't a development version.
*/
- function test_accepts_dev_updates() {
+ public function test_accepts_dev_updates() {
require ABSPATH . WPINC . '/version.php'; // $wp_version; // x.y.z
// Only for dev versions.
if ( false === strpos( $wp_version, '-' ) ) {
@@ -429,7 +429,7 @@
*
* @return array The test results.
*/
- function test_accepts_minor_updates() {
+ public function test_accepts_minor_updates() {
if ( defined( 'WP_AUTO_UPDATE_CORE' ) && false === WP_AUTO_UPDATE_CORE ) {
return array(
'description' => sprintf(