=== Flumente Assistant ===
Contributors: spdataforge
Tags: chatbot, ai, assistant, support, widget
Requires at least: 5.8
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 2.2.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Add the Flumente AI assistant to your site: paste the assistant ID and the widget appears. Logged-in users are recognised automatically.

== Description ==

Flumente Assistant puts the Flumente AI assistant on your WordPress site without writing a line of code.

* Paste the **assistant ID** in the settings page and the chat widget appears on your site.
* Choose **where it shows up**: the whole site, or only the pages you pick, using the **"Flumente Assistant" block** in the block editor (or the `[flumente_assistant]` shortcode).
* **Exclude specific pages** by ID or slug and, with one click, the WooCommerce pages (cart, checkout, account).
* Turn on **"Identify logged-in users"**: the first name, last name and email address of the WordPress user are handed to the assistant, which then treats them as a known person (memory, reminders, conversation history). You choose which field is the identifier (user ID, username or email) and whether to fall back to the display name when first and last name are empty. Visitors who are not logged in stay anonymous.
* No API key and no server-side calls: the widget talks to Flumente straight from the browser.

= Before you start =

The plugin shows an assistant, it does not create one: you need a Flumente account first.

1. Sign up at https://www.flumente.com/ and create your assistant. The free plan is enough to get it working on your site.
2. Copy the assistant ID from its page on Flumente.
3. Paste it into this plugin's settings.

= Requirements =

* A Flumente account and an assistant created on it (you need its ID). Signing up and creating an assistant on the free plan costs nothing: https://www.flumente.com/
* Your site domain has to be listed among the assistant's authorised domains on Flumente. The exact domain to add is shown on the plugin settings page.

== External services ==

This plugin connects your site to **Flumente** (https://flumente.com), the assistant service the widget belongs to. The connection is what makes the plugin work: without it there is no assistant to show. By default the plugin talks to `https://assistants-backend-d7i2.onrender.com`; the address is configurable on the settings page if you run Flumente elsewhere.

**What is loaded.** On the pages where the assistant is enabled, the plugin adds a `<script>` tag that loads `widget.js` from the Flumente server. From that moment the conversation happens directly between the visitor's browser and Flumente.

**What is sent to Flumente, and when:**

* Whenever the widget is displayed: the assistant ID you configured, and your site's address (sent by the browser as the origin of the request) so that Flumente can check the domain is authorised.
* Whatever a visitor types in the chat, including any file they choose to attach, because that is what the answer is produced from.
* Only when "Identify logged-in users" is enabled, and only for users who are actually logged in: the identifier you selected (WordPress user ID, username or email address), plus first name, last name and email address of that user. If you also enable the role option, the user's WordPress role is sent along with a signature computed from those values. **Visitors who are not logged in stay anonymous: the plugin sends nothing about them.**
* From the WordPress dashboard, at most once every six hours: an update check that reports the installed plugin version and your site address.

Flumente terms of service: https://flumente.com/terms
Flumente privacy policy: https://flumente.com/privacy

== Installation ==

1. Sign up at https://www.flumente.com/ and create an assistant — the free plan is enough. Keep its ID at hand.
2. Upload the `flumente-assistant` folder to `/wp-content/plugins/`, or install the ZIP from **Plugins → Add New → Upload Plugin**.
3. Activate the plugin.
4. Go to **Settings → Flumente Assistant**, paste the assistant ID and save.
5. Add your site domain to the assistant's authorised domains on Flumente.

== Frequently Asked Questions ==

= The assistant does not answer on my site =

Check that your site domain is listed among the assistant's authorised domains on Flumente. The exact domain to add is shown on the plugin settings page.

= Are logged-in users recognised? =

Yes. Turn on "Identify logged-in users" and the plugin passes the ID, first name, last name and email address of the current WordPress user. Visitors who are not logged in stay anonymous. It works on a mixed site too: on public pages the visitor is anonymous, in the members area they become a known user, automatically.

= Do I have to fill in the "Signing secret"? =

It depends on the assistant:

* Private assistant (internal, staff only): no, leave the field empty. The identity of the logged-in user is accepted as it is.
* Public assistant: yes, if you want logged-in users to get their own history and continuity. On a public assistant the identity has to be signed, otherwise a visitor could claim to be somebody else. You do it once: open the assistant on Flumente, go to the "Embed" section, reveal and copy the signing secret, paste it into the plugin field and save. From then on the signature is computed automatically on every page and the visitor does nothing. Without the secret, on a public assistant a logged-in user is treated as anonymous.

= Does the plugin store any personal data on my site? =

No. It reads the current user's data from WordPress when a page is rendered and passes it to the widget. Nothing is written to your database beyond the plugin settings.

== Screenshots ==

1. The settings page: paste the assistant ID, choose where the widget appears and which pages to leave out.
2. Identification of logged-in users: pick the identifier, optionally pass the WordPress role, and sign the identity.
3. The Setup guide tab: creating the assistant, choosing where it appears, and what to check if it stays silent.
4. The "Flumente Assistant" block in the editor, to show the assistant only on the pages you choose.
5. The assistant answering on the front end.

== Changelog ==

= 2.2.0 =
* New **Setup guide** tab on the plugin page: how to create the assistant, where to make it appear, how logged-in users are recognised, and what to check when the assistant stays silent. The settings keep their own tab.
* Clearer setup: the readme now states up front that a Flumente account is needed and that the free plan is enough to get the assistant running.
* The Italian translation now covers the whole interface, guide included.
* Tested with WordPress 7.1.

= 2.1.0 =
* The plugin interface is now in English, with the Italian translation included: it follows the language of the site.

= 2.0.0 =
* "Flumente Assistant" block for the block editor and `[flumente_assistant]` shortcode, to show the assistant only on the pages you choose.
* Reorganised settings: site area, exclusions (WooCommerce included) and identification of logged-in users.

= 1.4.1 =
* Updates arrive in the WordPress dashboard like any other plugin: no more manual downloads for later versions.

= 1.4.0 =
* Site area: choose where the assistant appears — front end only, admin area only, or both.
* Role for advanced access: option to pass the WordPress role of the logged-in user, signed together with the identity so it cannot be forged. On Flumente you list the roles allowed to use the advanced features through the widget (generating images, sending messages on channels, scheduling tasks).

= 1.3.0 =
* Signed identity: new "Signing secret" field, so logged-in users can safely get their own history on public assistants too. The signature is computed automatically and the visitor does nothing. Not needed on private assistants.

= 1.2.0 =
* Native "Flumente Assistant" block for the block editor, with a preview, as a visual alternative to the shortcode.

= 1.1.0 =
* Display mode: whole site, or only through the `[flumente_assistant]` shortcode.
* Page exclusions by ID or slug, and WooCommerce pages (cart, checkout, account).
* User mapping: choice of identifier (ID, username or email) and fallback to the display name when first and last name are missing.

= 1.0.0 =
* First release: widget injection and identity of logged-in users.
