=== Wizybot ===
Contributors: wizybot
Donate link: https://wizybot.com
Tags: woocommerce, chatbot, chat, sales, automation
Requires at least: 5.2
Tested up to: 7.1
Stable tag: 1.0.9
Requires PHP: 7.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

The AI CRM for Ecommerce that turns conversations into growth.

== Description ==

Wizybot is an AI chatbot and CRM that unifies every chat into a single smart inbox. It brings live chat, WhatsApp, Instagram, Facebook, email, and social media together into one unified CRM view of your customers, and lets AI Agents handle orders, refunds, FAQs, and recommendations in your brand's tone. Launch your chatbot in minutes and turn on CRM-powered WhatsApp marketing to boost repeat purchases and loyalty, all from one smart CRM inbox.

**Key Features:**

* **AI Chatbot and live chat:** resolves support in your brand's tone, 24/7
* **All-in-one CRM inbox:** brings together WhatsApp, email, chat, Instagram, and more
* **CRM-powered WhatsApp marketing:** automated flows to recover abandoned carts
* **AI chatbot recommendations:** turns every chat into a sale
* **Chat and DM automation:** AI responds to comments instantly

**Requirements:**

* WordPress 5.2 or higher
* PHP 7.2 or higher
* WooCommerce plugin (for full ecommerce features)
* Active Wizybot account or plan

By installing this plugin, you consent to share store information and customer interaction data with Wizybot. See the Privacy section below.

== Installation ==

1. Upload the wizybot folder to `/wp-content/plugins/` directory
2. Activate the plugin through the WordPress Plugins menu
3. Navigate to the Wizybot menu in WordPress admin
4. Complete setup by authenticating with your Wizybot account
5. Verify the chat widget appears on your store frontend

== Frequently Asked Questions ==

= Do I need a Wizybot account? =

