: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
namespace Yoast\WP\SEO\Analytics\User_Interface;
use Yoast\WP\SEO\Conditionals\No_Conditionals;
use Yoast\WP\SEO\Helpers\Options_Helper;
use Yoast\WP\SEO\Integrations\Integration_Interface;
* Handles setting a timestamp when the indexation of a specific indexation action is completed.
class Last_Completed_Indexation_Integration implements Integration_Interface {
* @var Options_Helper The options helper.
* @param Options_Helper $options_helper The options helper.
public function __construct( Options_Helper $options_helper ) {
$this->options_helper = $options_helper;
* Registers action hook to maybe save an option.
public function register_hooks(): void {
'wpseo_indexables_unindexed_calculated',
'maybe_set_indexables_unindexed_calculated',
* Saves a timestamp option when there are no unindexed indexables.
* @param string $indexable_name The name of the indexable that is being checked.
* @param int $count The amount of missing indexables.
public function maybe_set_indexables_unindexed_calculated( string $indexable_name, int $count ): void {
$no_index = $this->options_helper->get( 'last_known_no_unindexed', [] );
$no_index[ $indexable_name ] = \time();
$this->options_helper->set( 'last_known_no_unindexed', $no_index );