'array', 'sanitize_callback' => [Ai2Web_Settings::class, 'sanitize'], 'default' => Ai2Web_Settings::defaults(), ]); } public static function render(): void { if (!current_user_can('manage_options')) { return; } $s = Ai2Web_Settings::all(); $manifest = Ai2Web_Manifest::build(); $score = self::score($manifest); $has_woo = class_exists('WooCommerce'); $pretty = (bool) get_option('permalink_structure'); echo '
' . esc_html__('Describe your site once so AI agents can discover, understand and act on it.', 'ai2web') . '
'; if (!$pretty) { echo ''; printf( /* translators: %s: Permalinks settings URL */ wp_kses(__('AI2Web needs pretty permalinks. Set them under Settings → Permalinks (any option except “Plain”).', 'ai2web'), ['a' => ['href' => []]]), esc_url(admin_url('options-permalink.php')) ); echo '
'; echo '' . esc_html((string) $score['score']) . ''; echo ' / 100 '; echo '' . esc_html($score['tier']) . ''; echo '
'; echo '';
echo esc_html__('Manifest:', 'ai2web') . ' ' . esc_html($home) . '';
if (!empty($s['mcp_enabled'])) {
$mcp = home_url('/ai2w/mcp');
echo ' · ' . esc_html__('MCP endpoint:', 'ai2web') . ' ' . esc_html($mcp) . '';
}
echo '
' . esc_html__('Open in the AI2Web Validator', 'ai2web') . ''; if ($has_woo && current_user_can('manage_woocommerce')) { echo ' ' . esc_html__('View Agent Sales', 'ai2web') . ''; } echo '
'; echo '' . esc_html($desc) . '
'; echo '