From 8e754070f33fad67fd25c10c15b51318a9306781 Mon Sep 17 00:00:00 2001 From: Simon Prosser Date: Tue, 10 May 2022 23:53:19 +0100 Subject: [PATCH] Make sure variable is actually set themes_api() may return unexpected results see https://wordpress.org/support/topic/php-warnings-flooding-log-undefined-property-class-wc-admin-status-php for example. --- plugins/woocommerce/includes/admin/class-wc-admin-status.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/woocommerce/includes/admin/class-wc-admin-status.php b/plugins/woocommerce/includes/admin/class-wc-admin-status.php index 5c4aeafc70f..07be992b129 100644 --- a/plugins/woocommerce/includes/admin/class-wc-admin-status.php +++ b/plugins/woocommerce/includes/admin/class-wc-admin-status.php @@ -259,7 +259,7 @@ class WC_Admin_Status { $update_theme_version = 0; // Check .org for updates. - if ( is_object( $api ) && ! is_wp_error( $api ) ) { + if ( is_object( $api ) && ! is_wp_error( $api ) && isset( $api->version ) ) { $update_theme_version = $api->version; } elseif ( strstr( $theme->{'Author URI'}, 'woothemes' ) ) { // Check WooThemes Theme Version. $theme_dir = substr( strtolower( str_replace( ' ', '', $theme->Name ) ), 0, 45 ); // @codingStandardsIgnoreLine.