=== Yozo AI Marketing Agent ===
Contributors: cortechsai
Tags: chatbot, ai chatbot, chat widget, popup, engagement
Requires at least: 6.4
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.1.5
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Show the Yozo AI chat, popups and bars on your site and capture contacts for your email, SMS and WhatsApp campaigns. Requires a Yozo account.

== Description ==

Yozo AI Marketing Agent is the official WordPress connector for
[Yozo](https://yozo.ai), a hosted (SaaS) marketing platform for online stores.
Yozo brings email, SMS and WhatsApp campaigns, automated flows and an AI chat
assistant together in one place, so you can capture a visitor on your site and
follow up on whichever channel they prefer.

This plugin is the on-site half of that. It shows your Yozo widgets to your
visitors: the AI chat assistant, welcome popups (email/SMS capture,
spin-the-wheel, scratch card) and announcement bars. Contacts those popups
collect become part of your Yozo audience, which is what your campaigns and
flows send to. The campaigns themselves are built and sent from your Yozo
dashboard, not from WordPress.

The plugin contains no widget code of its own: once activated it loads the Yozo
widget script on every front-end page, and everything your visitors see is
rendered and controlled by Yozo's servers, so it can change without a plugin
update.

**A Yozo account is required.** Sign up at https://yozo.ai, connect your site's
domain in your Yozo dashboard (Integrations), and then activate this plugin.
The widget identifies your site by its domain, so there is no key or ID to
paste into WordPress. Yozo offers a free plan and paid subscriptions; depending
on your plan, Yozo may limit or pause features such as the AI chat on its side,
without any change to this plugin. All of the plugin's code is included;
nothing in it is locked, time-limited or unlocked by payment. Without a
connected Yozo account the widget shows nothing.

The plugin adds one page, Yozo AI, where you connect your store. It keeps its
connection details in your database and removes them when you delete the
plugin. "Widget" here means a floating on-page widget; the plugin does not add
a sidebar or block widget. Product-review widgets and cart tracking are
currently Shopify-only and are not active on WordPress.

If your site enforces a Content Security Policy (CSP), allow:
script-src https://agents.yozo.ai; connect-src https://agent.yozo.ai
https://*.firebaseio.com wss://*.firebaseio.com https://api.country.is
https://get.geojs.io; style-src and font-src https://fonts.googleapis.com
https://fonts.gstatic.com; img-src https://flagcdn.com.

== External Services ==

This plugin relies on Yozo, a third-party service operated by Yozo
(https://yozo.ai), and does nothing without it. Please read this section before
activating: it explains which servers your visitors' browsers will contact, what
data is sent, and when.

**When:** As soon as the plugin is active, on every front-end page view, for
every visitor, before any interaction and without any prompt or opt-in shown to
the visitor. Nothing is loaded in the WordPress admin.

**What is loaded:** The widget script
`https://agents.yozo.ai/widgets/yozo-widgets.js` is requested from the
visitor's browser on every front-end page. The script is maintained and updated
by Yozo.

**Servers contacted by the visitor's browser, and why:**

* `agents.yozo.ai` - serves the widget script.
* `agent.yozo.ai` - Yozo's API. The widget fetches your widget configuration on
  every page load (and re-checks it about once a minute while the page is
  open), reports widget impressions, and sends chat messages and form
  submissions.
* `*.firebaseio.com` (Google Firebase) - real-time delivery of chat messages. A
  connection is opened on page load whenever the chat is enabled in your Yozo
  account.
* `api.country.is` - a third-party IP-geolocation lookup used to pre-select the
  phone country code in popups. It is called on page load whenever a welcome
  popup is configured in your Yozo account.
* `get.geojs.io` - a second IP-geolocation lookup, called only when the AI chat
  shows a lead form with a phone field.
* `fonts.googleapis.com` and `fonts.gstatic.com` (Google Fonts) - loaded when a
  custom font is set in your Yozo brand settings.
* `flagcdn.com` - country-flag images shown next to phone-number fields.

Every server listed receives the visitor's IP address and browser details
(user agent) as part of the request.

**Data sent to Yozo:**

* On every page load: a random visitor identifier and session identifier
  generated by the widget (see Browser storage), your site's domain, and the
  visitor's IP address and user agent. When a popup, bar or bubble is shown,
  the widget reports that impression.
* When a visitor uses the chat: every message they type, together with the
  identifiers above.
* When a visitor submits a popup, bar or in-chat lead form: the email address,
  phone number and/or name they enter, the page URL where they submitted it,
  and, for SMS forms, the SMS-marketing consent text that was shown to them.
  Contacts collected this way are stored in your Yozo account as marketing
  contacts, and you can send them email, SMS and WhatsApp campaigns and
  automated flows from your Yozo dashboard.
* When a visitor taps a product card in the chat: which product was tapped.

Cart, checkout and product page-view tracking in the widget only run on Shopify
stores and are not active on WordPress/WooCommerce sites.

**When your store is connected to Yozo:** Connecting is optional. You do it on
the Yozo AI page in your WordPress admin. Once connected, your server talks to
Yozo at `agent.yozo.ai`:

* It sends your products, orders, customers and cart activity to Yozo, so Yozo
  can run your campaigns and help you recover abandoned carts.
* Yozo can send requests back to your store through this plugin. It can read
  your WooCommerce data, such as orders, products and customers. It can create
  and change discount codes, orders and products. It cannot read or change your
  payment settings or your store settings.
* A short daily record of those requests is sent to Yozo, so support can help
  if one fails. It holds no customer details.
* All of this stops when you click Disconnect on the Yozo AI page, or
  deactivate the plugin.

**Browser storage:** No cookies are set. The widget stores the following in the
visitor's browser: localStorage `yozo-identifier` (persistent visitor ID),
`yozo-session` (30-minute session ID), `yozo-widget-storage` (email/phone the
visitor submitted, so they are not asked again) and `yozo-popup-shown-session`;
sessionStorage `yozo-impression-sent` and `yozo_opening_msg_dismissed`.

**Branding:** The chat panel shows the text "Powered by Yozo" and popups show
"powered by yozo.ai". This is rendered by the Yozo service and cannot be turned
off from the plugin.

**Page changes:** The widget inserts a `<yozo-widgets>` element into the page
(its UI is isolated in a Shadow DOM) and, when a custom font is configured, a
`<link>` tag in `<head>`. The SMS popup's "Privacy Policy & Terms" link points
to `/policies/privacy-policy` on your own domain; create a page at that address
so the link works.

**Your responsibilities:** Because the widget contacts these servers for all
visitors without asking them, you are responsible for covering this in your own
privacy policy and, where required (for example under GDPR/ePrivacy), for your
own cookie/consent set-up. Do not activate the plugin unless you accept this.

**Service links:**

* Service: https://yozo.ai
* Terms of Service: https://yozo.ai/terms-of-service
* Privacy Policy: https://yozo.ai/privacy-policy

By activating this plugin you agree to Yozo's Terms of Service and Privacy
Policy on behalf of your site.

== Installation ==

1. Create a Yozo account at https://yozo.ai and connect this site's domain in
   your Yozo dashboard.
2. Upload the `yozo-ai-marketing-agent` folder to `/wp-content/plugins/`, or
   install the zip from Plugins > Add New > Upload Plugin.
3. Activate the plugin through the Plugins menu. The widget now loads on every
   front-end page for every visitor (see External Services).

== Frequently Asked Questions ==

= Do I need a Yozo account? =

Yes. The plugin only loads Yozo's hosted widget; the chat, popups and bars are
configured and served from your Yozo account, and the contacts they capture,
your campaigns and your flows all live there too. Yozo has a free plan and paid
subscriptions.

= Do I need a store ID or API key? =

No. The widget resolves your site by its domain, so there is no key to paste.
Just make sure your domain is connected in your Yozo dashboard.

= Does this plugin make external requests? =

Yes - that is its only function. It loads
`https://agents.yozo.ai/widgets/yozo-widgets.js` on every front-end page, and
the widget then communicates with `agent.yozo.ai` and the other servers listed
under External Services. When your store is connected, your server also
exchanges store data with Yozo, as described under External Services.

= Does this plugin collect any data? =

The plugin stores its connection to Yozo and its sync settings in WordPress. The
Yozo widget collects the visitor data listed under External Services. Please
review Yozo's Privacy Policy and update your own privacy policy and consent
tooling accordingly.

= How do I stop the widget from loading? =

Deactivate the plugin. Developers can also return an empty string from the
`yozo_widget_script_url` filter to suppress the script (for example until a
visitor has given consent in your consent tool), or block the inline loader
snippet by its tag id `yozo-widgets-bootstrap`.

= Can I point the plugin at a different Yozo environment? =

Developers can override the script URL with the `YOZO_WIDGET_SCRIPT_URL`
constant in `wp-config.php` or the `yozo_widget_script_url` filter. Only use
URLs provided by Yozo.

== Changelog ==

= 1.1.5 =
* Yozo can now create discount codes in your store for your campaigns.
* Free-shipping codes created by Yozo now make shipping free in your store's cart and checkout, with no shipping setup needed on your side.
* Tags that Yozo adds to an order now show on the order screen and in your orders list.
* While your store is connected, Yozo can read your store's data and update your discount codes, orders and products.

= 1.1.4 =
* If a sync runs into a problem, its diagnostic log is shared with Yozo support automatically, so we can help without asking for access to your site.

= 1.1.3 =
* Syncing your store to Yozo is now faster and lighter on your server.

= 1.1.2 =
* Product prices now reach Yozo in your store's own currency, even if you use a currency switcher.
* Yozo now knows your store's currency and country.

= 1.1.1 =
* Daily syncs are quicker: orders already reach Yozo the moment they change.
* Added a sync log under WooCommerce → Status → Logs to help support if anything goes wrong.

= 1.1.0 =
* Connect your store to your Yozo account from the new Yozo AI page, or by pasting a token from your Yozo dashboard.
* Sends cart, checkout and order activity to Yozo so it can help you recover abandoned carts.
* Adds cart recovery links for your reminder messages.
* The Yozo widget always loads its latest version, even with caching plugins.

= 1.0.0 =
* Initial release: loads the Yozo widget on every page of your store.
