Skip to content
This repository has been archived by the owner on Mar 9, 2024. It is now read-only.

Commit

Permalink
WP-r55620: General: Remove Windows Live Writer manifest file (#279)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
mattyrob and SergeyBiryukov authored Nov 10, 2023
1 parent a7ea8e6 commit 67d0b90
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 94 deletions.
1 change: 0 additions & 1 deletion src/wp-includes/default-filters.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down
12 changes: 12 additions & 0 deletions src/wp-includes/deprecated.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' );
}
13 changes: 0 additions & 13 deletions src/wp-includes/general-template.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
'<link rel="wlwmanifest" type="application/wlwmanifest+xml" href="%s">' . "\n",
includes_url( 'wlwmanifest.xml' )
);
}

/**
* Displays a referrer `strict-origin-when-cross-origin` meta tag.
*
Expand Down
9 changes: 1 addition & 8 deletions src/wp-includes/https-detection.php
Original file line number Diff line number Diff line change
Expand Up @@ -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().
Expand Down
Binary file removed src/wp-includes/images/wlw/wp-comments.png
Binary file not shown.
Binary file removed src/wp-includes/images/wlw/wp-icon.png
Binary file not shown.
Binary file removed src/wp-includes/images/wlw/wp-watermark.png
Binary file not shown.
43 changes: 0 additions & 43 deletions src/wp-includes/wlwmanifest.xml

This file was deleted.

29 changes: 0 additions & 29 deletions tests/phpunit/tests/https-detection.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' );
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 67d0b90

Please sign in to comment.