=== AI Explainer ===
Contributors: nicolasseverino
Tags: ai detection, eu ai act, content authenticity, ai scraper block, transparency
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 2.3.0
License: GPLv3 or later
License URI: https://www.gnu.org/licenses/gpl-3.0.html

Detect AI-generated content with 5-method analysis. Public /authenticity page, embeddable trust badge, AI scraper defense, EU AI Act transparency.

== Description ==

AI Explainer analyses your published WordPress content with a multi-method detection engine, displays transparency badges to readers, and gives you a dashboard to keep track of AI-related content on your site.

The detection engine combines five complementary local heuristic methods (statistical, linguistic, structural, vocabulary, repetition) to estimate the probability that a piece of text was generated by AI.

= Features =

* Five-method local detection engine — no external service required
* Authenticity badges (human / AI / mixed) on posts
* Public `/authenticity` page — standalone "Verified Human Content" page on your domain, plus an embeddable trust badge other sites can drop in
* AI scraper defense — blocks 22 known AI training crawlers (GPTBot, ClaudeBot, CCBot, PerplexityBot, Bytespider…) via robots.txt
* 4-step Get Started onboarding wizard with live progress tracking
* Manual content declaration meta box (author can declare "human", "AI" or "auto-detect")
* Admin detector page — paste any text and analyse it
* Dashboard with content inventory and scan history
* EU AI Act transparency dashboard (informational checklist + downloadable HTML report)
* Multilingual detection dictionaries (English, French, Spanish, German, Italian, Portuguese)
* REST API under the `ai-explainer-pro/v1` namespace
* WordPress dashboard widget with content overview

= Detection methods =

1. Statistical — sentence-length variance (burstiness), entropy, average length
2. Linguistic — transition words, formal vocabulary, hedging phrases, personal pronouns
3. Structural — paragraph uniformity, list/heading patterns, topic-sentence formulas
4. Vocabulary — Guiraud index, hapax-legomena ratio, word-length distribution
5. Repetition — repeated bigrams and sentence-opening patterns

Each method produces a 0-1 score. Scores are combined into a weighted ensemble.

= REST API =

Endpoints under `ai-explainer-pro/v1` (all require `manage_options`):

* `POST /detect` — analyse arbitrary text
* `POST /scan-post` — scan a specific post by ID
* `POST /bulk-scan` — batch scan with offset/limit
* `GET /stats` — overall detection statistics
* `GET /compliance` — EU AI Act transparency data
* `GET /post-status/{id}` — detection status for a post

= Important disclaimer =

Local heuristic detection produces directional indicators. It works well for clearly AI-generated or clearly human text, but edge cases exist. Results vary depending on content type, length and language. The EU AI Act transparency dashboard is informational only and does **not** constitute legal advice — consult a qualified legal professional for any compliance question.

= Paid add-on (sold separately, hosted off-site) =

A separate paid version is available at https://aiexplainerpro.noveralis.com. It is sold and downloaded from the developer's own website and is **not bundled with this plugin**. Every feature listed above works in this plugin without the paid add-on.

== External services ==

This free plugin (the version hosted on WordPress.org) does **not** call any external service. All detection is performed locally on your server.

The optional paid add-on is sold and hosted off-site at https://aiexplainerpro.noveralis.com. It is a separate plugin and its external service calls are documented on the developer's website. Nothing the paid add-on does affects the free plugin's behaviour.

== Installation ==

= Automatic installation =

1. Go to WordPress Admin > Plugins > Add New
2. Search for "AI Explainer"
3. Click Install Now and then Activate
4. Open AI Explainer > Dashboard
5. Click "Scan All Published Content" to populate detection data

= Manual installation =

1. Download the plugin ZIP
2. Go to WordPress Admin > Plugins > Add New > Upload Plugin
3. Select the ZIP and click Install Now, then Activate
4. Open AI Explainer > Dashboard

= Configuration =

1. Open AI Explainer > Settings
2. Choose where badges are displayed (posts, pages, home, archives)
3. Adjust the detection threshold
4. Pick a badge template

