=== Akukita Chat with AI Translation ===
Contributors: akukitadvt
Tags: chat, translation, multilingual, live-chat, customer-support
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.2.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Live chat where every message is auto-translated into each user's language. 70+ languages, no setup, no API key required.

== Description ==

**Turn your WordPress site into a global community.**

Got visitors from different countries who don't share a common language? With Akukita Chat, an English speaker and a Spanish speaker can hold a natural conversation — each one reads and writes in their own language. The translation is instant, invisible, and cached so it never slows down.

No API keys, no monthly fees, no configuration headaches. Drop a shortcode on any page and you have a multilingual chat running in under 60 seconds.

= Why people install Akukita Chat =

* 🧙 **Guided setup in 60 seconds** — A built-in setup wizard runs the moment you activate the plugin: pick your translation engine, get a ready-to-use chat page automatically created for you, and you're done.
* 👥 **Open the chat to anyone (no account required)** — Switch on guest mode and visitors join with just a display name and a language. Perfect for public communities, support chats and landing pages. Spam protection (rate limiting, length limits and a honeypot) is always on.
* 🌍 **70+ languages, zero configuration** — Works out of the box with the free MyMemory provider. No registration, no credit card.
* 💬 **Multi-room chat** — Create as many topic-based rooms as you want from the admin dashboard.
* ⚡ **Real-time** — Messages appear instantly, no page reload.
* 🧠 **3 translation engines** — Free (MyMemory), high-quality (DeepL), or premium AI (OpenAI GPT-4o-mini). You choose.
* 🚀 **Smart caching** — Each phrase is translated once, then served instantly to everyone. Saves quota and lightens server load.
* 📱 **Beautiful on mobile** — Dark-glass responsive UI that looks polished on phones and desktop.
* 🔐 **Admin-controlled** — Only administrators create rooms, so the conversation stays moderated by design.
* 🇪🇺 **GDPR-ready** — Privacy policy auto-generated, message retention configurable, no data leaves your DB except the text being translated.

= Perfect for =

* International communities and forums
* Language exchange and learning sites
* Multilingual e-commerce stores with WooCommerce
* Travel, expat and digital-nomad communities
* Online courses with students from multiple countries
* SaaS support chats serving customers worldwide

= How it works =

1. Install and activate the plugin.
2. The setup wizard opens automatically and asks two quick questions: which translation engine you want and where to place the chat. It then creates a ready-to-use chat page for you.
3. (Optional) Decide who can chat in **Akukita Chat → Settings → Who can chat**: only logged-in users (default), anyone with a display name (guest mode), or visitors who first create a WordPress account.
4. Share the chat URL with your audience. That's it.

= Shortcodes =

    [akukita_chat]                     Full chat widget with room sidebar
    [akukita_chat height="700"]        Custom height in pixels
    [akukita_chat_room id="1"]         Embed a specific room

= Translation Providers =

You choose which one to use, and you can switch any time without losing your chat history:

1. **MyMemory (default)** — 100% free, no API key. 5,000 words/day per IP, or 50,000/day if you add your email in Settings.
2. **DeepL Free** — Best European-language quality. 500,000 characters/month with a free DeepL API key.
3. **OpenAI GPT-4o-mini** — State-of-the-art translation quality including idiomatic and informal language. Requires a paid OpenAI API key. Costs are minimal (~$0.15 per 1M input tokens).

If the API ever goes down, the original message is shown as-is — your chat keeps working.

= Upgrade to Akukita Chat Premium =

