Merged in feature/314-dev-dev01 (pull request #24)
auto-patch 314-dev-dev01-2024-01-25T04_09_02 * auto-patch 314-dev-dev01-2024-01-25T04_09_02
This commit is contained in:
@@ -43,9 +43,7 @@ class Comment_Link_Fixer implements Integration_Interface {
|
||||
* @param Redirect_Helper $redirect The redirect helper.
|
||||
* @param Robots_Helper $robots The robots helper.
|
||||
*/
|
||||
public function __construct(
|
||||
Redirect_Helper $redirect, Robots_Helper $robots
|
||||
) {
|
||||
public function __construct( Redirect_Helper $redirect, Robots_Helper $robots ) {
|
||||
$this->redirect = $redirect;
|
||||
$this->robots = $robots;
|
||||
}
|
||||
|
||||
@@ -87,6 +87,8 @@ class Crawl_Cleanup_Basic implements Integration_Interface {
|
||||
|
||||
/**
|
||||
* Removes X-Pingback and X-Powered-By headers as they're unneeded.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function clean_headers() {
|
||||
if ( \headers_sent() ) {
|
||||
@@ -115,10 +117,8 @@ class Crawl_Cleanup_Basic implements Integration_Interface {
|
||||
unset( $hints[ $key ] );
|
||||
}
|
||||
}
|
||||
else {
|
||||
if ( \strpos( $hint, '//s.w.org' ) !== false ) {
|
||||
elseif ( \strpos( $hint, '//s.w.org' ) !== false ) {
|
||||
unset( $hints[ $key ] );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -38,6 +38,8 @@ class Crawl_Cleanup_Rss implements Integration_Interface {
|
||||
|
||||
/**
|
||||
* Register our RSS related hooks.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register_hooks() {
|
||||
if ( $this->is_true( 'remove_feed_global' ) ) {
|
||||
@@ -54,6 +56,8 @@ class Crawl_Cleanup_Rss implements Integration_Interface {
|
||||
|
||||
/**
|
||||
* Disable feeds on selected cases.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function maybe_disable_feeds() {
|
||||
if ( \is_singular() && $this->is_true( 'remove_feed_post_comments' )
|
||||
@@ -69,6 +73,8 @@ class Crawl_Cleanup_Rss implements Integration_Interface {
|
||||
|
||||
/**
|
||||
* Redirect feeds we don't want away.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function maybe_redirect_feeds() {
|
||||
global $wp_query;
|
||||
@@ -131,6 +137,8 @@ class Crawl_Cleanup_Rss implements Integration_Interface {
|
||||
* Sends a cache control header.
|
||||
*
|
||||
* @param int $expiration The expiration time.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function cache_control_header( $expiration ) {
|
||||
\header_remove( 'Expires' );
|
||||
@@ -153,6 +161,8 @@ class Crawl_Cleanup_Rss implements Integration_Interface {
|
||||
*
|
||||
* @param string $url The location we're redirecting to.
|
||||
* @param string $reason The reason we're redirecting.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
private function redirect_feed( $url, $reason ) {
|
||||
\header_remove( 'Content-Type' );
|
||||
|
||||
@@ -95,6 +95,8 @@ class Crawl_Cleanup_Searches implements Integration_Interface {
|
||||
|
||||
/**
|
||||
* Redirect pretty search URLs to the "raw" equivalent
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function maybe_redirect_searches() {
|
||||
if ( ! \is_search() ) {
|
||||
|
||||
@@ -114,6 +114,8 @@ class Force_Rewrite_Title implements Integration_Interface {
|
||||
|
||||
/**
|
||||
* Starts the output buffer so it can later be fixed by flush_cache().
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function force_rewrite_output_buffer() {
|
||||
$this->ob_started = true;
|
||||
@@ -159,6 +161,8 @@ class Force_Rewrite_Title implements Integration_Interface {
|
||||
* Starts the output buffering.
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function start_output_buffering() {
|
||||
\ob_start();
|
||||
|
||||
@@ -97,6 +97,8 @@ class Handle_404 implements Integration_Interface {
|
||||
|
||||
/**
|
||||
* Sets the 404 status code.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function set_404() {
|
||||
$wp_query = $this->query_wrapper->get_query();
|
||||
@@ -109,6 +111,8 @@ class Handle_404 implements Integration_Interface {
|
||||
* Sets the headers for http.
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function set_headers() {
|
||||
// Overwrite Content-Type header.
|
||||
|
||||
@@ -100,6 +100,8 @@ class Open_Graph_OEmbed implements Integration_Interface {
|
||||
|
||||
/**
|
||||
* Sets the OpenGraph title if configured.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function set_title() {
|
||||
$opengraph_title = $this->post_meta->open_graph_title;
|
||||
@@ -111,6 +113,8 @@ class Open_Graph_OEmbed implements Integration_Interface {
|
||||
|
||||
/**
|
||||
* Sets the OpenGraph description if configured.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function set_description() {
|
||||
$opengraph_description = $this->post_meta->open_graph_description;
|
||||
@@ -122,6 +126,8 @@ class Open_Graph_OEmbed implements Integration_Interface {
|
||||
|
||||
/**
|
||||
* Sets the image if it has been configured.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function set_image() {
|
||||
$images = $this->post_meta->open_graph_images;
|
||||
|
||||
@@ -128,6 +128,8 @@ class Redirects implements Integration_Interface {
|
||||
|
||||
/**
|
||||
* When certain archives are disabled, this redirects those to the homepage.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function archive_redirect() {
|
||||
if ( $this->need_archive_redirect() ) {
|
||||
@@ -137,6 +139,8 @@ class Redirects implements Integration_Interface {
|
||||
|
||||
/**
|
||||
* Based on the redirect meta value, this function determines whether it should redirect the current post / page.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function page_redirect() {
|
||||
if ( ! $this->current_page->is_simple_page() ) {
|
||||
@@ -158,6 +162,8 @@ class Redirects implements Integration_Interface {
|
||||
|
||||
/**
|
||||
* If the option to disable attachment URLs is checked, this performs the redirect to the attachment.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function attachment_redirect() {
|
||||
if ( ! $this->current_page->is_attachment() ) {
|
||||
@@ -210,10 +216,10 @@ class Redirects implements Integration_Interface {
|
||||
/**
|
||||
* Allows the developer to change the target redirection URL for attachments.
|
||||
*
|
||||
* @api string $attachment_url The attachment URL for the queried object.
|
||||
* @api object $queried_object The queried object.
|
||||
*
|
||||
* @since 7.5.3
|
||||
*
|
||||
* @param string $attachment_url The attachment URL for the queried object.
|
||||
* @param object $queried_object The queried object.
|
||||
*/
|
||||
return \apply_filters(
|
||||
'wpseo_attachment_redirect_url',
|
||||
@@ -244,6 +250,8 @@ class Redirects implements Integration_Interface {
|
||||
|
||||
/**
|
||||
* Strips `cat=-1` from the URL and redirects to the resulting URL.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function category_redirect() {
|
||||
/**
|
||||
|
||||
@@ -95,9 +95,8 @@ class RSS_Footer_Embed implements Integration_Interface {
|
||||
/**
|
||||
* Filter: 'wpseo_include_rss_footer' - Allow the RSS footer to be dynamically shown/hidden.
|
||||
*
|
||||
* @api boolean $show_embed Indicates if the RSS footer should be shown or not.
|
||||
*
|
||||
* @param string $context The context of the RSS content - 'full' or 'excerpt'.
|
||||
* @param bool $show_embed Indicates if the RSS footer should be shown or not.
|
||||
* @param string $context The context of the RSS content - 'full' or 'excerpt'.
|
||||
*/
|
||||
if ( ! \apply_filters( 'wpseo_include_rss_footer', true, $context ) ) {
|
||||
return false;
|
||||
@@ -184,9 +183,9 @@ class RSS_Footer_Embed implements Integration_Interface {
|
||||
* Filter: 'nofollow_rss_links' - Allow the developer to determine whether or not to follow the links in
|
||||
* the bits Yoast SEO adds to the RSS feed, defaults to false.
|
||||
*
|
||||
* @api bool $unsigned Whether or not to follow the links in RSS feed, defaults to true.
|
||||
*
|
||||
* @since 1.4.20
|
||||
*
|
||||
* @param bool $unsigned Whether or not to follow the links in RSS feed, defaults to true.
|
||||
*/
|
||||
if ( \apply_filters( 'nofollow_rss_links', false ) ) {
|
||||
return '<a rel="nofollow" href="%1$s">%2$s</a>';
|
||||
|
||||
@@ -191,8 +191,8 @@ class WP_Robots_Integration implements Integration_Interface {
|
||||
'follow' => 2,
|
||||
'nofollow' => 3,
|
||||
];
|
||||
$ai = isset( $order[ $a ] ) ? $order[ $a ] : 4;
|
||||
$bi = isset( $order[ $b ] ) ? $order[ $b ] : 4;
|
||||
$ai = ( $order[ $a ] ?? 4 );
|
||||
$bi = ( $order[ $b ] ?? 4 );
|
||||
|
||||
return ( $ai - $bi );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user