=== Leader24 - AI Assistant ===
Contributors: leader24
Tags: ai, chatbot, woocommerce, assistant, customer service
Requires at least: 6.6
Tested up to: 6.9
Requires PHP: 7.4
Stable tag: 2.1.21
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Integrate an AI assistant into your WordPress site with WooCommerce support.

== Description ==

Leader24 is a plugin that integrates an intelligent AI assistant into your WordPress site. With native WooCommerce support, your assistant can automatically manage orders, products, and customers.

= Key Features =

* **Chat Widget** - An elegant chat widget that integrates seamlessly with your site
* **WooCommerce Integration** - Complete management of orders, products, and customers
* **Easy Setup** - Get started in just a few minutes
* **Customizable** - Choose widget position and behavior

= WooCommerce Features =

When you connect WooCommerce, your AI assistant can:

* View orders and shipping status
* Search products and check availability
* Look up customer information
* Update order status
* Provide sales statistics

= How It Works =

1. Create a free account on [leader24.ai](https://leader24.ai)
2. Configure your AI agent from the dashboard
3. Install this plugin and enter your Agent ID
4. Optional: Connect WooCommerce for e-commerce features

= Requirements =

* WordPress 5.8 or higher
* PHP 7.4 or higher
* Leader24 account (free)
* WooCommerce 6.0+ (optional, for e-commerce features)

= Privacy and Security =

* All communications are protected via HTTPS
* WooCommerce credentials are encrypted
* No personal data is stored without consent
* GDPR compliant

= External Service =

This plugin connects to Leader24 servers (leader24.ai) to provide AI assistant functionality. When you activate the plugin and configure the Agent ID:

* The chat widget is loaded from api.leader24.ai
* User conversations are processed by Leader24 servers
* WooCommerce data (if connected) is sent to Leader24 to respond to requests

By using this plugin you agree to the Leader24 Terms of Service and Privacy Policy:
* Terms of Service: https://leader24.ai/terms
* Privacy Policy: https://leader24.ai/privacy

== Installation ==

= Automatic Installation =

1. Go to Plugins > Add New in your WordPress dashboard
2. Search for "Leader24"
3. Click "Install Now" and then "Activate"

= Manual Installation =

1. Download the plugin ZIP file
2. Go to Plugins > Add New > Upload Plugin
3. Select the ZIP file and click "Install Now"
4. Activate the plugin

= Configuration =

1. Go to Leader24 in the sidebar menu
2. Enter your Agent ID (find it at dash.leader24.ai)
3. Save settings
4. Optional: Go to the WooCommerce tab and click "Connect WooCommerce"

== Frequently Asked Questions ==

= Do I need a Leader24 account? =

Yes, you need a Leader24 account to use this plugin. You can sign up for free.

= Does the plugin slow down my site? =

No, the widget is loaded asynchronously and does not impact site performance.

= Can I customize the chatbot appearance? =

Yes, from the Leader24 dashboard you can customize colors, messages, and behavior of your assistant.

= Does it work with other e-commerce plugins? =

Currently we only support WooCommerce. We are working on adding other plugins in the future.

= Is my customer data secure? =

Yes, we use secure HTTPS connections and credentials are encrypted.

== Screenshots ==

1. Main configuration panel
2. WooCommerce integration
3. Chat widget on the frontend

== Changelog ==

= 2.1.21 =
* UI: the "Email sent" confirmation page now offers a generic "Back" button (reuses the existing onboardingBack translation) instead of the more specific "Change email" label introduced in 2.1.20.

= 2.1.20 =
* UI: added "Change email" back button on the "Email sent" confirmation page so the merchant can return to the email-input view if they typed the wrong address. Previously they had no way to go back without closing and reopening the app. Translated to all 5 supported languages (it/en/es/fr/de).

= 2.1.19 =
* UI: language selector now visible on all pre-login pages (Create Account, Email not linked, Agent list) so the merchant can switch language even before signing in. Previously the picker was only available in the post-login sidebar. The selector reuses the existing LangContext so the choice persists across views and is reactive without page reload.

= 2.1.18 =
* i18n: setup-create and verify-email requests now include the WordPress site locale, so welcome and verification emails arrive in the user's language (5 supported: it, en, es, fr, de). No PHP changes required — uses the existing window.leader24Config.locale exposed via wp_localize_script.

= 2.1.17 =
* Security: REST signature verification now requires the per-site api_secret. The legacy fallback to the public agent_id is removed. Sites still on the old setup must save the agent ID once in Leader24 settings to trigger a fresh handshake and receive the api_secret.

= 2.1.16 =
* Improvement: MB counter in the documents step now updates instantly on upload and delete (optimistic local update, backend re-sync in background) — same UX as the scanned-pages counter

= 2.1.15 =
* Fix: after verifying a different email, refreshing the original WordPress tab now shows the verified account (wizard or agents) instead of the old admin-email match
* Fix: the "Back to your agents" button on the email-sent screen now re-fetches the account state, so it reflects the verified account if verification happened in another tab

= 2.1.14 =
* Fix: email verification flow now shows the verified email (not the WordPress admin email) in the agent selection header
* Fix: verifying an email whose Leader24 account is still in onboarding now enters the wizard directly instead of showing an empty agent list
* Fix: verification link now includes the setup token so it works when opened in a new browser tab (Gmail default)

= 2.1.13 =
* Fix: session expired and setup error screens also scroll correctly when content is extended in future updates (consistency with other setup screens)

= 2.1.12 =
* Fix: agent selection and email verification screens now scroll correctly when the list of agents exceeds the viewport (pre-onboarding flow)

= 2.1.11 =
* Fix: sidebar language selector and wizard bottom nav now share the exact same height so their top borders align pixel-perfect

= 2.1.10 =
* Fix: admin dashboard no longer exposes any WP background below the bottom nav, even when the user scrolls manually with wheel/trackpad

= 2.1.9 =
* Fix: chat auto-scroll no longer scrolls the whole WordPress admin page; only the messages container scrolls

= 2.1.8 =
* Fix: restored fixed-height container for the admin dashboard so long lists and chat scroll internally instead of pushing the bottom nav off-screen
* The grey strip fix from 2.1.7 (background override on WP admin wrappers) is preserved

= 2.1.7 =
* Fix: removed grey strip that could appear below the admin dashboard when the React app didn't perfectly cover the viewport

= 2.1.6 =
* Security: HMAC signature now uses a per-site shared secret instead of the public agent_id (prevents unauthorized access to WooCommerce data if agent_id leaks)
* Fix: email verification is now actually delivered (previously the link was only logged server-side)
* Compatibility: plugin now requires WordPress 6.6+ (needed for react-jsx-runtime script handle used by the admin dashboard)
* Improvement: customer-name search in orders now works on both HPOS and legacy stores
* Fix: document upload UI no longer shows phantom 9999 MB limit when billing data fails to load
* Fix: generic 403 errors no longer trigger the "limit exceeded" dialog

= 2.1.5 =
* Fix: Step 2 website URL no longer duplicates protocol (https://http://...)
* Fix: plugin uninstall now correctly cleans up connection in backend DB
* Fix: chat no longer returns 401 after 15 minutes (embed token auto-refresh)
* Fix: chat scrolls internally instead of scrolling the entire WordPress page
* Fix: Step 4 bot icon color updated to brand blue (was green)
* Improvement: backend disconnect endpoint now accepts partial payloads for robust uninstall

= 2.1.0 =
* Fix: reinstall flow — always re-check admin email instead of reusing stale connection
* Connection created only after setup completes (not during embed-token)
* Plugin uninstall cleanup — removes connection from backend
* setup-info uses fresh admin email from PHP (not stale DB value)

= 2.0.2 =
* Fix: checkmark icon green background → blue (brand consistency)
* Fix: sidebar cut off on left + grey space above/below (CSS layout)
* Fix: auto-detect language from WordPress locale (fallback: browser → English)
* Fix: all components use 100% height instead of 100vh (proper WP admin fit)

= 2.0.1 =
* Fix: process is not defined error in browser (webpack polyfill)
* Fix: Stripe key passed via PHP config instead of process.env

= 2.0.0 =
* New React SPA admin dashboard (identical to Shopify experience)
* Full onboarding wizard (5 steps: agent setup, website scraping, documents, test chat, payment)
* Dashboard with conversation stats and recent activity
* Conversations view with full transcript and lead data
* Widget settings (colors, theme, position, avatar, suggested questions)
* WordPress section (site info, WooCommerce status)
* 5 languages: Italian, English, Spanish, French, German
* Mobile responsive with hamburger menu

= 1.2.0 =
* Prepared for WordPress.org submission
* Security and sanitization improvements
* Added WooCommerce HPOS compatibility
* Performance optimizations

= 1.1.0 =
* Added REST proxy endpoint for WooCommerce
* Bypass hosting anti-bot protections
* Full support for orders, products, customers management
* Store statistics

= 1.0.0 =
* Initial release
* Integrated chat widget
* Agent ID configuration
* Basic WooCommerce integration

== Upgrade Notice ==

= 1.2.0 =
Recommended update with security improvements and compatibility fixes.
