p_error( $response ) ) { return false; } $body = json_decode( wp_remote_retrieve_body( $response ), true ); $status_code = wp_remote_retrieve_response_code( $response ); if ( 200 !== $status_code ) { return false; } return $this->set_plan_options( $body ); } /** * Set plan info to options table * * @param array $plan_info - the decoded plan info array. */ public function set_plan_options( $plan_info ) { if ( ! isset( $plan_info['supports_instant_search'] ) ) { return false; } // set option whether has Jetpack Search plan for capability reason. if ( get_option( 'has_jetpack_search_product' ) !== (bool) $plan_info['supports_instant_search'] ) { update_option( 'has_jetpack_search_product', (bool) $plan_info['supports_instant_search'] ); } // We use this option to determine the visibility of search submenu. // If the site ever had search subscription, then we record it and show the menu after. if ( $plan_info['supports_instant_search'] ) { update_option( self::JETPACK_SEARCH_EVER_SUPPORTED_SEARCH, true, false ); } update_option( self::JETPACK_SEARCH_PLAN_INFO_OPTION_KEY, $plan_info ); return true; } }
Fatal error: Uncaught Error: Class "Automattic\Jetpack\Search\Plan" not found in /htdocs/wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-search/src/class-module-control.php:47 Stack trace: #0 /htdocs/wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-search/src/class-rest-controller.php(62): Automattic\Jetpack\Search\Module_Control->__construct() #1 /htdocs/wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-search/src/initializers/class-initializer.php(102): Automattic\Jetpack\Search\REST_Controller->__construct() #2 /htdocs/wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-search/src/initializers/class-initializer.php(48): Automattic\Jetpack\Search\Initializer::init_before_connection() #3 /htdocs/wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-config/src/class-config.php(282): Automattic\Jetpack\Search\Initializer::init() #4 /htdocs/wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-config/src/class-config.php(217): Automattic\Jetpack\Config->enable_search() #5 /htdocs/wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-config/src/class-config.php(134): Automattic\Jetpack\Config->ensure_feature('search') #6 /htdocs/wp-includes/class-wp-hook.php(324): Automattic\Jetpack\Config->on_plugins_loaded('') #7 /htdocs/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array) #8 /htdocs/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #9 /htdocs/wp-settings.php(559): do_action('plugins_loaded') #10 /htdocs/wp-config.php(85): require_once('/htdocs/wp-sett...') #11 /htdocs/wp-load.php(50): require_once('/htdocs/wp-conf...') #12 /htdocs/wp-blog-header.php(13): require_once('/htdocs/wp-load...') #13 /htdocs/index.php(17): require('/htdocs/wp-blog...') #14 {main} thrown in /htdocs/wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-search/src/class-module-control.php on line 47