/home/fortodpl/fortattooideas.com/wp-includes
NameSizeModeActions
abilities-api/-0755rm
ai-client/-0755rm
assets/-0755rm
block-bindings/-0755rm
block-patterns/-0755rm
block-supports/-0755rm
blocks/-0755rm
build/-0755rm
certificates/-0755rm
css/-0755rm
customize/-0755rm
fonts/-0755rm
html-api/-0755rm
ID3/-0755rm
images/-0755rm
interactivity-api/-0755rm
IXR/-0755rm
js/-0755rm
l10n/-0755rm
php-ai-client/-0755rm
php-compat/-0755rm
PHPMailer/-0755rm
pomo/-0755rm
Requests/-0755rm
rest-api/-0755rm
SimplePie/-0755rm
sitemaps/-0755rm
sodium_compat/-0755rm
style-engine/-0755rm
Text/-0755rm
theme-compat/-0755rm
widgets/-0755rm
.htaccess1780644editdlrm
abilities-api.php328000644editdlrm
abilities.php117970644editdlrm
admin-bar.php400670644editdlrm
ai-client.php25490644editdlrm
atomlib.php121810644editdlrm
author-template.php198440644editdlrm
block-bindings.php76320644editdlrm
block-editor.php287240644editdlrm
block-i18n.json3160644editdlrm
block-patterns.php156060644editdlrm
block-template-utils.php631680644editdlrm
block-template.php182570644editdlrm
blocks.php1242050644editdlrm
bookmark-template.php127680644editdlrm
bookmark.php154270644editdlrm
cache-compat.php110210644editdlrm
cache.php134860644editdlrm
canonical.php347860644editdlrm
capabilities.php435840644editdlrm
category-template.php569900644editdlrm
category.php128340644editdlrm
class-avif-info.php300080644editdlrm
class-feed.php5390644editdlrm
class-http.php3670644editdlrm
class-IXR.php26090644editdlrm
class-json.php436760644editdlrm
class-oembed.php4010644editdlrm
class-phpass.php67710644editdlrm
class-phpmailer.php6640644editdlrm
class-pop3.php211000644editdlrm
class-requests.php22370644editdlrm
class-simplepie.php4530644editdlrm
class-smtp.php4570644editdlrm
class-snoopy.php377150644editdlrm
class-walker-category-dropdown.php24690644editdlrm
class-walker-category.php84770644editdlrm
class-walker-comment.php142210644editdlrm
class-walker-nav-menu.php120440644editdlrm
class-walker-page-dropdown.php27100644editdlrm
class-walker-page.php76120644editdlrm
class-wp-admin-bar.php180020644editdlrm
class-wp-ajax-response.php52880644editdlrm
class-wp-application-passwords.php170990644editdlrm
class-wp-block-bindings-registry.php82630644editdlrm
class-wp-block-bindings-source.php29920644editdlrm
class-wp-block-editor-context.php13500644editdlrm
class-wp-block-list.php47130644editdlrm
class-wp-block-metadata-registry.php118460644editdlrm
class-wp-block-parser-block.php25550644editdlrm
class-wp-block-parser-frame.php19940644editdlrm
class-wp-block-parser.php115250644editdlrm
class-wp-block-pattern-categories-registry.php43830644editdlrm
class-wp-block-patterns-registry.php102650644editdlrm
class-wp-block-processor.php699140644editdlrm
class-wp-block-styles-registry.php64190644editdlrm
class-wp-block-supports.php75780644editdlrm
class-wp-block-template.php21110644editdlrm
class-wp-block-templates-registry.php70800644editdlrm
class-wp-block-type-registry.php53050644editdlrm
class-wp-block-type.php172220644editdlrm
class-wp-block.php282360644editdlrm
class-wp-classic-to-block-menu-converter.php40260644editdlrm
class-wp-comment-query.php490400644editdlrm
class-wp-comment.php172490644editdlrm
class-wp-connector-registry.php151810644editdlrm
class-wp-customize-control.php261120644editdlrm
class-wp-customize-manager.php2029080644editdlrm
class-wp-customize-nav-menus.php580340644editdlrm
class-wp-customize-panel.php107030644editdlrm
class-wp-customize-section.php112090644editdlrm
class-wp-customize-setting.php299560644editdlrm
class-wp-customize-widgets.php725960644editdlrm
class-wp-date-query.php359700644editdlrm
class-wp-dependencies.php170890644editdlrm
class-wp-dependency.php26530644editdlrm
class-wp-duotone.php408360644editdlrm
class-wp-editor.php722280644editdlrm
class-wp-embed.php159080644editdlrm
class-wp-error.php75140644editdlrm
class-wp-exception.php2530644editdlrm
class-wp-fatal-error-handler.php81500644editdlrm
class-wp-feed-cache-transient.php33040644editdlrm
class-wp-feed-cache.php9690644editdlrm
class-wp-filter-sentinel.php7600644editdlrm
class-wp-hook.php174720644editdlrm
class-wp-http-cookie.php72690644editdlrm
class-wp-http-curl.php132610644editdlrm
class-wp-http-encoding.php66890644editdlrm
class-wp-http-ixr-client.php35160644editdlrm
class-wp-http-proxy.php59800644editdlrm
class-wp-http-requests-hooks.php20220644editdlrm
class-wp-http-requests-response.php42430644editdlrm
class-wp-http-response.php29770644editdlrm
class-wp-http-streams.php167640644editdlrm
class-wp-http.php416410644editdlrm
class-wp-icon-collections-registry.php58050644editdlrm
class-wp-icons-registry.php99030644editdlrm
class-wp-image-editor-gd.php207410644editdlrm
class-wp-image-editor-imagick.php434540644editdlrm
class-wp-image-editor.php174560644editdlrm
class-wp-list-util.php74430644editdlrm
class-wp-locale-switcher.php67760644editdlrm
class-wp-locale.php168480644editdlrm
class-wp-matchesmapregex.php18280644editdlrm
class-wp-meta-query.php305070644editdlrm
class-wp-metadata-lazyloader.php68330644editdlrm
class-wp-navigation-fallback.php91930644editdlrm
class-wp-network-query.php199890644editdlrm
class-wp-network.php124110644editdlrm
class-wp-object-cache.php175240644editdlrm
class-wp-oembed-controller.php69050644editdlrm
class-wp-oembed.php343720644editdlrm
class-wp-paused-extensions-storage.php50670644editdlrm
class-wp-phpmailer.php43480644editdlrm
class-wp-plugin-dependencies.php252090644editdlrm
class-wp-post-type.php306720644editdlrm
class-wp-post.php88060644editdlrm
class-wp-query.php1641480644editdlrm
class-wp-recovery-mode-cookie-service.php68770644editdlrm
class-wp-recovery-mode-email-service.php111620644editdlrm
class-wp-recovery-mode-key-service.php49140644editdlrm
class-wp-recovery-mode-link-service.php35230644editdlrm
class-wp-recovery-mode.php114600644editdlrm
class-wp-rewrite.php636930644editdlrm
class-wp-role.php25230644editdlrm
class-wp-roles.php93260644editdlrm
class-wp-script-modules.php407430644editdlrm
class-wp-scripts.php367540644editdlrm
class-wp-session-tokens.php73190644editdlrm
class-wp-simplepie-file.php35520644editdlrm
class-wp-simplepie-sanitize-kses.php19030644editdlrm
class-wp-site-query.php314820644editdlrm
class-wp-site.php78360644editdlrm
class-wp-speculation-rules.php78840644editdlrm
class-wp-styles.php133160644editdlrm
class-wp-tax-query.php195770644editdlrm
class-wp-taxonomy.php185590644editdlrm
class-wp-term-query.php407510644editdlrm
class-wp-term.php52630644editdlrm
class-wp-text-diff-renderer-inline.php9790644editdlrm
class-wp-text-diff-renderer-table.php189250644editdlrm
class-wp-textdomain-registry.php104810644editdlrm
class-wp-theme-json-data.php18050644editdlrm
class-wp-theme-json-resolver.php356920644editdlrm
class-wp-theme-json-schema.php73670644editdlrm
class-wp-theme-json.php2215060644editdlrm
class-wp-theme.php658110644editdlrm
class-wp-token-map.php290320644editdlrm
class-wp-url-pattern-prefixer.php48020644editdlrm
class-wp-user-meta-session-tokens.php29540644editdlrm
class-wp-user-query.php441020644editdlrm
class-wp-user-request.php23420644editdlrm
class-wp-user.php231890644editdlrm
class-wp-view-config-data.php294270644editdlrm
class-wp-walker.php132920644editdlrm
class-wp-widget-factory.php33430644editdlrm
class-wp-widget.php184520644editdlrm
class-wp-xmlrpc-server.php2162720644editdlrm
class-wp.php263710644editdlrm
class-wpdb.php1214370644editdlrm
class.wp-dependencies.php3730644editdlrm
class.wp-scripts.php3430644editdlrm
class.wp-styles.php3380644editdlrm
comment-template.php1032110644editdlrm
comment.php1506300644editdlrm
compat-utf8.php193860644editdlrm
compat.php224790644editdlrm
connectors.php329220644editdlrm
cron.php462660644editdlrm
date.php4000644editdlrm
default-constants.php113650644editdlrm
default-filters.php395000644editdlrm
default-widgets.php22880644editdlrm
deprecated.php1939770644editdlrm
embed-template.php3380644editdlrm
embed.php392150644editdlrm
error-protection.php40920644editdlrm
feed-atom-comments.php55040644editdlrm
feed-atom.php31140644editdlrm
feed-rdf.php26680644editdlrm
feed-rss.php11890644editdlrm
feed-rss2-comments.php41360644editdlrm
feed-rss2.php37990644editdlrm
feed.php251890644editdlrm
fonts.php97890644editdlrm
formatting.php3576520644editdlrm
functions.php2954810644editdlrm
functions.wp-scripts.php204920644editdlrm
functions.wp-styles.php86540644editdlrm
general-template.php1834720644editdlrm
global-styles-and-settings.php207800644editdlrm
http.php289610644editdlrm
https-detection.php58570644editdlrm
https-migration.php47410644editdlrm
icons.php63340644editdlrm
json-schema.php78020644editdlrm
kses.php884970644editdlrm
l10n.php714150644editdlrm
link-template.php1601430644editdlrm
load.php564750644editdlrm
locale.php1620644editdlrm
media-template.php657590644editdlrm
media.php2368040644editdlrm
meta.php667390644editdlrm
ms-blogs.php263240644editdlrm
ms-default-constants.php49210644editdlrm
ms-default-filters.php66360644editdlrm
ms-deprecated.php217870644editdlrm
ms-files.php28570644editdlrm
ms-functions.php925300644editdlrm
ms-load.php200550644editdlrm
ms-network.php37820644editdlrm
ms-settings.php41970644editdlrm
ms-site.php417290644editdlrm
nav-menu-template.php259830644editdlrm
nav-menu.php442690644editdlrm
option.php1052460644editdlrm
pluggable-deprecated.php63240644editdlrm
pluggable.php1279190644editdlrm
plugin.php366690644editdlrm
post-formats.php70700644editdlrm
post-template.php691290644editdlrm
post-thumbnail-template.php108790644editdlrm
post.php3052150644editdlrm
query.php375540644editdlrm
registration-functions.php2000644editdlrm
registration.php2000644editdlrm
rest-api.php1029510644editdlrm
revision.php312410644editdlrm
rewrite.php195670644editdlrm
robots-template.php51850644editdlrm
rss-functions.php2770644editdlrm
rss.php232030644editdlrm
script-loader.php1635500644editdlrm
script-modules.php123110644editdlrm
session.php2580644editdlrm
shortcodes.php240340644editdlrm
sitemaps.php32380644editdlrm
speculative-loading.php118800644editdlrm
spl-autoload-compat.php4410644editdlrm
style-engine.php80450644editdlrm
taxonomy.php1783070644editdlrm
template-canvas.php5440644editdlrm
template-loader.php42670644editdlrm
template.php368240644editdlrm
theme-i18n.json18920644editdlrm
theme-previews.php28870644editdlrm
theme-templates.php40600644editdlrm
theme.json94800644editdlrm
theme.php1346410644editdlrm
update.php382690644editdlrm
user.php1803010644editdlrm
utf8.php69770644editdlrm
vars.php66000644editdlrm
version.php11010644editdlrm
view-config.php190870644editdlrm
view-transitions.php6020644editdlrm
widgets.php708660644editdlrm
wp-db.php4450644editdlrm
wp-diff.php7920644editdlrm
Edit: /home/fortodpl/fortattooideas.com/wp-includes/speculative-loading.php (11880B)
|null Associative array with 'mode' and 'eagerness' keys, or null if speculative * loading is disabled. * @phpstan-return array{ * mode: 'prefetch'|'prerender', * eagerness: 'conservative'|'moderate'|'eager', * }|null */ function wp_get_speculation_rules_configuration(): ?array { // By default, speculative loading is only enabled for sites with pretty permalinks when no user is logged in. if ( ! is_user_logged_in() && get_option( 'permalink_structure' ) ) { $config = array( 'mode' => 'auto', 'eagerness' => 'auto', ); } else { $config = null; } /** * Filters the way that speculation rules are configured. * * The Speculation Rules API is a web API that allows to automatically prefetch or prerender certain URLs on the * page, which can lead to near-instant page load times. This is also referred to as speculative loading. * * There are two aspects to the configuration: * * The "mode" (whether to "prefetch" or "prerender" URLs). * * The "eagerness" (whether to speculatively load URLs in an "eager", "moderate", or "conservative" way). * * By default, the speculation rules configuration is decided by WordPress Core ("auto"). This filter can be used * to force a certain configuration, which could for instance load URLs more or less eagerly. * * For logged-in users or for sites that are not configured to use pretty permalinks, the default value is `null`, * indicating that speculative loading is entirely disabled. * * @since 6.8.0 * @see https://developer.chrome.com/docs/web-platform/prerender-pages * * @param array|null $config Associative array with 'mode' and 'eagerness' keys, or `null`. The * default value for both of the keys is 'auto'. Other possible values * for 'mode' are 'prefetch' and 'prerender'. Other possible values for * 'eagerness' are 'eager', 'moderate', and 'conservative'. The value * `null` is used to disable speculative loading entirely. */ $config = apply_filters( 'wp_speculation_rules_configuration', $config ); // Allow the value `null` to indicate that speculative loading is disabled. if ( null === $config ) { return null; } // Sanitize the configuration and replace 'auto' with current defaults. $defaults = wp_get_speculation_rules_default_configuration(); $default_mode = $defaults['mode']; $default_eagerness = $defaults['eagerness']; if ( ! is_array( $config ) ) { return array( 'mode' => $default_mode, 'eagerness' => $default_eagerness, ); } if ( ! isset( $config['mode'] ) || 'auto' === $config['mode'] || ! WP_Speculation_Rules::is_valid_mode( $config['mode'] ) ) { $config['mode'] = $default_mode; } if ( ! isset( $config['eagerness'] ) || 'auto' === $config['eagerness'] || ! WP_Speculation_Rules::is_valid_eagerness( $config['eagerness'] ) || // 'immediate' is a valid eagerness, but for safety WordPress does not allow it for document-level rules. 'immediate' === $config['eagerness'] ) { $config['eagerness'] = $default_eagerness; } return array( 'mode' => $config['mode'], 'eagerness' => $config['eagerness'], ); } /** * Returns the default speculation rules configuration that the value 'auto' resolves to. * * WordPress Core defaults to a mode of 'prefetch' and an eagerness of 'conservative'. Hosting providers can override * either default by way of the `WP_SPECULATIVE_LOADING_DEFAULT_MODE` and `WP_SPECULATIVE_LOADING_DEFAULT_EAGERNESS` * constants or environment variables. This only changes what the 'auto' value resolves to, so a plugin which supplies * an explicit mode or eagerness via the {@see 'wp_speculation_rules_configuration'} filter continues to take * precedence. * * Note that an eagerness of 'immediate' is not permitted as a default, since WordPress does not allow it for the * document-level rules that it generates. * * @since 7.1.0 * @access private * * @return array Associative array with 'mode' and 'eagerness' keys. * @phpstan-return array{ * mode: 'prefetch'|'prerender', * eagerness: 'conservative'|'moderate'|'eager', * } */ function wp_get_speculation_rules_default_configuration(): array { $default_mode = 'prefetch'; $mode = wp_get_speculative_loading_override( 'WP_SPECULATIVE_LOADING_DEFAULT_MODE' ); if ( WP_Speculation_Rules::is_valid_mode( $mode ) ) { $default_mode = $mode; } $default_eagerness = 'conservative'; $eagerness = wp_get_speculative_loading_override( 'WP_SPECULATIVE_LOADING_DEFAULT_EAGERNESS' ); if ( WP_Speculation_Rules::is_valid_eagerness( $eagerness ) && // 'immediate' is a valid eagerness, but for safety WordPress does not allow it for document-level rules. 'immediate' !== $eagerness ) { $default_eagerness = $eagerness; } return array( 'mode' => $default_mode, 'eagerness' => $default_eagerness, ); } /** * Returns the value of a speculative loading override, as supplied by a constant or an environment variable. * * The constant takes precedence over the environment variable, consistent with {@see wp_get_environment_type()}. * * @since 7.1.0 * @access private * * @param string $name Name of the constant and environment variable to look up. * @return string|null The override value, or null if neither is set. */ function wp_get_speculative_loading_override( string $name ): ?string { $value = null; // Check if the environment variable has been set, if `getenv` is available on the system. if ( function_exists( 'getenv' ) ) { $has_env = getenv( $name ); if ( false !== $has_env ) { $value = $has_env; } } // Fetch the value from a constant, which overrides the environment variable. if ( defined( $name ) ) { $has_constant = constant( $name ); if ( is_string( $has_constant ) ) { $value = $has_constant; } } return $value; } /** * Returns the full speculation rules data based on the configuration. * * Plugins with features that rely on frontend URLs to exclude from prefetching or prerendering should use the * {@see 'wp_speculation_rules_href_exclude_paths'} filter to ensure those URL patterns are excluded. * * Additional speculation rules other than the default rule from WordPress Core can be provided by using the * {@see 'wp_load_speculation_rules'} action and amending the passed WP_Speculation_Rules object. * * @since 6.8.0 * @access private * * @return WP_Speculation_Rules|null Object representing the speculation rules to use, or null if speculative loading * is disabled in the current context. */ function wp_get_speculation_rules(): ?WP_Speculation_Rules { $configuration = wp_get_speculation_rules_configuration(); if ( null === $configuration ) { return null; } $mode = $configuration['mode']; $eagerness = $configuration['eagerness']; $prefixer = new WP_URL_Pattern_Prefixer(); $base_href_exclude_paths = array( $prefixer->prefix_path_pattern( '/wp-*.php', 'site' ), $prefixer->prefix_path_pattern( '/wp-admin/*', 'site' ), $prefixer->prefix_path_pattern( '/*', 'uploads' ), $prefixer->prefix_path_pattern( '/*', 'content' ), $prefixer->prefix_path_pattern( '/*', 'plugins' ), $prefixer->prefix_path_pattern( '/*', 'template' ), $prefixer->prefix_path_pattern( '/*', 'stylesheet' ), ); /* * If pretty permalinks are enabled, exclude any URLs with query parameters. * Otherwise, exclude specifically the URLs with a `_wpnonce` query parameter or any other query parameter * containing the word `nonce`. */ if ( get_option( 'permalink_structure' ) ) { $base_href_exclude_paths[] = $prefixer->prefix_path_pattern( '/*\\?(.+)', 'home' ); } else { $base_href_exclude_paths[] = $prefixer->prefix_path_pattern( '/*\\?*(^|&)*nonce*=*', 'home' ); } /** * Filters the paths for which speculative loading should be disabled. * * All paths should start in a forward slash, relative to the root document. The `*` can be used as a wildcard. * If the WordPress site is in a subdirectory, the exclude paths will automatically be prefixed as necessary. * * Note that WordPress always excludes certain path patterns such as `/wp-login.php` and `/wp-admin/*`, and those * cannot be modified using the filter. * * @since 6.8.0 * * @param string[] $href_exclude_paths Additional path patterns to disable speculative loading for. * @param string $mode Mode used to apply speculative loading. Either 'prefetch' or 'prerender'. */ $href_exclude_paths = (array) apply_filters( 'wp_speculation_rules_href_exclude_paths', array(), $mode ); $href_exclude_paths = array_filter( $href_exclude_paths, 'is_string' ); // Ensure that: // 1. There are no duplicates. // 2. The base paths cannot be removed. // 3. The array has sequential keys (i.e. array_is_list()). $href_exclude_paths = array_values( array_unique( array_merge( $base_href_exclude_paths, array_map( static function ( string $href_exclude_path ) use ( $prefixer ): string { return $prefixer->prefix_path_pattern( $href_exclude_path ); }, $href_exclude_paths ) ) ) ); $speculation_rules = new WP_Speculation_Rules(); $main_rule_conditions = array( // Include any URLs within the same site. array( 'href_matches' => $prefixer->prefix_path_pattern( '/*' ), ), // Except for excluded paths. array( 'not' => array( 'href_matches' => $href_exclude_paths, ), ), // Also exclude rel=nofollow links, as certain plugins use that on their links that perform an action. array( 'not' => array( 'selector_matches' => 'a[rel~="nofollow"]', ), ), // Also exclude links that are explicitly marked to opt out, either directly or via a parent element. array( 'not' => array( 'selector_matches' => ".no-{$mode}, .no-{$mode} a", ), ), ); // If using 'prerender', also exclude links that opt out of 'prefetch' because it's part of 'prerender'. if ( 'prerender' === $mode ) { $main_rule_conditions[] = array( 'not' => array( 'selector_matches' => '.no-prefetch, .no-prefetch a', ), ); } $speculation_rules->add_rule( $mode, 'main', array( 'source' => 'document', 'where' => array( 'and' => $main_rule_conditions, ), 'eagerness' => $eagerness, ) ); /** * Fires when speculation rules data is loaded, allowing to amend the rules. * * @since 6.8.0 * * @param WP_Speculation_Rules $speculation_rules Object representing the speculation rules to use. */ do_action( 'wp_load_speculation_rules', $speculation_rules ); return $speculation_rules; } /** * Prints the speculation rules. * * For browsers that do not support speculation rules yet, the `script[type="speculationrules"]` tag will be ignored. * * @since 6.8.0 * @access private */ function wp_print_speculation_rules(): void { $speculation_rules = wp_get_speculation_rules(); if ( null === $speculation_rules ) { return; } wp_print_inline_script_tag( (string) wp_json_encode( $speculation_rules, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ), array( 'type' => 'speculationrules' ) ); }