PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / trunk
Yoast SEO – Advanced SEO with real-time guidance and built-in AI vtrunk
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 / llms-txt / application / health-check / file-runner.php

file-runner.php in Yoast SEO – Advanced SEO with real-time guidance and built-in AI trunk, at src/llms-txt/application/health-check/file-runner.php

48 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 // phpcs:disable Yoast.NamingConventions.NamespaceName.TooLong
4 namespace Yoast\WP\SEO\Llms_Txt\Application\Health_Check;
5
6 use Yoast\WP\SEO\Llms_Txt\Application\File\Commands\Populate_File_Command_Handler;
7 use Yoast\WP\SEO\Services\Health_Check\Runner_Interface;
8
9 /**
10 * Runs the File_Generation health check.
11 */
12 class File_Runner implements Runner_Interface {
13
14 /**
15 * Is set to non-empty string when the llms.txt file failed to (re-)generate.
16 *
17 * @var bool
18 */
19 private $generation_failure_reason = '';
20
21 /**
22 * Runs the health check.
23 *
24 * @return void
25 */
26 public function run() {
27 $this->generation_failure_reason = \get_option( Populate_File_Command_Handler::GENERATION_FAILURE_OPTION, '' );
28 }
29
30 /**
31 * Returns true if there is no generation failure reason.
32 *
33 * @return bool The boolean indicating if the health check was succesful.
34 */
35 public function is_successful() {
36 return $this->generation_failure_reason === '';
37 }
38
39 /**
40 * Returns the generation failure reason.
41 *
42 * @return string The boolean indicating if the health check was succesful.
43 */
44 public function get_generation_failure_reason(): string {
45 return $this->generation_failure_reason;
46 }
47 }
48