=== BroodChat AI — AI Chatbot & Chat Widget ===
Contributors: digibrood
Tags: chatbot, ai chatbot, openai, chatgpt, chat widget
Requires at least: 5.8
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 2.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Add an AI chat widget to WordPress with your own OpenAI or Anthropic key — no per-message fees. Answers from your business info, greets visitors 24/7.

== Description ==

BroodChat AI adds a friendly AI chat widget to your WordPress site. It uses **your own** OpenAI or Anthropic API key, so there are no per-message fees charged by us — you pay your AI provider directly at cost.

Tell the assistant about your business once, and it answers visitor questions around the clock in a clean, mobile-friendly chat bubble.

= Free features =

* AI chat widget powered by your own OpenAI or Anthropic API key (bring your own key).
* Choose your provider and model (for example `gpt-4o-mini` or a Claude model).
* Give the bot a name, a persona/system prompt, and business information it can answer from.
* Custom greeting message and up to four suggested questions to get visitors started.
* Appearance controls: accent colour, left/right position, and custom launcher text.
* Live, interactive preview right inside the WordPress dashboard.
* Per-visitor daily message limit to protect your AI spend, plus honeypot spam protection.
* Conversations stored in your own site database, with automatic cleanup after a retention period you choose.
* API key encrypted at rest in the database.
* One-click "Test connection" button to confirm your key works.
* Automatic cache purging for popular caching plugins when you save settings.

The plugin is fully functional on its own, with no message cap. You pay only your AI provider, at cost.

= BroodChat AI Pro (optional) =

An optional paid upgrade, [BroodChat AI Pro](https://digibrood.com/broodchat-ai/), adds:

* Lead capture — collect name, email and phone from chats.
* A knowledge base the assistant can draw answers from.
* Page, device and visitor targeting to control where the widget appears.
* The option to remove the "Powered by" footer.

The Pro upgrade is a separate add-on and is **not** required to use the free plugin.

== External services ==

This plugin is an interface to a third-party AI service that **you** choose and connect with your own API key. It does not work until you add a key.

Depending on the provider you select in the settings, the plugin connects to **one** of the following services to generate chat replies:

**OpenAI**

* What it is used for: generating the assistant's replies when "OpenAI" is the selected provider.
* Data sent, and when: each time a visitor sends a chat message (and once when you click "Test connection"), the plugin sends that message, the recent messages in that conversation, and the persona and business information you configured, to the OpenAI Chat Completions API (`https://api.openai.com`). Your OpenAI API key is sent to authenticate the request.
* OpenAI Terms of Use: https://openai.com/policies/terms-of-use
* OpenAI Privacy Policy: https://openai.com/policies/privacy-policy

**Anthropic**

* What it is used for: generating the assistant's replies when "Anthropic" is the selected provider.
* Data sent, and when: each time a visitor sends a chat message (and once when you click "Test connection"), the plugin sends that message, the recent messages in that conversation, and the persona and business information you configured, to the Anthropic Messages API (`https://api.anthropic.com`). Your Anthropic API key is sent to authenticate the request.
* Anthropic Terms of Service: https://www.anthropic.com/legal/commercial-terms
* Anthropic Privacy Policy: https://www.anthropic.com/legal/privacy

No chat data is sent to DIGIBROOD or to any server other than the AI provider you select. Please make sure your site's privacy policy tells visitors that their chat messages are processed by your chosen AI provider.

== Installation ==

1. Upload the `broodchat-ai` folder to `/wp-content/plugins/`, or install the plugin through the **Plugins > Add New** screen in WordPress.
2. Activate the plugin through the **Plugins** screen.
3. Go to the new **BroodChat AI** menu in your dashboard.
4. On the **AI & Key** tab, choose your provider (OpenAI or Anthropic), paste your API key, and click **Test connection**.
5. Set your bot name, greeting and business information, adjust the appearance, then switch the widget on. It will appear on the front end of your site.

== Frequently Asked Questions ==

= Do I need an API key? =

Yes. BroodChat AI uses your own OpenAI or Anthropic API key. You can create one in your OpenAI or Anthropic account. The plugin will not respond to visitors until a valid key is saved.

= Is the plugin really free? =

Yes — the plugin is free and fully functional, with no message cap. You pay only your AI provider directly for the API usage. For extra features like lead capture, a knowledge base and page targeting, an optional paid Pro add-on is available.

= Where is my API key stored? =

Your key is stored in your own site's database and is encrypted at rest. It is only decrypted on your server when a request is sent to your chosen AI provider. It is never exposed to visitors or added to the front-end page.

= What data leaves my site? =

When a visitor chats, their message plus the recent conversation and your configured business information are sent to the AI provider you selected (OpenAI or Anthropic) to generate a reply. See the "External services" section above for details and links to each provider's terms and privacy policy.

= Does it slow down my site? =

The widget script and styles load only on the front end when a valid API key is set and the widget is enabled. Requests to the AI provider happen only when a visitor actually sends a message.

= Can I control costs? =

Yes. There is a per-visitor daily message limit you can set, plus honeypot spam protection, to help protect your AI spend.

== Screenshots ==

1. The chat widget on the front end of a site.
2. The AI & Key settings tab with the "Test connection" button.
3. Persona and business information settings.
4. Appearance settings with the live preview.

== Changelog ==

= 2.0.0 =
* Initial public release: AI chat widget with OpenAI and Anthropic support, persona and business info, appearance controls, per-visitor rate limiting, encrypted key storage, and an in-dashboard live preview.

== Upgrade Notice ==

= 2.0.0 =
Initial public release of BroodChat AI.
