From 20c490d73cc3b7c90225207b9ab3db50a7328259 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 4 Apr 2023 14:54:31 +0000 Subject: [PATCH] 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 [6192], [49904]. Props joostdevalk, ayeshrajans, flixos90, jhabdas, frank-klein, wtranch, SergeyBiryukov. Fixes #41404. git-svn-id: https://develop.svn.wordpress.org/trunk@55620 602fd350-edb4-49c9-b593-d223f7449a82 --- 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 664 -> 0 bytes src/wp-includes/images/wlw/wp-watermark.png | Bin 2376 -> 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 f10dc6f280..beddde2687 100644 --- a/src/wp-includes/default-filters.php +++ b/src/wp-includes/default-filters.php @@ -328,7 +328,6 @@ add_action( 'wp_head', 'wp_preload_resources', 1 ); 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 76f049df78..ffc26afdb1 100644 --- a/src/wp-includes/deprecated.php +++ b/src/wp-includes/deprecated.php @@ -4627,3 +4627,15 @@ function _resolve_home_block_template() { 'postId' => $template->id, ); } + +/** + * 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 f35f327962..39d79e19f2 100644 --- a/src/wp-includes/general-template.php +++ b/src/wp-includes/general-template.php @@ -3372,19 +3372,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 9ef7b2bdc5..1ef3fb8c59 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>{LhP0BZkCn#K~j_^ z!!RnG4?~t@sm9}0?aC$WsUrF;D+)fOfX@N{_&w1w3n(U}6vvjG)V?+;0j{H{YL%vG zZoUGBV2l+jY6hSA**A2t2&J)muOjA_~ani(nBF*3ftYf|LS2&yT50&e=8S5wUE7m^`Ui30{l#I4u&p zO?(@fOdcevj~5DsoU?+`=8fwIBaz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$kN-^an z^RG|F`>px_I%iut?NJfYl>JvTo_di00ne1-VT?Lq_+aLLJVhfVdh=>oQOz{X1pc@4 z(3OeXfG>|}Qh)Ve*^zH#uiFG*PxK=YaRwox}0Mlv&COhyD0`g&9;BNE+A=e;6N z`Hxsjj_0Z^pR~|fpqf-_lc~onEnU#LaRSVSK9UFh5B_H}?@NL+J>7e#YHpUZfj#Nm z`%tR0`tN{v&I5O{H|tRefNUj_00JeVp*OoIe2|9ROp`!NpQq4Ga%nH)fr==ScX?@&Grs6(N|{y?(6qsgovHl!>D5oP+t=Ca$K z4^mDLsgt?`0$h7PQMFQONkqvC^ZdQk2j8OO(kNOtd5ukk0LmOVK<(C;7u=xTky=ZD zc~S!)&tJ_oLszi?ks2LtK7ZHuy-`yWIIt1G^)YSM!${ax`t$BKw~}|C`CBZUJK}j# zrGAFXold^m_Wty#kt^&lr9?$CJEzNKWj)*gu+OC1Z??bbz58BjQg1C7^?6!#U6t0c z4d<-5lpcNa+bi8kAHS7cS2LXSM|A;6MrkH}dvxQCqpq ze0#pLv$L~%^Xcy;nXIkSK8~U|?(?F|8Y8_v{IYxg!Q7iq-=0hU>EoMU{) - - - - - 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 a30ceb146e..820f39fc6e 100644 --- a/tests/phpunit/tests/https-detection.php +++ b/tests/phpunit/tests/https-detection.php @@ -196,39 +196,11 @@ class Tests_HTTPS_Detection extends WP_UnitTestCase { $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 @@ class Tests_HTTPS_Detection extends WP_UnitTestCase { */ 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.