From c50289a945785c1e3728058a805b0fa7d545bc83 Mon Sep 17 00:00:00 2001 From: Marius Jensen Date: Thu, 25 Jul 2024 22:00:49 +0200 Subject: [PATCH] Ensure that a PHP Compatibility report exists from WP Tide before attempting to use it, to avoid an undefined property warning. Fixes #466 --- HealthCheck/Tools/class-health-check-plugin-compatibility.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/HealthCheck/Tools/class-health-check-plugin-compatibility.php b/HealthCheck/Tools/class-health-check-plugin-compatibility.php index 653ba73..a1e0a3c 100644 --- a/HealthCheck/Tools/class-health-check-plugin-compatibility.php +++ b/HealthCheck/Tools/class-health-check-plugin-compatibility.php @@ -140,7 +140,7 @@ function get_supported_php( $slug, $version ) { $json = json_decode( $tide_response ); - if ( empty( $json ) ) { + if ( empty( $json ) || ! isset( $json->reports->phpcs_phpcompatibilitywp->report->compatible ) ) { $tide_versions = array(); } else { $tide_versions = $json->reports->phpcs_phpcompatibilitywp->report->compatible;