=== AEO Tool Connect ===
Contributors: aeotool
Tags: aeo, json-ld, schema, llms-txt, ai
Requires at least: 5.8
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Applies the AEO optimizations from your aeotool.io account to your site, server-side: JSON-LD, AI-bot robots.txt directives and llms.txt.

== Description ==

AEO Tool Connect is the companion plugin for [aeotool.io](https://aeotool.io), the Answer Engine Optimization (AEO) platform. After auditing your site against 67 AEO criteria, aeotool.io generates the fixes — this plugin applies them on your WordPress site automatically, **server-side**, so AI crawlers (GPTBot, ClaudeBot, PerplexityBot, Google-Extended...) actually see them.

**What it does**

* **JSON-LD structured data** — injected in the page head, matched per page, with automatic deduplication against Yoast SEO and Rank Math (Organization / WebSite types are skipped when those plugins are active).
* **robots.txt AI-bot directives** — appended after your existing rules. Your robots.txt is never replaced.
* **Virtual /llms.txt** — served only when no physical llms.txt file exists at your site root.

**Built to be safe**

* The plugin never writes to your posts, pages or database content — everything is injected at render time through standard WordPress hooks.
* Global kill-switch and per-module toggles.
* One-click rollback to any of the last 3 applied bundle versions.
* If aeotool.io is unreachable, the plugin keeps serving its local cache — your optimizations stay online.
* Site-scoped key (never your account API key), revocable at any time from the aeotool.io dashboard.

An aeotool.io account with a Pro plan or higher is required to connect a site.

== Installation ==

1. Upload the `aeo-tool-connect` folder to `/wp-content/plugins/`, or install the ZIP via Plugins → Add New → Upload Plugin.
2. Activate the plugin through the Plugins menu.
3. In your aeotool.io dashboard, generate a pairing code (Account → Connected sites → Generate a pairing code). The code is valid for 15 minutes.
4. In WordPress, go to Settings → AEO Tool, paste the 8-character code and click **Connect**.
5. That's it — the first optimization bundle is synced immediately, then refreshed twice a day. You can also click **Sync now** at any time.

== External services ==

This plugin connects to **aeotool.io** (the plugin author's own service) to retrieve the optimization bundle generated for your site. It is required for the plugin to do anything: the optimizations (JSON-LD, robots.txt directives, llms.txt content) are generated by your aeotool.io account and pulled by the plugin.

Exactly three API calls are made, all over HTTPS to `https://aeotool.io`:

1. **Pairing** (once, when you click Connect): sends the pairing code you typed, your site URL, your WordPress version and the plugin version. Returns a key scoped to this site only.
2. **Bundle pull** (twice a day via WP-Cron, or when you click Sync now): sends your site domain, authenticated with the site-scoped key. Returns the optimization bundle.
3. **Status ping** (after a bundle is applied): sends the applied bundle version, the list of active modules (e.g. jsonld, robots, llms), your WordPress version and the plugin version, so your aeotool.io dashboard can display the sync status.

No personal data, no post or page content, no visitor data, no analytics and no usage tracking are ever transmitted. The plugin makes no other network requests.

Service provider: AEO Tool — [Terms of service](https://aeotool.io/cgu) — [Privacy policy](https://aeotool.io/confidentialite)

== Frequently Asked Questions ==

= Will this conflict with Yoast SEO or Rank Math? =

No. When Yoast SEO or Rank Math is active, AEO Tool Connect skips the JSON-LD types those plugins already emit (Organization and WebSite) to avoid duplicate structured data. Meta tag management stays entirely with your SEO plugin — this plugin does not touch titles or meta descriptions.

= What happens if aeotool.io is unreachable or my subscription ends? =

The plugin fails open on content: it keeps serving the last synced bundle from its local cache, so nothing disappears from your site. If the last successful sync is older than 48 hours you will see a warning in the WordPress admin. If the site key is revoked from the aeotool.io dashboard, all modules are disabled automatically and an admin notice is shown.

= Can I undo an applied optimization? =

Yes, two ways. Instantly: uncheck the master switch (or a single module) in Settings → AEO Tool — output stops immediately and no data is lost. Or use the Rollback section to restore any of the last 3 applied bundle versions in one click. The plugin never modifies your content or database tables, so there is nothing else to clean up.

== Changelog ==

= 1.0.0 =
* Initial release.
* Pairing with aeotool.io via 8-character code (site-scoped key).
* JSON-LD injection on wp_head with per-page matching and Yoast/Rank Math deduplication.
* Append-only robots.txt AI-bot directives.
* Virtual /llms.txt endpoint (only when no physical file exists).
* Twice-daily background sync (WP-Cron) + manual Sync now.
* Local cache fail-open, stale-sync (48 h) and revocation admin notices.
* Global kill-switch, per-module toggles, rollback of the last 3 bundle versions.

== Upgrade Notice ==

= 1.0.0 =
Initial release.
