=== Vizzel for WooCommerce ===
Contributors: vizzel
Tags: woocommerce, visualization, product preview, art, gallery
Requires at least: 6.3
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.3.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Let shoppers see a product on their own wall. Connect once, then turn on the widgets you want — starting with Wall Preview.

== Description ==

Vizzel brings AI storefront experiences to your WooCommerce shop. The plugin is a
single, extensible container: you connect it to your Vizzel workspace once, then
enable the widgets you want from one settings screen.

**Widgets**

* **Wall Preview** — adds a "See it on your wall" button to the product page. A
  shopper uploads a photo of their room, frames the wall, and Vizzel places the
  product's artwork on it, true to scale. Ideal for galleries and art sellers.

More widgets are added over time and appear on the same settings screen — no
plugin changes needed.

Widgets are rendered by the Vizzel widget bundle inside an isolated Shadow DOM, so
they never conflict with your theme. All display copy, usage caps and availability
are controlled from your Vizzel dashboard.

**What you control in WordPress**

* Which widgets are on.
* The button's wording.
* Where the button sits on the product page (five placements, with a live preview).
* Which product categories to hide it on.
* Button accent colour, shape and font.
* The widget language, or automatic per shopper.

**A Vizzel account is required.** The plugin is the storefront half of a hosted
service — without a workspace and a publishable key it renders nothing.

== External services ==

This plugin connects to Vizzel, a third-party service operated by Vizzel, to
generate product previews. It will not work without it.

**1. Vizzel API — `https://api.vizzel.ai`**

* *When your store's admin saves a publishable key:* the key is sent so Vizzel can
  confirm it is valid before the plugin switches anything on.
* *When an admin opens the Vizzel settings screen of a connected store:* a request
  is made for the list of supported widget languages. No store or visitor data is
  sent, and nothing is requested before the store is connected.
* *When a visitor uses a widget on your storefront (from their browser):* the
  publishable key, the WooCommerce product ID, the product title and image URL,
  the chosen language, and **the photo of their room that they upload** are sent so
  the preview can be generated. For a visitor who is **not logged in**, room photos
  are used only to produce that preview and are deleted automatically after a short
  retention window. An anonymous, randomly generated per-visit ID is also sent so
  Vizzel can count widget usage; it is not derived from anything identifying and
  contains no personal data.
* *When a logged-in customer uses a widget, and the Preview history widget is
  enabled:* an opaque per-customer token is also sent. The token is a random value
  generated on your own site and stored in WordPress user meta; it is **not** their
  email, name, or user ID, and Vizzel cannot resolve it back to a person. It lets
  their previews be listed back to them under **My account → Wall previews**, which
  means those room photos and previews are **kept until the customer deletes them**
  rather than being deleted after the short window. Each customer keeps a limited
  number of previews; older ones are removed automatically.
* *When a logged-in customer opens or deletes a preview:* the same token is sent,
  plus the preview's ID.
* *When you export or erase personal data* for a customer from Tools → Export/Erase
  Personal Data: the token is sent so their previews can be listed or deleted.
* *When you have turned on Purchase attribution, and a shopper buys a product they
  previewed:* your store sends the preview's opaque token, the product and variation
  IDs, the quantity, the line total, the currency, and the order's ID and status.
  The request is signed by your own site so Vizzel can confirm it came from you.
  **No customer name, email, phone, billing or shipping address, order notes or
  payment data is sent.** This setting is **off by default**: no order information
  of any kind leaves your store until an administrator turns it on, and turning it
  off stops it again.
* *When such an order is refunded or its status changes:* the same fields are sent
  again so the earlier figure can be corrected.

**2. Vizzel CDN — `https://cdn.vizzel.ai`**

* The widget JavaScript bundle is loaded from Vizzel's CDN on product pages where an
  enabled widget appears. While your store is connected, your server also requests a
  small manifest file from this host twice a day to learn the current bundle version.
  No store or visitor data is sent in either request. Neither request is made — and
  nothing is scheduled — until an administrator has connected the store.

