=== DRESSX ===
Contributors: dressx
Tags: woocommerce, virtual try-on, ai, fashion, fitting room
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
Stable tag: 1.0.3
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Add an AI virtual try-on button to your WooCommerce product pages, powered by the DressX try-on service.

== Description ==

DressX adds a "Try On" button to your WooCommerce product pages. Shoppers upload a photo and see how the product looks on them, generated by the DressX AI try-on service.

The plugin renders a configurable button on the single product page (PDP). When a shopper starts a try-on, the product image and the shopper's uploaded photo are sent to the DressX service, which returns a generated try-on image (and optionally a short video).

**Features**

* Adds a "Try On" button to WooCommerce product pages (PDP).
* Configurable button placement (choose the WooCommerce hook and priority).
* Choose which product image is used for the try-on (featured image or a gallery image by index).
* Sends a per-store client identifier so your try-ons are attributable to your store in the DressX dashboard (source is "wc_<client>", and "wc_<client>_video" for videos).
* Pulls product brand from common WooCommerce "brand" taxonomies when available.
* No account or theme edits required beyond activating the plugin and configuring the settings page.

**Important:** This plugin requires the external DressX service to function. It is a connector to a third-party SaaS; the actual try-on generation happens on DressX servers. See the "External services" section below.

== External services ==

This plugin connects to the DressX virtual try-on service to generate try-on images and videos. The plugin cannot produce try-ons locally; the external service is required for the plugin's core function.

1. DressX Try-On API - https://api.dressxagent.com

* What it is used for: to create a virtual try-on and to poll its status/result.
* What data is sent, and when: when a shopper starts a try-on on a product page, the plugin (via the loaded try-on widget) sends the product image URL, the shopper's uploaded photo, and identifiers (source "wc_<client>", store_id, product id/sku/handle, locale) to the DressX API. Data is sent only when the shopper actively initiates a try-on.

2. DressX widget host - https://dressxagent.com

* What it is used for: to load the try-on widget JavaScript that renders the try-on modal and handles the upload/preview flow on the product page.
* What data is sent, and when: a standard browser request for the script is made on product pages where the button is enabled. The script then communicates with the DressX Try-On API as described above.

3. DressX media host - https://api.dressx.com

* What it is used for: to load and display try-on and product media (images) used by the widget.
* What data is sent, and when: standard browser requests for media are made while the shopper is using the try-on modal. No shopper-identifying data beyond the media request itself is sent.

The Try-On API and widget host endpoints are configurable on the plugin settings page (for example, to point to a staging environment).

By using this plugin you (the site owner) and your shoppers agree to the DressX Terms of Service and Privacy Policy:

* Terms of Service: https://dressx.com/policies/terms-of-service
* Privacy Policy: https://dressx.com/pages/privacy-policy

== Installation ==

1. Install and activate WooCommerce.
2. Upload the plugin to /wp-content/plugins/dressx, or install it from the Plugins screen in WordPress.
3. Activate **DressX** through the Plugins screen.
4. Go to **WooCommerce -> DressX** and configure the settings (client id, button placement, image source).
5. Open any product page to see the "Try On" button.

== Frequently Asked Questions ==

= Does this plugin work without WooCommerce? =

No. WooCommerce must be installed and active. The button is rendered on WooCommerce product pages.

= Where does the try-on generation happen? =

On the DressX service. The plugin is a connector: it sends the product image and the shopper's photo to the DressX API and displays the result. See the "External services" section.

= Where is the button shown? =

On the single product page (PDP). You can choose the exact placement (WooCommerce hook and priority) on the settings page.

= Which product image is used? =

By default the featured (main) image. You can switch to a specific gallery image by index on the settings page.

= Is shopper data stored on my site? =

No. The plugin stores only its settings option on your site. The uploaded photo and try-on results are handled by the DressX service.

= Can I point the plugin at a staging environment? =

Yes. The API base URL and script base URL are configurable on the settings page, so you can point the plugin at a DressX staging environment for testing. Leave them at their defaults for normal production use.

== Changelog ==

= 1.0.3 =
* Cache-busting: the loader now appends the plugin version to the main try-on script URL, so updating the plugin always fetches the matching script from the (often long-cached) script host instead of a stale copy. This ensures the per-client video attribution fix ("wc_<client>_video") actually takes effect after an update.

= 1.0.2 =
* Per-client attribution: the analytics source is now "wc_<client>" (and "wc_<client>_video" for videos), so try-ons from every store that installs the plugin are distinguishable in the DressX dashboard. The free-text "Source" setting was replaced by a "Client ID" field (auto-derived from the site host when left blank).

= 1.0.1 =
* Initial public release: AI virtual try-on button on WooCommerce product pages, with configurable button placement, product image source, and source/store identifiers.

== Upgrade Notice ==

= 1.0.3 =
Ensures the plugin fetches the matching (non-stale) try-on script after updates, so the per-client video attribution fix takes effect. Re-upload the widget files to your script host if you self-host them.

= 1.0.2 =
Try-on orders are now attributed per store as "wc_<client>". Review the Client ID on the WooCommerce -> DressX settings page after updating.

= 1.0.1 =
Initial public release.
