Script Loader: Remove default DNS prefetch entry for s.w.org.

A default DNS prefetch entry for s.w.org was previously included to save a few ms in case an emoji is used that is not supported by the browser. It appears this use case doesn't justify a prefetch to s.w.org on every WordPress website.

This changesets removes `emoji_svg_url` prefetch from `wp_resource_hints()`. It also updates unit tests in `Tests_General_wpResourceHints` by removing `test_should_have_defaults_on_frontend()` entirely and removing s.w.org prefetch from expected output of ten other test functions.

Plugin authors can use the `wp_resource_hints` filter if they need to re-add the DNS prefetch entry for s.w.org.

Follow-up to [37920], [38122].

Props joelhardi, superpoincare, jhabdas, garrett-eclipse, sabernhardt, SergeyBiryukov.
Fixes #40426.
See #37387.

Built from https://develop.svn.wordpress.org/trunk@53904


git-svn-id: http://core.svn.wordpress.org/trunk@53463 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
audrasjb 2022-08-18 08:45:12 +00:00
parent 431a8d5414
commit 183165304f
2 changed files with 1 additions and 8 deletions

View File

@ -3317,13 +3317,6 @@ function wp_resource_hints() {
'prerender' => array(),
);
/*
* Add DNS prefetch for the Emoji CDN.
* The path is removed in the foreach loop below.
*/
/** This filter is documented in wp-includes/formatting.php */
$hints['dns-prefetch'][] = apply_filters( 'emoji_svg_url', 'https://s.w.org/images/core/emoji/13.0.0/svg/' );
foreach ( $hints as $relation_type => $urls ) {
$unique_urls = array();

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.1-alpha-53902';
$wp_version = '6.1-alpha-53904';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.