Get features designed for serious communities and businesses at [akukita.es/plugins](https://akukita.es/plugins):

* 💌 **Direct Messages** — Private 1-on-1 translated conversations
* 🛡 **Moderation Panel** — Ban, mute, delete with one click
* 🎨 **6 Themes + Custom CSS** — Match your brand perfectly
* 📊 **Analytics Dashboard** — Active users, peak hours, language breakdown
* 🛒 **WooCommerce Integration** — Gate rooms behind product purchases

[See all premium features →](https://akukita.es/plugins)

= Built by Akukita =

Akukita is a Spanish software studio focused on building tools that connect people across languages. Mario Simón Melchor leads development. The plugin is actively maintained — bug reports and feature requests get a response within 48 hours on the [support forum](https://wordpress.org/support/plugin/akukita-chat-with-ai-translation/).

== Installation ==

= From WordPress.org (recommended) =

1. Go to **Plugins → Add New** in your WordPress admin.
2. Search for **"Akukita Chat"**.
3. Click **Install Now**, then **Activate**.
4. Go to **Akukita Chat → Settings** to configure your provider (the free one works out of the box).
5. Go to **Akukita Chat → Rooms** to create your first room.
6. Paste `[akukita_chat]` on any page or post.
7. Make sure **Settings → General → Anyone can register** is enabled so visitors can join.

= Manual installation =

1. Download the ZIP from this page.
2. Upload it via **Plugins → Add New → Upload Plugin**.
3. Activate and follow steps 4-7 above.

== Frequently Asked Questions ==

= Do I really need zero configuration? =

Yes. After activating the plugin, the free MyMemory provider is already selected. You only need to create a room and paste the shortcode. The default 5,000 words/day quota is enough for small to medium communities.

= How do I get the 50,000 words/day free quota? =

In **Akukita Chat → Settings**, enter any email address in the MyMemory field. That's it — your quota goes from 5,000 to 50,000 words/day at no cost.

= Can my users create their own rooms? =

No, by design. Only administrators can create and manage rooms from the dashboard. This keeps the chat moderated and prevents spam rooms. The Premium add-on adds private and invite-only rooms if you need that flexibility.

= Do users need a WordPress account? =

No. By default the chat is open to guests: a visitor enters a display name and their language and can start chatting right away — no account, no email. You can change this under **Akukita Chat → Settings → Who can chat**, where you can instead require visitors to be logged in, or require them to create a WordPress account. Spam protection (rate limiting, message length limits and a honeypot) is always on for guest chat.

= What about chat history? =

Messages are stored in your own WordPress database. You decide how many days of history to keep in Settings, and older messages are auto-purged daily. Nothing is ever sent to third parties except the text being translated to your chosen provider.

= What if my translation provider goes down? =

The original (untranslated) message is shown. Users still see the conversation, just without translation during the outage. The chat itself keeps working at full speed.

= Is it compatible with caching plugins (WP Rocket, LiteSpeed, W3 Total Cache)? =

Yes, but you must exclude the page containing `[akukita_chat]` from full-page cache. The chat output and its security tokens depend on the visitor, so serving a cached copy to guests can make sending messages fail. Add the chat page to your caching plugin's "never cache" list, or configure it to vary cache by login status.

= Does it work with Multisite? =

Yes. Each site in the network has its own rooms, messages and settings.

= What PHP version is required? =

PHP 7.4 or higher. PHP 8.0 or higher is recommended for better performance.

= Is the plugin compatible with WordPress 7.0? =

Yes, fully tested and compatible with WordPress 7.0.

== Screenshots ==

1. Live chat on a WooCommerce product page — a Japanese-speaking customer asks a question in Japanese while the shop owner reads and replies in English. Every message is translated instantly in real time.
2. The same conversation seen by the Japanese-speaking user — they read the owner's English replies in Japanese. Each participant chats entirely in their own language.
3. Settings — pick your translation engine. MyMemory is selected by default with no API key required, so the chat works out of the box. DeepL and OpenAI are optional.
4. Chat Rooms management — create topic-based rooms in seconds and copy the ready-made shortcode to embed any room on a page, post or product.

== External services ==

Akukita Chat connects to third-party translation APIs to translate chat messages. Each provider is opt-in and configured by you in **Akukita Chat → Settings**. No data is sent unless you enable a provider and a user posts a message.

**1. MyMemory / Translated.net** (default — no API key needed)
Only the text of each chat message is sent. No user identifiers, emails or WordPress data are transmitted.

* Service URL: https://mymemory.translated.net
* Terms of Service: https://mymemory.translated.net/terms-and-conditions
* Privacy Policy: https://translated.com/confidentiality

**2. DeepL API** (optional — requires API key)
Only message text is sent.

* Service URL: https://www.deepl.com
* Terms of Service: https://www.deepl.com/pro-license
* Privacy Policy: https://www.deepl.com/privacy

**3. OpenAI API** (optional — requires API key)
Only message text is sent to the GPT model.

* Service URL: https://openai.com
* Terms of Service: https://openai.com/policies/row-terms-of-use/
* Privacy Policy: https://openai.com/policies/row-privacy-policy/

**4. Deactivation feedback** (optional — only when you submit it)
When you deactivate the plugin, an optional form asks why. If — and only if — you fill it in and click "Submit & deactivate", the reason you select, any comment you type, and a reply email (only if you choose to provide one) are emailed to the plugin developer at akukita.es. Choosing "Skip & deactivate" sends nothing. No site URL beyond the standard email signature, and no other site or admin data, is collected.

* Developer: https://akukita.es

== Privacy ==

Akukita Chat stores all chat messages in your own WordPress database. The plugin uses `wp_add_privacy_policy_content()` to automatically suggest privacy text for your site's policy page (visible in **Settings → Privacy**). You control the message retention period from the plugin settings.

== Changelog ==

= 1.2.0 =

**Headline features**

* 🧙 **New: Guided setup wizard.** Activating the plugin now opens a one-screen wizard that asks for your translation engine and creates a ready-to-use chat page for you — first-run time is under a minute.
* 👥 **New: Open chat for guests, no account required.** Switch "Who can chat" to *Anyone* in Settings and visitors join the chat by entering just a display name and a language. Per-identity rate limiting, message length limits and a honeypot field protect open chats from spam, always on.
* 💬 **New: Optional deactivation feedback.** When you deactivate the plugin, an opt-in modal asks why. Skip it and nothing is sent. If you submit, only the reason and any text you type leave your site — no URL, no WP version, no other site data. Helps the plugin keep improving.

**Improvements**

* Message moderation: administrators can remove individual messages.
* "Settings" link added to the row of the Plugins screen.
* Clearer labels and an active-mode banner in **Settings → Who can chat**.
* The registration / login modal now opens the WooCommerce "My Account" page automatically when WooCommerce is active. A new `akch_login_url` filter lets you point the button anywhere.
* Uninstall now removes every plugin option, transient and user meta entry cleanly, including the new 1.2.0 keys.
* Pages that contain the chat shortcode are now marked as uncacheable for WP Rocket, LiteSpeed, W3 Total Cache, WP Super Cache and Cloudflare. Avoids one guest's session being served from cache to a different visitor.
* All chat input fields (textarea, language picker, registration inputs) now use a white background with dark text and explicit placeholder colours, for consistent readability across OS themes.

**Bug fixes**

* The first message sent in an empty room could appear twice on the sender's screen due to a race between the optimistic render and the polling loop. Fixed with a sender-side ID set and a corrected ordering of state updates.
* The "Log in" tab in the registration modal did not respond to clicks because the JS bound to an outdated element id. Fixed.
* The guest name gate did not initialise on guest-mode pages because the bootstrap only ran for users with positive IDs. It now runs whenever the chat widget is rendered.
* Server-side error messages were being swallowed by the front-end API helper. Errors now surface as toasts and, if the server reports a missing name, the name gate reappears automatically with the typed text preserved.
* The guest gate now also renders correctly inside themes that aggressively rewrite shortcode output (e.g. Divi), thanks to a fixed-position fallback overlay that attaches directly to `<body>` with a maximum z-index.

= 1.1.2 =
* Fixed: Messages now sync correctly in real time when using the single-room shortcode [akukita_chat_room].
* Improved: Refined plugin tags for better discoverability in the plugin directory.
* Improved: New screenshots showcasing live multilingual chat.

= 1.1.1 =
* Improved: Review prompt now appears after 3 days of use (previously 14) for faster user feedback.

= 1.1.0 =
* Added: Friendly review prompt in admin (appears after 3 days of use, fully dismissible).
* Improved: Better integration with the WordPress.org support workflow — unhappy users are directed to the support forum instead of leaving rushed reviews.

= 1.0.9 =
* Confirmed compatibility with WordPress 7.0.
* Improved plugin documentation and on-screen help.

= 1.0.8 =
* Improved: Database security review and code hardening across the entire plugin.
* Improved: Updated all external service links to canonical URLs for stability.

= 1.0.7 =
* Improved: Plugin scope optimized for the free version. Private rooms moved to the Premium add-on for a cleaner feature split.
* Improved: All third-party service documentation links verified and updated.

= 1.0.5 =
* Added: "Powered by" badge is now opt-in from Settings (off by default).
* Improved: REST API permission checks tightened across all endpoints.

= 1.0.3 =
* Added: Premium upgrade page with feature overview.
* Added: Developer hooks (`akch_message_created`, `akch_room_created`, `akch_can_post_message`) for extensions and integrations.

= 1.0.2 =
* Added: GDPR-ready privacy policy suggestion.
* Improved: Full compliance with WordPress.org coding standards.

= 1.0.1 =
* Initial public release.
* Multi-room real-time chat with AI translation.
* MyMemory (free), DeepL and OpenAI GPT-4o-mini providers.
* 70+ languages with automatic detection and caching.
* User self-registration from the chat page.
* Configurable message history retention.
* Responsive dark-glass UI.

== Upgrade Notice ==

= 1.2.0 =
Major release: new setup wizard, open chat for guests (no account required), opt-in deactivation feedback. Your existing access settings are preserved — chat continues to require login until you explicitly enable guests in Settings → Who can chat.

= 1.1.2 =
Fixes real-time message sync for the single-room shortcode. Recommended update for everyone using [akukita_chat_room].

= 1.1.0 =
New review prompt that respects your workflow. Safe non-breaking update.

= 1.0.9 =
Confirmed compatibility with WordPress 7.0. Recommended update.

= 1.0.8 =
Important security review and stability improvements. Recommended for all users.
