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

Yoast / wordpress-seo / 5025ae743cb0167825f79d2c424b6d3ca2e3a8fa

16 Dec 2025 11:17AM UTC coverage: 53.04%. First build
5025ae743cb0167825f79d2c424b6d3ca2e3a8fa

push

github

leonidasmi
Merge branch 'release/26.7' of github.com:Yoast/wordpress-seo into trunk

8706 of 16079 branches covered (54.15%)

Branch coverage included in aggregate %.

0 of 7 new or added lines in 3 files covered. (0.0%)

32421 of 61461 relevant lines covered (52.75%)

46914.88 hits per line

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

0.0
/src/task-list/application/tasks/enable-llms-txt.php
1
<?php
2
// phpcs:disable Yoast.NamingConventions.NamespaceName.TooLong -- Needed in the folder structure.
3
namespace Yoast\WP\SEO\Task_List\Application\Tasks;
4

5
use Yoast\WP\SEO\Helpers\Options_Helper;
6
use Yoast\WP\SEO\Task_List\Domain\Components\Call_To_Action_Entry;
7
use Yoast\WP\SEO\Task_List\Domain\Components\Copy_Set;
8
use Yoast\WP\SEO\Task_List\Domain\Exceptions\Complete_LLMS_Task_Exception;
9
use Yoast\WP\SEO\Task_List\Domain\Tasks\Abstract_Completeable_Task;
10

11
/**
12
 * Represents the task for the enabling the llms.txt file.
13
 */
14
class Enable_Llms_Txt extends Abstract_Completeable_Task {
15

16
        /**
17
         * Holds the id.
18
         *
19
         * @var string
20
         */
21
        protected $id = 'enable-llms-txt';
22

23
        /**
24
         * Holds the priority.
25
         *
26
         * @var string
27
         */
28
        protected $priority = 'medium';
29

30
        /**
31
         * Holds the duration.
32
         *
33
         * @var int
34
         */
35
        protected $duration = 1;
36

37
        /**
38
         * Holds the options helper.
39
         *
40
         * @var Options_Helper
41
         */
42
        private $options_helper;
43

44
        /**
45
         * Constructs the task.
46
         *
47
         * @param Options_Helper $options_helper The options helper.
48
         */
49
        public function __construct( Options_Helper $options_helper ) {
×
50
                $this->options_helper = $options_helper;
×
51
        }
52

53
        /**
54
         * Returns whether this task is completed.
55
         *
56
         * @return bool Whether this task is completed.
57
         */
58
        public function get_is_completed(): bool {
×
59
                return $this->options_helper->get( 'enable_llms_txt', false );
×
60
        }
61

62
        /**
63
         * Returns the task's link.
64
         *
65
         * @return string|null
66
         */
67
        public function get_link(): ?string {
×
68
                return null;
×
69
        }
70

71
        /**
72
         * Completes a task.
73
         *
74
         * @return void
75
         *
76
         * @throws Complete_LLMS_Task_Exception If the option could not be set.
77
         */
78
        public function complete_task(): void {
×
79
                $result = $this->options_helper->set( 'enable_llms_txt', true );
×
80

81
                if ( ! $result ) {
×
82
                        throw new Complete_LLMS_Task_Exception();
×
83
                }
84
        }
85

86
        /**
87
         * Returns the task's call to action entry.
88
         *
89
         * @return string|null
90
         */
91
        public function get_call_to_action(): Call_To_Action_Entry {
×
92
                return new Call_To_Action_Entry(
×
93
                        \__( 'Enable llms.txt', 'wordpress-seo' ),
×
94
                        'default',
×
95
                        $this->get_link()
×
96
                );
×
97
        }
98

99
        /**
100
         * Returns the task's copy set.
101
         *
102
         * @return string|null
103
         */
104
        public function get_copy_set(): Copy_Set {
×
105
                return new Copy_Set(
×
106
                        \__( 'Create an llms.txt file', 'wordpress-seo' ),
×
107
                        \__( 'Without llms.txt, AI crawlers may not know how to treat your content. Publishing it helps communicate your preferences in a clearer way to AI tools.', 'wordpress-seo' )
×
108
                );
×
109
        }
110

111
        /**
112
         * Returns whether the task is valid.
113
         *
114
         * @return bool
115
         */
NEW
116
        public function is_valid(): bool {
×
NEW
117
                return ! \is_multisite();
×
118
        }
119
}
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