WordPress.org

Making WordPress.org

Changeset 4457


Ignore:
Timestamp:
12/02/2016 12:00:12 AM (3 years ago)
Author:
tellyworth
Message:

Plugin directory: don't trigger an ElasticSearch query if the search will redirect to a pretty URL.

This eliminates double queries and appears to fix the 502 error in Firefox.

Fixes #2275

File:
1 edited

Legend:

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

    r4424 r4457  
    323323
    324324        // Instantiate our copy of the Jetpack_Search class.
    325         if ( class_exists( 'Jetpack' ) && ! class_exists( 'Jetpack_Search' ) ) {
    326             require_once( __DIR__ . '/libs/site-search/jetpack-search.php' );
    327             \Jetpack_Search::instance();
     325        if ( class_exists( 'Jetpack' ) && ! class_exists( 'Jetpack_Search' )
     326            && !isset( $_GET['s'] ) ) { // Don't run the ES query if we're going to redirect to the pretty search URL
     327                require_once( __DIR__ . '/libs/site-search/jetpack-search.php' );
     328                \Jetpack_Search::instance();
    328329        }
    329330
Note: See TracChangeset for help on using the changeset viewer.