PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / 28.3
Yoast SEO – Advanced SEO with real-time guidance and built-in AI v28.3
28.5 28.4 28.3 28.2 28.1 28.0 27.9 27.8 27.7 27.6 27.5 trunk 18.0 18.1 18.2 18.3 18.4 18.4.1 18.5 18.5.1 18.6 18.7 18.8 18.9 19.0 All 129 releases
wordpress-seo / src / integrations / admin / cron-integration.php

cron-integration.php in Yoast SEO – Advanced SEO with real-time guidance and built-in AI 28.3, at src/integrations/admin/cron-integration.php

50 lines 1003 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Yoast\WP\SEO\Integrations\Admin;
4
5 use Yoast\WP\SEO\Conditionals\Admin_Conditional;
6 use Yoast\WP\SEO\Helpers\Date_Helper;
7 use Yoast\WP\SEO\Integrations\Integration_Interface;
8
9 /**
10 * Cron_Integration class.
11 */
12 class Cron_Integration implements Integration_Interface {
13
14 /**
15 * The indexing notification integration.
16 *
17 * @var Date_Helper
18 */
19 protected $date_helper;
20
21 /**
22 * {@inheritDoc}
23 */
24 public static function get_conditionals() {
25 return [ Admin_Conditional::class ];
26 }
27
28 /**
29 * Cron_Integration constructor
30 *
31 * @param Date_Helper $date_helper The date helper.
32 */
33 public function __construct( Date_Helper $date_helper ) {
34 $this->date_helper = $date_helper;
35 }
36
37 /**
38 * {@inheritDoc}
39 */
40 public function register_hooks() {
41 if ( ! \wp_next_scheduled( Indexing_Notification_Integration::NOTIFICATION_ID ) ) {
42 \wp_schedule_event(
43 $this->date_helper->current_time(),
44 'daily',
45 Indexing_Notification_Integration::NOTIFICATION_ID,
46 );
47 }
48 }
49 }
50