id = 'thinkrank/detect-import-sources'; $this->label = __( 'Detect SEO Import Sources', 'thinkrank' ); $this->description = __( 'Detect installed SEO plugins (Yoast, RankMath, SEOPress, AIOSEO) whose metadata can be imported into ThinkRank, with per-type available counts, plus any snapshots already captured. Start here: pass a detected source to preview-seo-import to see what an import would change, then run-seo-import to perform it.', 'thinkrank' ); } /** * {@inheritDoc} * * @return array */ public function get_annotations() { return [ 'readonly' => true, 'destructive' => false, 'idempotent' => true, 'priority' => 1.0, 'openWorldHint' => false, ]; } /** * {@inheritDoc} * * @return array */ public function get_input_schema() { return [ 'type' => 'object', 'additionalProperties' => false, 'properties' => self::empty_properties(), ]; } /** * {@inheritDoc} * * @return array */ public function get_output_schema() { return [ 'type' => 'object', 'properties' => [ 'detected' => [ 'type' => 'object', 'additionalProperties' => true, ], 'snapshots' => [ 'type' => 'object', 'additionalProperties' => true, ], ], ]; } /** * Execute ability. * * @param array $input Ability input payload. * @return array */ public function execute( $input ) { $detector = new Import_Detector(); return [ 'detected' => $detector->detect(), 'snapshots' => Snapshot_Store::get_available_snapshots(), ]; } }