redis ) || class_exists( 'WP_Object_Cache' ) ) ) { return 'Redis'; } if ( class_exists( 'Memcached' ) || class_exists( 'Memcache' ) ) { return 'Memcached'; } return __( 'External Object Cache', 'speednest' ); } /** * Flush object cache. * * @return array */ public static function flush() { if ( ! function_exists( 'wp_cache_flush' ) ) { return array( 'status' => 'not_supported', 'message' => __( 'Object cache flush function is not available.', 'speednest' ), ); } $result = wp_cache_flush(); return array( 'status' => $result ? 'cleared' : 'error', 'message' => $result ? __( 'Object cache flushed successfully.', 'speednest' ) : __( 'Failed to flush object cache.', 'speednest' ), ); } }