=== Replya Chat ===
Contributors: replya
Tags: chat, live chat, chatbot, ai, customer support
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Adds the Replya website chat with its AI assistant to your website. Create a free Replya account or connect an existing one from the plugin settings.

== Description ==

Replya is a messaging platform for businesses. Its website chat answers visitors with an AI assistant that learns from your website, and hands conversations over to your team in the Replya inbox.

This plugin connects your WordPress website to Replya and embeds the chat, without copying any code:

* **Create a free account** from the plugin settings. Your website is already filled in; after the registration you come back to WordPress and the chat is active.
* **Connect an existing Replya account** by logging in to your workspace and choosing a chat widget. Your domain is allowed in the widget automatically.
* **Consent tools:** load the chat only after consent with Borlabs Cookie, Real Cookie Banner, Complianz or any other tool (opt-in code).
* **Logged-in users:** pass name and e-mail address of logged-in users to the chat, verified with the identity secret of the widget.
* **Display rules:** hide the chat for roles, post types, single pages or addresses.
* **Chat button:** a block, a shortcode and `#replya-chat` links open the chat.

A Replya account is required. Replya offers a free plan for one website; larger plans are available in Replya.

== Installation ==

1. Install and activate the plugin.
2. Open **Replya Chat** in the admin menu.
3. Click **Create a free account**, or enter the address of your existing workspace and click **Log in and connect**.
4. Finish the steps in Replya. You are sent back to WordPress and the chat appears on your website.

Your website has to use https.

== Frequently Asked Questions ==

= Do I need a consent banner for the chat? =

The chat stores a random visitor ID in the browser as soon as it is loaded. If your website asks for consent, choose your consent tool under **Privacy and consent** so the chat loads only after consent. For Borlabs Cookie and Real Cookie Banner, create a service for the Replya chat and enter its ID or unique name. For other tools, run the opt-in code shown in the settings when a visitor agrees.

= The chat button appears, but the chat window does not open. =

The domain of your website is not allowed in the Replya widget. The settings page shows this under **This domain**; click **Allow this domain in Replya**.

= Can I use the plugin on a staging website? =

Yes. A staging domain has to be allowed in the widget as well. Depending on your Replya plan, an additional domain may count against the domain limit.

= Does page caching work with the chat? =

Yes. The chat is loaded by a small script and works with caching and optimization plugins. The plugin excludes its script from delaying and combining in WP Rocket, LiteSpeed Cache, Autoptimize and SiteGround Speed Optimizer. Rules for logged-in users only apply to pages that are not cached for logged-in users, which is the default of these plugins.

= How are logged-in users recognized? =

If enabled, the plugin passes the display name and e-mail address of the logged-in user to the chat, where they are prefilled. For the roles you choose under "Verified identity for roles", the plugin also sends an HMAC signature of the e-mail address made with the identity secret, and Replya assigns the conversation to an existing customer with that address. WordPress does not confirm e-mail addresses, so only choose roles whose addresses you trust. The secret never leaves your server. When another person logs in or out in the same browser, the chat starts a new conversation.

= Developers =

* Filter `replya_chat_should_display` (bool): show or hide the chat on the current request.
* Filter `replya_chat_identity` (array|null): change or remove the identity passed to the chat.
* Filter `replya_chat_identity_is_verified` (bool): sign the e-mail address of a user, for example after your own e-mail confirmation.
* Filter `replya_chat_http_args` (array): arguments of requests to Replya.
* Constant `REPLYA_CHAT_BASE_DOMAIN`: domain of a staging or local Replya installation.
* JavaScript: `window.ReplyaChat.consent()`, `window.ReplyaChat.open()`, `window.ReplyaChat.revoke()`; events `replya-chat:loaded` and `replya-chat:consent-required` on `document`.

== External services ==

This plugin connects to Replya (https://replya.de/), the service that provides the website chat. Without Replya the plugin has no function.

* **Connecting an account:** when you click "Create a free account" or "Log in and connect", your browser is sent to `chatregistration.replya.de` or to your workspace (`yourcompany.replya.de`) with the address and name of your website, the address of the plugin settings page and random handshake values. Before the login, the plugin checks from your server whether the workspace exists. When you return, your server sends a one-time code, its verifier and the address of your website to your workspace and receives the chat widget key, the workspace name and, if you allowed it, the identity secret.
* **Status checks:** on the plugin settings page, your server requests the public status and chat window addresses of your widget from your workspace to show whether the widget is active and your domain is allowed.
* **Chat on your website:** on pages where the chat is shown (and after consent, if configured), the browser of each visitor loads the chat from your workspace. Replya receives the visitor's IP address, browser information and the page address, and stores a random visitor ID in the browser. Messages and details that visitors enter in the chat are sent to Replya. If "Recognize users" is enabled, name and e-mail address of logged-in users and an identity signature are passed to the chat.

Replya terms of use: https://replya.de/nutzungsbedingungen-replya-app/
Data processing agreement: https://replya.de/avv/

== Screenshots ==

1. Connecting the plugin to Replya.
2. Status and settings of a connected website.
3. The chat on the website.

== Changelog ==

= 1.0.0 =
* First release: registration and account connection from WordPress, automatic embedding, consent tools, logged-in users, display rules, chat button block and shortcode.
