=== Humassistant ===
Contributors: humassistant
Tags: chatbot, AI assistant, customer support, live chat, WhatsApp
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 2.0.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Integrate Humassistant AI chatbots into your WordPress site with automatic content synchronization and multiple embedding options.

== Description ==

Humassistant allows you to seamlessly integrate the [Humassistant](https://humassistant.com/en/) AI assistant into your WordPress website. Humassistant is a unified inbox for [WhatsApp, email, phone, web chat and social channels](https://humassistant.com/en/channels/), with an AI that answers in your voice when you decide to turn it on. The plugin provides:

* **Automatic Content Synchronization** - Sync posts, pages, custom post types, and WooCommerce products to your chatbot's knowledge base
* **Multiple Integration Methods** - 5 different ways to add the chatbot to your site
* **User Data Mapping** - Pass logged-in user data to the chatbot for personalized conversations
* **Elementor Support** - Extract content from Elementor pages for better synchronization
* **WooCommerce Integration** - Full support for product synchronization including attributes and variations

= Chat Widget Integration (5 Methods) =

1. **Auto-inject Footer** - Automatically adds the chat widget to your site footer
2. **Shortcodes** - Use `[humassistant]` to embed chat anywhere
3. **Elementor Widgets** - Drag-and-drop widgets for Elementor page builder
4. **Gutenberg Blocks** - Native blocks for the WordPress block editor
5. **WordPress Widget** - Add to sidebars and footer areas via Appearance > Widgets

= Display Modes =

* **Floating Widget** - Fixed button that opens a chat popup
* **Inline Chat** - Embedded chat interface in your content
* **Search Bar** - Compact search-style interface
* **Fullscreen** - Full-page chat experience

= Content Synchronization =

The plugin automatically syncs your WordPress content to Humassistant:

* Posts and Pages
* Custom Post Types
* WooCommerce Products (with pricing, attributes, categories)
* Elementor page content extraction
* Custom field mapping
* Automatic deletion cleanup

= Third-Party Service: Humassistant =

This plugin connects to the **Humassistant** external service ([humassistant.com](https://humassistant.com/)) to provide AI chatbot functionality. The connection is required for the plugin to function, as the chatbot engine runs on Humassistant's servers.

**What data is sent to Humassistant:**

* **API authentication** - Your API key is sent to `app.humassistant.com` to authenticate and obtain an access token
* **Content synchronization** - Post titles, content, metadata, and taxonomy terms are sent to `app.humassistant.com` to build the chatbot's knowledge base
* **Widget loading** - The chat widget JavaScript is loaded from `widget.humassistant.com` to render the chatbot on your site. This is the core SaaS widget, dynamically generated per chatbot configuration (similar to services like Intercom, HubSpot, or Zendesk Chat)
* **User data (optional)** - When explicitly enabled by the site administrator, basic logged-in user information (name, email) may be transmitted to personalize conversations. This is disabled by default and requires opt-in

**Service links:**

* [Humassistant Website](https://humassistant.com/en/)
* [Product overview: unified inbox and AI assistant](https://humassistant.com/en/product/)
* [Supported channels: WhatsApp, email, phone, chat and social](https://humassistant.com/en/channels/)
* [Pricing and plans](https://humassistant.com/en/pricing/)
* [Use cases: online shops, B2B and local businesses](https://humassistant.com/en/use-cases/)
* [Guide: how WhatsApp Business works](https://humassistant.com/en/blog/how-whatsapp-business-works/)
* [Terms and Conditions](https://humassistant.com/en/legal/terms-and-conditions/)
* [Privacy Policy](https://humassistant.com/en/legal/privacy-policy/)

All data transmission uses secure HTTPS connections with JWT Bearer token authentication.

== Installation ==

= From WordPress Admin =

1. Download the plugin zip file
2. Go to **Plugins > Add New** in your WordPress admin
3. Click **Upload Plugin** and choose the zip file
4. Click **Install Now** and then **Activate**

= Manual Installation =

1. Upload the `humassistant` folder to `/wp-content/plugins/`
2. Activate the plugin through the **Plugins** menu in WordPress

= Configuration =

1. Go to **Humassistant** in your WordPress admin menu
2. Enter your **API Key** (get it from [app.humassistant.com](https://app.humassistant.com))
3. Select your **Organization** and **Chatbot** from the dropdowns
4. Choose a **Widget** to embed on your site
5. Enable **Content Synchronization** and select post types to sync

== Frequently Asked Questions ==

= How do I get an API key? =

1. Sign up at [app.humassistant.com](https://app.humassistant.com) (the unified inbox is free, see [pricing](https://humassistant.com/en/pricing/) for the AI plans)
2. Go to **Settings > API Keys**
3. Create a new API key with WordPress integration scope
4. Copy the key and paste it in the plugin settings

= Can I use multiple chatbots? =

The plugin supports one chatbot per WordPress site. However, you can use shortcodes and blocks with custom parameters to create different chat experiences.

= Does this work with page builders? =

Yes! The plugin provides native integrations for:

* **Elementor** - Custom widgets with full content extraction
* **Gutenberg** - Native blocks
* **Classic Editor** - Via shortcodes and widgets

= How does content synchronization work? =

The plugin extracts content from your posts and pages and sends it to Humassistant's API. For Elementor pages, it intelligently extracts text from widgets. For WooCommerce products, it includes pricing, descriptions, and attributes.

= Can I customize the chatbot appearance? =

Yes, all widget configuration (colors, position, avatar, voice, language) is managed from your Humassistant dashboard at [app.humassistant.com](https://app.humassistant.com).

= Is user data secure? =

User data sharing is optional and disabled by default. When enabled, it only shares basic information (name, email) for logged-in users to personalize conversations. All data transmission uses secure HTTPS connections with JWT authentication.

= What about performance? =

The plugin uses aggressive caching for API tokens (24 hours) and supports WordPress object cache for better performance. The widget script is loaded asynchronously and does not block page rendering.

== Screenshots ==

1. Setup page - Connect your Humassistant account
2. Widget configuration - Select and configure your chatbot widget
3. Content synchronization - Select post types to sync
4. Integrations - WooCommerce and Elementor Pro settings

== Changelog ==

= 2.0.4 =
* Add independent WooCommerce checkout fields and separate email, WhatsApp and email measurement consents
* Support classic and block checkout, preserve captured evidence and existing remote revocations
* Add phone country and preferred language mappings; retain existing custom field configurations
* Fix historical synchronization of refund records and retry missing order events
* Recover explicitly imported email consents and verify persistence before reporting success
* Show detailed HTTP/API errors and preserve progress when synchronization stops
* Add explicit website linking while keeping widget settings independent of connection errors
* Consolidate customer updates and field loading; remove unused widget identity capture

= 2.0.3 =
* Updated widget CDN domain from cdn.humassistant.com to widget.humassistant.com

= 2.0.2 =
* Updated API endpoint URL to use the new app.humassistant.com domain
* Updated documentation to reflect the new API endpoint URL

= 2.0.1 =
* Added Spanish (es_ES) translation
* Added Italian (it_IT) translation

= 2.0.0 =
* Simplified widget embedding using widgetUuid approach
* All widget configuration managed from Humassistant dashboard
* Added WooCommerce customer sync on order completion
* Added WooCommerce custom checkout fields
* Added Elementor Pro form action integration
* Added per-chatbot content synchronization
* Added bulk include/exclude for content sync
* Improved API error handling with automatic token refresh
* Added developer hooks and filters

= 1.0.0 =
* Initial release
* Chat widget integration with 5 embedding methods
* Automatic content synchronization
* Elementor widgets
* Gutenberg blocks
* WordPress native widget
* User data mapping
* WooCommerce product sync

== Upgrade Notice ==

= 2.0.4 =
Adds independent checkout fields and consent handling. Existing settings are retained. Historical imports do not infer consent; explicitly prepared recovery records are verified through the API. Rerun pending recovery without reimporting SQL.

= 2.0.3 =
This version updates the widget loading domain to ensure continued chatbot functionality.

= 2.0.2 =
This update ensures compatibility with Humassistant's new API endpoint infrastructure.

= 2.0.1 =
This version adds Spanish and Italian language support for international users.

= 2.0.0 =
Major update: widget configuration is now managed from the Humassistant dashboard. After upgrading, go to Humassistant settings and select your widget.
