rebase on oct-10-2023
This commit is contained in:
@@ -5,8 +5,8 @@ namespace Yoast\WP\SEO\Integrations\Front_End;
|
||||
use WP_Query;
|
||||
use Yoast\WP\SEO\Conditionals\Front_End_Conditional;
|
||||
use Yoast\WP\SEO\Helpers\Options_Helper;
|
||||
use Yoast\WP\SEO\Integrations\Integration_Interface;
|
||||
use Yoast\WP\SEO\Helpers\Redirect_Helper;
|
||||
use Yoast\WP\SEO\Integrations\Integration_Interface;
|
||||
|
||||
/**
|
||||
* Class Crawl_Cleanup_Searches.
|
||||
|
||||
@@ -95,7 +95,6 @@ class Open_Graph_OEmbed implements Integration_Interface {
|
||||
$this->set_image();
|
||||
}
|
||||
|
||||
|
||||
return $this->data;
|
||||
}
|
||||
|
||||
@@ -127,7 +126,7 @@ class Open_Graph_OEmbed implements Integration_Interface {
|
||||
protected function set_image() {
|
||||
$images = $this->post_meta->open_graph_images;
|
||||
|
||||
if ( ! is_array( $images ) ) {
|
||||
if ( ! \is_array( $images ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -73,6 +73,9 @@ class Robots_Txt_Integration implements Integration_Interface {
|
||||
if ( $this->options_helper->get( 'deny_wp_json_crawling' ) && ! \is_multisite() ) {
|
||||
\add_action( 'Yoast\WP\SEO\register_robots_rules', [ $this, 'add_disallow_wp_json_to_robots' ], 10, 1 );
|
||||
}
|
||||
if ( $this->options_helper->get( 'deny_adsbot_crawling' ) && ! \is_multisite() ) {
|
||||
\add_action( 'Yoast\WP\SEO\register_robots_rules', [ $this, 'add_disallow_adsbot' ], 10, 1 );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -116,6 +119,7 @@ class Robots_Txt_Integration implements Integration_Interface {
|
||||
*/
|
||||
public function add_disallow_search_to_robots( Robots_Txt_Helper $robots_txt_helper ) {
|
||||
$robots_txt_helper->add_disallow( '*', '/?s=' );
|
||||
$robots_txt_helper->add_disallow( '*', '/page/*/?s=' );
|
||||
$robots_txt_helper->add_disallow( '*', '/search/' );
|
||||
}
|
||||
|
||||
@@ -131,6 +135,17 @@ class Robots_Txt_Integration implements Integration_Interface {
|
||||
$robots_txt_helper->add_disallow( '*', '/?rest_route=' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a disallow rule for AdsBot agents to robots.txt.
|
||||
*
|
||||
* @param Robots_Txt_Helper $robots_txt_helper The robots txt helper.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function add_disallow_adsbot( Robots_Txt_Helper $robots_txt_helper ) {
|
||||
$robots_txt_helper->add_disallow( 'AdsBot', '/' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Replaces the default WordPress robots.txt output.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user