=== Yozigo GEO ===
Contributors: yozigo
Tags: bot-tracking, analytics, crawlers, ai-search
Requires at least: 5.0
Tested up to: 7.1
Stable tag: 1.1.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Requires PHP: 7.2

Tracks visits and sends them to your Yozigo GEO dashboard for bot/AI-crawler and traffic-share analytics.

== Description ==

Yozigo GEO is a lightweight plugin that reports front-end page visits on your WordPress site to the Yozigo GEO collector service, which classifies each one (bot vs. human, and which AI crawler) using its own regularly-updated bot registry.

This plugin requires a Yozigo GEO account. It sends nothing until you enter your API key on its settings page; without a key it does not run at all.

Features include:
- **Bot & AI Crawler Tracking**: Every page visit is reported to the collector, which classifies it against a centrally maintained bot registry (Googlebot, Bingbot, GPTBot, ClaudeBot, and more) — kept current without a plugin update.
- **Accurate AI Traffic Share**: Because human visits are reported too, the dashboard can compute real AI-traffic-share percentages, not just raw bot counts.
- **Performance**: The tracking call is non-blocking so it never slows down a real visitor's page load.

== External services ==

This plugin connects to the Yozigo GEO collector, an API operated by Yozigo (https://www.yozigo.ai), to report your site's front-end page visits so that your Yozigo GEO dashboard can identify AI crawlers, AI-referred visits and your AI traffic share. The plugin cannot do this locally: the crawler registry lives in the service and is updated centrally.

What is sent and when: on every front-end page view (never admin, AJAX, cron or REST requests) the plugin sends one HTTPS POST to https://yozigo-geo-backend-service.fly.dev/api/v1/crawl/track containing the visitor's IP address, user agent, referer, request path and query parameters, a timestamp, and your API key, organisation ID and brand ID. Human visits are reported as well as bot visits, because the AI-traffic-share figure needs both. Nothing is sent until you enter your API key on the settings page; without a key the plugin does nothing. The request is non-blocking, so it never delays the visitor's page.

This service is provided by Yozigo: [terms of service](https://www.yozigo.ai/terms), [privacy policy](https://www.yozigo.ai/privacy).

Because visitor IP addresses are transmitted, you are responsible for disclosing this plugin's data collection in your own site's privacy policy where your local law requires it.

== Installation ==

1. Upload the plugin folder to `/wp-content/plugins/` or install via Plugins → Add New.
2. Activate the plugin from the Plugins page.
3. Go to "Yozigo GEO" under Settings.
4. Enter the **API Key**, **Org ID**, and **Brand ID** shown on the Plugins page of your Yozigo GEO dashboard.

== Frequently Asked Questions ==

= Do I need an API key? =
Yes, you need a valid API Key, Org ID, and Brand ID from your Yozigo GEO dashboard to send tracking data.

= Does this slow down my site? =
No. The tracking API call is performed asynchronously (non-blocking).

== Screenshots ==

1. Settings → Yozigo GEO: paste the API Key, Org ID and Brand ID from your Yozigo GEO dashboard. Nothing is sent until the API key is saved.

== Changelog ==

= 1.1.4 =
* Plugin review compliance: every $_SERVER read is sanitized, the page path and query string are both read from the request URI via esc_url_raw (which keeps percent-encoded and non-ASCII paths intact), hooks use named functions, and "Tested up to" is WordPress 7.1.
* Removed the function_exists() guards added in 1.1.3. WordPress already refuses to activate a second copy of a plugin that would redeclare its functions, so the guards protected nothing, and the plugin review guidelines discourage them.
* Adds suggested wording to the site's Privacy Policy Guide (Settings → Privacy) describing what the tracker sends.
* Reports each visitor IP together with its provenance ("client"), the same way the Vercel and Cloudflare collectors do.

= 1.1.3 =
* Guarded every plugin function against "Cannot redeclare" fatal errors if a stale second copy of the plugin (e.g. left over from an incomplete manual upgrade, installed under a different folder name) ever ends up active alongside this one. Previously this white-screened the entire site; now the duplicate copy just silently no-ops.

= 1.1.2 =
* Fixed the settings page showing a contradicting "Settings saved" success message at the same time as an "API Key is required" error on a failed save. Now uses WordPress's own settings-errors mechanism, which also removes a harmless but confusing double "Settings saved" message on a real successful save.

= 1.1.1 =
* Added uninstall cleanup — deleting the plugin now removes its saved settings (including the API key) from the database instead of leaving them behind.

= 1.1.0 =
* Send every page visit (not just bot-matched ones) and let the backend classify bot vs. human — the old local user-agent regex was missing many current AI crawlers (ClaudeBot, Google-Extended, and others) and couldn't support AI-traffic-share reporting.
* Send visitor IP address for accurate classification and geolocation.
* Removed the WP-Cron retry queue (and its "Enable Retry Queue" setting) — matches the no-retry model used by our other integrations; a failed send is now logged via the `yozigo_geo_send_failed` action instead of queued.

= 1.0.0 =
* Initial release — bot/crawler tracking with an opt-in WP-Cron retry queue.
