=== FiveMinChat - AI Chatbot Widget ===
Contributors: ssurojit
Tags: chatbot, ai chatbot, chat widget, customer support, live chat
Requires at least: 5.8
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.3
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Add the FiveMinChat AI chatbot to your WordPress site in under five minutes. Paste your Bot ID, save, done.

== Description ==

**FiveMinChat** lets you add an AI chatbot, trained on your own website and documents, to any WordPress site by entering a single Bot ID.

Once activated and configured, the plugin loads the FiveMinChat widget script on every public page, so your visitors can start chatting immediately - without you touching a single line of code.

**How it works:**

1. Sign up at [fiveminchat.com](https://fiveminchat.com) and create your AI chatbot.
2. Copy your Bot ID from the FiveMinChat dashboard (Settings page).
3. Paste the Bot ID into the plugin settings under **Settings > FiveMinChat**.
4. Save - the widget is live on your site.

**Features:**

* One field, one save, done.
* Works on every page and post automatically.
* Lightweight: loads a single deferred script in the footer, no extra CSS or assets.
* No shortcodes or blocks required.
* Bot ID is validated as a UUID v4 before saving and before output. The widget script URL is fixed and never user-controlled.
* Settings require the `manage_options` capability and are protected by WordPress nonces.
* Clean uninstall: deleting the plugin removes its stored settings (including on multisite).

== External services ==

This plugin connects to the FiveMinChat service, operated by Vibgyor Techsolutions, to show an AI chatbot on your site. The chatbot cannot work without it.

* **Widget script** - on every public page (only after you save a Bot ID), visitors' browsers load `https://cdn.fiveminchat.com/widget.js`. The request sends the usual browser data (IP address, user agent, referring page URL).
* **Chat API** - when a visitor sends a message, the widget sends your Bot ID, the message, the recent chat history and a random session ID to `https://api.fiveminchat.com`. If the visitor types their name, email or phone number into the chat, that text is sent too, so the site owner can follow up.

No data is sent from your WordPress admin, and nothing is loaded until a Bot ID is saved.

* Terms of Service: [https://fiveminchat.com/terms.html](https://fiveminchat.com/terms.html)
* Privacy Policy: [https://fiveminchat.com/privacy-policy.html](https://fiveminchat.com/privacy-policy.html)

== Installation ==

1. In WordPress go to **Plugins > Add New**, search for "FiveMinChat", then click **Install Now** and **Activate**. Or upload the `fiveminchat` folder to `/wp-content/plugins/` and activate it on the Plugins screen.
2. Go to **Settings > FiveMinChat**, paste your Bot ID from the [FiveMinChat dashboard](https://app.fiveminchat.com), and click **Save Settings**.

== Frequently Asked Questions ==

= Where do I find my Bot ID? =

Log in to your FiveMinChat dashboard at [app.fiveminchat.com](https://app.fiveminchat.com) and open the **Settings** page. Your Bot ID looks like `xxxxxxxx-xxxx-4xxx-xxxx-xxxxxxxxxxxx`.

= The widget is not appearing on my site. What should I check? =

* You have saved a valid Bot ID in **Settings > FiveMinChat**. The status on that page tells you whether the widget is active.
* Your theme calls `wp_footer()`. Nearly all themes do, but some custom themes omit it.
* You are viewing a public page, not wp-admin - the widget is not loaded in the admin area.
* You have cleared your caching plugin (if any) after saving the Bot ID.

= Does this plugin slow down my site? =

No. The widget script is loaded in the footer with the `defer` attribute, so it downloads in the background and runs after the page has finished parsing.

= Can I show the widget only on specific pages? =

The current version shows the widget on all public pages. Per-page control is planned for a future release.

= Is a FiveMinChat account required? =

Yes. The plugin connects your site to a chatbot you create at [fiveminchat.com](https://fiveminchat.com). A free plan is available.

== Screenshots ==

1. The FiveMinChat chatbot answering a visitor on a live website.
2. The plugin settings page under Settings > FiveMinChat - paste your Bot ID and save.
3. The FiveMinChat dashboard, where you train the bot by crawling your website or uploading documents.

== Changelog ==

= 1.0.3 =
* Widget script is now loaded with wp_enqueue_script() (footer, defer strategy) instead of a raw script tag.
* Added a Settings link on the Plugins screen and a one-time onboarding notice after activation.
* Documented the external FiveMinChat service in the readme.
* Tested up to WordPress 7.1.

= 1.0.1 =
* Packaged under a fiveminchat/ folder so it always installs to wp-content/plugins/fiveminchat/.

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 1.0.3 =
Loads the widget the standard WordPress way and adds a Settings link. Recommended for all users.
