=== AEO SiteFix Connection ===
Contributors: aeositefix
Tags: seo, aeo, geo, woocommerce, llms-txt
Requires at least: 6.4
Tested up to: 7.1
Requires PHP: 8.1
Stable tag: 1.2.8
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Companion plugin connecting WordPress and WooCommerce to AEO SiteFix for SEO, AEO & GEO audits, preview/undo fixes, /llms.txt, and monitoring.

== Description ==

**AEO SiteFix Connection** links your WordPress website or **WooCommerce** store to [AEO SiteFix](https://aeositefix.com/) — without replacing your existing SEO plugin or risking accidental edits.

**Built as a Safe Companion (No Migration Required):**
Keep **Yoast SEO**, **Rank Math**, **All in One SEO (AIOSEO)**, or **SEOPress** active. AEO SiteFix detects which SEO plugin manages your site, reads and updates supported meta descriptions directly inside that plugin's own fields, and never injects duplicate meta tags.

**WooCommerce & E-Commerce Ready:**
* Supports WooCommerce `product` pages, product short descriptions (`post_excerpt`), and the WooCommerce Shop page.
* Declared compatible with WooCommerce **High-Performance Order Storage (HPOS)** and **Cart & Checkout Blocks**.
* Protects WooCommerce's built-in `Product` JSON-LD so product schema is never duplicated.

**AEO & GEO Readiness Features Included:**
* **Virtual `/llms.txt` & `/llms-full.txt`:** Generate, auto-refresh on publish/edit/delete, and serve both `/llms.txt` and a clean cached Markdown `/llms-full.txt` site guide without touching server files (automatically yields if physical files exist on disk).
* **AI Crawler Controls & Active Scraper Shield:** Independent green ON/OFF toggles to allow established AI search engines (`OAI-SearchBot`, `PerplexityBot`, `ChatGPT-User`, `Claude-SearchBot`, `Google-Extended`) while actively blocking site scrapers (`Bytespider`, `CCBot`, `Meta-ExternalAgent`, `Amazonbot`) and non-search AI training bots (`GPTBot`, `ClaudeBot`, `anthropic-ai`, `cohere-ai`).
* **Optional 1-Click IndexNow Ping (OFF by default):** Locally generates an IndexNow verification key file and notifies `api.indexnow.org` (Bing / ChatGPT Search, DuckDuckGo, and partner search engines) when pages, posts, or products are published or updated.
* **Dashboard Widget & Post/Product Editor AI Readiness Box:** View 7-day AI search vs. blocked scraper counters right on your WordPress Dashboard home screen and get instant local traffic-light AI readiness hints while editing posts, pages, and WooCommerce products.
* **Instant Local Site Readiness Check:** Scans public pages, posts, and WooCommerce products locally for missing alt text, thin pages (`< 150` words), duplicate titles, missing trust pages, and missing WooCommerce short descriptions, prices, or SKUs/GTINs.
* **Safe Additive JSON-LD:** Publish approved non-product structured data (`FAQPage`, `Organization`, `LocalBusiness`, `Article`, etc.) cleanly in `<head>`.
* **Exact Preview & One-Click Undo:** Every approved Assisted Site Fix (ASF) shows an exact preview, verifies InnoDB transactional storage before writing, and supports one-click restoration back to your original content or SEO plugin state.
* **Lightweight Change Signals:** Notifies AEO SiteFix when published public content changes so scheduled audits stay accurate.

== External Services ==

This plugin connects your website to the **AEO SiteFix** external SaaS platform (`https://aeositefix.com`) in order to verify site ownership, run cloud SEO/AEO/GEO audits and PageSpeed checks, prepare approved Assisted Site Fixes, and receive lightweight published-content change notices.

* **Service provider:** AEO SiteFix ([https://aeositefix.com](https://aeositefix.com/))
* **When data is transmitted:**
  * During 1-click Google Sign-In site connection and connection verification initiated by a site administrator.
  * When an administrator requests an audit or previews/applies/restores an Assisted Site Fix over a cryptographically signed HMAC-SHA256 HTTPS connection.
  * When published public WordPress posts, pages, products, or public SEO settings change, the plugin sends a minimal change signal (`installation` ID, integer `revision`, and `epoch` identifier only — no post body text, customer orders, personal data, or visitor data leave WordPress via this signal).
* **Terms of Service:** [https://aeositefix.com/terms/](https://aeositefix.com/terms/)
* **Privacy Policy:** [https://aeositefix.com/privacy/](https://aeositefix.com/privacy/)
* **WordPress & WooCommerce Documentation:** [https://aeositefix.com/resources/wordpress/](https://aeositefix.com/resources/wordpress/)

**Optional IndexNow Indexing Service (OFF by default):**

If a site administrator explicitly enables the **Instant AI & Search Ping (IndexNow)** toggle in **Settings > AEO SiteFix**, the plugin sends a non-blocking notification to the open **IndexNow** protocol endpoint (`https://api.indexnow.org/indexnow`) whenever a public post, page, or WooCommerce product is published or updated.

* **Service provider:** IndexNow ([https://www.indexnow.org/](https://www.indexnow.org/)) — shared across participating search engines including Microsoft Bing (which powers ChatGPT Search), DuckDuckGo, Seznam, Naver, and Yandex.
* **When data is transmitted:** Only when the opt-in IndexNow toggle is turned ON and a public post, page, or product is published or updated (subject to a 120-second per-post cooldown). Nothing is sent while the toggle is OFF.
* **Data transmitted:** Your website hostname, a randomly generated local verification key and key-file URL (`https://yourdomain.com/<key>.txt`), and the public permalink URL of the published or updated page/product. No personal data, customer records, or private content are ever sent.
* **Terms of Use & Documentation:** [https://www.indexnow.org/terms](https://www.indexnow.org/terms) · [https://www.indexnow.org/documentation](https://www.indexnow.org/documentation)

== Installation ==

1. Install **AEO SiteFix Connection** from Plugins > Add New in WordPress and click **Activate** — your free local AI Visibility & Protection switches, `/llms.txt` & `/llms-full.txt`, 7-day AI bot counters, and live editor/WooCommerce checks start working immediately with no account required.
2. Open **Settings > AEO SiteFix** to review or flip any of the 7 plain-English switches.
3. Optional: click **Connect with Google (1-Click)** to link your free AEO SiteFix account for cloud SEO/AEO/GEO audits and 1-click Assisted Site Fix with instant Undo (no manual codes or ZIP uploads).

== Frequently Asked Questions ==

= Do I have to uninstall Yoast SEO, Rank Math, AIOSEO, or SEOPress? =
No. Keep your existing SEO plugin installed and active. AEO SiteFix works alongside it cleanly and updates its stored meta description fields without adding duplicate `<meta>` tags.

= Does this work with WooCommerce stores? =
Yes. WooCommerce products (`product`), product short descriptions (`post_excerpt`), and the WooCommerce Shop page are supported, and the plugin is compatible with WooCommerce HPOS and Cart/Checkout Blocks.

= Can I undo any change AEO SiteFix publishes? =
Yes. Every published change stores a sealed original snapshot before updating WordPress and can be restored in one click from AEO SiteFix, provided you have not manually edited the field afterward.

= Will activating this plugin break `/llms.txt` or `/robots.txt` if I already have those files? =
No. If a physical `llms.txt` or `robots.txt` exists in your website root directory, AEO SiteFix automatically detects it and leaves it untouched.

= Does uninstalling the plugin clean up its database options? =
Yes. Deleting the plugin runs `uninstall.php` and removes AEO SiteFix options and scheduled hooks while preserving your original WordPress posts, pages, WooCommerce products, and direct edits.

== Screenshots ==

1. Settings > AEO SiteFix showing paired status, Active HTTP 403 Shield, and 7 plain-English AI Visibility & Protection switches.
2. Assisted Site Fix (ASF) exact Before -> After preview and one-click Undo/Restore in AEO SiteFix.
3. 7-Day AI Bot Activity showing AI search visits allowed vs. AI scrapers blocked (zero IP addresses or personal visitor data stored).
4. Live Block Editor (Gutenberg) AI Readiness sidebar and AI Ready badge column for Pages, Posts, and WooCommerce Products.
5. WordPress Dashboard home widget and Instant Local WooCommerce & Content Site Readiness checks alongside Yoast SEO, Rank Math, and AIOSEO.

== Changelog ==

= 1.2.8 =
* Replaced direct `strip_tags()` fallbacks in `readiness.php` with core `wp_strip_all_tags()` for zero-error, zero-warning WordPress Plugin Check (PCP) compliance.
* Incorporates the `1.0.1` `get_home_path()` subdirectory fix and explicit output filter escaping (`wp_kses_post()`, `esc_html()`, `sanitize_textarea_field()`).

= 1.2.7 =
* Upgraded the in-plugin promotion card across **Settings > AEO SiteFix**, the **WordPress Dashboard Widget**, the **Classic/WooCommerce Meta Box**, and the **Gutenberg Live AI Readiness Sidebar** to AEO SiteFix's branded Deep Slate Navy layout highlighting both the free local tools included in WordPress (AI Scraper Shield, auto `/llms.txt` & `/llms-full.txt`, live editor/WooCommerce checks, optional IndexNow) and transparent no-subscription cloud audit options (`$0` Free SEO, `$6.90` Standard, `$9` one-time Premium + 1-click fixes with Undo), dynamically tailored to each site's live local scan.

= 1.2.6 =
* Added a 100% local, dismissible WordPress.org review invitation banner after 14 days of active use (only shown once real value has been delivered and never stacked with setup reminders; supports 14-day snooze and permanent dismiss, cleaned up on uninstall).
* Added a direct **Setup Guide & Video Tutorial** link inside **Settings > AEO SiteFix** pointing to `https://aeositefix.com/resources/wordpress/`.

= 1.2.5 =
* Enforced the strict 6-month remote service window cleanly in WordPress: when a site's 6-month service window ends, the plugin verifies the signed `disconnected` receipt from AEO SiteFix, automatically stops all background change pings, and continues running 100% locally offline (all AI visibility switches, `/llms.txt`, `/llms-full.txt`, AI Scraper Shield, IndexNow, Dashboard widget, Gutenberg sidebar, and `AI Ready` column stay active locally).
* Updated Settings Card 1 to display clear **Local mode** status and a 1-click **Reconnect & Start New Audit** action when a service window has ended.

= 1.2.4 =
* Replaced generic "Run Free AI Audit" buttons across the Gutenberg Editor Sidebar, Classic/WooCommerce Meta Box, Dashboard Widget, and Settings with a clear 3-point **"What you can do in AEO SiteFix"** value summary and a connection-aware primary button (**"Open Audit Library & 1-Click Fixes"** -> `https://aeositefix.com/audit/#library` when connected, or **"Connect for 1-Click Site Fixes"** when not connected yet).
* Fixed right-edge text and button clipping inside the 280px Gutenberg Editor Sidebar (`box-sizing: border-box`, flexible wrapping).

= 1.2.3 =
* Upgraded the Block Editor (Gutenberg) **AI Readiness Check** to a native top-right toolbar button (`AI` green/amber badge) and live right-hand sidebar (`editor-sidebar.js`) that updates in real time as you write — while keeping the classic sidebar meta box for WooCommerce Products and the Classic Editor (`__back_compat_meta_box`).
* Added a compact **`AI Ready`** badge column (`3/3` green / `1/3` amber with hover tooltip) to the **Pages**, **Posts**, and **WooCommerce Products** list tables in WordPress Admin.
* Clarified Settings Card 2 example badges to explicitly display `(12 words)` and `(11 missing)` units.

= 1.2.2 =
* Added **Automatic `/llms.txt` Refresh** toggle so your virtual AI Site Guide updates automatically whenever public pages, posts, or WooCommerce products are published, edited, or deleted.
* Added **Full Markdown Guide (`/llms-full.txt`)** toggle serving a clean, cached Markdown digest of top public pages and products (automatically yields to any physical `/llms-full.txt` on disk).
* Added **Optional 1-Click IndexNow Ping** toggle (OFF by default) with local verification key serving (`/<key>.txt`) and non-blocking publish/update pings with cooldown protection.
* Added **WordPress Dashboard Home Widget** displaying 7-day AI search visits vs. blocked scrapers, active protections, cached readiness summary, and a 1-click Free AI Audit shortcut.
* Added **Post, Page & Product Editor "AI Readiness Box"** with 100% local traffic-light checks for opening summary/depth, question-style headings, image alt text, and WooCommerce short descriptions, pricing, and SKU/GTIN.
* Expanded **Instant Local Site Readiness Checks** in Settings > AEO SiteFix to also detect thin public pages (`< 150` words), duplicate page/post titles, and WooCommerce products missing prices or SKUs/GTINs.

= 1.2.1 =
* Simplified Settings > AEO SiteFix to three plain-English ON/OFF toggle switches (**AI Site Guide (`/llms.txt`)**, **Allow AI Search Engines**, **Block AI Content Scrapers**) with automatic `/llms.txt` generation and zero required typing, plus a collapsed Advanced drawer and clean 7-day AI activity counters.

= 1.2.0 =
* Added **Active AI Scraper Shield**: optional HTTP 403 enforcement against disallowed AI model training scrapers (`GPTBot`, `ClaudeBot`, `CCBot`, `Bytespider`, `Meta-ExternalAgent`, etc.) plus a privacy-safe 7-day AI bot activity counter in Settings > AEO SiteFix (no IPs or visitor data stored; never blocks human visitors, search engines, or AI search bots).
* Added **Instant Local AI-Readiness Quick Check** inside Settings > AEO SiteFix highlighting WooCommerce products missing short descriptions or image alt text, content images missing alt text, and missing Store/Site Trust pages (`Privacy`, `Contact`, `Terms / Returns`), with direct links to edit or launch a free audit.

= 1.1.0 =
* Added transactional Open Graph (`og:*`) and Twitter Card (`twitter:*`) publishing and 1-click restore via Yoast SEO, Rank Math, SEOPress, All in One SEO, or safe `wp_head` output with anti-duplication guards.
* Added taxonomy/category/tag/WooCommerce product-category archive URL resolution and meta description publishing/restore.
* Added reversible post-level GEO block insertion (`aeositefix-geo-block`) for Gutenberg and classic posts, multi-block `Organization`/`ContactPoint` JSON-LD support, and Site SEO files (`/robots.txt`, `/llms.txt`) workspace integration.

= 1.0.1 =
* Use WordPress `get_home_path()` (loading `wp-admin/includes/file.php` conditionally when needed) to detect physical `/llms.txt` and `/robots.txt` files on subdirectory installations.
* Apply `wp_kses_post()`, `esc_html()`, and `sanitize_textarea_field()` explicitly at output filter return points and when saving managed content.

= 1.0.0 =
* First public WordPress.org release (`AEO SiteFix Connection 1.0.0`).
* Added 1-click Google Sign-In connect flow alongside full backward compatibility with personal `config.php` packages, plus a dismissible/snoozable unconnected reminder schedule (7-day / 30-day).
* Added WooCommerce support: `product` post type, Shop page resolution, `post_excerpt` short description fixes, HPOS & Cart/Checkout Blocks declarations, and Product JSON-LD anti-duplication guard.
* Added transactional SEO meta description read/write/restore support for Yoast SEO, Rank Math, and SEOPress alongside All in One SEO, plus renamed-folder plugin detection.
* Added virtual `/llms.txt` serving & generator, AI crawler `robots.txt` controls, safe additive JSON-LD schema injection, and WP-Admin Site Readiness panel.
* Added full WordPress internationalization (`Text Domain: aeositefix`), `wp_parse_url()` hygiene, clean Multisite notice handling, and `readme.txt` external service disclosures.
