=== FittingByMe Virtual Try-On ===
Contributors: fittingbyme
Tags: virtual try-on, woocommerce, fitting room, fashion, ai clothing
Requires at least: 5.8
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Professional virtual try-on for WooCommerce. Let customers preview clothing on themselves using AI before they buy.

== Description ==

= **LIVE DEMO — [https://demo.fittingbyme.com](https://demo.fittingbyme.com)** =

**Try virtual try-on right now on our live WooCommerce demo store:** **[https://demo.fittingbyme.com](https://demo.fittingbyme.com)**

See the product page try-on popup, gallery, and full shopper flow before you install the plugin on your own site.

= **Support, setup & free try-on activation — [https://fittingbyme.com/en/wordpress/fittingbymeplugin](https://fittingbyme.com/en/wordpress/fittingbymeplugin)** =

**Official plugin hub — documentation, support, plans, and free try-on activation:** **[https://fittingbyme.com/en/wordpress/fittingbymeplugin](https://fittingbyme.com/en/wordpress/fittingbymeplugin)**

Create your account, choose a plan (including the free plan with complimentary try-ons), get your API token, and connect your store in minutes.

FittingByMe Virtual Try-On connects your WooCommerce store to the FittingByMe AI service so shoppers can try on product images virtually and save results to a personal gallery.

**Features**

* Virtual try-on on product pages
* Select which product images are available for try-on
* Customer gallery in My Account
* Try-on credit plans (WooCommerce products)
* Store branding on result images
* Admin dashboard, statistics, and user credit management
* API service credits via fittingbyme.com (cloud AI processing)

**Requirements**

* WordPress 5.8 or newer
* WooCommerce 5.0 or newer
* Optional: FittingByMe API token for cloud try-on processing

== Free plugin, paid cloud processing ==

This plugin is **100% free and fully functional** on WordPress.org. After installation, all settings, WooCommerce integration, product try-on UI, customer gallery, statistics, and WooCommerce credit packs work immediately.

**Virtual try-on image processing** is performed on FittingByMe servers (similar to how Akismet processes spam remotely). That cloud service requires a FittingByMe API token and try-on credits purchased at [fittingbyme.com](https://fittingbyme.com). New accounts receive **50 complimentary try-ons** for setup. Monthly credit packs can be purchased on our website.

When API credits are used up or a monthly plan expires, **only AI processing on our servers stops**. The plugin itself is never locked, disabled, or trialware — no plugin features are removed.

Store owners may also sell try-on credits to their own customers via WooCommerce products (handled locally on your site).

== Installation ==

1. Upload the plugin folder to `/wp-content/plugins/` or install via Plugins → Add New.
2. Activate the plugin through the Plugins screen.
3. Go to **FittingByMe → Settings** and optionally enter your API token from fittingbyme.com.
4. Edit products and choose images for virtual try-on.
5. Create try-on credit products under **FittingByMe → Plans** (WooCommerce). Purchase FittingByMe API credits at fittingbyme.com for cloud AI processing.

== Frequently Asked Questions ==

= Where is the live demo? =

**[https://demo.fittingbyme.com](https://demo.fittingbyme.com)** — a fully working WooCommerce store with virtual try-on enabled. Open any product with try-on images and test the experience in your browser.

= How do I get support and activate free try-ons? =

Visit **[https://fittingbyme.com/en/wordpress/fittingbymeplugin](https://fittingbyme.com/en/wordpress/fittingbymeplugin)** for plugin documentation, support, pricing plans, and free try-on activation (API token setup).

= Do I need a FittingByMe account? =

Only if you want cloud AI try-on processing. Register at [fittingbyme.com](https://fittingbyme.com) to get an API token (includes 50 complimentary try-ons). The plugin works without an account for configuration and WooCommerce credit products; shoppers need a valid store API token for actual try-ons.

= Is the plugin free? =

Yes. The plugin code is free and fully functional. You only pay fittingbyme.com for cloud AI processing credits when you choose to use the try-on service.

= Does this work without WooCommerce? =

No. WooCommerce is required for products, checkout, and credit plans.

== External services ==

This plugin connects to third-party services over HTTPS. By using this plugin, data may be transmitted to these services as described below. Site administrators must review each provider's terms and privacy policies before enabling the plugin.

= FittingByMe API =

**What the service is and what it is used for**

The FittingByMe API (`https://fittingbyme.com/api`) powers **cloud AI virtual try-on processing**. The plugin is a free client; payment on fittingbyme.com buys processing credits on our servers, not a license to unlock plugin code.

**When data is sent**

* When a store administrator saves an API token or tests the connection (health check).
* When the WordPress admin area loads API service balance or plan catalog (informational links to fittingbyme.com only — purchases happen on our website, not in wp-admin).
* When a shopper (logged in or guest, if enabled) runs a virtual try-on from the storefront.

**What data is sent**

Requests are made with `wp_remote_request()` to endpoints under `https://fittingbyme.com/api`, including:

* `GET /health` — connection test; sends the site API bearer token in the `Authorization` header when configured.
* `GET /admin/plans` — lists available subscription plans; no API token is required for this request.
* `GET /admin/balance` — reads plan name, balance, expiry, and active status; sends the bearer token.
* `POST /admin/subscribe` — legacy API endpoint; this plugin does not initiate purchases from WordPress. Plan purchases are completed on fittingbyme.com.
* `POST /tryon/perform` — generates a virtual try-on; sends JSON including:
  * `user_code` (a customer identifier for the try-on session),
  * `clothing_image` (base64-encoded product/clothing image),
  * `user_image` (base64-encoded photo uploaded by the shopper),
  * `type` (try-on category, e.g. upper, lower, overall),
  * optional `store_logo` and `store_instagram` (store branding settings),
  * `Authorization: Bearer` with the site API token,
  * `X-Server-IP` with the WordPress server's public IP address (stored locally after detection).

No try-on images or customer photos are sent until a user initiates a try-on. Administrators control which product images are eligible for try-on in the product editor.

**Browser visits to fittingbyme.com**

Administrators may be redirected in the browser to `https://fittingbyme.com` (for example `https://fittingbyme.com/en/wordpress/plans`) to complete subscription checkout. That page may receive the site `domain` and a `callback_url` query argument. Those visits are subject to FittingByMe's website policies, not the API requests above.

**Terms of Service**

https://fittingbyme.com/en/terms-and-conditions

**Privacy Policy**

https://fittingbyme.com/en/privacy

= ipify =

**What the service is and what it is used for**

ipify (`https://api.ipify.org`) is a public IP address API operated as the open-source ipify project (Randall Degges). This plugin uses it only as a fallback to discover the hosting server's outward-facing (public) IP address when PHP cannot determine it from `$_SERVER['SERVER_ADDR']` or `$_SERVER['LOCAL_ADDR']`. That IP is saved in the WordPress database (`fittingbyme_api_server_ip`) and sent to the FittingByMe API in the `X-Server-IP` header on `POST /tryon/perform` requests.

**When data is sent**

* When the API handler is first loaded and no server IP is stored yet, and local server variables do not provide an address.

ipify is not called on every page load or on every try-on—only during this one-time (per site) detection fallback.

**What data is sent**

The plugin sends a single unauthenticated HTTP `GET` request to:

`https://api.ipify.org?format=json`

The request has no JSON body and no WordPress user, customer, or product data in the URL or payload. Like any HTTP client, your server may expose its public IP address to ipify as part of the connection (that is how the service returns the IP). The JSON response (`{"ip":"..."}`) is read once and stored locally; it is not sent to ipify again.

**Terms of Service**

ipify does not publish a separate Terms of Service document. The service is offered as free, open-source software. License terms for the ipify software are available here:

https://github.com/rdegges/ipify-api/blob/master/LICENSE

**Privacy Policy**

ipify does not publish a separate Privacy Policy URL. The project website states that no visitor information is logged:

https://www.ipify.org/

Project source and documentation:

https://github.com/rdegges/ipify-api

== Changelog ==

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 1.0.0 =
Initial release.
