• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Yoast / wordpress-seo / 4e9a897fb1ee530c7457b57167b01bca3d3e59ac

25 Mar 2025 09:23AM UTC coverage: 41.43% (-7.3%) from 48.71%
4e9a897fb1ee530c7457b57167b01bca3d3e59ac

Pull #22125

github

web-flow
Merge 676938857 into facbdded4
Pull Request #22125: Add tracking of user progress in the Site Kit setup widged

2067 of 7841 branches covered (26.36%)

Branch coverage included in aggregate %.

92 of 122 new or added lines in 8 files covered. (75.41%)

1446 existing lines in 50 files now uncovered.

20534 of 46711 relevant lines covered (43.96%)

4.28 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

78.57
/src/integrations/admin/activation-cleanup-integration.php
1
<?php
2

3
namespace Yoast\WP\SEO\Integrations\Admin;
4

5
use Yoast\WP\SEO\Conditionals\No_Conditionals;
6
use Yoast\WP\SEO\Helpers\Indexable_Helper;
7
use Yoast\WP\SEO\Helpers\Options_Helper;
8
use Yoast\WP\SEO\Integrations\Cleanup_Integration;
9
use Yoast\WP\SEO\Integrations\Integration_Interface;
10

11
/**
12
 * This integration registers a run of the cleanup routine whenever the plugin is activated.
13
 */
14
class Activation_Cleanup_Integration implements Integration_Interface {
15

16
        use No_Conditionals;
17

18
        /**
19
         * The indexable helper.
20
         *
21
         * @var Indexable_Helper
22
         */
23
        protected $indexable_helper;
24

25
        /**
26
         * The options helper.
27
         *
28
         * @var Options_Helper
29
         */
30
        private $options_helper;
31

32
        /**
33
         * Activation_Cleanup_Integration constructor.
34
         *
35
         * @param Options_Helper   $options_helper   The options helper.
36
         * @param Indexable_Helper $indexable_helper The indexable helper.
37
         */
38
        public function __construct( Options_Helper $options_helper, Indexable_Helper $indexable_helper ) {
×
UNCOV
39
                $this->options_helper   = $options_helper;
×
UNCOV
40
                $this->indexable_helper = $indexable_helper;
×
41
        }
42

43
        /**
44
         * Registers the action to register a cleanup routine run after the plugin is activated.
45
         *
46
         * @return void
47
         */
48
        public function register_hooks() {
2✔
49
                \add_action( 'wpseo_activate', [ $this, 'register_cleanup_routine' ], 11 );
2✔
50
        }
1✔
51

52
        /**
53
         * Registers a run of the cleanup routine if this has not happened yet.
54
         *
55
         * @return void
56
         */
57
        public function register_cleanup_routine() {
8✔
58
                if ( ! $this->indexable_helper->should_index_indexables() ) {
8✔
59
                        return;
2✔
60
                }
61
                $first_activated_on = $this->options_helper->get( 'first_activated_on', false );
6✔
62

63
                if ( ! $first_activated_on || \time() > ( $first_activated_on + ( \MINUTE_IN_SECONDS * 5 ) ) ) {
6✔
64
                        if ( ! \wp_next_scheduled( Cleanup_Integration::START_HOOK ) ) {
4✔
65
                                \wp_schedule_single_event( ( \time() + \DAY_IN_SECONDS ), Cleanup_Integration::START_HOOK );
2✔
66
                        }
67
                }
68
        }
3✔
69
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc