) )->clean_all( time() - static::LIFETIME, $time_limit ); } /** * Delete the nonces. * * @param int $limit How many nonces to delete. * @param null|int $cutoff_timestamp All nonces added before this timestamp will be removed. * * @return int|false Number of removed nonces, or `false` if nothing to remove (or in case of a database error). */ public function delete( $limit = 10, $cutoff_timestamp = null ) { global $wpdb; $ids = $wpdb->get_col( $wpdb->prepare( "SELECT option_id FROM `{$wpdb->options}`" . " WHERE `option_name` >= 'jetpack_nonce_' AND `option_name` < %s" . ' LIMIT %d', 'jetpack_nonce_' . $cutoff_timestamp, $limit ) ); if ( ! is_array( $ids ) ) { // There's an error and we can't proceed. return false; } // Removing zeroes in case AUTO_INCREMENT of the options table is broken, and all ID's are zeroes. $ids = array_filter( $ids ); if ( array() === $ids ) { // There's nothing to remove. return false; } $ids_fill = implode( ', ', array_fill( 0, count( $ids ), '%d' ) ); $args = $ids; $args[] = 'jetpack_nonce_%'; // The Code Sniffer is unable to understand what's going on... // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared,WordPress.DB.PreparedSQLPlaceholders.ReplacementsWrongNumber return $wpdb->query( $wpdb->prepare( "DELETE FROM `{$wpdb->options}` WHERE `option_id` IN ( {$ids_fill} ) AND option_name LIKE %s", $args ) ); } /** * Clean the cached nonces valid during the current request, therefore making them invalid. * * @return bool */ public static function invalidate_request_nonces() { static::$nonces_used_this_request = array(); return true; } }
Fatal error: Uncaught Error: Class "Automattic\Jetpack\Connection\Nonce_Handler" not found in /htdocs/wp-content/plugins/woocommerce/vendor/automattic/jetpack-connection/src/class-manager.php:118 Stack trace: #0 /htdocs/wp-content/plugins/woocommerce/vendor/automattic/jetpack-config/src/class-config.php(273): Automattic\Jetpack\Connection\Manager::configure() #1 /htdocs/wp-content/plugins/woocommerce/vendor/automattic/jetpack-config/src/class-config.php(225): Automattic\Jetpack\Config->enable_connection() #2 /htdocs/wp-content/plugins/woocommerce/vendor/automattic/jetpack-config/src/class-config.php(111): Automattic\Jetpack\Config->ensure_feature('connection') #3 /htdocs/wp-includes/class-wp-hook.php(324): Automattic\Jetpack\Config->on_plugins_loaded('') #4 /htdocs/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array) #5 /htdocs/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #6 /htdocs/wp-settings.php(559): do_action('plugins_loaded') #7 /htdocs/wp-config.php(106): require_once('/htdocs/wp-sett...') #8 /htdocs/wp-load.php(50): require_once('/htdocs/wp-conf...') #9 /htdocs/wp-blog-header.php(13): require_once('/htdocs/wp-load...') #10 /htdocs/index.php(17): require('/htdocs/wp-blog...') #11 {main} thrown in /htdocs/wp-content/plugins/woocommerce/vendor/automattic/jetpack-connection/src/class-manager.php on line 118