settings = $settings; $this->abilities = $abilities; $this->profile = $profile; } public function init() { if ( ! $this->settings->get( 'site_health_enabled', 1 ) ) { return; } add_filter( 'site_status_tests', array( $this, 'register_tests' ) ); } public function register_tests( $tests ) { $tests['direct']['agizoai_agentic_llms'] = array( 'label' => __( 'AgizoAI llms.txt discovery', 'agizoai-agentic-browsing-optimizer' ), 'test' => array( $this, 'test_llms' ), ); $tests['direct']['agizoai_agentic_ai_profile'] = array( 'label' => __( 'AgizoAI AI site profile', 'agizoai-agentic-browsing-optimizer' ), 'test' => array( $this, 'test_ai_profile' ), ); $tests['direct']['agizoai_agentic_abilities'] = array( 'label' => __( 'AgizoAI WordPress Abilities API', 'agizoai-agentic-browsing-optimizer' ), 'test' => array( $this, 'test_abilities' ), ); return $tests; } public function test_llms() { $enabled = (bool) $this->settings->get( 'enabled', 1 ); return $this->result( $enabled, $enabled ? __( 'llms.txt discovery is enabled', 'agizoai-agentic-browsing-optimizer' ) : __( 'llms.txt discovery is disabled', 'agizoai-agentic-browsing-optimizer' ), $enabled ? __( 'AI agents can discover the site summary at /llms.txt.', 'agizoai-agentic-browsing-optimizer' ) : __( 'Enable llms.txt in AgizoAI Agentic settings to publish a concise agent-facing site summary.', 'agizoai-agentic-browsing-optimizer' ) ); } public function test_ai_profile() { $enabled = $this->profile->is_enabled(); return $this->result( $enabled, $enabled ? __( 'The machine-readable AI site profile is enabled', 'agizoai-agentic-browsing-optimizer' ) : __( 'The machine-readable AI site profile is disabled', 'agizoai-agentic-browsing-optimizer' ), $enabled ? sprintf( __( 'The site profile is available at %s.', 'agizoai-agentic-browsing-optimizer' ), esc_url( $this->profile->get_url() ) ) : __( 'Enable ai.json in AgizoAI Agentic settings to expose a compact machine-readable discovery profile.', 'agizoai-agentic-browsing-optimizer' ) ); } public function test_abilities() { $available = $this->abilities->is_available(); $enabled = $this->abilities->is_enabled(); $good = $available && $enabled; if ( ! $available ) { $description = __( 'The WordPress Abilities API is not available on this WordPress version. WordPress 6.9 or newer is required for native abilities.', 'agizoai-agentic-browsing-optimizer' ); } elseif ( ! $enabled ) { $description = __( 'The Abilities API is available, but AgizoAI native abilities are disabled in plugin settings.', 'agizoai-agentic-browsing-optimizer' ); } else { $description = __( 'AgizoAI read-only abilities are registered and can be discovered by compatible WordPress REST and MCP clients subject to their permission callbacks.', 'agizoai-agentic-browsing-optimizer' ); } return $this->result( $good, $good ? __( 'Native agent abilities are ready', 'agizoai-agentic-browsing-optimizer' ) : __( 'Native agent abilities need attention', 'agizoai-agentic-browsing-optimizer' ), $description ); } private function result( $good, $label, $description ) { return array( 'label' => $label, 'status' => $good ? 'good' : 'recommended', 'badge' => array( 'label' => __( 'AgizoAI Agentic', 'agizoai-agentic-browsing-optimizer' ), 'color' => 'blue' ), 'description' => '

' . wp_kses_post( $description ) . '

', 'actions' => '', 'test' => 'agizoai_agentic', ); } }