From 8cc8a221fc96d8706191331ae737e180ca780481 Mon Sep 17 00:00:00 2001 From: Jeremy Felt Date: Tue, 28 Mar 2017 21:07:22 +0000 Subject: [PATCH] Multisite: Remove unused `site-lookup` global cache group. The `site-lookup` group was introduced in WPMU, but never actually used in WordPress core. Props johnjamesjacoby. Fixes #38725. git-svn-id: https://develop.svn.wordpress.org/trunk@40347 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/load.php | 2 +- src/wp-includes/ms-blogs.php | 4 ++-- tests/phpunit/includes/testcase.php | 2 +- tests/phpunit/tests/cache.php | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/wp-includes/load.php b/src/wp-includes/load.php index 68ed0bd1ee..6fe15214a4 100644 --- a/src/wp-includes/load.php +++ b/src/wp-includes/load.php @@ -515,7 +515,7 @@ function wp_start_object_cache() { } if ( function_exists( 'wp_cache_add_global_groups' ) ) { - wp_cache_add_global_groups( array( 'users', 'userlogins', 'usermeta', 'user_meta', 'useremail', 'userslugs', 'site-transient', 'site-options', 'site-lookup', 'blog-lookup', 'blog-details', 'site-details', 'rss', 'global-posts', 'blog-id-cache', 'networks', 'sites' ) ); + wp_cache_add_global_groups( array( 'users', 'userlogins', 'usermeta', 'user_meta', 'useremail', 'userslugs', 'site-transient', 'site-options', 'blog-lookup', 'blog-details', 'site-details', 'rss', 'global-posts', 'blog-id-cache', 'networks', 'sites' ) ); wp_cache_add_non_persistent_groups( array( 'counts', 'plugins' ) ); } } diff --git a/src/wp-includes/ms-blogs.php b/src/wp-includes/ms-blogs.php index 50e3358bcc..32e331e0ec 100644 --- a/src/wp-includes/ms-blogs.php +++ b/src/wp-includes/ms-blogs.php @@ -842,7 +842,7 @@ function switch_to_blog( $new_blog, $deprecated = null ) { if ( is_array( $global_groups ) ) { wp_cache_add_global_groups( $global_groups ); } else { - wp_cache_add_global_groups( array( 'users', 'userlogins', 'usermeta', 'user_meta', 'useremail', 'userslugs', 'site-transient', 'site-options', 'site-lookup', 'blog-lookup', 'blog-details', 'rss', 'global-posts', 'blog-id-cache', 'networks', 'sites', 'site-details' ) ); + wp_cache_add_global_groups( array( 'users', 'userlogins', 'usermeta', 'user_meta', 'useremail', 'userslugs', 'site-transient', 'site-options', 'blog-lookup', 'blog-details', 'rss', 'global-posts', 'blog-id-cache', 'networks', 'sites', 'site-details' ) ); } wp_cache_add_non_persistent_groups( array( 'counts', 'plugins' ) ); } @@ -916,7 +916,7 @@ function restore_current_blog() { if ( is_array( $global_groups ) ) { wp_cache_add_global_groups( $global_groups ); } else { - wp_cache_add_global_groups( array( 'users', 'userlogins', 'usermeta', 'user_meta', 'useremail', 'userslugs', 'site-transient', 'site-options', 'site-lookup', 'blog-lookup', 'blog-details', 'rss', 'global-posts', 'blog-id-cache', 'networks', 'sites', 'site-details' ) ); + wp_cache_add_global_groups( array( 'users', 'userlogins', 'usermeta', 'user_meta', 'useremail', 'userslugs', 'site-transient', 'site-options', 'blog-lookup', 'blog-details', 'rss', 'global-posts', 'blog-id-cache', 'networks', 'sites', 'site-details' ) ); } wp_cache_add_non_persistent_groups( array( 'counts', 'plugins' ) ); } diff --git a/tests/phpunit/includes/testcase.php b/tests/phpunit/includes/testcase.php index b9b2098810..c77511d3a4 100644 --- a/tests/phpunit/includes/testcase.php +++ b/tests/phpunit/includes/testcase.php @@ -301,7 +301,7 @@ class WP_UnitTestCase extends PHPUnit_Framework_TestCase { $wp_object_cache->__remoteset(); } wp_cache_flush(); - wp_cache_add_global_groups( array( 'users', 'userlogins', 'usermeta', 'user_meta', 'useremail', 'userslugs', 'site-transient', 'site-options', 'site-lookup', 'blog-lookup', 'blog-details', 'rss', 'global-posts', 'blog-id-cache', 'networks', 'sites', 'site-details' ) ); + wp_cache_add_global_groups( array( 'users', 'userlogins', 'usermeta', 'user_meta', 'useremail', 'userslugs', 'site-transient', 'site-options', 'blog-lookup', 'blog-details', 'rss', 'global-posts', 'blog-id-cache', 'networks', 'sites', 'site-details' ) ); wp_cache_add_non_persistent_groups( array( 'comment', 'counts', 'plugins' ) ); } diff --git a/tests/phpunit/tests/cache.php b/tests/phpunit/tests/cache.php index a282fc90b0..6c2eb7770f 100644 --- a/tests/phpunit/tests/cache.php +++ b/tests/phpunit/tests/cache.php @@ -22,7 +22,7 @@ class Tests_Cache extends WP_UnitTestCase { global $wp_object_cache; $cache_class = get_class( $wp_object_cache ); $cache = new $cache_class(); - $cache->add_global_groups( array( 'global-cache-test', 'users', 'userlogins', 'usermeta', 'user_meta', 'useremail', 'userslugs', 'site-transient', 'site-options', 'site-lookup', 'blog-lookup', 'blog-details', 'rss', 'global-posts', 'blog-id-cache', 'networks', 'sites', 'site-details' ) ); + $cache->add_global_groups( array( 'global-cache-test', 'users', 'userlogins', 'usermeta', 'user_meta', 'useremail', 'userslugs', 'site-transient', 'site-options', 'blog-lookup', 'blog-details', 'rss', 'global-posts', 'blog-id-cache', 'networks', 'sites', 'site-details' ) ); return $cache; }