Yes. You need an active Wizybot account (subscription or paid plan) to use this plugin. Visit [wizybot.com](https://wizybot.com) to create your account. Wizybot is a Software-as-a-Service (SaaS) platform that requires a valid subscription.

= Is this plugin free? =

The plugin code is free and open-source (GPL v2). However, accessing Wizybot's services requires an active paid subscription or plan with Wizybot Inc. You pay for access to the cloud service, not for the plugin code.

= What subscription plans are available? =

Visit [wizybot.com](https://wizybot.com) for current plan details, pricing, and features.

= Can I modify or redistribute the plugin? =

Yes, you can modify the plugin code under the GPL v2 license. However, the Wizybot cloud service itself is proprietary and subject to Wizybot's Terms of Service. You cannot:
- Modify, reverse engineer, or copy the Wizybot backend service
- Redistribute your Wizybot subscription to others
- Bypass subscription requirements

= Does it work without WooCommerce? =

The plugin loads on WordPress sites without WooCommerce, but ecommerce features (cart recovery, order attribution) require WooCommerce to be installed and active.

= What data does Wizybot collect? =

Wizybot collects customer interactions, cart data, and sales information to provide personalized engagement and track conversions. See our [Privacy Policy](https://app.wizybot.com/privacy) for details on how your data is handled.

= Do I need to modify my theme? =

No. The plugin integrates using native WordPress hooks and does not require theme modifications.

= Where do I get support? =

Visit [wizybot.com](https://wizybot.com) for technical support, billing questions, and commercial information about plans and features.

== Changelog ==

= 1.0.9 =
* Fixed the size of the chat and redirect launchers so they match the width and height configured in Wizybot.
* Fixed the outbound-message UI on the chat widget.

= 1.0.8 =
* Fixed a bug where logging in could return you to the login screen even with the correct password. The plugin now saves your Wizybot connection from your own admin session instead of relying on Wizybot's servers being able to reach your site, which some hosts and security plugins block.
* Fixed a bug where an incorrect password left the screen stuck on a loading spinner with no error message.
* Fixed a bug where the store name and email you typed during setup were ignored, and where a store name containing "&" broke the connection.
* Your WooCommerce connection status is no longer reset every time you log in.
* Setup now works on sites with permalinks set to "Plain".
* Your password and connection token are no longer sent in the page address.
* Added the missing Spanish, English and Portuguese translations for the setup and login screens.

= 1.0.7 =
* The storefront can now show extra widget launchers (WhatsApp, Instagram, and other redirects) alongside the chat button, using the buttons configured in Wizybot instead of a single live-chat launcher.

= 1.0.6 =
* The chat widget now shows icebreaker prompts (pre-written conversation starters) when they are configured, so customers can start a chat with one tap.

= 1.0.5 =
* Deactivating the plugin (which also happens automatically during every plugin update) no longer deletes the plugin's stored settings. Your store stays paired with Wizybot and your Terms acceptance is kept across updates. Settings are still fully removed when you delete the plugin from the Plugins screen.

= 1.0.4 =
* Customers can now add AI-suggested products straight to their real WooCommerce cart, or buy them now, directly from the chat widget.
* The chat widget's cart panel now reads and updates your live WooCommerce cart in real time (quantity changes, totals).
* Fixed a bug that hid the widget's cart icon on WooCommerce stores.
* Fixed a bug where a customer's own chat messages could briefly appear duplicated in the widget.
* The cart panel's "Pay" button now goes to your store's actual checkout page instead of a hardcoded `/cart` URL.

= 1.0.3 =
* Added a REST endpoint (`wizybot/v1/version`) so the Wizybot backend can detect the installed plugin version and unlock multi-product abandoned-cart recovery with cart/checkout redirect selection.
* Cart tracking cookie is now created lazily (on add-to-cart, or on demand via a new `wizybot/v1/cart-id` endpoint) instead of on every page view.
* Cart-recovery links can now redirect to the cart page or the checkout page, matching what the customer had before abandoning.
* Hardened the cart tracking cookie (HttpOnly, Secure) since it is never read from JavaScript.

= 1.0.2 =
* Fixed a bug where the plugin could redirect to the dashboard before the user accepted the terms and data-processing consent.
* The terms acceptance request now retries against the API backend if the site's own REST endpoint fails, improving reliability.
* Added an on-screen error message when the terms acceptance fails to save, so the user can retry.

= 1.0.1 =
* Maintenance release: verifies the dev and prod CI/CD pipelines (version validation, build, packaging and deployment) end to end. No functional changes.

= 1.0.0 =
* Custom chat widget images are now stored in the site's own WordPress Media Library and served from the site's own URL.
* Removed the external media storage host (Amazon S3) from the list of servers contacted by the plugin.
* The custom widget image is registered through the existing authenticated `wizybot/v1/setup` REST route and removed on uninstall.

= 0.0.1 =
* Initial plugin release
* WooCommerce integration
* Abandoned cart recovery functionality
* Customer tracking and order attribution
* Admin dashboard integration

== Upgrade Notice ==

= 1.0.9 =
Fixes chat and redirect launcher sizes and the outbound-message display in the widget.

= 1.0.8 =
Fixes a bug that could send you back to the login screen after entering the correct password. Recommended for every store.

= 1.0.7 =
Adds extra storefront launchers (WhatsApp, Instagram, and other redirects) alongside the chat widget.

= 1.0.6 =
Adds tap-to-start icebreaker prompts in the chat widget when they are configured for the store.

= 1.0.5 =
Fixes settings being wiped on deactivation/update; your store now stays paired with Wizybot across plugin updates.

= 1.0.4 =
Adds Add to Cart / Buy Now for AI-suggested products in the chat widget, live cart sync, and fixes the missing cart icon and duplicate-message bugs.

= 1.0.2 =
Fixes a terms-acceptance redirect bug and improves reliability of saving terms acceptance.

= 1.0.1 =
Maintenance release verifying the CI/CD pipelines. No functional changes.

= 1.0.0 =
Custom widget images are now served from your own WordPress Media Library; the plugin no longer contacts an external media storage host.

= 0.0.1 =
Initial release.

== Screenshots ==

1. Home dashboard: sales, time saved, AI-answered messages, and ticket volume at a glance.
2. Unified inbox: WhatsApp, Instagram, and other channels in one AI-managed chat view.
3. Metrics and records: delivery rates, sales attribution, and ROI for every campaign.
4. Visual automation builder: trigger-based flows like abandoned cart recovery.
5. Knowledge base: train the AI with store-specific answers and product recommendations.
6. Campaigns: send and track outreach to your customer segments.
7. Chat widget live on the storefront.

== Licensing ==

**Plugin Code:** GPL v2 or later
- You can modify, use, and redistribute the plugin code under GPL v2 terms
- Source code is open and freely available

**Wizybot Service:** Proprietary Software-as-a-Service (SaaS)
- The Wizybot platform itself is proprietary and closed-source
- Wizybot service is subject to Wizybot's Terms of Service and Privacy Policy
- You require an active paid subscription to access Wizybot services
- You cannot modify, reproduce, or redistribute the Wizybot subscription service
- You cannot bypass or circumvent subscription requirements

**What This Means:**
- This WordPress plugin is free and open-source
- Using Wizybot's cloud platform requires a paid subscription
- You pay for access to cloud services, not for software licenses
- The plugin integrates your WordPress site with Wizybot's proprietary platform

== Third-Party Service ==

This plugin integrates with **Wizybot**, a third-party Software-as-a-Service (SaaS) platform.

**Service Details:**
- **Provider:** Wizybot Inc
- **Service URL:** https://wizybot.com
- **API Communication:** Plugin communicates with Wizybot servers for:
  - Chat widget functionality
  - Customer engagement tracking
  - Cart recovery services
  - WhatsApp/SMS messaging
  - Analytics and reporting

**Servers contacted by this plugin:**
- `https://api.wizybot.com` — Wizybot's own backend API. Used to link the store to the merchant's Wizybot account and to power the chat widget (conversations, widget configuration). Contacted only after the administrator explicitly accepts the Terms & Privacy Policy on the plugin dashboard, and by the chat widget on the storefront as part of the service.
- `https://fonts.googleapis.com` / `https://fonts.gstatic.com` — Google Fonts (font families used by the chat widget), loaded from Google's approved CDN.

If the merchant personalizes the chat widget with a custom image, that image is stored in this site's own WordPress Media Library and served from this site's own URL. No external media storage is contacted for it.

**Subscription Required:**
- Active paid subscription with Wizybot is required
- Subscription terms and pricing at [wizybot.com/pricing](https://wizybot.com/pricing)
- Different plans available with varying features

**Data Sharing:**
By installing and activating this plugin, you consent to share:
- Store domain and basic shop information
- Customer interactions and conversations
- Shopping cart data
- Customer contact information
- Order information for attribution

**Privacy Policy:**
- Wizybot Privacy Policy: [https://app.wizybot.com/privacy](https://app.wizybot.com/privacy)
- Review these documents before using this plugin

== Support & Billing ==

For support, billing, feature requests, or account management:
- Visit [wizybot.com](https://wizybot.com)
- Email: support@wizybot.com

For WordPress plugin technical issues:
- Check installation instructions above
- Review FAQ section
- Contact Wizybot support for platform-related issues

== Included source code (source/) ==

The compiled assets shipped in `assets/` (`main.js`, `dashboard.js`, `main.css`, `dashboard.css`) are built from the `source/` directory, which is included inside this plugin and contains all the original, human-readable frontend widget source code (React + TypeScript) together with the build configuration needed to reproduce those assets. The `source/` directory is not loaded or executed at runtime; WordPress only ever loads the compiled files in `assets/`. It is bundled solely to satisfy the human-readable source requirement, so the shipped bundles can be independently reviewed and reproduced. Build instructions are provided below.

**Main structure:**

- `package.json`: development/build dependencies and scripts.
- `webpack.wordpress.config.js`: webpack configuration to build the WordPress bundles.
- `public/`: CSS files copied to the plugin during the build:
  - `ShopifyWidgetInner.css`
  - `ShopifyWidgetOutter.css`
- `src/components/`: React/TypeScript components that implement the widget and UI.
- `src/wordpress/`: WordPress-specific entries and assets:
  - `widget/indexWidget.wordpress.tsx`
  - `dashboard/indexDashboard.wordpress.tsx`
  - `index.wordpress.css`

**How to build the WordPress assets (widget + dashboard):**

1. Install dependencies:
   - `cd source`
   - `npm install`
2. Create a Babel config file:
  - .babelrc
  - with the contents:
  {
    "presets": [
      "@babel/preset-env",
      "@babel/preset-react",
      "@babel/preset-typescript"
    ]
  }
3. Build in production mode:
   - `npm run widget-wordpress`

The `widget-wordpress` script runs:

`webpack --config webpack.wordpress.config.js --mode production`

**Build output:**

- Generated files are written to `assets/` in the plugin root.
- `main.js`, `dashboard.js`, `main.css`, `dashboard.css` are created.
- Images and static CSS defined in `webpack.wordpress.config.js` are copied.

**Development (watch):**

- `npm run widget-wordpress:watch` rebuilds automatically in development mode.

This source code represents the frontend widget implementation that integrates with the plugin to display the chat interface and functionality in stores.