Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/wp-includes/load.php
Original file line number Diff line number Diff line change
Expand Up @@ -901,7 +901,6 @@ function wp_start_object_cache() {
wp_cache_add_global_groups(
array(
'blog-details',
'blog-id-cache',
'blog-lookup',
'blog_meta',
'global-posts',
Expand Down
2 changes: 0 additions & 2 deletions src/wp-includes/ms-blogs.php
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,6 @@ function switch_to_blog( $new_blog_id, $deprecated = null ) {
wp_cache_add_global_groups(
array(
'blog-details',
'blog-id-cache',
'blog-lookup',
'blog_meta',
'global-posts',
Expand Down Expand Up @@ -650,7 +649,6 @@ function restore_current_blog() {
wp_cache_add_global_groups(
array(
'blog-details',
'blog-id-cache',
'blog-lookup',
'blog_meta',
'global-posts',
Expand Down
10 changes: 0 additions & 10 deletions src/wp-includes/ms-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -350,13 +350,6 @@ function get_blog_permalink( $blog_id, $post_id ) {
function get_blog_id_from_url( $domain, $path = '/' ) {
$domain = strtolower( $domain );
$path = strtolower( $path );
$id = wp_cache_get( md5( $domain . $path ), 'blog-id-cache' );

if ( -1 === $id ) { // Blog does not exist.
return 0;
} elseif ( $id ) {
return (int) $id;
}

$args = array(
'domain' => $domain,
Expand All @@ -369,12 +362,9 @@ function get_blog_id_from_url( $domain, $path = '/' ) {
$id = array_shift( $result );

if ( ! $id ) {
wp_cache_set( md5( $domain . $path ), -1, 'blog-id-cache' );
return 0;
}

wp_cache_set( md5( $domain . $path ), $id, 'blog-id-cache' );

return $id;
}

Expand Down
1 change: 0 additions & 1 deletion src/wp-includes/ms-site.php
Original file line number Diff line number Diff line change
Expand Up @@ -992,7 +992,6 @@ function clean_blog_cache( $blog ) {
wp_cache_delete( $blog_id, 'blog-details' );
wp_cache_delete( $blog_id . 'short', 'blog-details' );
wp_cache_delete( $domain_path_key, 'blog-lookup' );
wp_cache_delete( $domain_path_key, 'blog-id-cache' );
wp_cache_delete( $blog_id, 'blog_meta' );

/**
Expand Down
1 change: 0 additions & 1 deletion tests/phpunit/includes/abstract-testcase.php
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,6 @@ public static function flush_cache() {
wp_cache_add_global_groups(
array(
'blog-details',
'blog-id-cache',
'blog-lookup',
'blog_meta',
'global-posts',
Expand Down
13 changes: 0 additions & 13 deletions tests/phpunit/tests/multisite/site.php
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,6 @@ public function test_data_in_cache_after_wpmu_delete_blog_drop_false() {
$this->assertFalse( wp_cache_get( $blog_id, 'blog-details' ) );
$this->assertFalse( wp_cache_get( $blog_id . 'short', 'blog-details' ) );
$this->assertFalse( wp_cache_get( $key, 'blog-lookup' ) );
$this->assertFalse( wp_cache_get( $key, 'blog-id-cache' ) );
}

/**
Expand Down Expand Up @@ -273,7 +272,6 @@ public function test_data_in_cache_after_wpmu_delete_blog_drop_true() {
$this->assertFalse( wp_cache_get( $blog_id, 'blog-details' ) );
$this->assertFalse( wp_cache_get( $blog_id . 'short', 'blog-details' ) );
$this->assertFalse( wp_cache_get( $key, 'blog-lookup' ) );
$this->assertFalse( wp_cache_get( $key, 'blog-id-cache' ) );
}

/**
Expand Down Expand Up @@ -314,7 +312,6 @@ public function test_data_in_cache_after_wpmu_delete_blog_main_site_drop_true()
$this->assertFalse( wp_cache_get( $blog_id, 'blog-details' ) );
$this->assertFalse( wp_cache_get( $blog_id . 'short', 'blog-details' ) );
$this->assertFalse( wp_cache_get( $key, 'blog-lookup' ) );
$this->assertFalse( wp_cache_get( $key, 'blog-id-cache' ) );
}

/**
Expand Down Expand Up @@ -465,7 +462,6 @@ public function test_get_blog_id_from_url() {

// Test the original response and cached response for the newly created site.
$this->assertSame( $blog_id, get_blog_id_from_url( $details->domain, $details->path ) );
$this->assertSame( $blog_id, wp_cache_get( $key, 'blog-id-cache' ) );
}

/**
Expand All @@ -491,7 +487,6 @@ public function test_get_blog_id_from_url_that_does_not_exist() {
$details = get_site( $blog_id );

$this->assertSame( 0, get_blog_id_from_url( $details->domain, 'foo' ) );
$this->assertSame( -1, wp_cache_get( md5( $details->domain . 'foo' ), 'blog-id-cache' ) );
}

/**
Expand All @@ -505,7 +500,6 @@ public function test_get_blog_id_from_url_with_deleted_flag() {
wpmu_delete_blog( $blog_id );

$this->assertSame( $blog_id, get_blog_id_from_url( $details->domain, $details->path ) );
$this->assertSame( $blog_id, wp_cache_get( $key, 'blog-id-cache' ) );
}

/**
Expand All @@ -518,9 +512,7 @@ public function test_get_blog_id_from_url_after_dropped() {
$key = md5( $details->domain . $details->path );
wpmu_delete_blog( $blog_id, true );

$this->assertFalse( wp_cache_get( $key, 'blog-id-cache' ) );
$this->assertSame( 0, get_blog_id_from_url( $details->domain, $details->path ) );
$this->assertSame( -1, wp_cache_get( $key, 'blog-id-cache' ) );
}

/**
Expand Down Expand Up @@ -1042,7 +1034,6 @@ public function data_get_site_caches() {
array( '%blog_id%', 'blog-details' ),
array( '%blog_id%' . 'short', 'blog-details' ),
array( '%domain_path_key%', 'blog-lookup' ),
array( '%domain_path_key%', 'blog-id-cache' ),
);
}

Expand Down Expand Up @@ -1657,11 +1648,9 @@ public function test_wp_update_site_cleans_old_cache_on_domain_change() {
// Ensure all respective cache values are empty.
$result = array(
wp_cache_get( $domain_path_key_old, 'blog-lookup' ),
wp_cache_get( $domain_path_key_old, 'blog-id-cache' ),
wp_cache_get( 'current_blog_' . $old_domain, 'site-options' ),
wp_cache_get( 'current_blog_' . $old_domain . '/', 'site-options' ),
wp_cache_get( $domain_path_key_new, 'blog-lookup' ),
wp_cache_get( $domain_path_key_new, 'blog-id-cache' ),
wp_cache_get( 'current_blog_' . $new_domain, 'site-options' ),
wp_cache_get( 'current_blog_' . $new_domain . '/', 'site-options' ),
);
Expand Down Expand Up @@ -1712,10 +1701,8 @@ public function test_wp_update_site_cleans_old_cache_on_path_change() {
// Ensure all respective cache values are empty.
$result = array(
wp_cache_get( $domain_path_key_old, 'blog-lookup' ),
wp_cache_get( $domain_path_key_old, 'blog-id-cache' ),
wp_cache_get( 'current_blog_test.wordpress.org' . $old_path, 'site-options' ),
wp_cache_get( $domain_path_key_new, 'blog-lookup' ),
wp_cache_get( $domain_path_key_new, 'blog-id-cache' ),
wp_cache_get( 'current_blog_test.wordpress.org' . $new_path, 'site-options' ),
);

Expand Down
Loading