=== FiveMinChat — AI Chatbot Widget ===
Contributors:      vibgyortechsolutions
Tags:              chatbot, ai chatbot, chatgpt, ai assistant, live chat, customer support, helpdesk, chat widget, chat popup, chat box, knowledge base, faq bot, website bot
Requires at least: 5.8
Tested up to:      6.5
Stable tag:        1.0.0
Requires PHP:      7.4
License:           GPL-2.0-or-later
License URI:       https://www.gnu.org/licenses/gpl-2.0.html

Embed the FiveMinChat AI chatbot widget on your WordPress site in under five minutes — no coding required.

== Description ==

**FiveMinChat** lets you add a fully-featured AI chatbot to any WordPress site by entering a single Bot ID. That's it.

Once activated and configured, the plugin automatically injects the FiveMinChat widget script into every page's footer, 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 **WP Admin → Settings → FiveMinChat**.
4. Save — the widget is live on your site instantly.

**Features:**

* Zero-configuration embed — one field, one save, done.
* Works on every page and post automatically.
* Lightweight: adds a single deferred `<script>` tag with no extra assets.
* No coding, no shortcodes, no blocks required.
* Secure: Bot ID is validated as UUID v4 before saving and before output. The widget CDN URL is hardcoded and never user-controlled.
* Fully compliant with WordPress coding standards and the WordPress Plugin Review guidelines.

**Security highlights:**

* All form submissions are protected by WordPress nonces (CSRF protection).
* Bot ID input is validated against a strict UUID v4 regex — invalid values are rejected with a clear error message.
* All output is properly escaped (`esc_attr`, `esc_url`) before being written to the page.
* The widget `<script>` src is hardcoded to `https://cdn.fiveminchat.com/widget.js` — users cannot inject arbitrary URLs.
* Requires the `manage_options` capability to access or change settings.

== Installation ==

1. **Upload the plugin.**
   Upload the `fiveminchat` folder to the `/wp-content/plugins/` directory on your server, or install the plugin directly through the WordPress Plugins admin screen by searching for "FiveMinChat".

2. **Activate the plugin.**
   Navigate to **WP Admin → Plugins** and click **Activate** next to "FiveMinChat — AI Chatbot Widget".

3. **Enter your Bot ID.**
   Go to **WP Admin → Settings → FiveMinChat**, paste your Bot ID from the [FiveMinChat dashboard](https://fiveminchat.com), and click **Save Settings**. The widget will appear on your site immediately.

== Frequently Asked Questions ==

= Where do I find my Bot ID? =

Log in to your FiveMinChat account at [fiveminchat.com](https://fiveminchat.com). Open the dashboard, select your chatbot, and go to its **Settings** page. Your Bot ID is displayed there — it looks like `xxxxxxxx-xxxx-4xxx-xxxx-xxxxxxxxxxxx`.

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

Make sure:

* You have saved a valid Bot ID in **WP Admin → Settings → FiveMinChat**. The status indicator on that page will tell you whether the widget is active.
* Your WordPress theme calls `wp_footer()` inside the `</body>` tag. Nearly all modern themes do this, but older or custom themes occasionally omit it.
* You are not viewing a wp-admin page — the widget is intentionally suppressed in the WordPress admin area.
* Your caching plugin (if any) has been flushed after saving the Bot ID.

= Does this plugin slow down my site? =

No. The widget script is loaded with the `defer` attribute, which means it is downloaded in the background and executed after the page has finished parsing. It will not block rendering or affect your page load time.

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

The current version injects the widget on all public-facing pages. Per-page control (via shortcode or block) is planned for a future release. In the meantime, your FiveMinChat dashboard may offer display rules you can configure on the bot itself.

= Is my Bot ID stored securely? =

Yes. The Bot ID is stored in the WordPress options table using the standard `update_option()` API. It is validated as a UUID v4 before saving and again before output, so only well-formed values ever reach the page.

== Changelog ==

= 1.0.0 =
* Initial release.
* Settings page under WP Admin → Settings → FiveMinChat.
* Bot ID field with UUID v4 validation and nonce-protected form.
* Automatic widget injection into `wp_footer` (priority 99) on all public pages.
* Admin notice feedback when an invalid Bot ID is submitted.
* Status indicator on the settings page showing whether the widget is active.
* Clean uninstall: removes stored option when the plugin is deleted.
