=== Etryon Virtual Try-On ===

Contributors: kevin52718
Tags: woocommerce, e-commerce, fashion, products, ai
Requires at least: 6.2
Tested up to: 7.0
Requires PHP: 7.4
Requires Plugins: woocommerce
Stable tag: 1.0.16
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

AI virtual try-on for WooCommerce—shoppers preview outfits before buying. Requires WooCommerce and a free Etryon account with API key.

== Description ==

Give your WooCommerce shoppers a clearer picture before they check out. Etryon Virtual Try-On adds a try-on button on product pages so customers can upload or capture a full-body photo and see an AI-generated preview wearing the selected product or variation.

= Why stores use virtual try-on =

* **Purchase confidence** — Help customers decide with a visual preview instead of guessing fit or style from product photos alone.
* **Fewer “will it look on me?” doubts** — Especially useful for apparel, accessories, and variant-heavy catalogs.
* **Smoother path to cart** — Shoppers can try on, review results in a history tab, and add to cart from the same modal.
* **Merchant control** — Choose which products get try-on, set daily limits, customize button text and styling, and manage image retention on your site.

Can help reduce returns driven by style or fit uncertainty—not a substitute for your sizing policy or support process.

= How it works =

On a supported product page, shoppers open the try-on modal, provide a photo (upload or camera), and receive a generated image. Variable products use the selected variation’s garment image when applicable.

