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

Yoast / wordpress-seo / 481faf637ba3a7c1e5f2bfef59b582ac39523de6

21 May 2025 09:11AM UTC coverage: 46.174%. First build
481faf637ba3a7c1e5f2bfef59b582ac39523de6

Pull #22291

github

web-flow
Merge pull request #22278 from Yoast/577-sanitize-and-deal-with-special-markdown-characters-before-writing-to-file

577 sanitize and deal with special markdown characters before writing to file
Pull Request #22291: Introduce the llms.txt feature

52 of 403 new or added lines in 30 files covered. (12.9%)

15586 of 33755 relevant lines covered (46.17%)

3.67 hits per line

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

0.0
/src/llms-txt/user-interface/schedule-population-on-activation-integration.php
1
<?php
2

3
namespace Yoast\WP\SEO\Llms_Txt\User_Interface;
4

5
use Yoast\WP\SEO\Conditionals\No_Conditionals;
6
use Yoast\WP\SEO\Helpers\Options_Helper;
7
use Yoast\WP\SEO\Integrations\Integration_Interface;
8
use Yoast\WP\SEO\Llms_Txt\Application\File\Llms_Txt_Cron_Scheduler;
9

10

11
/**
12
 * Handles the cron when the plugin is activated.
13
 */
14
class Schedule_Population_On_Activation_Integration implements Integration_Interface {
15

16
        use No_Conditionals;
17

18
        /**
19
         * The options helper.
20
         *
21
         * @var Options_Helper $options_helper
22
         */
23
        private $options_helper;
24

25
        /**
26
         * The scheduler.
27
         *
28
         * @var Llms_Txt_Cron_Scheduler $scheduler
29
         */
30
        private $scheduler;
31

32
        /**
33
         * The constructor.
34
         *
35
         * @param Llms_Txt_Cron_Scheduler $scheduler      The cron scheduler.
36
         * @param Options_Helper          $options_helper The options helper.
37
         */
NEW
38
        public function __construct(
×
39
                Llms_Txt_Cron_Scheduler $scheduler,
40
                Options_Helper $options_helper
41
        ) {
NEW
42
                $this->scheduler      = $scheduler;
×
NEW
43
                $this->options_helper = $options_helper;
×
44
        }
45

46
        /**
47
         * Registers the scheduling of the cron to the activation action.
48
         *
49
         * @return void
50
         */
NEW
51
        public function register_hooks() {
×
NEW
52
                \add_action( 'wpseo_activate', [ $this, 'schedule_llms_txt_population' ] );
×
53
        }
54

55
        /**
56
         * Schedules the cron if the option is turned on.
57
         *
58
         * @return void
59
         */
NEW
60
        public function schedule_llms_txt_population() {
×
NEW
61
                if ( $this->options_helper->get( 'enable_llms_txt', false ) === true ) {
×
NEW
62
                        $this->scheduler->schedule_quick_llms_txt_population();
×
63
                }
64
        }
65
}
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

© 2025 Coveralls, Inc