=== Chatdozo – Live Chat and Inbox for WordPress ===
Contributors: chatdozo
Tags: live chat, chat, chat widget, customer support, chatbot
Requires at least: 6.2
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 0.13.3
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Live chat for small to medium sites on your own WordPress: branded widget, team inbox, email when you're away. AI receptionist with Pro.

== Description ==

Chatdozo is a live chat plugin for WordPress: a chat window on your site and an inbox in your WordPress admin. A visitor writes, you answer from the inbox; if you are away, they write anyway and the chat reaches you by email, and your reply goes back to them by email.

**Nothing leaves your server.** Conversations are stored in your own database, the people who answer are your own WordPress users, and the widget loads with no outside calls: no chat service in the middle, no account to make, no data sent to Chatdozo or anyone else.

**Everything in this plugin is free and complete:**

* The chat window, in your brand colour, with your logo, an optional header picture, your business name and a choice of nineteen quiet wallpapers or your own.
* Your whole team: everyone who should answer gets a login, a name visitors see, a role line and a face (sixteen illustrated faces or a photo). Chats can be assigned, tagged and annotated with private notes.
* The inbox in wp-admin: Needs you, Mine, Open, Closed; search; mark done, reopen, delete, select many at once; the visitor's page, source, device, country and local time; an On duty / Off duty switch in the admin bar on every page.
* Saved replies: type / in the inbox and pick one; {name} and {me} fill in by themselves.
* Business hours: tell visitors when you are closed and when you are back, in your words.
* Photos and PDFs both ways, up to 8 MB, stored in your own uploads folder.
* Ratings and transcripts: visitors can rate a chat when it closes and email themselves a copy; you can email one too, or download any chat as text.
* An email the moment a visitor writes while nobody is online, and replies that reach the visitor by email after they leave.
* Name and email before the first message: required, optional or off. Logged-in members skip the form.
* Every line a visitor reads, editable in your words or your language.
* Hide the chat on chosen pages or on phones; a privacy line; block a visitor; delete closed chats after N days.
* Works with page optimisers (WP Rocket, Autoptimize, LiteSpeed Cache, SiteGround Optimizer, Perfmatters, WP-Optimize) without being minified into silence.

**Chatdozo Pro** is a separate plugin from chatdozo.com that installs beside this one and adds: an AI receptionist that answers from your own website day and night and hands over to a person when it matters; a live globe of who is on your site with a Say hello button and automatic messages; Reports and a Monday email; and the inbox as an app on your phone with a ping when a visitor writes. It uses everything you have set up here.

== Installation ==

1. Plugins → Add New → search for "Chatdozo" → Install → Activate.
2. Chatdozo → Settings: type your business name, pick your colour, add your logo, tick who answers. Save.
3. Open your site in a private window: the chat button is in the corner.
4. When a visitor writes, Chatdozo → Inbox. Anyone on duty who is anywhere in WordPress counts as online; when nobody is, chats come by email.

== Frequently Asked Questions ==

= Does any chat data go to Chatdozo or anyone else? =

No. Conversations, names and emails stay in your own database (two tables, prefixed chatdozo_). The widget talks only to your own site, and the pictures of your team are files on your own site; nothing is fetched from Gravatar or any other outside service. The only outside call this plugin can make is the optional activation note described under External services, and it carries no chat content.

= How many people can answer? =

As many as you like. Administrators always can; tick anyone else under Settings → Who answers and they get the Chatdozo operator capability and nothing more.

= Visitors say "Couldn't send". =

A page optimiser has served a stale minified copy of the chat script. Chatdozo excludes itself from the usual optimisers; if yours is not among them, exclude chatdozo/assets/ from minify, delay and "remove unused CSS", then clear the cache.

= Does it work in my language? =

The lines visitors read are editable under Settings → Wording, so the chat can speak any language today; the admin side follows WordPress translations as they arrive.

= Where did the Pro features go? =

