Skip to content

Commit

Permalink
Merge pull request #783 from humanmade/afterburner-healthcheck
Browse files Browse the repository at this point in the history
Fix healthcheck with afterburner
  • Loading branch information
kovshenin committed Jun 28, 2023
2 parents b61e36b + 63e9132 commit aadc84a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions inc/healthcheck/namespace.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,11 +197,11 @@ function run_mysql_healthcheck() {
function run_object_cache_healthcheck() {
global $wp_object_cache, $wpdb;

if ( method_exists( $wp_object_cache, 'getStats' ) && ! empty( $wp_object_cache->getStats() ) ) {
if ( ! empty( $wp_object_cache ) && method_exists( $wp_object_cache, 'getStats' ) && ! empty( $wp_object_cache->getStats() ) ) {
return new WP_Error( 'memcached-no-stats', 'Unable to get memcached stats.' );
}

if ( method_exists( $wp_object_cache, 'stats' ) ) {
if ( ! empty( $wp_object_cache ) && method_exists( $wp_object_cache, 'stats' ) ) {
ob_start();
$result = (string) $wp_object_cache->stats();
$result .= ob_get_clean();
Expand Down

0 comments on commit aadc84a

Please sign in to comment.