**Live demo:** Try it on our [WooCommerce demo store](https://demo.etryon.ai/)—no plugin install required.

= Key features =

* Try-on modal on single product pages (WooCommerce)
* Upload or camera capture; recent uploads for returning shoppers
* Try-on history tab; add to cart from the modal
* Admin: setup wizard, generation options (aspect ratio, background, beauty), product availability rules, text & styles, images & storage
* Server-side API key; domain validation via `X-Site-Domain`

= Requirements =

* **WooCommerce** (required)
* **WordPress** 6.2+ · **PHP** 7.4+
* **Etryon account & API key** — Image generation is processed by Etryon’s service; usage follows Etryon plans and policies (https://etryon.ai/).

Outcomes depend on your store, products, and shopper photos.

== Installation ==

1. Install and activate WooCommerce.
2. Install this plugin (ZIP upload or copy the folder into `wp-content/plugins/`) and activate it.
3. Run the setup wizard: register at https://app.etryon.ai, add your API key, and optionally verify your site domain.
4. Adjust settings under the **Etryon Try-On** admin menu.

== Frequently Asked Questions ==

= Is there a live demo? =

Yes. Browse products and use Virtual Try-On on https://demo.etryon.ai/ (no WordPress install required).

= How can this help my store? =

Virtual try-on is designed to give shoppers a clearer sense of how an item may look on them before purchase. Many apparel stores use it to build confidence and reduce uncertainty-driven returns—especially when product photos alone are not enough. Your results will vary based on catalog, imagery, and how you promote try-on on product pages.

= Do I need an Etryon account? =

Yes. The plugin authenticates to Etryon with your API key. Create an account at https://app.etryon.ai .

= Can I change labels and button text? =

Yes. Use **Etryon Try-On → Text & Styles**.

= Where are generated images stored? =

High-resolution outputs are stored on your site according to **Images & Storage**. Etryon may keep a limited preview for operational records.

= What happens to plugin data when I uninstall? =

By default, uninstall **does not** wipe the plugin’s settings or custom tables, so you do not lose history or references to stored files after an accidental uninstall. To delete all plugin data on uninstall, set `ETRYON_TRYON_PURGE_DATA_ON_UNINSTALL` to `true` in `wp-config.php` before deleting the plugin from **Plugins**.

== Privacy ==

= What data is sent to Etryon? =

This plugin uses a third-party service (Etryon) to generate try-on images.

When a shopper uses Virtual Try-On, the plugin sends the following data to Etryon’s API:

- a URL to the shopper photo (uploaded to Etryon storage via the plugin; the API receives a signed URL so Etryon can fetch the image for generation)
- a URL to the garment or product image used for the try-on (the selected variation’s image when applicable)
- generation settings from the plugin (for example aspect ratio, background option, and beauty when enabled)
- your site domain (HTTP header `X-Site-Domain` for domain validation)

Product and variation IDs are stored in your WordPress database for history, daily limits, and cart-related flows; they are not included in the JSON body sent to Etryon’s task API in this plugin version.

The plugin does not expose your API key in the storefront UI; it is used server-side to authenticate API requests.

= Data storage and retention =

- Shopper uploads are stored on Etryon infrastructure (Supabase) for up to 14 days by default, then removed automatically. Large uploads are resized client-side and server-side (max long edge 1024px) before storage to improve reliability.
- Generated try-on images may be stored on your WordPress site according to **Etryon Try-On → Images & Storage** (retention can be configured).
- Etryon processes uploaded content to provide the try-on result. Etryon’s retention and processing details are described in their policies:
  - Privacy Policy: https://etryon.ai/privacy
  - Terms of Service: https://etryon.ai/terms

= Uninstall and local data =

By default, uninstalling the plugin **does not** delete its options or custom database tables. This avoids accidental loss of try-on history and stored media references if the plugin is removed by mistake or temporarily for troubleshooting. To remove all plugin-specific options and custom tables when you uninstall, define `ETRYON_TRYON_PURGE_DATA_ON_UNINSTALL` as `true` in `wp-config.php` **before** you delete the plugin. See **Etryon Try-On → Images & Storage** in wp-admin for the same guidance.

== Screenshots ==

1. Virtual try-on button on a WooCommerce single product page.
2. Step 1 of the try-on modal: upload, take a photo, or use a recent photo.
3. Step 2: review the uploaded photo and start generation.
4. Try-on result with add to cart, try again, and download options.
5. Admin dashboard: connection status, usage, and recent generation jobs.
6. Generation settings: product availability and daily try-on limits.
7. Output controls: aspect ratio and selectable AI background scenes.
8. Text & Styles: customize storefront button and modal labels with live preview.
9. Images & Storage: upload limits, retention, and uninstall guidance.

== Changelog ==

= 1.0.16 =
* Fixed Upgrade plan and Buy try-ons links on the admin dashboard.
* Improved visibility of membership action buttons on the dashboard.

= 1.0.15 =
* Fixed an issue that could prevent saving the API key during setup.
* Improved domain binding in the admin dashboard.
* Clearer error messages when domain binding fails.

= 1.0.14 =
* Longer create-task API timeout for OpenAI synchronous generation (reduces false "Something went wrong" errors).
* Background prefetch failures no longer show an error banner before the shopper taps Try it on.
* Idempotent retry reuses the same client request id when the server already finished generating.

= 1.0.13 =
* Product garment images are uploaded to Etryon storage from the WordPress server before generation, avoiding host WAF/captcha blocks when the API fetches wp-content URLs.

= 1.0.12 =
* Improved try-on generation speed and responsiveness on product pages.

= 1.0.11 =
* Improved try-on generation speed and responsiveness on product pages.

= 1.0.10 =
* Fix photo upload to Etryon API using JSON base64 (resolves "Invalid JSON body" on some hosts).

= 1.0.9 =
* Shopper uploads are stored on Etryon cloud storage instead of the WordPress media library.
* Upload and camera photos are resized before upload (max long edge 1024px) for faster, more reliable try-on generation.
* Recent uploads are loaded from Etryon storage (default 14-day retention).
* Updated privacy documentation for cloud upload storage.
* Fixed plugin directory short description length for WordPress.org.

= 1.0.8 =
* Declared compatibility with WordPress 7.0.
* Extended try-on generation polling for slower AI jobs (up to about 7.5 minutes).
* Admin and storage settings refinements.

= 1.0.7 =
* Clearer uninstall guidance on the Images & Storage settings page.
* Quick link from plugin admin screens to leave a review on WordPress.org.

= 1.0.6 =
* Improved reliability when saving generation settings (background options).
* Refinements to the generation settings screen in wp-admin.
* General stability and maintenance updates.

= 1.0.5 =
* Improved theme style capture for Text & Styles previews.
* Better storefront behavior when JavaScript is disabled in the browser.

= 1.0.4 =
* Maintenance update (installation paths and media storage locations).

= 1.0.3 =
* Storefront try-on modal improvements and settings cleanup on upgrade.

= 1.0.2 =
* Improved try-on modal styling compatibility with themes.
* Translation and text-domain updates for language packs.

= 1.0.1 =
* Improved how custom storefront styles are applied to the try-on modal.

= 1.0.0 =
* Initial release.
* Setup wizard, dashboard, generation and product availability, text & styles, images and storage.
* Try-on modal with history and add to cart; background task polling and scheduled cleanup.