They are in Chatdozo Pro, a separate plugin from chatdozo.com. Nothing in this plugin is locked or limited; Pro adds the Assistant, Who's here, Reports and the phone app on top of it.

= Does it work with WooCommerce? =

Yes. The chat button sits on every page of the site, shop, product and checkout pages included, and the inbox shows which page the visitor is on, so you see the product they are asking about. If you would rather not have it on the checkout, hide it there under Settings → Housekeeping.

= Is it GDPR friendly? Where are the chats stored? =

Chats live in your own WordPress database and nowhere else; no third-party chat service sees them. The widget keeps one random token in the visitor's browser so they find their conversation again, stores a hash of the IP rather than the address, shows a privacy line you write, and can delete closed chats after a number of days you choose. Any conversation can be deleted from the inbox.

= Will it slow my site down? =

No. The widget is one script and one stylesheet, about 15 KB compressed between them, loaded at the end of the page with no outside calls, no fonts and no tracking. It is tested with WP Rocket, Autoptimize, LiteSpeed Cache, SiteGround Optimizer, Perfmatters and WP-Optimize.

= Is there an AI chatbot? =

The free plugin is people answering people. Chatdozo Pro adds an AI receptionist that answers from your own website's content day and night, says plainly when it does not know, and hands the chat to a person when it matters. It runs on your own OpenAI key or on Chatdozo AI.

= Can I use it on more than one site? =

The free plugin, on as many sites as you like. Pro is licensed per site, with plans for several sites at chatdozo.com.

== External services ==

This plugin works entirely on your own server. One optional connection exists:

