PluginProbe
ThinkRank AI SEO – AI SEO Plugin for WordPress: Schema, XML Sitemaps, Meta Tags, Search Console & Local SEO / 2.0.0
ThinkRank AI SEO – AI SEO Plugin for WordPress: Schema, XML Sitemaps, Meta Tags, Search Console & Local SEO v2.0.0
2.7.0 2.6.0 2.5.0 2.4.0 2.3.0 2.2.0 2.1.1 2.1.0 2.0.2 2.0.1 2.0.0 1.32.0 1.31.0 1.30.0 1.29.0 1.28.0 1.27.0 1.26.0 1.25.0 trunk 1.0.0 1.0.1 1.0.2 1.1.0 1.10.0 All 48 releases
thinkrank / includes / abilities / analysis / class-get-llms-txt-status.php

class-get-llms-txt-status.php in ThinkRank AI SEO – AI SEO Plugin for WordPress: Schema, XML Sitemaps, Meta Tags, Search Console & Local SEO 2.0.0, at includes/abilities/analysis/class-get-llms-txt-status.php

92 lines 2.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Get llms.txt status ability.
4 *
5 * @package ThinkRank\Abilities\Analysis
6 */
7
8 declare(strict_types=1);
9
10 namespace ThinkRank\Abilities\Analysis;
11
12 use ThinkRank\Abilities\Ability_Base;
13 use ThinkRank\SEO\LLMs_Txt_Manager;
14
15 if ( ! defined( 'ABSPATH' ) ) {
16 exit; // Exit if accessed directly.
17 }
18
19 /**
20 * Reports the current status of the published llms.txt file.
21 */
22 class Get_Llms_Txt_Status extends Ability_Base {
23 /**
24 * Constructor.
25 */
26 public function __construct() {
27 $this->id = 'thinkrank/get-llms-txt-status';
28 $this->label = __( 'Get ThinkRank llms.txt Status', 'thinkrank' );
29 $this->description = __( 'Report the current status of the published llms.txt file, including existence, path, URL, writability, last modified time, size, and a content preview.', 'thinkrank' );
30 }
31
32 /**
33 * {@inheritDoc}
34 *
35 * @return array<string, bool|float|string>
36 */
37 public function get_annotations() {
38 return [
39 'readonly' => true,
40 'destructive' => false,
41 'idempotent' => true,
42 'priority' => 1.0,
43 'openWorldHint' => false,
44 ];
45 }
46
47 /**
48 * {@inheritDoc}
49 *
50 * @return array<string, mixed>
51 */
52 public function get_input_schema() {
53 return [
54 'type' => 'object',
55 'additionalProperties' => false,
56 'properties' => [],
57 ];
58 }
59
60 /**
61 * {@inheritDoc}
62 *
63 * @return array<string, mixed>
64 */
65 public function get_output_schema() {
66 return [
67 'type' => 'object',
68 'properties' => [
69 'file_exists' => [ 'type' => 'boolean' ],
70 'file_path' => [ 'type' => 'string' ],
71 'file_url' => [ 'type' => 'string' ],
72 'writable' => [ 'type' => 'boolean' ],
73 'last_modified' => [ 'type' => [ 'string', 'integer', 'null' ] ],
74 'file_size' => [ 'type' => [ 'integer', 'null' ] ],
75 'content_preview' => [ 'type' => 'string' ],
76 ],
77 ];
78 }
79
80 /**
81 * Execute ability.
82 *
83 * @param array<string, mixed> $input Ability input payload.
84 * @return array<string, mixed>
85 */
86 public function execute( $input ) {
87 $manager = new LLMs_Txt_Manager();
88
89 return $manager->get_llms_txt_status( false );
90 }
91 }
92