Make WordPress Core


Ignore:
Timestamp:
10/18/2022 06:14:01 PM (4 years ago)
Author:
davidbaumwald
Message:

Networks and Sites: Revert the use of the metadata API for *_network_options functions.

[54080] refactored the logic in get_network_option(), update_network_option() and delete_network_option() to use the metadata API. However, this change resulted in issues with large multisite installs that utilize memcached having network options > 1MB in size.

This change reverts [54080] and all related follow-up changes.

Reverts [54080], [54081], and [54082]. Partially reverts [54267] and [54402].

Props pavelschoffer, rebasaurus, johnbillion, spacedmonkey, desrosj, rinatkhaziev.
Fixes #56845.
See #37181.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/option/multisite.php

    r54080 r54637  
    151151                        $this->assertFalse( get_blog_option( $blog_id, $key2 ) );
    152152                        // $this->assertFalse( get_option( $key2 ) );                        // Check get_option().
     153                }
     154
     155                /**
     156                 * @group multisite
     157                 *
     158                 * @covers ::get_site_option
     159                 */
     160                public function test_site_notoptions() {
     161                        $network_id     = get_current_network_id();
     162                        $notoptions_key = "{$network_id}:notoptions";
     163
     164                        $_notoptions = wp_cache_get( 'notoptions', 'site-options' );
     165                        $this->assertEmpty( $_notoptions );
     166                        $_notoptions1 = wp_cache_get( $notoptions_key, 'site-options' );
     167                        $this->assertEmpty( $_notoptions1 );
     168
     169                        get_site_option( 'burrito' );
     170
     171                        $notoptions = wp_cache_get( 'notoptions', 'site-options' );
     172                        $this->assertEmpty( $notoptions );
     173                        $notoptions1 = wp_cache_get( $notoptions_key, 'site-options' );
     174                        $this->assertNotEmpty( $notoptions1 );
    153175                }
    154176
Note: See TracChangeset for help on using the changeset viewer.