=== Omybox – AI Assistant for Your Website ===
Contributors: omybox
Tags: chatbot, ai, assistant, customer support, live chat
Requires at least: 5.8
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.6.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Connect your site to Omybox: an AI assistant built from your own content that answers your visitors 24/7, set up in minutes.

== Description ==

Omybox turns your website into a smart assistant able to answer your visitors' questions 24/7, based on your own pages and posts. The plugin:

* Connects your site to your Omybox account in one click (no API key to copy and paste).
* Keeps your posts and pages in sync with Omybox when you create, update or delete them.
* Displays a customizable chatbot widget on your site (design managed from your Omybox dashboard).
* Lets you choose: automatic sync, sync on confirmation, or no sync at all.
* Optionally lets your chatbot search WooCommerce products and suggest "add to cart" links.

No technical skills required.

This plugin is the WordPress connector for the Omybox service. An Omybox account is required (a free trial is available). See the "External services" section below for details on the data exchanged with Omybox.

== Installation ==

1. Upload the `omybox` folder to `/wp-content/plugins/`, or install the plugin from the **Plugins > Add New** screen.
2. Activate the plugin from the **Plugins** screen.
3. Go to **Omybox > Connection** and click "Connect to Omybox".
4. Authorize the connection from your Omybox dashboard (omybox.ai).

== Frequently Asked Questions ==

= Do I need a paid Omybox account? =

No. A 14-day free trial is offered when you sign up, with no credit card required.

= Does the plugin send all my content to Omybox? =

Only published posts and pages of the content types you select in the **Sync** tab. Private content, drafts and user data are never sent.

= Does the plugin contact Omybox as soon as it is activated? =

No. Activation only stores default settings in your database. Nothing is sent to Omybox until an administrator clicks "Connect to Omybox".

= Can I temporarily disable the widget? =

Yes. In the **Widget appearance** tab, uncheck "Display the widget on my site". The connection stays active.

= Is the plugin available in French? =

The plugin is fully translatable. Translations, including French, are provided by the community through translate.wordpress.org.

== External services ==

This plugin connects your WordPress site to **Omybox** (https://omybox.ai), a third-party SaaS operated by Omybox that builds an AI chatbot from your website content. The plugin cannot work without this service. Here is exactly what is sent, where and when.

**1. Omybox API – https://api.omybox.ai**

* **Connection (pairing)** – only when an administrator clicks "Connect to Omybox" or the "Create one for free" link on the plugin page: `POST /api/plugin/pair/start` sends the site URL, the site name, the plugin version and the source (`wordpress`). Then, while waiting for approval, `POST /api/plugin/pair/poll` is called every 3 seconds with the pairing code. Once approved, Omybox returns an access token, the project ID and the account email, which are stored in your database.
* **Content sync** – `POST /api/tenant/plugin/sync-page` sends the project ID, the URL, the title and the rendered HTML content of a published post/page, plus the action (`created`/`updated`). It runs when you publish or update a post of a selected content type: about 5 seconds later in "Automatic" mode, or when you click "Sync now" in "Ask me" mode. Nothing is sent in "Disabled" mode.
* **Deletion** – when a synced post is deleted or unpublished, the same endpoint receives the project ID, the post URL and the action `deleted`, so that Omybox removes it from the chatbot knowledge base.
* **Plan information** – `GET /api/auth/me` when you open the "My plan" tab.
* **Dashboard login** – `POST /api/tenant/plugin/sso-link` when you click "Open your Omybox dashboard", to get a one-time login code.

All authenticated requests carry the access token obtained during the connection (Bearer header) and a `User-Agent: Omybox-WP/<version>` header.

**2. Omybox app – https://omybox.ai**

* **Chat widget** – when the site is connected and the widget is enabled, the script `https://omybox.ai/embed.js` is loaded on the public pages you selected. It sends the project ID and the widget settings to Omybox, and the messages your visitors type in the chat are sent to and processed by Omybox to generate answers. The widget is loaded from omybox.ai by your visitors' browsers, so Omybox receives their IP address and browser information as with any web resource.
* **Links** – buttons in the admin page open omybox.ai (sign-up, connection approval, dashboard, billing).

**3. Requests from Omybox to your site (WooCommerce only)**

If WooCommerce is active, the plugin exposes `/wp-json/omybox/v1/health`, `/wp-json/omybox/v1/products/search` and `/wp-json/omybox/v1/cart/add`. They are protected by a secret generated locally and shown on the plugin page; they only answer requests that present this secret, which you choose to paste into your Omybox dashboard. They return public product information (name, price, stock, image, link) and an "add to cart" link.

Omybox terms of service: https://omybox.ai/cgu
Omybox privacy policy: https://omybox.ai/confidentialite

== Changelog ==

= 1.6.1 =
* Translation files are no longer bundled: translations are delivered by translate.wordpress.org.

= 1.6.0 =
* Compliance with WordPress.org guidelines.
* English source strings with French translation.
* Security hardening (escaping, input sanitization, capability checks, safe redirects).
* The chat widget script is now loaded with wp_enqueue_script.
* Removed the unused Google Fonts request from the admin page.
* Scheduled sync events are now cleared on deactivation and uninstall.

= 1.5.1 =
* Bug fixes.

= 1.0.0 =
* First release: one-click pairing, automatic sync, customizable widget.

== Upgrade Notice ==

= 1.6.1 =
Translations are now delivered by translate.wordpress.org.

= 1.6.0 =
WordPress.org compliance and security hardening. Your connection and settings are kept.
