=== Demitr ===
Contributors: dcodetechnologies
Tags: chatbot, ai, gdpr, chat widget, live chat
Requires at least: 6.4
Tested up to: 6.9
Stable tag: 1.2.0
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Add a GDPR-compliant AI chat widget to your WordPress site that answers visitor questions automatically.

== Description ==

Demitr adds an AI chat widget to your WordPress site. The AI answers visitor questions about your business — hours, services, prices, location — because you tell it what to say.

= Why Demitr? =

* **Knows your business** — Enter your details once, the AI handles the rest
* **GDPR by design** — Consent gate, no cookies, no persistent storage, PII anonymization
* **EU-sovereign AI** — Powered by Mistral (Paris). Hosted on Hetzner (Germany). Data stays in the EU
* **30-second setup** — Install, enter your info, enable. Done
* **6 European languages** — English, French, German, Dutch, Italian, Spanish. AI responds in the visitor's language
* **Customizable** — Brand name, accent color, position, language

= Two Modes =

**Free mode:** Configure business details in WordPress admin. The AI uses them to answer questions.

**Paid mode:** Enter your API key from [demitr.ai](https://demitr.ai). Widget config is managed from the dashboard.

= External Service =

This plugin sends chat messages to the Demitr API for AI processing. You configure the endpoint in Settings > Demitr Chat.

* **Default endpoint:** [demitr.ai](https://demitr.ai)
* **Provider:** dcode technologies S.a r.l., Luxembourg
* **Terms of Service:** [demitr.ai/terms](https://demitr.ai/terms)
* **Privacy Policy:** [demitr.ai/privacy](https://demitr.ai/privacy)

**Data sent:** visitor message (PII tokenized), session ID (random UUID), business context, consent flag.
**Data NOT sent:** IP address, cookies, personal identifiers, browsing history.

You can self-host the API for full data control by configuring the API endpoint URL in the plugin settings.

== Installation ==

1. Upload the plugin to `/wp-content/plugins/demitr/` or install via Plugins > Add New
1. Activate the plugin
1. Go to Settings > Demitr Chat
1. Enter your API endpoint URL (or use the default demitr.ai)
1. Fill in your business name, type, hours, and services
1. Check "Enable Widget" and save

== Frequently Asked Questions ==

= Is it GDPR compliant? =

Yes. Explicit consent gate before any processing. No cookies. No persistent storage. PII anonymized. EU-only infrastructure.

= Does it use cookies? =

No. SessionStorage only — cleared when the tab closes.

= What AI model is used? =

Mistral Small by Mistral AI (Paris, France). EU-sovereign — no international data transfers.

= Can I self-host the API? =

Yes. Set the API endpoint URL in the plugin settings to point to your own Demitr API server instead of demitr.ai.

= Does it work with caching plugins? =

Yes. The widget runs client-side. Compatible with all caching plugins.

== Screenshots ==

1. Settings page with business card configuration
2. Chat widget on a live website
3. GDPR consent gate before first message
4. Compliance checklist in admin

== Changelog ==

= 1.0.2 =
* Renamed main plugin file from `demitr-wp.php` to `demitr.php` to match the WordPress.org slug convention
* Removed remaining inline `style=""` attributes from admin notice — moved to admin CSS class
* JS now toggles classes via `classList.toggle()` instead of writing to `element.style.display`

= 1.0.1 =
* Replaced inline `<script>` in admin settings with `wp_add_inline_script()` (WordPress.org review fix)
* Added opt-in attribution setting — "Powered by demitr.ai" link is now off by default (Guideline 10)
* Fixed broken GitHub URL in readme.txt

= 1.0.0 =
* Initial release
* AI chat widget powered by Mistral (EU-sovereign)
* GDPR consent gate (Art. 6) and AI disclosure (EU AI Act Art. 50)
* PII anonymization (email and phone tokenization)
* Business Card mode with 5 context fields
* Paid mode with API key from demitr.ai dashboard
* WordPress color picker for accent color
* Bilingual (English and French)
* Widget position setting
* Clean uninstall

= 1.2.0 =
* Widget redesign: SVG icons, bigger chat window, warm welcome messages, consent-only view
* Auto-language detection: widget reads page language from html lang attribute and browser navigator.language
* SSE streaming with LLM fallback chain: Mistral Small + 3 free fallback models
* Anti-injection hardening: explicit security directives in every system prompt
* Lead capture AI: natural contact collection prompt for Pro customers
* PII anonymization Level 3: 8 regex + NLP (names, addresses, IBANs, credit cards, DOBs)
* Installation tracking: widget pings server on load for domain analytics
* Persistent chat history via localStorage (survives refresh and tab close)
* Clear chat button with localized label in all 6 languages
* Google Fonts: DM Sans + Instrument Sans

= 1.1.0 =
* Widget upgraded: CSP-safe stylesheet (constructable stylesheet with fallback), hex color validation, SSE streaming responses
* 6 European languages: English, French, German, Dutch, Italian, Spanish (widget UI + admin language selector)
* Auto-detect language from WordPress locale for DE, NL, IT, ES (not just FR)
* Level 3 PII anonymization: 8 regex patterns (EMAIL, URL, IBAN, CREDIT with Luhn, SSN, DOB, PHONE, ADDRESS) + NLP for names, places, organizations
* "Powered by demitr.ai" badge remains opt-in (Guideline 10 compliant)

== Upgrade Notice ==

= 1.2.0 =
Widget redesign, auto-language detection, LLM fallback chain, anti-injection security, lead capture AI, installation tracking, persistent chat history. Recommended update.

= 1.1.0 =
Major widget upgrade: 6 European languages, SSE streaming, CSP-safe styles, Level 3 PII anonymization.

= 1.0.2 =
Main plugin file renamed to match the slug convention (demitr.php). On a clean WordPress install you can simply install fresh; existing installs from a previous unreleased build should reactivate after updating.

= 1.0.1 =
WordPress.org review fixes: inline script moved to `wp_add_inline_script()`, attribution link now opt-in.

= 1.0.0 =
First release. Install, add your business info, enable the widget.
