=== RetroChat Live Chat ===
Contributors: retrochat
Tags: live chat, chatbot, chat, customer support, helpdesk
Requires at least: 5.8
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.5
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Live chat and a conditional chatbot for WordPress. Answer visitors in real time and keep every conversation in one inbox.

== Description ==

RetroChat puts a friendly chat window on your WordPress site. A chatbot greets every visitor, asks the questions you choose and hands the conversation to your team the moment a person is needed. Every chat lands in your RetroChat inbox with its full history and everything the visitor told the bot.

This plugin connects your site to [RetroChat](https://theretrochat.com). You need a RetroChat account: [start a free 14-day trial (no card needed)](https://theretrochat.com/signup).

= Features =

* **Conditional chatbot questions.** Build a flow of questions with quick-reply buttons. Each answer decides what the bot asks next, so every visitor gets a relevant conversation, and the answers are saved on the contact.
* **Live human handoff.** Visitors can ask for a person at any time and your team picks up the chat in real time, with typing indicators and online status. When nobody is online, the widget collects an email address so you can follow up.
* **Full chat history in your dashboard.** Every conversation, chatbot answer, page and contact detail is kept in your RetroChat dashboard, so your whole team has the context.
* **Identify logged-in users.** Optionally pass the name and email of logged-in WordPress users (members, customers) so they never have to introduce themselves.
* **Chat buttons anywhere.** Add a "Chat with us" button with the `[retrochat_button]` shortcode or the RetroChat button block, or point any menu item at `#retrochat`.
* **Show it only where you want.** Hide the chat for logged-in administrators and on chosen pages, by post ID or URL path, with wildcards such as `/shop/*`.
* **Fast.** One small script, loaded asynchronously in the footer, so your pages stay quick.
* **Make it yours.** Set the widget's title, greeting, color and position in your RetroChat dashboard. Changes show up on your site straight away.
* **Ratings.** Visitors can rate a conversation once it is closed.

= How it works =

1. Install and activate the plugin.
2. Start a free 14-day trial of RetroChat (no card needed) and copy your widget key from Install in your RetroChat dashboard.
3. Paste the key under Settings → RetroChat and click Save Changes.

The chat appears on your site right away. Reply to visitors from the RetroChat dashboard in any browser.

== External services ==

This plugin relies on RetroChat (https://theretrochat.com), a third-party live chat service, to provide the chat widget. Nothing is sent to RetroChat until you add a widget key.

* **On your public pages** (wherever the widget is enabled), visitors' browsers load the chat widget from https://theretrochat.com/widget.js. The widget sends RetroChat your widget key, the address of the page and the referring page, the visitor's browser details, the messages they write and any details they choose to share (such as their name, email address or answers to chatbot questions). If you turn on "Identify logged-in WordPress users", the name and email address of logged-in users are sent as well. The widget stores a token in the visitor's browser (local storage) so the conversation can continue on their next visit.
* **In your WordPress admin**, when you click "Test connection", your site sends your widget key to https://theretrochat.com/api/widget/config to check it and to show your workspace name and how many agents are online.

RetroChat terms of service: https://theretrochat.com/terms
RetroChat privacy policy: https://theretrochat.com/privacy

== Installation ==

= Uploading the zip file =

1. Download [retrochat-live-chat.zip](https://theretrochat.com/downloads/retrochat-live-chat.zip).
2. Go to Plugins → Add New → Upload Plugin, choose the zip file, click Install Now, then Activate.
3. Go to Settings → RetroChat, paste your widget key and click Save Changes.

== Frequently Asked Questions ==

= Do I need a RetroChat account? =

Yes. The plugin connects your site to RetroChat, where you reply to chats and build your chatbot. You can [start a free 14-day trial (no card needed)](https://theretrochat.com/signup) in about a minute.

= Where do I find my widget key? =

In your RetroChat dashboard, open Install and copy the widget key, then paste it under Settings → RetroChat. If you paste the whole embed code by mistake, the plugin picks the key out of it.

= How do I check that it works? =

Click "Test connection" next to the widget key. You should see "Connected to (your workspace) · N agents online". Then open your site in a private browser window: the chat launcher appears in the corner.

= The chat does not show up on my site =

Check that "Enable chat widget" is on, that "Hide the chat for logged-in administrators" is off (or look at your site while logged out) and that the page is not listed under "Hide on". The widget is never loaded in feeds, AMP pages or the Customizer preview.

= How do I add a "Chat with us" button? =

Use the `[retrochat_button]` shortcode or add the "RetroChat button" block. Change the text with `label` and add your own CSS classes with `class`, for example `[retrochat_button label="Talk to sales" class="button"]`. Buttons only appear on pages where the chat widget loads.

= Can a menu item open the chat? =

Yes. Add a Custom Link to your menu with the URL `#retrochat`. Any link to `#retrochat` on a page with the widget opens the chat.

= Can I hide the chat on some pages? =

Yes. Under Settings → RetroChat → Hide on, list one entry per line: a post or page ID (like `42`) or a URL path (like `/checkout`). End a path with `*` to hide the chat on everything below it too, for example `/shop/*`.

= Does it work with caching plugins? =

Yes. The widget loads from RetroChat, so cached pages keep working. If you turn on "Identify logged-in WordPress users", make sure your caching plugin does not cache pages for logged-in users (the default in popular caching plugins).

= Is it GDPR friendly? =

You stay in control of what is shared: visitors are anonymous until they share their details, and logged-in users are only identified if you turn that option on. The plugin adds suggested text under Settings → Privacy that you can use in your privacy policy, and the External services section above lists exactly what is sent.

= Can developers change what is sent to the widget? =

Yes. The `retrochat_live_chat_widget_settings` filter receives the settings object (key, host and the optional user) before it is printed as `window.RetroChatSettings`, and the `retrochat_live_chat_should_load` filter can switch the widget off for any request. In JavaScript, use `window.RetroChat.open()`, `.close()`, `.toggle()` and `.identify({ name, email })`.

= What happens to my data if I delete the plugin? =

Deleting the plugin removes its settings from your WordPress database. Your conversations stay safe in your RetroChat account.

== Screenshots ==

1. The chat widget on a WordPress site: the chatbot asks questions with quick-reply buttons.
2. A visitor asks for a person and an agent joins the chat live.
3. Settings → RetroChat: the three-step onboarding card.
4. Settings → RetroChat: widget key with Test connection, visibility and advanced options.
5. The RetroChat inbox with the full history of every conversation.
6. The RetroChat button block in the block editor.

== Changelog ==

= 1.0.5 =
* Wording updates.

= 1.0.4 =
* Updates now appear in your WordPress dashboard (Dashboard → Updates), with "View details" and optional automatic updates. After this version you never need to upload the plugin by hand again.

= 1.0.3 =
* RetroChat's previous server address is no longer supported. Sites still set to it switch to https://theretrochat.com automatically; update to keep the chat working.

= 1.0.2 =
* New: Identity secret setting. Logged-in users are signed so your team can trust who they are (identity verification).
* Security: the Server URL can only point at RetroChat (theretrochat.com); local test servers work only with WP_DEBUG on. Test connection uses WordPress's safe HTTP API.

= 1.0.1 =
* The chat server is now https://theretrochat.com. Existing settings update automatically.

= 1.0.0 =
* Initial release: the RetroChat chat widget, Settings → RetroChat with onboarding and Test connection, identification of logged-in users, hiding for administrators and on chosen pages, the `[retrochat_button]` shortcode, the RetroChat button block and `#retrochat` links.

== Upgrade Notice ==

= 1.0.3 =
Required: the chat stops working on the previous server address. This update switches your site to https://theretrochat.com.

= 1.0.0 =
Initial release.
