From 37fe48bb899be8f07af8564210ccf92c5cd633cc Mon Sep 17 00:00:00 2001 From: mkurdybanowski Date: Thu, 13 Jun 2024 15:39:59 +0200 Subject: [PATCH 1/6] #718: object caching info --- .../includes/site-health/load.php | 4 + .../site-health/object-cache/helper.php | 119 ++++++++++++++++++ .../site-health/object-cache/hooks.php | 33 +++++ 3 files changed, 156 insertions(+) create mode 100644 plugins/performance-lab/includes/site-health/object-cache/helper.php create mode 100644 plugins/performance-lab/includes/site-health/object-cache/hooks.php diff --git a/plugins/performance-lab/includes/site-health/load.php b/plugins/performance-lab/includes/site-health/load.php index b3ade868d..06ad1c3b8 100644 --- a/plugins/performance-lab/includes/site-health/load.php +++ b/plugins/performance-lab/includes/site-health/load.php @@ -25,3 +25,7 @@ // AVIF Support site health check. require_once __DIR__ . '/avif-support/helper.php'; require_once __DIR__ . '/avif-support/hooks.php'; + +// Object Cache Support site health info. +require_once __DIR__ . '/object-cache/helper.php'; +require_once __DIR__ . '/object-cache/hooks.php'; diff --git a/plugins/performance-lab/includes/site-health/object-cache/helper.php b/plugins/performance-lab/includes/site-health/object-cache/helper.php new file mode 100644 index 000000000..c02b708bb --- /dev/null +++ b/plugins/performance-lab/includes/site-health/object-cache/helper.php @@ -0,0 +1,119 @@ + array( + 'label' => __( 'Extension', 'performance-lab' ), + 'value' => wp_get_cache_type(), + ), + 'multiple_gets' => array( + 'label' => __( 'Multiple gets', 'performance-lab' ), + 'value' => wp_cache_supports( 'get_multiple' ) ? 'Enabled' : 'Disabled', + ), + 'multiple_sets' => array( + 'label' => __( 'Multiple sets', 'performance-lab' ), + 'value' => wp_cache_supports( 'set_multiple' ) ? 'Enabled' : 'Disabled', + ), + 'multiple_deletes' => array( + 'label' => __( 'Multiple deletes', 'performance-lab' ), + 'value' => wp_cache_supports( 'delete_multiple' ) ? 'Enabled' : 'Disabled', + ), + 'flush_group' => array( + 'label' => __( 'Flush group', 'performance-lab' ), + 'value' => wp_cache_supports( 'flush_group' ) ? 'Enabled' : 'Disabled', + ), + ); +} + +/** + * Attempts to determine which object cache is being used. + * + * Note that the guesses made by this function are based on the WP_Object_Cache classes + * that define the 3rd party object cache extension. Changes to those classes could render + * problems with this function's ability to determine which object cache is being used. + * + * @return string + * @since 3.3.0 + */ +function wp_get_cache_type() { + global $_wp_using_ext_object_cache, $wp_object_cache; + + if ( ! empty( $_wp_using_ext_object_cache ) ) { + // Test for Memcached PECL extension memcached object cache (https://github.com/tollmanz/wordpress-memcached-backend) + if ( isset( $wp_object_cache->m ) && $wp_object_cache->m instanceof \Memcached ) { + $message = 'Memcached'; + + // Test for Memcache PECL extension memcached object cache (https://wordpress.org/extend/plugins/memcached/) + } elseif ( isset( $wp_object_cache->mc ) ) { + $is_memcache = true; + foreach ( $wp_object_cache->mc as $bucket ) { + if ( ! $bucket instanceof \Memcache && ! $bucket instanceof \Memcached ) { + $is_memcache = false; + } + } + + if ( $is_memcache ) { + $message = 'Memcache'; + } + + // Test for Xcache object cache (https://plugins.svn.wordpress.org/xcache/trunk/object-cache.php) + } elseif ( $wp_object_cache instanceof \XCache_Object_Cache ) { + $message = 'Xcache'; + + // Test for WinCache object cache (https://wordpress.org/extend/plugins/wincache-object-cache-backend/) + } elseif ( class_exists( 'WinCache_Object_Cache' ) ) { + $message = 'WinCache'; + + // Test for APC object cache (https://wordpress.org/extend/plugins/apc/) + } elseif ( class_exists( 'APC_Object_Cache' ) ) { + $message = 'APC'; + + // Test for WP Redis (https://wordpress.org/plugins/wp-redis/) + } elseif ( isset( $wp_object_cache->redis ) && $wp_object_cache->redis instanceof \Redis ) { + $message = 'Redis'; + + // Test for Redis Object Cache (https://wordpress.org/plugins/redis-cache/) + } elseif ( method_exists( $wp_object_cache, 'redis_instance' ) && method_exists( $wp_object_cache, + 'redis_status' ) ) { + $message = 'Redis'; + + // Test for Object Cache Pro (https://objectcache.pro/) + } elseif ( method_exists( $wp_object_cache, 'config' ) && method_exists( $wp_object_cache, 'connection' ) ) { + $message = 'Redis'; + + // Test for WP LCache Object cache (https://github.com/lcache/wp-lcache) + } elseif ( isset( $wp_object_cache->lcache ) && $wp_object_cache->lcache instanceof \LCache\Integrated ) { + $message = 'WP LCache'; + + } elseif ( function_exists( 'w3_instance' ) ) { + $config = w3_instance( 'W3_Config' ); + $message = 'Unknown'; + + if ( $config->get_boolean( 'objectcache.enabled' ) ) { + $message = 'W3TC ' . $config->get_string( 'objectcache.engine' ); + } + } else { + $message = 'Unknown'; + } + } else { + $message = 'Disabled'; + } + + return $message; +} diff --git a/plugins/performance-lab/includes/site-health/object-cache/hooks.php b/plugins/performance-lab/includes/site-health/object-cache/hooks.php new file mode 100644 index 000000000..37a2f62d0 --- /dev/null +++ b/plugins/performance-lab/includes/site-health/object-cache/hooks.php @@ -0,0 +1,33 @@ + __( 'Object Caching', 'performance-lab' ), + 'description' => __( 'Shows which features object cache supports and if object caching is in use.', + 'performance-lab' ), + 'fields' => object_cache_supported_fields(), + ); + + return $info; +} + +add_filter( 'debug_information', 'object_cache_supported_info', 10, 1 ); From 061657f05d37fe852fa55f145f4bf2d82719ced4 Mon Sep 17 00:00:00 2001 From: mkurdybanowski Date: Thu, 25 Jul 2024 23:32:54 +0200 Subject: [PATCH 2/6] WordPress#718: Fix lint and phpstan errors --- .../class-dominant-color-image-editor-gd.php | 4 +- ...er-background-image-styled-tag-visitor.php | 2 +- .../site-health/object-cache/helper.php | 37 ++++++++++--------- .../site-health/object-cache/hooks.php | 8 ++-- plugins/webp-uploads/hooks.php | 2 +- .../webp-uploads/tests/test-image-edit.php | 2 +- 6 files changed, 27 insertions(+), 28 deletions(-) diff --git a/plugins/dominant-color-images/class-dominant-color-image-editor-gd.php b/plugins/dominant-color-images/class-dominant-color-image-editor-gd.php index a6106bf1f..faf2d9850 100644 --- a/plugins/dominant-color-images/class-dominant-color-image-editor-gd.php +++ b/plugins/dominant-color-images/class-dominant-color-image-editor-gd.php @@ -34,7 +34,7 @@ public function get_dominant_color() { $shorted_image = imagecreatetruecolor( 1, 1 ); $image_width = imagesx( $this->image ); $image_height = imagesy( $this->image ); - if ( false === $shorted_image || false === $image_width || false === $image_height ) { + if ( false === $shorted_image || false === $image_width || false === $image_height ) { // @phpstan-ignore-line return new WP_Error( 'image_editor_dominant_color_error', __( 'Dominant color detection failed.', 'dominant-color-images' ) ); } imagecopyresampled( $shorted_image, $this->image, 0, 0, 0, 0, 1, 1, $image_width, $image_height ); @@ -78,7 +78,7 @@ public function has_transparency() { return new WP_Error( 'unable_to_obtain_rgb_via_imagecolorat' ); } $rgba = imagecolorsforindex( $this->image, $rgb ); - if ( ! is_array( $rgba ) ) { + if ( ! is_array( $rgba ) ) { // @phpstan-ignore-line return new WP_Error( 'unable_to_obtain_rgba_via_imagecolorsforindex' ); } if ( $rgba['alpha'] > 0 ) { diff --git a/plugins/image-prioritizer/class-image-prioritizer-background-image-styled-tag-visitor.php b/plugins/image-prioritizer/class-image-prioritizer-background-image-styled-tag-visitor.php index 8d1f7a6d6..4a5fc36af 100644 --- a/plugins/image-prioritizer/class-image-prioritizer-background-image-styled-tag-visitor.php +++ b/plugins/image-prioritizer/class-image-prioritizer-background-image-styled-tag-visitor.php @@ -41,7 +41,7 @@ public function __invoke( OD_HTML_Tag_Walker $walker ): bool { && 0 < (int) preg_match( '/background(-image)?\s*:[^;]*?url\(\s*[\'"]?\s*(?.+?)\s*[\'"]?\s*\)/', $style, $matches ) && - '' !== $matches['background_image'] // PHPStan should ideally know that this is a non-empty string based on the `.+?` regular expression. + '' !== $matches['background_image'] // PHPStan should ideally know that this is a non-empty string based on the `.+?` regular expression. // @phpstan-ignore-line && ! $this->is_data_url( $matches['background_image'] ) ) { diff --git a/plugins/performance-lab/includes/site-health/object-cache/helper.php b/plugins/performance-lab/includes/site-health/object-cache/helper.php index c02b708bb..8b83a7191 100644 --- a/plugins/performance-lab/includes/site-health/object-cache/helper.php +++ b/plugins/performance-lab/includes/site-health/object-cache/helper.php @@ -13,10 +13,10 @@ /** * Callback for Object Cache Info fields. * - * @return array Fields. + * @return array Fields. * @since 3.3.0 */ -function object_cache_supported_fields() { +function object_cache_supported_fields(): array { return array( 'extension' => array( 'label' => __( 'Extension', 'performance-lab' ), @@ -42,24 +42,26 @@ function object_cache_supported_fields() { } /** - * Attempts to determine which object cache is being used. + * Attempts to determine which object cache is being used as in wp-cli repository. * * Note that the guesses made by this function are based on the WP_Object_Cache classes * that define the 3rd party object cache extension. Changes to those classes could render * problems with this function's ability to determine which object cache is being used. * - * @return string + * @return string Object cache type. * @since 3.3.0 */ -function wp_get_cache_type() { +function wp_get_cache_type(): string { global $_wp_using_ext_object_cache, $wp_object_cache; + $message = ''; + if ( ! empty( $_wp_using_ext_object_cache ) ) { - // Test for Memcached PECL extension memcached object cache (https://github.com/tollmanz/wordpress-memcached-backend) + // Test for Memcached PECL extension memcached object cache (https://github.com/tollmanz/wordpress-memcached-backend). if ( isset( $wp_object_cache->m ) && $wp_object_cache->m instanceof \Memcached ) { $message = 'Memcached'; - // Test for Memcache PECL extension memcached object cache (https://wordpress.org/extend/plugins/memcached/) + // Test for Memcache PECL extension memcached object cache (https://wordpress.org/extend/plugins/memcached/). } elseif ( isset( $wp_object_cache->mc ) ) { $is_memcache = true; foreach ( $wp_object_cache->mc as $bucket ) { @@ -72,33 +74,32 @@ function wp_get_cache_type() { $message = 'Memcache'; } - // Test for Xcache object cache (https://plugins.svn.wordpress.org/xcache/trunk/object-cache.php) - } elseif ( $wp_object_cache instanceof \XCache_Object_Cache ) { + // Test for Xcache object cache (https://plugins.svn.wordpress.org/xcache/trunk/object-cache.php). + } elseif ( $wp_object_cache instanceof \XCache_Object_Cache ) { // @phpstan-ignore-line $message = 'Xcache'; - // Test for WinCache object cache (https://wordpress.org/extend/plugins/wincache-object-cache-backend/) + // Test for WinCache object cache (https://wordpress.org/extend/plugins/wincache-object-cache-backend/). } elseif ( class_exists( 'WinCache_Object_Cache' ) ) { $message = 'WinCache'; - // Test for APC object cache (https://wordpress.org/extend/plugins/apc/) + // Test for APC object cache (https://wordpress.org/extend/plugins/apc/). } elseif ( class_exists( 'APC_Object_Cache' ) ) { $message = 'APC'; - // Test for WP Redis (https://wordpress.org/plugins/wp-redis/) + // Test for WP Redis (https://wordpress.org/plugins/wp-redis/). } elseif ( isset( $wp_object_cache->redis ) && $wp_object_cache->redis instanceof \Redis ) { $message = 'Redis'; - // Test for Redis Object Cache (https://wordpress.org/plugins/redis-cache/) - } elseif ( method_exists( $wp_object_cache, 'redis_instance' ) && method_exists( $wp_object_cache, - 'redis_status' ) ) { + // Test for Redis Object Cache (https://wordpress.org/plugins/redis-cache/). + } elseif ( method_exists( $wp_object_cache, 'redis_instance' ) && method_exists( $wp_object_cache, 'redis_status' ) ) { $message = 'Redis'; - // Test for Object Cache Pro (https://objectcache.pro/) + // Test for Object Cache Pro (https://objectcache.pro/). } elseif ( method_exists( $wp_object_cache, 'config' ) && method_exists( $wp_object_cache, 'connection' ) ) { $message = 'Redis'; - // Test for WP LCache Object cache (https://github.com/lcache/wp-lcache) - } elseif ( isset( $wp_object_cache->lcache ) && $wp_object_cache->lcache instanceof \LCache\Integrated ) { + // Test for WP LCache Object cache (https://github.com/lcache/wp-lcache). + } elseif ( isset( $wp_object_cache->lcache ) && $wp_object_cache->lcache instanceof \LCache\Integrated ) { // @phpstan-ignore-line $message = 'WP LCache'; } elseif ( function_exists( 'w3_instance' ) ) { diff --git a/plugins/performance-lab/includes/site-health/object-cache/hooks.php b/plugins/performance-lab/includes/site-health/object-cache/hooks.php index 37a2f62d0..f70497ba4 100644 --- a/plugins/performance-lab/includes/site-health/object-cache/hooks.php +++ b/plugins/performance-lab/includes/site-health/object-cache/hooks.php @@ -13,17 +13,15 @@ /** * Adds Object Cache module to Site Health Info. * - * @param array $info Site Health Info. + * @param array{object_cache: array{label: string,description: string,fields: array}} $info Site Health Info. * - * @return array Amended Info. + * @return array{object_cache: array{label: string,description: string,fields: array}} Amended Info. * @since 3.3.0 * @since 3.3.0 - * */ function object_cache_supported_info( array $info ): array { $info['object_cache'] = array( 'label' => __( 'Object Caching', 'performance-lab' ), - 'description' => __( 'Shows which features object cache supports and if object caching is in use.', - 'performance-lab' ), + 'description' => __( 'Shows which features object cache supports and if object caching is in use.', 'performance-lab' ), 'fields' => object_cache_supported_fields(), ); diff --git a/plugins/webp-uploads/hooks.php b/plugins/webp-uploads/hooks.php index be993c35a..37ff2cef3 100644 --- a/plugins/webp-uploads/hooks.php +++ b/plugins/webp-uploads/hooks.php @@ -544,7 +544,7 @@ function webp_uploads_update_image_references( $content ): string { continue; } - if ( empty( $class_name ) ) { + if ( empty( $class_name ) ) { // @phpstan-ignore-line continue; } diff --git a/plugins/webp-uploads/tests/test-image-edit.php b/plugins/webp-uploads/tests/test-image-edit.php index 8f5fe9cc5..db541b51f 100644 --- a/plugins/webp-uploads/tests/test-image-edit.php +++ b/plugins/webp-uploads/tests/test-image-edit.php @@ -50,7 +50,7 @@ public function test_it_should_backup_the_sources_structure_alongside_the_full_s foreach ( $backup_sizes as $size => $properties ) { $size_name = str_replace( '-orig', '', $size ); - if ( 'full-orig' === $size ) { + if ( 'full-orig' === $size ) { // @phpstan-ignore-line continue; } From dd59b4c4a0fda01e162ef18207b3749ed8538f24 Mon Sep 17 00:00:00 2001 From: mkurdybanowski Date: Fri, 26 Jul 2024 00:23:06 +0200 Subject: [PATCH 3/6] WordPress#718: Fix CR issues --- .../site-health/object-cache/helper.php | 24 +++++++++++-------- .../site-health/object-cache/hooks.php | 12 +++++----- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/plugins/performance-lab/includes/site-health/object-cache/helper.php b/plugins/performance-lab/includes/site-health/object-cache/helper.php index 8b83a7191..788d7fd53 100644 --- a/plugins/performance-lab/includes/site-health/object-cache/helper.php +++ b/plugins/performance-lab/includes/site-health/object-cache/helper.php @@ -3,7 +3,7 @@ * Helper functions used for Object Cache Support Info. * * @package performance-lab - * @since 2.1.0 + * @since n.e.x.t */ if ( ! defined( 'ABSPATH' ) ) { @@ -14,29 +14,29 @@ * Callback for Object Cache Info fields. * * @return array Fields. - * @since 3.3.0 + * @since n.e.x.t */ -function object_cache_supported_fields(): array { +function performance_lab_object_cache_supported_fields(): array { return array( 'extension' => array( 'label' => __( 'Extension', 'performance-lab' ), - 'value' => wp_get_cache_type(), + 'value' => performance_lab_get_cache_type(), ), 'multiple_gets' => array( 'label' => __( 'Multiple gets', 'performance-lab' ), - 'value' => wp_cache_supports( 'get_multiple' ) ? 'Enabled' : 'Disabled', + 'value' => wp_cache_supports( 'get_multiple' ) ? __( 'Enabled', 'performance-lab' ) : __( 'Disabled', 'performance-lab' ), ), 'multiple_sets' => array( 'label' => __( 'Multiple sets', 'performance-lab' ), - 'value' => wp_cache_supports( 'set_multiple' ) ? 'Enabled' : 'Disabled', + 'value' => wp_cache_supports( 'set_multiple' ) ? __( 'Enabled', 'performance-lab' ) : __( 'Disabled', 'performance-lab' ), ), 'multiple_deletes' => array( 'label' => __( 'Multiple deletes', 'performance-lab' ), - 'value' => wp_cache_supports( 'delete_multiple' ) ? 'Enabled' : 'Disabled', + 'value' => wp_cache_supports( 'delete_multiple' ) ? __( 'Enabled', 'performance-lab' ) : __( 'Disabled', 'performance-lab' ), ), 'flush_group' => array( 'label' => __( 'Flush group', 'performance-lab' ), - 'value' => wp_cache_supports( 'flush_group' ) ? 'Enabled' : 'Disabled', + 'value' => wp_cache_supports( 'flush_group' ) ? __( 'Enabled', 'performance-lab' ) : __( 'Disabled', 'performance-lab' ), ), ); } @@ -48,10 +48,14 @@ function object_cache_supported_fields(): array { * that define the 3rd party object cache extension. Changes to those classes could render * problems with this function's ability to determine which object cache is being used. * + * This function was copied from WP-CLI. + * + * @link https://github.com/wp-cli/wp-cli/blob/0ca6d920123ac904c918d69181edc5071dc92c9d/php/utils-wp.php#L259-L331 + * * @return string Object cache type. - * @since 3.3.0 + * @since n.e.x.t */ -function wp_get_cache_type(): string { +function performance_lab_get_cache_type(): string { global $_wp_using_ext_object_cache, $wp_object_cache; $message = ''; diff --git a/plugins/performance-lab/includes/site-health/object-cache/hooks.php b/plugins/performance-lab/includes/site-health/object-cache/hooks.php index f70497ba4..7ab894573 100644 --- a/plugins/performance-lab/includes/site-health/object-cache/hooks.php +++ b/plugins/performance-lab/includes/site-health/object-cache/hooks.php @@ -3,7 +3,7 @@ * Hook callbacks used for Site Health Info. * * @package performance-lab - * @since 2.1.0 + * @since n.e.x.t */ if ( ! defined( 'ABSPATH' ) ) { @@ -15,17 +15,17 @@ * * @param array{object_cache: array{label: string,description: string,fields: array}} $info Site Health Info. * - * @return array{object_cache: array{label: string,description: string,fields: array}} Amended Info. * @since 3.3.0 - * @since 3.3.0 + * @return array{object_cache: array{label: string,description: string,fields: array}} Amended Info. + * @since n.e.x.t */ -function object_cache_supported_info( array $info ): array { +function performance_lab_object_cache_supported_info( array $info ): array { $info['object_cache'] = array( 'label' => __( 'Object Caching', 'performance-lab' ), 'description' => __( 'Shows which features object cache supports and if object caching is in use.', 'performance-lab' ), - 'fields' => object_cache_supported_fields(), + 'fields' => performance_lab_object_cache_supported_fields(), ); return $info; } -add_filter( 'debug_information', 'object_cache_supported_info', 10, 1 ); +add_filter( 'debug_information', 'performance_lab_object_cache_supported_info', 10, 1 ); From d746d31802e2bab147e8418122685bfc845653dd Mon Sep 17 00:00:00 2001 From: mkurdybanowski Date: Fri, 26 Jul 2024 00:40:48 +0200 Subject: [PATCH 4/6] WordPress#718: Fix prefix --- .../includes/site-health/object-cache/helper.php | 6 +++--- .../includes/site-health/object-cache/hooks.php | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/plugins/performance-lab/includes/site-health/object-cache/helper.php b/plugins/performance-lab/includes/site-health/object-cache/helper.php index 788d7fd53..dd3fdca7e 100644 --- a/plugins/performance-lab/includes/site-health/object-cache/helper.php +++ b/plugins/performance-lab/includes/site-health/object-cache/helper.php @@ -16,11 +16,11 @@ * @return array Fields. * @since n.e.x.t */ -function performance_lab_object_cache_supported_fields(): array { +function perflab_object_cache_supported_fields(): array { return array( 'extension' => array( 'label' => __( 'Extension', 'performance-lab' ), - 'value' => performance_lab_get_cache_type(), + 'value' => perflab_get_cache_type(), ), 'multiple_gets' => array( 'label' => __( 'Multiple gets', 'performance-lab' ), @@ -55,7 +55,7 @@ function performance_lab_object_cache_supported_fields(): array { * @return string Object cache type. * @since n.e.x.t */ -function performance_lab_get_cache_type(): string { +function perflab_get_cache_type(): string { global $_wp_using_ext_object_cache, $wp_object_cache; $message = ''; diff --git a/plugins/performance-lab/includes/site-health/object-cache/hooks.php b/plugins/performance-lab/includes/site-health/object-cache/hooks.php index 7ab894573..3d95b2704 100644 --- a/plugins/performance-lab/includes/site-health/object-cache/hooks.php +++ b/plugins/performance-lab/includes/site-health/object-cache/hooks.php @@ -18,14 +18,14 @@ * @return array{object_cache: array{label: string,description: string,fields: array}} Amended Info. * @since n.e.x.t */ -function performance_lab_object_cache_supported_info( array $info ): array { +function perflab_object_cache_supported_info( array $info ): array { $info['object_cache'] = array( 'label' => __( 'Object Caching', 'performance-lab' ), 'description' => __( 'Shows which features object cache supports and if object caching is in use.', 'performance-lab' ), - 'fields' => performance_lab_object_cache_supported_fields(), + 'fields' => perflab_object_cache_supported_fields(), ); return $info; } -add_filter( 'debug_information', 'performance_lab_object_cache_supported_info', 10, 1 ); +add_filter( 'debug_information', 'perflab_object_cache_supported_info', 10, 1 ); From b2a3c87f25c0b9bf185542d69eba839e45c1c7dc Mon Sep 17 00:00:00 2001 From: mkurdybanowski Date: Fri, 26 Jul 2024 00:47:34 +0200 Subject: [PATCH 5/6] WordPress#718: Fix prefix --- .../includes/site-health/object-cache/helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/performance-lab/includes/site-health/object-cache/helper.php b/plugins/performance-lab/includes/site-health/object-cache/helper.php index dd3fdca7e..64a5ac67d 100644 --- a/plugins/performance-lab/includes/site-health/object-cache/helper.php +++ b/plugins/performance-lab/includes/site-health/object-cache/helper.php @@ -50,7 +50,7 @@ function perflab_object_cache_supported_fields(): array { * * This function was copied from WP-CLI. * - * @link https://github.com/wp-cli/wp-cli/blob/0ca6d920123ac904c918d69181edc5071dc92c9d/php/utils-wp.php#L259-L331 + * @link https://github.com/wp-cli/wp-cli/blob/0ca6d920123ac904c918d69181edc5071dc92c9d/php/utils-wp.php#L259-L331. * * @return string Object cache type. * @since n.e.x.t From 74897bbb2cd07126175c138975f3d9daa5a49605 Mon Sep 17 00:00:00 2001 From: mkurdybanowski Date: Mon, 29 Jul 2024 12:36:41 +0200 Subject: [PATCH 6/6] WordPress#718: globals in docBlock --- .../includes/site-health/object-cache/helper.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/performance-lab/includes/site-health/object-cache/helper.php b/plugins/performance-lab/includes/site-health/object-cache/helper.php index 64a5ac67d..013d25418 100644 --- a/plugins/performance-lab/includes/site-health/object-cache/helper.php +++ b/plugins/performance-lab/includes/site-health/object-cache/helper.php @@ -52,6 +52,9 @@ function perflab_object_cache_supported_fields(): array { * * @link https://github.com/wp-cli/wp-cli/blob/0ca6d920123ac904c918d69181edc5071dc92c9d/php/utils-wp.php#L259-L331. * + * @global bool $_wp_using_ext_object_cache Whether external object cache is being used. + * @global WP_Object_Cache $wp_object_cache Object cache global instance. + * * @return string Object cache type. * @since n.e.x.t */