=== Countnest ===
Contributors: idcph
Tags: analytics, privacy, seo, ai, statistics
Requires at least: 5.8
Tested up to: 6.7
Requires PHP: 7.4
Stable tag: 1.1.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Privacy-friendly website analytics from Countnest.com: visitor stats, AI assistant traffic and AI/search crawler logging in one install.

== Description ==

Countnest counts visits without tracking people. This plugin:

1. Adds the Countnest tracker script (about 2.6 KB, about 1.4 KB compressed, loaded with defer). It stores nothing on the visitor's device.
2. Logs AI and search crawler fetches (GPTBot, ClaudeBot, Googlebot, Bingbot and others) from your server, because crawlers do not run JavaScript.
3. Optional, off by default: applies the fixes you approve in your Countnest action plan. Only three kinds: 301 redirects, structured data (JSON-LD) on chosen pages, and internal links in post content. Each one needs your click in Countnest, is logged there, and can be undone.

Only bot class and path are sent for crawlers. No visitor IP addresses are stored by Countnest.

== Installation ==

1. Upload the `countnest` folder to `/wp-content/plugins/`, or install the zip via Plugins → Add New → Upload.
2. Activate the plugin.
3. Go to Settings → Countnest and paste your Site ID and Ingest key from your Countnest setup page.
4. Save. Open your site once, then use “Check installation” in Countnest.

== Upgrade Notice ==

= 1.1.0 =
Optional one-click fixes from your Countnest action plan (off until you turn them on).

= 1.0.1 =
Adds a Settings link and cleans up its options on uninstall.

== Frequently Asked Questions ==

= Does the tracker store anything on visitors' devices? =

No. It does not use cookies, local storage or any other device storage. Whether your site needs a consent banner depends on your site and your jurisdiction; check with your own advisor.

= What is the ingest key? =

A server-only key from your Countnest account. It authenticates crawler reports. Never put it in public HTML.

= What does "Apply approved fixes" change on my site? =

Nothing until you tick the box, paste the connector key and click Apply on a task in Countnest. Then: approved redirects send visitors from the old path to the new one (301); approved structured data is printed in the page head; an approved internal link wraps the first matching words in the source post (or adds a short "Related:" line at the end if the words are not there). Post edits create a normal WordPress revision. Undo in Countnest removes the link again at the next hourly sync, or press "Sync fixes now".

= Does Countnest need an account? =

Yes. The plugin connects your site to a Countnest account (30-day free trial with no card required, then a paid plan). Without a Site ID the plugin does nothing.

== External services ==

This plugin connects to Countnest (https://countnest.com), operated by IDCPH ApS, Denmark. Data is processed in the EU.

* **Tracker script** (`https://countnest.com/c.js`): loaded on front-end pages once a Site ID is saved. In each visitor's browser it sends the page URL, referrer, screen size class, browser language and UTM tags to `https://countnest.com/api/c`. Countnest does not store IP addresses.
* **Approved fixes** (`https://countnest.com/api/fixes`): only when "Apply approved fixes" is on. Once an hour your server fetches the fixes you approved and reports which ones it applied. Requests are signed with your connector key. It sends your Site ID, the plugin version and fix ids with their status. No visitor data is sent.
* **Crawler reports** (`https://countnest.com/api/crawl`): sent from your server only when a known AI or search crawler (for example GPTBot, ClaudeBot or Googlebot) requests a page and an Ingest key is saved. It sends your Site ID, Ingest key, the crawler's user agent, the requested path and the status code. No visitor data and no IP address is sent.

Terms of service: https://countnest.com/terms
Privacy policy: https://countnest.com/privacy
Data processing agreement: https://countnest.com/dpa

== Changelog ==

= 1.1.0 =
* Optional: apply the redirects, structured data and internal links you approve in your Countnest action plan, with undo. Signed requests, allowlisted fix types only, off by default.

= 1.0.1 =
* Settings link on the Plugins screen.
* Options are removed when the plugin is deleted.
* Readme: external services section, clearer FAQ.


= 1.0.0 =
* First release: tracker injection and AI/search bot logging.
