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

Add the BotMotion AI chatbot widget to your WordPress site by pasting your embed code.

== Description ==

BotMotion Widget lets you embed the [BotMotion](https://botmotion.ai/) AI-powered chatbot on your WordPress site. Simply paste your embed code from the BotMotion dashboard and the widget will appear on every page.

**Key Features:**

* Easy setup — just paste your embed code from the dashboard
* Works with all WordPress themes
* Works with all major caching plugins (WP Rocket, LiteSpeed Cache, Autoptimize, SG Optimizer, Perfmatters, W3 Total Cache, and more)
* Enable or disable the widget with a single toggle
* Lightweight — no additional JavaScript or CSS files bundled

**Third-Party Service**

This plugin loads the BotMotion chatbot widget from an external server:

* **Service:** BotMotion AI Chatbot
* **URL loaded:** `https://cdn.botmotion.ai/widget.js`
* **Data sent:** Your API key is included as a data attribute on the script tag so the widget can authenticate with the BotMotion service.
* **When:** The script is loaded on every frontend page when the widget is enabled and an API key is configured.
* **Terms of Service:** [https://botmotion.ai/terms](https://botmotion.ai/terms)
* **Privacy Policy:** [https://botmotion.ai/privacy](https://botmotion.ai/privacy)

== Installation ==

1. Upload the `botmotion-widget` folder to the `/wp-content/plugins/` directory, or install the plugin through the WordPress plugins screen.
2. Activate the plugin through the 'Plugins' screen in WordPress.
3. Go to **Settings > BotMotion Widget** and paste your embed code.
4. Save settings. The chatbot widget will now appear on your site.

== Frequently Asked Questions ==

= Where do I get my embed code? =

Log in to your [BotMotion dashboard](https://botmotion.ai/) and copy the embed code from your widget settings. It looks like: `<script src="https://cdn.botmotion.ai/widget.js" data-key="your-api-key"></script>`

= Does this plugin work with caching plugins? =

Yes. The plugin automatically registers exclusions for WP Rocket, LiteSpeed Cache, Autoptimize, SG Optimizer, Perfmatters, and other popular caching and optimization plugins. The widget script will always load correctly.

= Can I disable the widget temporarily? =

Yes. Go to **Settings > BotMotion Widget** and uncheck the "Enable Widget" option.

= Does the widget affect page speed? =

The widget script is lightweight and loads from the BotMotion CDN. It does not block page rendering.

== Screenshots ==

1. Settings page where you paste your embed code and enable the widget.

== Changelog ==

= 1.0.2 =
* Fixed: Store only API key instead of raw script tag.
* Fixed: Use WordPress enqueue system properly — no raw script output.
* Fixed: Contributors username corrected.

= 1.0.1 =
* Improved theme compatibility — widget script now loads in wp_head for 100% theme support.
* Added automatic cache flushing on activation, deactivation, settings change, and uninstall.
* Cache exclusion improvements for all major caching plugins.

= 1.0.0 =
* Initial release.
* Embed code configuration via Settings page.
* Automatic cache plugin compatibility.

== Upgrade Notice ==

= 1.0.2 =
Fixed enqueue compliance and contributor info.

= 1.0.1 =
Improved theme compatibility and cache handling.

= 1.0.0 =
Initial release.
