PluginProbe
ThinkRank AI SEO – AI SEO Plugin for WordPress: Schema, XML Sitemaps, Meta Tags, Search Console & Local SEO / 2.7.0
ThinkRank AI SEO – AI SEO Plugin for WordPress: Schema, XML Sitemaps, Meta Tags, Search Console & Local SEO v2.7.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-run-seo-analyzer.php

class-run-seo-analyzer.php in ThinkRank AI SEO – AI SEO Plugin for WordPress: Schema, XML Sitemaps, Meta Tags, Search Console & Local SEO 2.7.0, at includes/abilities/analysis/class-run-seo-analyzer.php

63 lines 1.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Run Site SEO Analyzer audit ability.
4 *
5 * @package ThinkRank\Abilities\Analysis
6 */
7
8 declare(strict_types=1);
9
10 namespace ThinkRank\Abilities\Analysis;
11
12 use ThinkRank\SEO\SEO_Analyzer;
13
14 if ( ! defined( 'ABSPATH' ) ) {
15 exit; // Exit if accessed directly.
16 }
17
18 /**
19 * Runs a fresh whole-site SEO audit (Site SEO Analyzer).
20 *
21 * Mirrors `POST /thinkrank/v1/seo-analyzer/run`: forces a fresh crawl-free
22 * audit (bypassing and refreshing the hourly cache) and returns the same
23 * payload shape as `get-seo-analyzer`. Idempotent — running it repeatedly
24 * re-computes the current site state without side effects on content.
25 */
26 class Run_Seo_Analyzer extends Get_Seo_Analyzer {
27 /**
28 * Constructor.
29 */
30 public function __construct() {
31 $this->id = 'thinkrank/run-seo-analyzer';
32 $this->label = __( 'Run Site SEO Analyzer Audit', 'thinkrank' );
33 $this->description = __( 'Run a fresh whole-site SEO audit (Site SEO Analyzer), bypassing and refreshing the hourly cache. Returns the same payload as get-seo-analyzer: overall 0-100 score, grade, summary counts, and per-check results across Basic, Advanced, Content, Performance, Security and GEO/AEO. A failing per-item check (meta descriptions, image alt text, and the content-sampled GEO checks) lists what fails it in affected_posts (id, title, type, edit_url, url), with affected_total counting every failing item when the list is capped.', 'thinkrank' );
34 }
35
36 /**
37 * {@inheritDoc}
38 *
39 * @return array<string, bool|float|string>
40 */
41 public function get_annotations() {
42 return [
43 'readonly' => false,
44 'destructive' => false,
45 'idempotent' => true,
46 'priority' => 2.0,
47 'openWorldHint' => false,
48 ];
49 }
50
51 /**
52 * Execute ability.
53 *
54 * @param array<string, mixed> $input Ability input payload.
55 * @return array<string, mixed>
56 */
57 public function execute( $input ) {
58 $analyzer = new SEO_Analyzer();
59
60 return $analyzer->run( true );
61 }
62 }
63