[ 'version' => '2026-08-25', 'services' => [ 'dev.ucp.shopping' => [[ 'version' => '2026-08-25', 'spec' => 'https://ucp.dev/2026-08-25/specification/overview', 'transport' => 'rest', 'schema' => 'https://ucp.dev/2026-08-25/services/shopping/rest.openapi.json', 'endpoint' => $home . '/wp-json/wc/store/v1', ]], ], 'capabilities' => [ 'dev.ucp.shopping.checkout' => [['version' => '2026-08-25', 'schema' => 'https://ucp.dev/schemas/shopping/checkout.json']], 'dev.ucp.shopping.catalog' => [['version' => '2026-08-25', 'endpoint' => $home . '/wp-json/wc/store/v1/products']], ], ], 'keys' => [], ], JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES); exit; } if ($path === '/llms.txt') { header('Content-Type: text/plain; charset=utf-8'); header('Cache-Control: public, max-age=3600'); echo "# " . $site . "\n\n"; echo "> Official AI-Shopping & Catalog Discovery Index for " . $home . " (Generated by Ultrathink Google UCP Plugin — Audit at https://eurocompliancestudio.com/ucp-validator)\n\n"; echo "## Machine Endpoints\n"; echo "- Google UCP Manifest: " . $home . "/.well-known/ucp\n"; echo "- WooCommerce Store Catalog API: " . $home . "/wp-json/wc/store/v1/products\n"; echo "- AI Agent Access Policy: " . $home . "/agents.md\n\n"; if (function_exists('wc_get_products')) { $products = wc_get_products(['status' => 'publish', 'limit' => 50]); if (!empty($products)) { echo "## Top Published Products\n"; foreach ($products as $p) { echo "- [" . $p->get_name() . "](" . get_permalink($p->get_id()) . ") — " . $p->get_price() . " " . get_woocommerce_currency() . " (SKU: " . $p->get_sku() . ")\n"; } } } exit; } if ($path === '/agents.md') { header('Content-Type: text/markdown; charset=utf-8'); header('Cache-Control: public, max-age=3600'); echo "# " . $site . " — AI Shopping Agent Policy\n\n"; echo "- UCP Discovery: " . $home . "/.well-known/ucp\n"; echo "- Product Catalog Index: " . $home . "/llms.txt\n"; echo "- Permitted Shopping Agents: OAI-SearchBot, GPTBot, ClaudeBot, PerplexityBot, Google-Extended\n"; exit; } });