Making WordPress.org


Ignore:
Timestamp:
11/01/2022 07:12:44 AM (3 years ago)
Author:
dd32
Message:

Plugin Directory: Code Cleanup: Remove option-cache bypass code that no longer appears needed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-plugin-directory.php

    r11408 r12177  
    9696        } );
    9797
    98 /*
    99         // Temporarily disabled to see if this is still needed / causing issues.
    100         // Work around caching issues
    101         add_filter( 'pre_option_jetpack_sync_full__started', array( $this, 'bypass_options_cache' ), 10, 2 );
    102         add_filter( 'default_option_jetpack_sync_full__started', '__return_null' );
    103         add_filter( 'pre_option_jetpack_sync_full__params', array( $this, 'bypass_options_cache' ), 10, 2 );
    104         add_filter( 'default_option_jetpack_sync_full__params', '__return_null' );
    105         add_filter( 'pre_option_jetpack_sync_full__queue_finished', array( $this, 'bypass_options_cache' ), 10, 2 );
    106         add_filter( 'default_option_jetpack_sync_full__queue_finished', '__return_null' );
    107         add_filter( 'pre_option_jetpack_sync_full__send_started', array( $this, 'bypass_options_cache' ), 10, 2 );
    108         add_filter( 'default_option_jetpack_sync_full__send_started', '__return_null' );
    109         add_filter( 'pre_option_jetpack_sync_full__finished', array( $this, 'bypass_options_cache' ), 10, 2 );
    110         add_filter( 'default_option_jetpack_sync_full__finished', '__return_null' );
    111 */
    112 
    11398        // Fix login URLs in admin bar
    11499        add_filter( 'login_url', array( $this, 'fix_login_url' ), 10, 3 );
     
    553538        remove_action( 'template_redirect', 'wp_redirect_admin_locations', 1000 );
    554539
    555         // disable feeds
     540        // Disable feeds
    556541        remove_action( 'wp_head', 'feed_links', 2 );
    557542        remove_action( 'wp_head', 'feed_links_extra', 3 );
     
    956941
    957942        return $found_posts;
    958     }
    959 
    960     /**
    961      * Filter to bypass caching for options critical to Jetpack sync to work around race conditions and other unidentified bugs.
    962      * If this works and becomes a permanent solution, it probably belongs elsewhere.
    963      */
    964     public function bypass_options_cache( $value, $option ) {
    965         global $wpdb;
    966         $value = $wpdb->get_var( $wpdb->prepare(
    967             "SELECT option_value FROM $wpdb->options WHERE option_name = %s LIMIT 1",
    968             $option
    969         ) );
    970         $value = maybe_unserialize( $value );
    971 
    972         return $value;
    973943    }
    974944
Note: See TracChangeset for help on using the changeset viewer.