=== 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.6.1
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.

**One screen, one key to connect**

In your Vizzel dashboard, open **Store connection** and copy your **connection key**.
Paste it into **Vizzel** in your WordPress admin and click **Connect** — that one key
is all the plugin needs.

**What you control in WordPress**

* One switch to show or hide Wall Preview on your store. It is the same switch as
  in your Vizzel dashboard, so it always agrees with it.
* Where the button sits on the product page (five positions).
* Which product categories to hide it on.
* Whether signed-in customers get a *Wall previews* tab in My account.
* Optional, off-by-default sales analytics.

The button's wording, colours, style and font are set in your Vizzel dashboard, and
a change there reaches your storefront immediately.

**A Vizzel account is required.** The plugin is the storefront half of a hosted
service — until it is connected to a Vizzel workspace 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 pastes a connection key and clicks Connect:* your server
  makes one signed request to confirm the key belongs to this store, and sends the
  key's publishable part so Vizzel can confirm it too. Nothing is saved unless both
  succeed.
* *When an admin opens the Vizzel screen of a connected store, or uses its switch:*
  a signed request reads, or changes, whether Wall Preview is shown on your
  storefront. No store or visitor data is sent.
* *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 Sales analytics (under Placement & visibility), 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.** 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. Install and activate Vizzel for WooCommerce (WooCommerce must be active).
2. In Vizzel (or after creating an account), open **Store connection**, connect this
   store, and copy the **connection key**.
3. Open **Vizzel** in the WordPress admin menu, paste the key, and click **Connect**.
4. Click **Open your storefront** — the Wall Preview button is on your product pages.

== Frequently Asked Questions ==

= Do I need a Vizzel account? =

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

= Where do I find the connection key, and is it secret? =

In your Vizzel dashboard under **Store connection**, once this store is connected;
only workspace owners and admins can see it. Treat it like a password: it contains
the publishable key (public — it appears in your page source) and your store's
signing secret, which lets it switch Wall Preview and report sales. The plugin
stores it on your server and never shows it again.

= I updated from an earlier version. What do I need to do? =

Open **Vizzel** and paste your connection key once. Your storefront keeps working in
the meantime; the key is what lets the screen's switch and sales analytics talk to
Vizzel. If you had switched Wall Preview off in an earlier version, it stays off.

= 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 move this store to another workspace? =

Open **Vizzel**, choose **Disconnect**, and confirm. The widgets stop appearing on
your storefront immediately and the stored credentials are removed. Your placement
and visibility choices are kept, so connecting again restores them as they were.

= Where is a widget's wording, design and limits configured? =

In your Vizzel dashboard, under *Storefront widgets*. The plugin decides where the
button sits and passes the product context; everything else is server-driven.

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

Yes. The only order access — for the optional sales analytics — goes through
WooCommerce's order API, and the plugin declares itself compatible.

= What is removed if I delete the plugin? =

Deleting it removes the Vizzel settings option (connection and widget setup), its
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 screen once a store is connected — status, the Wall Preview switch, and two shortcuts.
2. The Placement & visibility drawer: button position, hidden categories, the My account tab and sales analytics.
3. The "See it on your wall" button on a WooCommerce product page.
4. A shopper framing their room photo to a square before generating.
5. The finished preview, with the artwork placed on the shopper's own wall.

== Changelog ==

= 1.6.1 =
* **Connect with one key.** In Vizzel, open Store connection and copy your
  connection key; paste it into Vizzel in WordPress and click Connect. It replaces
  the Connect to Vizzel redirect, so connecting no longer sends you back and forth
  between sites.
* The key carries everything the plugin needs — the storefront key and your store's
  signing secret — so the Wall Preview switch and sales analytics work from the
  first paste. It is checked with Vizzel before anything is saved, and a key that
  does not connect is explained right under the field.
* Sales analytics is greyed out until a connection key is in place, rather than
  appearing to be on while sending nothing.

= 1.6.0 =
* **Connect in one click.** *Connect to Vizzel* takes you to your Vizzel account to
  approve, then straight back. There is no publishable key to paste any more.
* **One screen, one switch.** The Vizzel screen is now a status banner, a single
  switch to show or hide Wall Preview, and two shortcuts — *Open your storefront* and
  *Customize in Vizzel*. The switch is the same one as in your Vizzel dashboard, so
  the two can no longer disagree.
* Button position, hidden categories, the My account tab and sales analytics are
  together in a collapsed *Placement & visibility* section.
* **Sales analytics now works without a secret to paste.** The signing secret it
  needs arrives with the connection. (The old *Analytics secret* field asked for a
  value no Vizzel screen showed.)
* Removed the *Widget language* setting, which had no effect: widgets follow each
  shopper's language.
* Removed the placement sketch and the plugin's admin script; every control is a
  standard WordPress form element.

= 1.5.0 =
* **The preview now matches the option your shopper picked.** On a variable
  product — different sizes, framed and unframed — the preview follows the
  variation selected on the page, so a shopper choosing the oak frame sees the
  oak frame on their wall, and a 30x40 print no longer fills the same space as
  a 120x160 canvas.
* Sizes are read from your existing product data — the variation's dimensions,
  or a size written into the option name such as "50 x 70 cm". Nothing to set
  up, and a product without either previews exactly as it does today.
* You can turn this off under *Storefront widgets* in your Vizzel dashboard if
  your option names do not describe sizes.

= 1.4.0 =
* **The button's design and wording now live in your Vizzel dashboard**, under
  *Storefront widgets*, alongside a live preview. Colour, button style and size,
  corner shape, font, button text and the photo consent note are all set there —
  and a change reaches your storefront immediately, with no plugin update.
* **Why the move:** the same settings existed here AND in the Shopify app, so they
  drifted apart, and changing a button label meant waiting for a plugin release.
* **Nothing to do.** Your existing colour, shape and font keep working while you
  switch over. Set them once in the dashboard and they take over from there.
* This screen keeps what only WordPress can answer: where on the product page the
  button sits, which categories to hide it on, and your connection.

= 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.6.1 =
Connect by pasting one connection key from Vizzel → Store connection. If your store
was connected with an older version, paste the key once to turn on the switch and
sales analytics.

= 1.6.0 =
A simpler Vizzel screen with one-click connect. After updating, open Vizzel and click
Reconnect to Vizzel once. Your storefront keeps working until you do.

= 1.5.0 =
Previews now follow the size and frame your shopper selected on the product
page, instead of showing every piece the same way.

= 1.4.0 =
The button's colour, style, size, shape, font and wording move to your Vizzel
dashboard, with a live preview — so a change reaches your storefront straight
away instead of waiting for a plugin update. Your current settings keep working;
nothing to do when you update.

= 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.