**Nothing is sent to Vizzel, and no request of any kind is made, until an
administrator connects the store with a publishable key.** Installing and activating
the plugin schedules no background work and generates no traffic. Disconnecting stops
all of it again. No visitor data is sent until a visitor actively uses a widget.

Vizzel's terms of service: https://vizzel.ai/terms
Vizzel's privacy policy: https://vizzel.ai/privacy

== Installation ==

1. In Vizzel, connect this store and copy your **publishable key**.
2. Install and activate Vizzel for WooCommerce (WooCommerce must be active).
3. Open **Vizzel** in the WordPress admin menu, paste your publishable key, and
   enable the widgets you want (e.g. Wall Preview).
4. Visit a product page — the enabled widgets appear automatically.

== Frequently Asked Questions ==

= Do I need a Vizzel account? =

Yes. The plugin is the storefront half of a hosted service: it needs a Vizzel
workspace and a publishable key before it renders anything. See the **External
services** section for exactly what is sent where.

= Is my publishable key a secret? =

No. It is a public identifier bound to your store's domain and rate-limited by
Vizzel, so it is safe to appear in your page source. The settings screen still
handles it like a credential — the field is masked (with a reveal toggle), and once
your store is connected the key is not shown again — so it is not exposed over a
shared screen, a screenshot, or a support session.

= What happens to a shopper's room photo? =

For a visitor who is not logged in, it is sent to Vizzel to generate that one
preview and then deleted automatically after a short retention window.

If you enable the **Preview history** widget, a logged-in customer's previews and
room photos are **kept** instead, so they can find them again under **My account →
Wall previews**. They can delete any preview themselves at any time, and each
customer keeps only a limited number — older ones are removed automatically.

Either way the photo is never stored by this plugin and never written to your
WordPress site. Enabling Preview history changes what you are telling shoppers
about their photos, so review your own privacy policy before switching it on.

= How do I export or delete a customer's previews? =

Use WordPress's built-in **Tools → Export Personal Data** and **Tools → Erase
Personal Data**. This plugin answers both requests: an export lists the customer's
previews, and an erasure deletes them from Vizzel and forgets the token that linked
them.

= How do I change the key or move this store to another workspace? =

Open **Vizzel**, choose **Disconnect**, and confirm. The widgets stop appearing on
your storefront immediately and the stored key is removed. Your widget setup
(placement, hidden categories, appearance) is kept, so pasting a new key restores it
as it was.

= Where is a widget's copy and limits configured? =

In your Vizzel dashboard. The plugin only decides which widgets are on and passes
the product context; everything else is server-driven.

= Does it work with High-Performance Order Storage? =

Yes. The plugin never touches orders, and declares itself compatible.

= What is removed if I delete the plugin? =

Deleting it removes the Vizzel settings option (connection and widget setup), its two
cached lookups, its scheduled bundle-version check, and every customer's preview
token. Deactivating keeps the settings, so switching the plugin off and on again does
not mean reconnecting — but it does remove the scheduled check, which is recreated
when the plugin is active and your store is connected.

Removing the tokens means previews already generated can no longer be reached from
your store; Vizzel removes the imagery on its own retention schedule. To delete a
specific customer's previews outright, use Tools → Erase Personal Data before
deleting the plugin.

== Screenshots ==

1. The Vizzel settings screen once a store is connected — widgets, language, and the connection panel.
2. Choosing where the button sits on the product page, with a live preview that follows the placement.
3. The Appearance panel — accent colour with named presets and a label contrast check, plus button shape.
4. The "See it on your wall" button on a WooCommerce product page.
5. A shopper framing their room photo to a square before generating.
6. The finished preview, with the artwork placed on the shopper's own wall.

== Changelog ==

= 1.3.0 =
* **New: see which sales followed a wall preview.** Turn on *Purchase attribution*
  on the Vizzel settings screen and, when a shopper buys a product they previewed,
  your store reports that sale to Vizzel so it can be credited to the preview.
* **It is off by default and does nothing until you switch it on.** While it is
  off, no order information of any kind leaves your store.
