| Server IP : 3.93.235.159 / Your IP : 216.73.216.140 Web Server : Apache System : Linux ip-172-26-0-169 5.10.0-46-cloud-amd64 #1 SMP Debian 5.10.262-1 (2026-07-31) x86_64 User : bitnami ( 1000) PHP Version : 8.2.9 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /bitnami/wordpress/wp-content/plugins/yoast-test-helper/src/ |
Upload File : |
<?php
namespace Yoast\WP\Test_Helper;
/**
* Adds a filter to change the alert based on the saved set indexing reason.
*/
class Indexing_Reason_Integration implements Integration {
/**
* Registers the hook to set the indexing reason.
*
* @return void
*/
public function add_hooks() {
\add_filter( 'wpseo_indexables_indexation_alert', [ $this, 'set_indexing_alert' ], 10, 2 );
}
/**
* Sets the indexing alert to something more specific when the reason is an indexables reset.
*
* @param string $alert The current content of alert.
* @param string $reason The reason to show the alert for.
*
* @return string The reason to show.
*/
public function set_indexing_alert( $alert, $reason ) {
if ( $reason !== 'indexables-reset-by-test-helper' ) {
return $alert;
}
return \sprintf(
/* translators: %1$s: Yoast Test Helper */
\esc_html__( 'Because some of your SEO data was reset by the %1$s, your SEO data needs to be reprocessed.', 'yoast-test-helper' ),
'Yoast Test Helper',
);
}
}