From 67d0b90bcaa0817794e981a5c25f404aa2586035 Mon Sep 17 00:00:00 2001 From: Matt Robinson Date: Fri, 10 Nov 2023 16:14:04 +0000 Subject: [PATCH] WP-r55620: General: Remove Windows Live Writer manifest file (#279) * WP-r55620: General: Remove Windows Live Writer manifest file. The XML manifest was originally added in WordPress 2.3.1 to turn on tagging support in Windows Live Writer. Given that the last major release of the software came out in 2012, and it was completely discontinued in January 2017, including this file in core no longer provides any benefit. Follow-up to https://core.trac.wordpress.org/changeset/6192, https://core.trac.wordpress.org/changeset/49904. WP:Props joostdevalk, ayeshrajans, flixos90, jhabdas, frank-klein, wtranch, SergeyBiryukov. Fixes https://core.trac.wordpress.org/ticket/41404. Conflicts: - src/wp-includes/deprecated.php - src/wp-includes/general-template.php - src/wp-includes/images/wlw/wp-icon.png - src/wp-includes/images/wlw/wp-watermark.png --- Merges https://core.trac.wordpress.org/changeset/55620 / WordPress/wordpress-develop@20c490d73c to ClassicPress. * Fix merge conflicts from 55620 --------- Co-authored-by: Sergey Biryukov --- src/wp-includes/default-filters.php | 1 - src/wp-includes/deprecated.php | 12 ++++++ src/wp-includes/general-template.php | 13 ------ src/wp-includes/https-detection.php | 9 +--- src/wp-includes/images/wlw/wp-comments.png | Bin 1373 -> 0 bytes src/wp-includes/images/wlw/wp-icon.png | Bin 311 -> 0 bytes src/wp-includes/images/wlw/wp-watermark.png | Bin 2192 -> 0 bytes src/wp-includes/wlwmanifest.xml | 43 -------------------- tests/phpunit/tests/https-detection.php | 29 ------------- 9 files changed, 13 insertions(+), 94 deletions(-) delete mode 100644 src/wp-includes/images/wlw/wp-comments.png delete mode 100644 src/wp-includes/images/wlw/wp-icon.png delete mode 100644 src/wp-includes/images/wlw/wp-watermark.png delete mode 100644 src/wp-includes/wlwmanifest.xml diff --git a/src/wp-includes/default-filters.php b/src/wp-includes/default-filters.php index ea7ea73e86..70416facfe 100644 --- a/src/wp-includes/default-filters.php +++ b/src/wp-includes/default-filters.php @@ -321,7 +321,6 @@ add_action( 'wp_head', 'feed_links', 2 ); add_action( 'wp_head', 'feed_links_extra', 3 ); add_action( 'wp_head', 'rsd_link' ); -add_action( 'wp_head', 'wlwmanifest_link' ); add_action( 'wp_head', 'locale_stylesheet' ); add_action( 'publish_future_post', 'check_and_publish_future_post', 10, 1 ); add_action( 'wp_head', 'wp_robots', 1 ); diff --git a/src/wp-includes/deprecated.php b/src/wp-includes/deprecated.php index 14c264859a..94430852d4 100644 --- a/src/wp-includes/deprecated.php +++ b/src/wp-includes/deprecated.php @@ -4441,3 +4441,15 @@ function get_page_by_title( $page_title, $output = OBJECT, $post_type = 'page' ) return null; } + +/** + * Displays the link to the Windows Live Writer manifest file. + * + * @link https://msdn.microsoft.com/en-us/library/bb463265.aspx + * @since 2.3.1 + * @deprecated 6.3.0 WLW manifest is no longer in use and no longer included in core, + * so the output from this function is removed. + */ +function wlwmanifest_link() { + _deprecated_function( __FUNCTION__, '6.3.0' ); +} diff --git a/src/wp-includes/general-template.php b/src/wp-includes/general-template.php index cd1e4394e2..60e9333ee6 100644 --- a/src/wp-includes/general-template.php +++ b/src/wp-includes/general-template.php @@ -3343,19 +3343,6 @@ function rsd_link() { ); } -/** - * Displays the link to the Windows Live Writer manifest file. - * - * @link https://msdn.microsoft.com/en-us/library/bb463265.aspx - * @since 2.3.1 - */ -function wlwmanifest_link() { - printf( - '' . "\n", - includes_url( 'wlwmanifest.xml' ) - ); -} - /** * Displays a referrer `strict-origin-when-cross-origin` meta tag. * diff --git a/src/wp-includes/https-detection.php b/src/wp-includes/https-detection.php index e0194c5764..3372d75c15 100644 --- a/src/wp-includes/https-detection.php +++ b/src/wp-includes/https-detection.php @@ -208,14 +208,7 @@ function wp_is_local_html_output( $html ) { return false !== strpos( $html, $pattern ); } - // 2. Check if HTML includes the site's Windows Live Writer manifest link. - if ( has_action( 'wp_head', 'wlwmanifest_link' ) ) { - // Try both HTTPS and HTTP since the URL depends on context. - $pattern = preg_replace( '#^https?:(?=//)#', '', includes_url( 'wlwmanifest.xml' ) ); // See wlwmanifest_link(). - return false !== strpos( $html, $pattern ); - } - - // 3. Check if HTML includes the site's REST API link. + // 2. Check if HTML includes the site's REST API link. if ( has_action( 'wp_head', 'rest_output_link_wp_head' ) ) { // Try both HTTPS and HTTP since the URL depends on context. $pattern = preg_replace( '#^https?:(?=//)#', '', esc_url( get_rest_url() ) ); // See rest_output_link_wp_head(). diff --git a/src/wp-includes/images/wlw/wp-comments.png b/src/wp-includes/images/wlw/wp-comments.png deleted file mode 100644 index 6bc3d523f420e9cd3bf7daabb492a919dff33a69..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1373 zcmV-j1)}bp*(ZH*ibg*kAW|97HVo0tVAjmD$s$U-ZsTsdwbhEbH_96eYR_#>=P8CKB%kxW$km$+W)ooI{WM^ zF~;D(H2E(ABt${nhz}`4Dv(Oy%fx-Rh?D+4!Che$@d>eNqz-9BRyv65I`O}&6NZP$TM+TPxOqOaxP$>G)yyT*2X&^f&0{f@q! z?{&2AIn?<^ci-9n<#M?dVxH#@g>QRlzYSwdLHx*yfuYNrTMu>~+qwVv?T@>^V!eYG z*uaIK*!e4y?1%AN?7Ptk)_?vI>-uttwVgb}w(mO{-to@S6Ww2Yvn3jhHV7RB0Y_XG z;`JXL?|X5_yT>jbJ2l9@zIcUQ3(d07T!e)e<17+Sv1l^Q7SM;IG4^wKo?V@qVFTZf zvi48=*_(R~kM2Em{MAq>v~p=_DZq94E|SEH3buEic{;ohe|`PBRqL7>SHQB0G6;CR zpsET0v;Tn)7z2daSe6Bvu0!%p7N&oR!1(y|R8_gRZOf)dPX~j+xUzfqZk!GNo73Tk zhexmff9;y44NZ-;5UeN%pBM8=5*NJt`h~c~p%kdaK*kui%LQJK8)Q{^;P%{Nm0PyP z{9ac|7F#Uv`QY%gwYAGPHP+RDAFGyS8BAgUrIc661re}4we0&q&=d5!N$f-cpBEbI ztD&x;X2Z2xb6Xb|7njShf|w?=TRPf@z8bgkUmTM0kNy0LB>{LhP0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FMe`%gFC0WUpl)!vOgbMeeG?-&YUT-?Dw72h!`E+=Oa@8fdNWA2?W!XL&G)E53Zlpdjqc zuICxtvgt%1&-)?X^u@58+D!jOx2hHt!?)ukiNlG19d-RPQF&bB`^pC^+0-9QIC-~x zJQvDW!Eb$geyR7T=BjrT%aZoFri2Hw - - - - - WordPress - Yes - Yes - - - - WordPress - images/wlw/wp-icon.png - images/wlw/wp-watermark.png - View site - Dashboard - - - - - - - - - - - - - - diff --git a/tests/phpunit/tests/https-detection.php b/tests/phpunit/tests/https-detection.php index 307925bd88..80f1684699 100644 --- a/tests/phpunit/tests/https-detection.php +++ b/tests/phpunit/tests/https-detection.php @@ -196,39 +196,11 @@ public function test_wp_is_local_html_output_via_rsd_link() { $this->assertFalse( wp_is_local_html_output( $html ) ); } - /** - * @ticket 47577 - */ - public function test_wp_is_local_html_output_via_wlwmanifest_link() { - remove_action( 'wp_head', 'rsd_link' ); - - // HTML includes WLW manifest link. - $head_tag = get_echo( 'wlwmanifest_link' ); - $html = $this->get_sample_html_string( $head_tag ); - $this->assertTrue( wp_is_local_html_output( $html ) ); - - // HTML includes modified WLW manifest link but same URL. - $head_tag = str_replace( ' />', '>', get_echo( 'wlwmanifest_link' ) ); - $html = $this->get_sample_html_string( $head_tag ); - $this->assertTrue( wp_is_local_html_output( $html ) ); - - // HTML includes WLW manifest link with alternative URL scheme. - $head_tag = get_echo( 'wlwmanifest_link' ); - $head_tag = false !== strpos( $head_tag, 'https://' ) ? str_replace( 'https://', 'http://', $head_tag ) : str_replace( 'http://', 'https://', $head_tag ); - $html = $this->get_sample_html_string( $head_tag ); - $this->assertTrue( wp_is_local_html_output( $html ) ); - - // HTML does not include WLW manifest link. - $html = $this->get_sample_html_string(); - $this->assertFalse( wp_is_local_html_output( $html ) ); - } - /** * @ticket 47577 */ public function test_wp_is_local_html_output_via_rest_link() { remove_action( 'wp_head', 'rsd_link' ); - remove_action( 'wp_head', 'wlwmanifest_link' ); // HTML includes REST API link. $head_tag = get_echo( 'rest_output_link_wp_head' ); @@ -256,7 +228,6 @@ public function test_wp_is_local_html_output_via_rest_link() { */ public function test_wp_is_local_html_output_cannot_determine() { remove_action( 'wp_head', 'rsd_link' ); - remove_action( 'wp_head', 'wlwmanifest_link' ); remove_action( 'wp_head', 'rest_output_link_wp_head' ); // The HTML here doesn't matter because all hooks are removed.