=== Visibility Kit SEO ===
Contributors: ryhowa
Tags: ai, analytics, chatgpt, tracking, seo
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 7.4
Stable tag: 2.1.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Track AI referral traffic from ChatGPT, Claude, Gemini, and Perplexity, plus server-side detection of AI crawlers hitting your site.

== Description ==

Visibility Kit shows you how AI is interacting with your website. Connect your site with one email, and you get:

* **AI referral traffic tracking**: see when visitors arrive from ChatGPT, Claude, Gemini, and Perplexity
* **Server-side AI bot detection**: catch AI crawlers (GPTBot, ClaudeBot, PerplexityBot, Google-Extended, Applebot, and more) that never show up in client-side analytics
* **In-admin dashboard**: a clean widget inside WordPress showing this week's AI referral sessions broken down by platform
* **No external analytics accounts needed**: data lives at visibilitykit.ai, tied to the email you connect with

= How it works =

1. Install and activate the plugin
2. Enter your email address on the **Visibility Kit** admin page and click "Start tracking"
3. A lightweight tracking script loads on your public pages (from `cdn.visibilitykit.ai`), and server-side bot detection starts immediately
4. Your dashboard in wp-admin shows summary counts; full details are available at [visibilitykit.ai](https://visibilitykit.ai)

= What gets tracked =

**Client-side (referral traffic)**
The `vk.js` script detects when a visitor arrived from an AI platform and reports the session anonymously. No personal data is collected.

**Server-side (AI crawlers)**
The plugin checks the User-Agent string on each request and identifies known AI bots across four categories:

* **Search bots**: OAI-SearchBot, Claude-SearchBot, PerplexityBot, GoogleOther, Applebot, Amazonbot, YouBot, PetalBot
* **User-action bots**: ChatGPT-User, Claude-User, Perplexity-User, MistralAI-User, Meta-ExternalFetcher, TikTokSpider
* **Training bots**: GPTBot, ClaudeBot, Claude-Web, Google-Extended, Meta-ExternalAgent, Bytespider, CCBot
* **Other**: additional platforms as they emerge

Detections are rate-limited per bot+page to one remote report per hour to avoid unnecessary requests.

= Privacy =

* No cookies are set by the plugin
* The tracking script (`vk.js`) does not identify individual users
* Server-side bot detection only looks at the User-Agent header; no IP addresses or personal data are logged
* You can disconnect at any time to remove the script and stop tracking

== Installation ==

1. Upload the `visibility-kit-seo` folder to `/wp-content/plugins/`
2. Activate the plugin through the Plugins menu
3. Go to **Visibility Kit** in the admin sidebar
4. Enter your email and click "Start tracking"

== Frequently Asked Questions ==

= Do I need a Visibility Kit account first? =

No. Entering your email on the admin page creates your account automatically.

= What happens when I disconnect? =

The tracking script is removed from your site, server-side bot detection stops, and local summary data is cleared. Your historical dashboard data remains at visibilitykit.ai in case you reconnect later.

= Does this work with caching plugins? =

Yes for referral tracking. The client-side script loads on every page regardless of caching. Server-side bot detection may miss some hits on sites with full-page caching at the CDN layer (WP Engine, Cloudflare, etc.) because WordPress isn't invoked for cached responses. The admin page shows a note about this.

= Is this a replacement for Google Analytics? =

No. Visibility Kit only tracks traffic from AI platforms. It complements your existing analytics, it does not replace them.

= Will this slow down my site? =

The tracking script is loaded async in the footer and is small (~2 KB). Server-side bot detection is a single User-Agent string match on `init`, with negligible overhead.

= Can I take over a domain that's already connected under a different email? =

Yes. If someone at your organization already connected the site with a different email, entering a new email will prompt you to claim the domain with a one-click takeover.

= What about GDPR / privacy regulations? =

The plugin does not track personally identifiable information. The tracking script records referral source (ChatGPT, Claude, etc.) and the page visited, tied to an anonymous session. Server-side bot detection only inspects the User-Agent header of incoming requests, which is not personal data.

= Where was the SEO / sitemap / schema stuff from 1.x? =

Version 2.0.0 pivoted this plugin to focus exclusively on AI visibility tracking. The previous SEO meta box, XML sitemap, JSON-LD schema, and FAQ accordion features were removed. If you need those features, use a dedicated SEO plugin like Rank Math or Yoast SEO.

== External services ==

This plugin connects to two Visibility Kit services to track AI visibility on your site. Both are operated by Visibility Kit.

**Visibility Kit API** (`api.visibilitykit.ai`)

* **What it does:** Registers your site when you connect by email, returns an embed token, receives server-side bot detection reports, and provides summary data for the in-admin dashboard.
* **What data is sent:** The email address you enter on connect, your site's domain name, plugin version, and (for bot detections) bot name, bot type, and page path visited.
* **When it is sent:**
    * On connect / disconnect / domain takeover (admin-initiated)
    * When an AI bot is detected crawling your site (rate-limited to once per bot+page per hour)
    * When the admin dashboard loads (hourly cached summary fetch)
* **Service provider:** Visibility Kit
* [Visibility Kit Privacy Policy](https://visibilitykit.ai/privacy)
* [Visibility Kit Terms of Service](https://visibilitykit.ai/terms)

**Visibility Kit CDN** (`cdn.visibilitykit.ai`)

* **What it does:** Serves the `vk.js` tracking script that loads on your public pages to detect AI referral traffic.
* **What data is sent:** When the script is loaded, standard HTTP request data (IP, User-Agent, Referer) is visible to the CDN, same as any other third-party script.
* **When it is sent:** On every public page view after you connect.
* **Service provider:** Visibility Kit
* [Visibility Kit Privacy Policy](https://visibilitykit.ai/privacy)
* [Visibility Kit Terms of Service](https://visibilitykit.ai/terms)

== Changelog ==

= 2.1.0 =
* Server-side bot classification: the bot taxonomy is now sourced from the Visibility Kit API and cached for 24 hours via a transient. New bots and reclassifications take effect without a plugin update.
* Telemetry payloads now include the raw User-Agent string. The server is the source of truth for bot name and bot type.
* Bundled fallback list still ships so detection keeps working when the API is unreachable.

= 2.0.0 =
* Plugin repurposed as a dedicated AI visibility tracking plugin.
* Added: Connect by email to Visibility Kit and begin tracking in seconds.
* Added: In-admin "AI Search Traffic" dashboard showing ChatGPT, Claude, Gemini, and Perplexity referral sessions.
* Added: Server-side AI bot detection across 20+ known crawlers (search / user-action / training taxonomies).
* Added: `vk.js` tracking script loader for client-side referral detection.
* Added: Domain takeover flow when reconnecting under a different email.
* Added: Admin-wide announcement banner with per-user dismiss.
* Removed: SEO meta box, title templating, canonical / OG / robots postmeta (use Rank Math or Yoast instead).
* Removed: XML sitemap generator (WordPress core sitemaps cover this since 5.5).
* Removed: JSON-LD structured data (Organization, LocalBusiness, Article, Person, FAQPage).
* Removed: `[viskit_faq]` FAQ accordion shortcode.

= 1.1.0 =
* Initial release with SEO meta box, XML sitemap, JSON-LD structured data, and FAQ accordion shortcode.

== Upgrade Notice ==

= 2.1.0 =
Bot taxonomy now comes from the Visibility Kit API instead of the plugin. Detection picks up new bots and reclassifications automatically; no plugin update needed for taxonomy changes.

= 2.0.0 =
Major update. The plugin has been refocused entirely on AI visibility tracking. SEO meta, XML sitemap, schema, and FAQ accordion features have been removed. If you need those, install a dedicated SEO plugin before upgrading. After upgrading, go to Visibility Kit in the admin sidebar to connect.

= 1.1.0 =
Initial release.