== Frequently Asked Questions ==

= How does detection work? =

Five complementary local heuristic methods (statistical, linguistic, structural, vocabulary, repetition) each produce a 0-1 score. Scores are combined into a weighted ensemble.

= How accurate is the detection? =

Accuracy depends on content length, type and language. Longer texts (200+ words) produce more reliable results. We do not advertise a specific accuracy figure because it would vary too much across content types.

= Does this slow down my website? =

No. Detection runs only during admin-initiated scans. Badge display reads cached post meta — that is instant.

= What data is sent externally? =

Nothing, by default. All analysis runs locally on your server. The optional paid add-on can be configured by the user to call OpenAI; that is documented in the "External services" section above.

= Is this GDPR friendly? =

The plugin does not set cookies, does not track visitors, and stores all data in your own WordPress database.

= Can I customize the badges? =

Yes — choose between three templates (modern, pill, minimal), set the position (top, bottom, both), and toggle which badge types appear.

= Which languages are supported? =

Detection dictionaries cover English, French, Spanish, German, Italian and Portuguese. Developers can extend them via filters (`ai_explainer_pro_transition_words`, `ai_explainer_pro_formal_words`, `ai_explainer_pro_hedging_phrases`).

= Is there a REST API? =

Yes. Six endpoints under the `ai-explainer-pro/v1` namespace. All require `manage_options`. See the Description tab for the list.

= What about the EU AI Act? =

The EU AI Act (Regulation 2024/1689) introduces transparency obligations for AI-generated content. The plugin's transparency dashboard offers an informational checklist and a downloadable HTML report to support your own compliance review. It is **not** legal advice.

== Screenshots ==

1. Dashboard — content inventory and quick actions
2. Detector — paste any text and analyse it with five methods
3. Detection results — per-method scores, indicators, confidence
4. Transparency dashboard — informational checklist and content inventory
5. Settings — badge display, detection threshold, position
6. Frontend badge — authenticity badge displayed on posts
7. Dashboard widget — quick content overview
8. Compliance report — downloadable HTML

== Changelog ==

= 2.3.0 =
First stable public release.

* Five-method local detection engine — statistical, linguistic, structural, vocabulary and repetition analysis combined into a weighted ensemble. No external service required.
* Multilingual detection dictionaries (English, French, Spanish, German, Italian, Portuguese) with Unicode word-boundary matching for accurate, accent-aware results.
* Authenticity badges (human / AI / mixed) on posts, with three templates and a live preview.
* Public `/authenticity` page — a standalone "Verified Human Content" page on your domain — plus an embeddable trust badge other sites can drop in.
* AI scraper defense — robots.txt rules blocking 22 known AI training crawlers (GPTBot, ClaudeBot, CCBot, PerplexityBot, anthropic-ai, Google-Extended…).
* EU AI Act transparency dashboard: an informational checklist and a downloadable HTML report. Informational only — not legal advice.
* Manual content declaration meta box (human / AI / auto-detect) and an admin detector page for analysing arbitrary text.
* REST API under the `ai-explainer-pro/v1` namespace — six endpoints, all requiring `manage_options`.
* WordPress dashboard widget and a 4-step Get Started onboarding wizard.
* Developer hooks: `aiep_method_weights`, `aiep_detector_results_extra`, and the detection-dictionary filters (`ai_explainer_pro_transition_words`, `ai_explainer_pro_formal_words`, `ai_explainer_pro_hedging_phrases`).

== Upgrade Notice ==

= 2.3.0 =
First stable public release of AI Explainer.

== Privacy ==

**Stored locally:**

* Detection scores (post meta)
* Scan history (custom database table)
* Plugin settings (WordPress options)

**Not collected:**

* No visitor tracking, no cookies, no analytics

**External calls:** none, in the version distributed on WordPress.org. See the "External services" section for the optional paid add-on.

**Uninstall:** removing the plugin clears all options, post meta, custom tables and transients.
