=== Foglift AI Traffic ===
Contributors: foglift
Tags: ai, seo, geo, analytics, crawlers
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
Stable tag: 0.1.0
License: MIT
License URI: https://opensource.org/licenses/MIT

Record AI crawler requests and visits referred by AI search engines in your Foglift workspace, with no theme edits.

== Description ==

Foglift AI Traffic reports two things WordPress owners cannot see in ordinary analytics:

* AI crawlers hitting your site (GPTBot, ClaudeBot, PerplexityBot, Googlebot, and the rest of the tracked AI agent list).
* Human visits referred by an AI answer (ChatGPT, Claude, Perplexity, Gemini, Copilot, NotebookLM).

The plugin captures the crawler request server-side on the earliest available WordPress hook and sends a non-blocking report to Foglift. It also injects the Foglift browser pixel into your site head, so referral clicks and JavaScript-executing AI agents are recorded even on pages served from a full-page cache.

You read the results in your Foglift dashboard under AI Traffic. This plugin is the WordPress installation of Foglift Sensor: it sends data out and shows no analytics inside WordPress.

**No secret key.** The plugin authenticates with your public workspace token only. That token identifies your site and is safe to store in WordPress and to appear in page source. The plugin never asks for or stores a secret Foglift API key.

**Privacy.** Each report contains the request path, the request User-Agent, your site hostname, a timestamp, the matched AI crawler or referring AI engine, and your public workspace token. No visitor personal data, no cookies, and no page content are sent.

== Installation ==

1. In WordPress admin, go to Plugins, Add New, Upload Plugin, and choose the `foglift-ai-traffic.zip` file. Click Install Now, then Activate.
2. In Foglift, open AI Traffic, then Set up Sensor, and copy your public workspace token.
3. In WordPress admin, go to Settings, Foglift AI Traffic. Paste the workspace token into the Workspace token field and click Save Changes.
4. That is the whole setup. New AI crawler requests and AI referral visits start appearing in your Foglift AI Traffic dashboard.

To confirm it is working, load any page of your site, then check AI Traffic in Foglift for the incoming events. Crawler events depend on real AI crawler visits, which arrive on their own schedule.

== Frequently Asked Questions ==

= Where do I find my workspace token? =

In Foglift, open AI Traffic, then Set up Sensor. The token shown there is your public workspace token. It is the same identifier the Foglift browser pixel uses, so it is safe to paste into WordPress.

= Does this need a secret API key? =

No. The plugin uses your public workspace token only. It refuses to store or transmit a secret Foglift API key.

= I use a caching plugin. Does it still work? =

Partly, and the plugin is honest about the gap. Pages served entirely from a full-page cache (WP Rocket, LiteSpeed Cache, W3 Total Cache) never reach WordPress, so the server-side crawler capture cannot observe those hits. When one of those caches is active the settings screen shows a warning and recommends pairing this plugin with Foglift's nginx setup where your host allows it. The browser pixel still fires from cached HTML, so AI referral clicks are recorded even on cached pages.

= Does it slow down my site? =

No. Reports are sent with a non-blocking HTTP request, so WordPress does not wait for Foglift to respond before finishing the page. The browser pixel is loaded asynchronously.

= What does it send to Foglift? =

For a matched request: the path, the User-Agent, your site hostname, a timestamp, the matched AI crawler or referring AI engine, and your public workspace token. Nothing is sent for ordinary human traffic that is not referred by a tracked AI engine.

= Which crawlers and AI engines are recognized? =

The plugin ships the same crawler and referrer dictionary Foglift uses everywhere else, kept in exact parity by an automated test. It includes the OpenAI, Anthropic, Perplexity, Google, Amazon, Apple, Microsoft, Mistral, Meta, Cohere, ByteDance, and Common Crawl agents, plus referrals from ChatGPT, Claude, Perplexity, Gemini, Copilot, and NotebookLM.

== Changelog ==

= 0.1.0 =
* First release. Server-side AI crawler and AI-referrer capture on the earliest WordPress hook, browser pixel injection into the site head, public workspace-token settings screen, and honest full-page-cache warnings for WP Rocket, LiteSpeed Cache, and W3 Total Cache.

== Upgrade Notice ==

= 0.1.0 =
First release of Foglift Sensor for WordPress.