**Freemius** (https://freemius.com), the licensing and update library bundled with the plugin. At activation it asks whether it may send a note when the plugin is activated, updated or removed, so you get security updates and we hear when something breaks. If you allow it, it sends your site address, the WordPress and plugin versions and, if you choose, your email address; never any chat content. If you skip it, nothing is sent and everything works the same. Terms: https://freemius.com/terms/ · Privacy: https://freemius.com/privacy/

Chatdozo Pro, the separate plugin, adds its own connections (an AI provider for the Assistant: OpenAI, or Chatdozo AI at ai.chatdozo.com; and the browser vendors' push services for the phone app), and documents them in its own readme.

== Screenshots ==

1. The chat window on a site: your colour, your logo, the operator's face beside each reply.
2. The inbox in wp-admin: Needs you, the conversation, the visitor card.
3. Settings: the widget, the colour and text colour, the lines visitors see.
4. Who answers: the team, each with a name, a role and a face.
5. Choose a face: sixteen illustrated faces or your own photo.
6. The chat on a phone.

== Privacy ==

Chatdozo stores chat messages, the visitor's name and email when they give them, the page they were on, their browser and a hash of their IP, in your site's database, so you can answer them. It keeps one random token in the visitor's browser (localStorage, with a cookie as fallback, a year) so a returning visitor sees their own conversation; the token identifies the browser, not the person. Delete any conversation from the inbox, or set an automatic retention period under Settings → Privacy. Nothing is sent to any outside server; see External services for the one optional exception.

== Changelog ==

= 0.13.3 =
* Inbox tabs, the on-duty pill and the action chips are flat colour-tinted pills with a solid count; on phones the four tabs sit two by two so every count is on screen.

= 0.13.2 =
* The phone app shows how many chats are waiting: a number on the app icon (Android, iPhone home-screen app, desktop Chrome and Edge), in the tab title and in the app bar. A notification updates the icon even when the app is closed.

= 0.13.1 =
* Settings form input is sanitized value by value before anything reads it; field helpers and icons are escaped where they are printed; transcript export is made in the browser from the API's text.

= 0.13.0 =
* The free edition is now the complete live chat. Everything that used to wait behind a Pro door is free and fully working: the whole team, assigning, tags, private notes, saved replies, business hours, photos and PDFs both ways, ratings, transcripts and downloads, the header picture, the wallpapers and the greeting-card delay. Chatdozo Pro is a separate plugin that adds the Assistant, Who's here, Reports and the phone app; nothing in this plugin is locked.
* Everything the plugin stores is now prefixed chatdozo_ (tables, options, user settings). An existing site is moved over by itself on the first page load after the update, with every chat and setting kept.
* Team photos are files on your own site only: the plugin no longer falls back to Gravatar, so visitors' browsers never contact an outside service.
* Files shared in chat go through WordPress' own uploader.
* The Chatdozo menu sits under Comments, with the other inboxes of a site.
* The settings page's scripts are proper enqueued files.
* The list of who can answer is remembered for a few minutes between page loads, which spares two user queries on every admin page of a large membership site.
* Fixed: adding more than one automatic message in one go kept only the last (Pro).
* Fixed: settings handed to the inbox and widget scripts arrived as text, so a switched-off option ("0") could read as on. They now keep their types.
* Installing Chatdozo Pro beside this plugin switches this one off cleanly, with no warnings while both are present.

= 0.12.7 =
* One phone, one ping, without a list to read: when the Hub subscribes a site it replaces the old single-site app on that kind of device and any earlier key from the same Hub install. The Hub asks the phone's name once and every site shows it ("Graeme's iPhone · Chatdozo Hub"). The Hub's Settings has "Make this the only phone" for the stubborn cases.

= 0.12.6 =
* On your phone lists every phone (and every copy of the app) that pings you, with Ping it to find the one in your hand and Forget for the rest. Three pings for one chat meant three copies of the app were subscribed.

= 0.12.5 =
* Plugin URI now points at the features section of chatdozo.com, so it differs from the author address as WordPress.org requires.

= 0.12.4 =
* Passed the WordPress.org Plugin Check with no errors, on both editions: every database query in the form the checker recognises, translator notes on every string with a placeholder, hook names under the chatdozo_ prefix, and the few outputs it could not see were escaped.

= 0.12.3 =
* You are not a visitor. Settings → Housekeeping → Not visitors: a list of addresses never counted (one per line, a trailing dot matches a range) with an "Add my address now" button, and a "this browser is mine" link to open once in any browser that is not signed in (a harvesting tool, the office PC); the chat never shows there and the globe never counts it. On a visitor card, "That's me, hide this address" (administrators) adds the address and clears the dot at once.

= 0.12.2 =
* Who's here is a globe. A lit sphere drawn once on a canvas with the visitors as glowing dots, grouped by place and labelled, pulsing when someone has just arrived or is waiting for a reply; it turns to face the people on the site, drag to spin it, tap a dot for the full card (page, source, time on site, visits, place, local time, device and browser, language, email). The numbers sit on the globe: countries, phones, chats, arrivals, the busiest page. Refreshes every five seconds without redrawing the land, so the phone app and the Hub stay quick.
* Who greets visitors is a row of face tiles instead of a dropdown: the logo, the AI (its own choice now, lit only while the AI is on) and every person who can answer, with the chosen one ringed. Sites that had "the logo" chosen while the AI was on keep that behaviour.
* The AI mode in Answering now shows the chosen option as a filled card with a tick, and the AI box names and shows who it replies as.
* "Tell me when someone arrives" is also a switch in Settings → Live support → Who's here, saved on click, so it is found before the first chat; the menu item is "Inbox / Notifications".
* Arrival pings on the phone name the site: "JAPAN CAR CONNECTION · someone is on the site".
* Install: the version upgrade runs at init, so WordPress no longer warns about translations loading early.

= 0.12.1 =
* On duty is one flag in one place. The top bar, the Answering now strip, the inbox button and the Chatdozo menu badge all read it and all follow each other the moment any of them is switched, in every open tab, with no reload.
* The top bar label says "AI first · Tomo-chan on duty" when "AI answers every chat" is chosen and someone is on duty, and the strip's sentence says why the AI is answering and which option puts people first.
* Someone on duty who is not in WordPress and has no phone set to ping is named: "Tomo-chan is on duty but not in WordPress or on a phone, so…" instead of "Nobody is on duty".
* A person answering under another name shows whose login it is: "Tomo-chan (Graeme's login)".
* "inbox open" became "in WordPress now": being anywhere in WordPress counts, because the top bar pings you there.
* The team list in Who answers is "The team: everyone who can answer", so it is no longer confused with Answering now.
* No more "translation loading triggered too early" notice on WordPress 6.7 and later.

= 0.12.0 =
* Answering now: a strip at the top of Settings that says in one sentence who answers a visitor this minute, with the switches that change it: each person on or off duty (administrators can set anyone), and the AI's mode (every chat, only when nobody is on duty, or off). Every switch saves itself the moment it is clicked.
* The same state shows on the Chatdozo menu (AI, Live or Away) and in the top bar on every page, with On duty / Off duty for yourself.
* Pro: a person whose phone is set to ping counts as there, so chats reach them through the Hub without the inbox open.
* The Assistant card no longer carries its own On switch or "when it answers"; both live in Answering now.

= 0.11.3 =
* Your own buttons can open the chat: give any link or button a data-chatdozo attribute (its value becomes the first message), or call window.Chatdozo.open('text') from your code.

= 0.11.2 =
* Settings laid out in two balanced columns per band, the Assistant's steps as panels, textures in small tiles, and a save bar that stays in view.

= 0.11.1 =
* Settings is now four bands with jump buttons: Your brand, Live support, AI support, Housekeeping. Everything about one subject sits together.
* Fixed: the people finder answered "That did not work".

= 0.11.0 =
* Who answers no longer lists every user on the site. Pick a role (with a count) or search by name, then tick the people who should answer; only they appear on the page. On a membership site with thousands of members this is the difference between a card and a wall.
* The operator capability is now given and taken by difference, so large sites are not walked user by user on every save.
* Pro: when the AI writes questions it starts from your standing pages and typed facts rather than the newest listings.
* Pro: two post types with the same name (a plugin's "Posts" next to WordPress posts) now show which is which in the reading list.

= 0.10.2 =
* Pro: the On your phone steps now match the iPhone flow (home screen first, then scan from inside the Hub).

= 0.10.1 =
* Pro: the On your phone card is one clear path, code first, with the steps beside it.

= 0.10.0 =
* Pro: the Chatdozo Hub. One app on your phone for every Pro site you answer: Settings, On your phone, "Add this site to the Hub", scan the code or email yourself the link. Every site's notifications arrive in the one app and open the right chat.
* Pro: each site now answers the Hub over a WordPress application password made for it, which you can revoke from your profile at any time.

= 0.9.3 =
* Tested on WordPress 7.1.

= 0.9.0 =
* Two editions from one plugin, with a 14-day trial of Pro, no card, started from Settings.

= 0.8.5 =
* Eleven more wallpapers for the chat window and the inbox, all tinted with your brand colour.

= 0.8.0 =
* Reports: a new page under Chatdozo, and the Monday email.

= 0.7.3 =
* The widget's script and stylesheet are excluded from page optimisers (WP Rocket, Autoptimize, LiteSpeed Cache, SiteGround Optimizer, Perfmatters, WP-Optimize, Cloudflare Rocket Loader).

= 0.5.0 =
* Who's here, Say hello and automatic messages.

= 0.4.0 =
* Chatdozo on your phone: the inbox as an app with push notifications.

= 0.3.0 =
* The Assistant: answers visitors from your own pages, posts and products, your FAQ and your facts.

= 0.2.0 =
* Pre-chat name and email, saved replies, private notes, assign, tags, business hours, operator photos, block visitor, rating and transcript, photos and PDFs both ways, retention, delete and download of any chat.

= 0.1.0 =
* Widget, conversation engine, operator inbox, settings, email alerts.
