=== Mirrago Virtual Tryon ===
Contributors: mirragotryon
Tags: virtual try-on, woocommerce, ai, fashion, try before you buy
Requires at least: 6.2
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.5.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

AI-powered virtual try-on for WooCommerce. Let customers see how clothes look on them before buying.

== Description ==

Mirrago Virtual Tryon adds an AI-powered "Virtual Try-On" button to your WooCommerce product pages. Customers upload a photo of themselves, and the Mirrago service generates an image showing how the product would look on them — helping shoppers buy with confidence and reducing returns.

**Features**

* One-click Virtual Try-On button on WooCommerce product pages
* Customizable button design (colors, icon, size, placement)
* Per-product enable/disable toggle
* Optional email capture before try-on, with an explicit marketing-consent checkbox (unchecked by default)
* Try-on analytics dashboard (totals, completion rate, top products)
* CSV export of captured emails
* Optional "Powered by Mirrago" attribution — disabled by default, shown only if the site administrator explicitly enables it

**Requirements**

This plugin requires WooCommerce and a Mirrago account with API credentials (Client ID and Client Secret), available from your Mirrago dashboard at https://app.mirrago.com/.

== External services ==

This plugin connects to the Mirrago API (https://api.mirrago.com), a third-party AI image-generation service operated by Mirrago, to generate virtual try-on images. This connection is required for the plugin's core functionality.

**What data is sent and when:**

* When a customer starts a try-on, the photo they upload and the product (garment) image are sent to the Mirrago API to generate the try-on result. The uploaded photo is deleted from your server immediately after it is sent.
* Your Mirrago Client ID and Client Secret are sent to the Mirrago API to authenticate your store (OAuth token request).
* While a try-on is processing, the plugin polls the Mirrago API with the job ID to check its status.
* Your site's REST API callback URL is sent with each generation request so Mirrago can notify your site when the job completes.

**Service provider:**

This service is provided by Mirrago:

* Terms of service: https://mirrago.com/terms
* Privacy policy: https://mirrago.com/privacy-policy

== Data stored locally ==

If the "Require Email Before Try-On" option is enabled, the plugin stores the email address the customer enters, together with their marketing-consent choice (an explicit, unchecked-by-default checkbox), in your site's own database. This data never leaves your site and can be exported or reviewed by the site administrator under Mirrago → Captured Emails. The plugin also logs try-on events (product, SKU, job status) for the analytics dashboard. No IP addresses or browser user agents are recorded.

== Installation ==

1. Upload the plugin files to the `/wp-content/plugins/` directory, or install the plugin through the WordPress plugins screen directly.
2. Activate the plugin through the 'Plugins' screen in WordPress.
3. Go to the Mirrago menu in your WordPress admin and connect your Mirrago account, or enter your Client ID and Client Secret manually.
4. Enable Virtual Try-On and customize the button to match your store.

== Frequently Asked Questions ==

= Do I need a Mirrago account? =

Yes. The try-on images are generated by the Mirrago API, which requires API credentials from your Mirrago dashboard.

= Is customer data shared with Mirrago? =

The customer's uploaded photo and the product image are sent to the Mirrago API to generate the try-on image (see the External services section). Captured emails and consent choices are stored only in your own WordPress database and are not sent to Mirrago.

= Can I disable the try-on button for specific products? =

Yes. Each product has a "Mirrago Try-On" panel in the WooCommerce Product Data box with an enable/disable toggle.

= Does the plugin work without WooCommerce? =

No. The plugin is built for WooCommerce product pages and requires WooCommerce to be active.

== Screenshots ==

1. Virtual Try-On button on the product page
2. Try-on modal with photo upload
3. Admin settings dashboard
4. Try-on analytics

== Changelog ==

= 1.5.0 =
* Marketing-consent checkbox is now unchecked by default
* Removed IP address and user-agent logging
* "Powered by Mirrago" attribution is now opt-in and disabled by default
* Security hardening: input sanitization, nonce verification, output escaping
* Moved inline scripts and styles to properly enqueued assets
* Documentation of the Mirrago external service

= 1.4.0 =
* Added email capture, analytics, per-product toggle, and CSV export

= 1.0.0 =
* Initial release

== Upgrade Notice ==

= 1.5.0 =
Security and privacy improvements; attribution is now opt-in.
