mirror of
git://develop.git.wordpress.org/
synced 2025-01-18 05:18:42 +01:00
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
This commit is contained in:
parent
ba4709cdc2
commit
20c490d73c
@ -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', 2 );
|
||||||
add_action( 'wp_head', 'feed_links_extra', 3 );
|
add_action( 'wp_head', 'feed_links_extra', 3 );
|
||||||
add_action( 'wp_head', 'rsd_link' );
|
add_action( 'wp_head', 'rsd_link' );
|
||||||
add_action( 'wp_head', 'wlwmanifest_link' );
|
|
||||||
add_action( 'wp_head', 'locale_stylesheet' );
|
add_action( 'wp_head', 'locale_stylesheet' );
|
||||||
add_action( 'publish_future_post', 'check_and_publish_future_post', 10, 1 );
|
add_action( 'publish_future_post', 'check_and_publish_future_post', 10, 1 );
|
||||||
add_action( 'wp_head', 'wp_robots', 1 );
|
add_action( 'wp_head', 'wp_robots', 1 );
|
||||||
|
@ -4627,3 +4627,15 @@ function _resolve_home_block_template() {
|
|||||||
'postId' => $template->id,
|
'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' );
|
||||||
|
}
|
||||||
|
@ -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(
|
|
||||||
'<link rel="wlwmanifest" type="application/wlwmanifest+xml" href="%s" />' . "\n",
|
|
||||||
includes_url( 'wlwmanifest.xml' )
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Displays a referrer `strict-origin-when-cross-origin` meta tag.
|
* Displays a referrer `strict-origin-when-cross-origin` meta tag.
|
||||||
*
|
*
|
||||||
|
@ -208,14 +208,7 @@ function wp_is_local_html_output( $html ) {
|
|||||||
return false !== strpos( $html, $pattern );
|
return false !== strpos( $html, $pattern );
|
||||||
}
|
}
|
||||||
|
|
||||||
// 2. Check if HTML includes the site's Windows Live Writer manifest link.
|
// 2. Check if HTML includes the site's REST API 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.
|
|
||||||
if ( has_action( 'wp_head', 'rest_output_link_wp_head' ) ) {
|
if ( has_action( 'wp_head', 'rest_output_link_wp_head' ) ) {
|
||||||
// Try both HTTPS and HTTP since the URL depends on context.
|
// 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().
|
$pattern = preg_replace( '#^https?:(?=//)#', '', esc_url( get_rest_url() ) ); // See rest_output_link_wp_head().
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 1.3 KiB |
Binary file not shown.
Before Width: | Height: | Size: 664 B |
Binary file not shown.
Before Width: | Height: | Size: 2.3 KiB |
@ -1,43 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
|
||||||
|
|
||||||
<manifest xmlns="http://schemas.microsoft.com/wlw/manifest/weblog">
|
|
||||||
|
|
||||||
<options>
|
|
||||||
<clientType>WordPress</clientType>
|
|
||||||
<supportsKeywords>Yes</supportsKeywords>
|
|
||||||
<supportsGetTags>Yes</supportsGetTags>
|
|
||||||
</options>
|
|
||||||
|
|
||||||
<weblog>
|
|
||||||
<serviceName>WordPress</serviceName>
|
|
||||||
<imageUrl>images/wlw/wp-icon.png</imageUrl>
|
|
||||||
<watermarkImageUrl>images/wlw/wp-watermark.png</watermarkImageUrl>
|
|
||||||
<homepageLinkText>View site</homepageLinkText>
|
|
||||||
<adminLinkText>Dashboard</adminLinkText>
|
|
||||||
<adminUrl>
|
|
||||||
<![CDATA[
|
|
||||||
{blog-postapi-url}/../wp-admin/
|
|
||||||
]]>
|
|
||||||
</adminUrl>
|
|
||||||
<postEditingUrl>
|
|
||||||
<![CDATA[
|
|
||||||
{blog-postapi-url}/../wp-admin/post.php?action=edit&post={post-id}
|
|
||||||
]]>
|
|
||||||
</postEditingUrl>
|
|
||||||
</weblog>
|
|
||||||
|
|
||||||
<buttons>
|
|
||||||
<button>
|
|
||||||
<id>0</id>
|
|
||||||
<text>Manage Comments</text>
|
|
||||||
<imageUrl>images/wlw/wp-comments.png</imageUrl>
|
|
||||||
<clickUrl>
|
|
||||||
<![CDATA[
|
|
||||||
{blog-postapi-url}/../wp-admin/edit-comments.php
|
|
||||||
]]>
|
|
||||||
</clickUrl>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
</buttons>
|
|
||||||
|
|
||||||
</manifest>
|
|
@ -196,39 +196,11 @@ class Tests_HTTPS_Detection extends WP_UnitTestCase {
|
|||||||
$this->assertFalse( wp_is_local_html_output( $html ) );
|
$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
|
* @ticket 47577
|
||||||
*/
|
*/
|
||||||
public function test_wp_is_local_html_output_via_rest_link() {
|
public function test_wp_is_local_html_output_via_rest_link() {
|
||||||
remove_action( 'wp_head', 'rsd_link' );
|
remove_action( 'wp_head', 'rsd_link' );
|
||||||
remove_action( 'wp_head', 'wlwmanifest_link' );
|
|
||||||
|
|
||||||
// HTML includes REST API link.
|
// HTML includes REST API link.
|
||||||
$head_tag = get_echo( 'rest_output_link_wp_head' );
|
$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() {
|
public function test_wp_is_local_html_output_cannot_determine() {
|
||||||
remove_action( 'wp_head', 'rsd_link' );
|
remove_action( 'wp_head', 'rsd_link' );
|
||||||
remove_action( 'wp_head', 'wlwmanifest_link' );
|
|
||||||
remove_action( 'wp_head', 'rest_output_link_wp_head' );
|
remove_action( 'wp_head', 'rest_output_link_wp_head' );
|
||||||
|
|
||||||
// The HTML here doesn't matter because all hooks are removed.
|
// The HTML here doesn't matter because all hooks are removed.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user