* What gets sent is deliberately narrow: the preview's anonymous token, the product
  and variation IDs, the quantity, the line total, the currency, and the order's ID
  and status. No customer name, email, phone, billing or shipping address, order
  notes or payment details — the full list is under "External services" above.
* Refunds and status changes are reported too, so a refunded sale stops counting.

= 1.2.2 =
* **The plugin now contacts Vizzel only after you connect it.** Activating it no
  longer schedules the twice-daily check for the current widget bundle version —
  that schedule is created when you connect your store with a publishable key, and
  removed again when you disconnect. An installed but unconfigured plugin makes no
  outbound request at all.
* Deleting the plugin also clears that scheduled check, so nothing is left behind.
* No change to how anything looks or behaves once your store is connected.

= 1.2.1 =
* Every style the plugin adds to the WordPress admin now goes through WordPress's
  own stylesheet APIs. The settings screen no longer writes `style` attributes of
  its own: the accent colour, button shape and font you choose travel as CSS
  custom properties added with `wp_add_inline_style()` alongside the plugin's
  stylesheet, so WordPress can version, order and dequeue all of it as one thing.
* No change to how anything looks or behaves, on the settings screen or your
  storefront.

= 1.2.0 =
* **Add to cart now works** from the Wall Preview popup. The button announced the
  intent but nothing acted on it, so it only closed the popup. It now triggers your
  theme's own Add to cart control, so variations, quantity and validation behave
  exactly as they do elsewhere on the page.
* **The button's wording is yours.** A "Button text" field on the Wall Preview card
  sets what shoppers see, previewed live as you type. Leave it empty to keep the
  wording from your Vizzel dashboard.
* The finished preview is now shown whole in the popup instead of being cropped to
  fill the panel — tall and wide rooms alike.
* **Preview history has its own Appearance section**, previewing the Wall previews
  tab in My account rather than a product page with a button that widget never
  renders.
* The preview detail popup is sized to its content instead of carrying the empty
  second panel that made it roughly twice as wide as it needed to be.
* Removed "Try another piece in this room" from the preview detail popup.

= 1.1.0 =
* New **Preview history** widget: adds a "Wall previews" tab to WooCommerce My
  account where a logged-in customer can revisit every preview they have created,
  compare it against their room, download it, jump back to the product, or try
  another piece in the same room without re-uploading a photo.
* Previews created by a logged-in customer are now kept so they can be listed back
  to them, instead of being deleted after the short retention window. Customers can
  delete any preview themselves, and each keeps a limited number.
* Customers are identified to Vizzel only by an opaque random token stored in
  WordPress user meta — never an email, name, or user ID.
* Added WordPress privacy integration: previews are included in Export Personal
  Data and removed by Erase Personal Data.

= 1.0.0 =
* Initial release — Vizzel container plugin with the Wall Preview widget.
* Connection: the publishable key is entered in a masked field with a reveal
  toggle, is never rendered back into the page once confirmed, and can be removed
  with Disconnect (widget setup is kept for reconnecting).
* Appearance: hex-editable accent with named presets and a label contrast check, a
  segmented button-shape control, and a product-page live preview that follows the
  chosen placement.
* Placement: five product-page positions, plus per-category exclusion.

== Upgrade Notice ==

= 1.3.0 =
Adds optional purchase attribution, so you can see which sales followed a wall
preview. It is off by default and sends no order data until you turn it on.

= 1.2.2 =
Privacy fix: the plugin no longer schedules or makes any request to Vizzel until you
connect your store. Nothing changes for an already-connected store.

= 1.2.1 =
Internal tidy-up: the admin screen's CSS is now added entirely through WordPress's
stylesheet APIs. Nothing changes for you or for shoppers.

= 1.2.0 =
Fixes Add to cart in the Wall Preview popup, which previously did nothing. Also adds
an editable button text field and tidies the Preview history popup.

= 1.1.0 =
Adds an optional Wall previews tab to My account. Enabling it means logged-in
customers' room photos are kept until they delete them, rather than removed after a
short window — review your privacy policy before turning it on.

= 1.0.0 =
Initial release.
