=== HBWA Website Chat Assistant ===
Contributors: hell0bunny
Donate link: https://profiles.wordpress.org/hell0bunny/
Tags: chatbot, ai, woocommerce, leads, appointments
Requires at least: 7.0
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Front-end chat trained on your pages and WooCommerce products, with leads, appointments, and analytics.

== Description ==

HBWA Website Chat Assistant adds a floating chat widget that answers questions from your WordPress content.

**Core features**

* Train on pages, posts, and WooCommerce products (when WooCommerce is active)
* Local knowledge replies out of the box (no AI provider required)
* Optional AI-powered answers via the WordPress AI Client using your trained content as context
* Lead capture from the chat widget
* Appointment booking with configurable hours, days, and durations
* Email notifications for leads and appointments (custom templates)
* Simple analytics dashboard (opens, messages, leads, bookings)

**External service (optional)**

This plugin does not store third-party AI API keys. If you configure an AI provider under **Settings → Connectors**, the plugin uses the WordPress AI Client to generate replies. Selected visitor messages and matching knowledge snippets may then be sent to the provider you connected. Without a configured provider, no chat data is sent to external AI services.

**Data stored on your site**

Chat sessions/messages, leads, appointments, and basic analytics events are stored in custom database tables on your WordPress install. Suggested privacy policy text is available under **Settings → Privacy**.

Author: [hell0bunny](https://profiles.wordpress.org/hell0bunny/)

== Installation ==

1. Upload the plugin folder to `/wp-content/plugins/hbwa-website-chat-assistant/`
2. Activate the plugin through the **Plugins** screen
3. Go to **Website Chat → Training** and click **Train now**
4. (Optional) Configure an AI provider under **Settings → Connectors** for AI replies
5. Configure appointments and emails under **Website Chat → Settings** and **Website Chat → Emails**

== Frequently Asked Questions ==

= Does it require an AI provider? =

No. Without a configured provider it answers from your trained knowledge base using keyword matching. With a provider connected in WordPress, natural language answers use that knowledge as context.

= What data is sent to an AI provider? =

Only when a provider is configured in Settings → Connectors: the visitor’s recent chat messages plus short excerpts from trained pages/products that match the question. Credentials stay in WordPress Connectors, not in this plugin.

= Does it require WooCommerce? =

No. Product training runs only when WooCommerce is active.

= Where are leads and appointments stored? =

In your WordPress database (`wp_hbwa_leads`, `wp_hbwa_appointments`, etc.). Delete the plugin via the Plugins screen to remove tables and settings (see uninstall).

= How do appointments block time slots? =

Pending and confirmed bookings remove that time from the chat selector. Cancelling (or completing) frees the slot again.

= Is this GDPR / privacy friendly? =

The plugin stores visitor-submitted data on your site and can optionally share chat context with your configured AI provider. Use the privacy policy suggestion under **Settings → Privacy**, and tell visitors how chat/leads/bookings work. Contact the site owner for access or deletion requests.

== Screenshots ==

1. Front-end chat widget on your website
2. Lead capture form in the chat widget
3. Appointment booking from the chat widget
4. Analytics dashboard with chat activity overview
5. Knowledge training screen for pages, posts, and products
6. Plugin settings — chat widget, AI, and appointments
7. Chat leads management in the admin
8. Appointments management in the admin

== Changelog ==

= 1.0.0 =
* Initial release: training, chat, leads, appointments, emails, analytics
* Optional AI replies via the WordPress AI Client (configure providers under Settings → Connectors; no plugin-stored API keys)
* Public REST hardening (nonce, rate limits, honeypot, feature flags)
* Privacy policy suggestion and uninstall cleanup

== Upgrade Notice ==

= 1.0.0 =
Initial release. Configure AI providers under Settings → Connectors. Requires WordPress 7.0+.
