From e50ac120a36bddfe36945ca078a4f19161dbdfe9 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 17 Aug 2020 02:03:04 +0000 Subject: [PATCH] Site Health: Ensure that the tests returned by `WP_Site_Health::get_tests()` always have the required array keys: `direct` and `async`. This avoids PHP notices if these keys were accidentally removed using the `site_status_tests` filter. Props khag7, Ov3rfly, desrosj, Clorith. Fixes #50858. Built from https://develop.svn.wordpress.org/trunk@48808 git-svn-id: http://core.svn.wordpress.org/trunk@48570 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/class-wp-site-health.php | 9 +++++++++ wp-includes/version.php | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/wp-admin/includes/class-wp-site-health.php b/wp-admin/includes/class-wp-site-health.php index dd58d93b4e..de698d7a30 100644 --- a/wp-admin/includes/class-wp-site-health.php +++ b/wp-admin/includes/class-wp-site-health.php @@ -2207,6 +2207,15 @@ class WP_Site_Health { */ $tests = apply_filters( 'site_status_tests', $tests ); + // Ensure that the filtered tests contain the required array keys. + $tests = array_merge( + array( + 'direct' => array(), + 'async' => array(), + ), + $tests + ); + return $tests; } diff --git a/wp-includes/version.php b/wp-includes/version.php index e484198fb9..67c86d0acc 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.6-alpha-48802'; +$wp_version = '5.6-alpha-48808'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.