OD__, sprintf( /* translators: 1: source value, 2: forbidden key */ __( 'A speculation rule of source "%1$s" must not include a "%2$s" key.' ), 'document', 'urls' ), '6.8.0' ); return false; } } // If there is an 'eagerness' key specified, make sure it's valid. if ( isset( $rule['eagerness'] ) ) { if ( ! self::is_valid_eagerness( $rule['eagerness'] ) ) { _doing_it_wrong( __METHOD__, sprintf( /* translators: %s: invalid eagerness value */ __( 'The value "%s" is not a valid eagerness for a speculation rule.' ), esc_html( $rule['eagerness'] ) ), '6.8.0' ); return false; } if ( isset( $rule['where'] ) && 'immediate' === $rule['eagerness'] ) { _doing_it_wrong( __METHOD__, sprintf( /* translators: %s: forbidden eagerness value */ __( 'The eagerness value "%s" is forbidden for document-level speculation rules.' ), 'immediate' ), '6.8.0' ); return false; } } if ( ! isset( $this->rules_by_mode[ $mode ] ) ) { $this->rules_by_mode[ $mode ] = array(); } $this->rules_by_mode[ $mode ][ $id ] = $rule; return true; } /** * Checks whether a speculation rule for the given mode and ID already exists. * * @since 6.8.0 * * @param string $mode Speculative loading mode. Either 'prefetch' or 'prerender'. * @param string $id Unique string identifier for the speculation rule. * @return bool True if the rule already exists, false otherwise. */ public function has_rule( string $mode, string $id ): bool { return isset( $this->rules_by_mode[ $mode ][ $id ] ); } /** * Returns the speculation rules data ready to be JSON-encoded. * * @since 6.8.0 * * @return array>> Speculation rules data. */ #[ReturnTypeWillChange] public function jsonSerialize() { // Strip the IDs for JSON output, since they are not relevant for the Speculation Rules API. return array_map( static function ( array $rules ) { return array_values( $rules ); }, array_filter( $this->rules_by_mode ) ); } /** * Checks whether the given ID is valid. * * @since 6.8.0 * * @param string $id Unique string identifier for the speculation rule. * @return bool True if the ID is valid, false otherwise. */ private function is_valid_id( string $id ): bool { return (bool) preg_match( '/^[a-z][a-z0-9_-]+$/', $id ); } /** * Checks whether the given speculation rules mode is valid. * * @since 6.8.0 * @since 7.1.0 The $mode param now allows mixed and not just string. * * @param mixed $mode Speculation rules mode. * @return bool True if valid, false otherwise. * * @phpstan-assert-if-true 'prefetch'|'prerender' $mode */ public static function is_valid_mode( $mode ): bool { return is_string( $mode ) && isset( self::$mode_allowlist[ $mode ] ); } /** * Checks whether the given speculation rules eagerness is valid. * * @since 6.8.0 * @since 7.1.0 The $eagerness param now allows mixed and not just string. * * @param mixed $eagerness Speculation rules eagerness. * @return bool True if valid, false otherwise. * * @phpstan-assert-if-true 'conservative'|'moderate'|'eager'|'immediate' $eagerness */ public static function is_valid_eagerness( $eagerness ): bool { return is_string( $eagerness ) && isset( self::$eagerness_allowlist[ $eagerness ] ); } /** * Checks whether the given speculation rules source is valid. * * @since 6.8.0 * * @param string $source Speculation rules source. * @return bool True if valid, false otherwise. */ public static function is_valid_source( string $source ): bool { return isset( self::$source_allowlist[ $source ] ); } }
Fatal error: Uncaught Error: Class "Automattic\Jetpack\Publicize\Publicize_Assets" not found in /htdocs/emploitogo.info/wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-publicize/src/class-publicize-setup.php:83 Stack trace: #0 /htdocs/emploitogo.info/wp-includes/class-wp-hook.php(353): Automattic\Jetpack\Publicize\Publicize_Setup::pre_initialization('') #1 /htdocs/emploitogo.info/wp-includes/class-wp-hook.php(377): WP_Hook->apply_filters(NULL, Array) #2 /htdocs/emploitogo.info/wp-includes/plugin.php(523): WP_Hook->do_action(Array) #3 /htdocs/emploitogo.info/wp-settings.php(630): do_action('plugins_loaded') #4 /htdocs/emploitogo.info/wp-config.php(112): require_once('/htdocs/emploit...') #5 /htdocs/emploitogo.info/wp-load.php(50): require_once('/htdocs/emploit...') #6 /htdocs/emploitogo.info/wp-blog-header.php(13): require_once('/htdocs/emploit...') #7 /htdocs/emploitogo.info/index.php(17): require('/htdocs/emploit...') #8 {main} thrown in /htdocs/emploitogo.info/wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-publicize/src/class-publicize-setup.php on line 83