From cd4b5ee8075ffb75972c1d2fdc4d02eb4f939e5a Mon Sep 17 00:00:00 2001 From: EarthlingDavey <15802017+EarthlingDavey@users.noreply.github.com> Date: Wed, 16 Oct 2024 11:19:06 +0100 Subject: [PATCH] Update check_client_dependencies to check for Relay This PR fixes 2 cases where `WP_REDIS_USE_RELAY=true` - The class is not checked for existence. - The drop-in will not run if Redis extension is not installed. The fix: - Relay\Relay is correctly checked for existence. - The drop-in still works if the Redis extension is not installed. --- object-cache.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/object-cache.php b/object-cache.php index e84beef..75d921d 100644 --- a/object-cache.php +++ b/object-cache.php @@ -1226,7 +1226,7 @@ protected function _connect_redis() { * not with a message describing the issue. */ public function check_client_dependencies() { - if ( ! class_exists( 'Redis' ) ) { + if ( ! class_exists( WP_REDIS_USE_RELAY ? 'Relay\Relay' : 'Redis' ) ) { return 'Warning! PHPRedis extension is unavailable, which is required by WP Redis object cache.'; } return true;