=== Blenda Art — View Artwork on Your Wall ===
Contributors: blendaart
Tags: woocommerce, augmented reality, ar, art, posters
Requires at least: 5.8
Tested up to: 6.9
Requires PHP: 7.4
Stable tag: 1.8.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Add a "View on your wall" augmented-reality button to WooCommerce product pages. Customers see artwork at true scale in their space — no app required.

== Description ==

Blenda AR connects your WooCommerce store to your gallery on [blenda.art](https://blenda.art) and adds a "View on your wall" button to product pages. When a customer taps it on their phone, the camera opens and the artwork appears on their wall at its real-world size.

**How it works**

1. Upload your artwork on [blenda.art](https://blenda.art) (the dimensions you set there are used for AR scale).
2. Open a WooCommerce product, click **Link Blenda artwork** in the Blenda AR metabox, and pick the matching artwork from the picker — visual, no slug typing.
3. Products linked to a Blenda artwork show the AR button automatically. Links are by stable artwork ID, so renaming the artwork in Blenda never breaks them.

**Features**

* Daily auto-sync verifies all products against your Blenda gallery.
* Manual "Sync All Products" button on the settings page.
* Per-product status badge in the WooCommerce products list.
* Per-product metabox with status, custom slug, and a one-click "Check Now" verify.
* Four button styles (default dark, outline, minimal, match-theme).
* Configurable button placement (before/after add-to-cart, after meta, after summary).
* WooCommerce HPOS compatible.
* No app download required for buyers — AR runs in the mobile browser.

**Privacy**

The plugin sends product slugs to the Blenda API to check whether each product has a matching artwork. No customer data is transmitted.

== Installation ==

1. Upload the `blenda-ar-woocommerce` folder to `/wp-content/plugins/` (or install via the plugin directory).
2. Activate the plugin via the **Plugins** menu in WordPress.
3. Go to **Settings → Blenda AR** and enter your subdomain (e.g. `studio-rosa` for `studio-rosa.blenda.art`) and an API key from your Blenda dashboard.
4. Click **Sync All Products Now** to verify your existing products.

== Frequently Asked Questions ==

= Do I need a Blenda account? =

Yes. Sign up free at [blenda.art](https://blenda.art) and upload your artworks there.

= Does the AR button require an app download? =

No. It opens directly in the buyer's mobile browser using the device camera.

= Why doesn't the button show up on my product? =

The plugin only shows the AR button on products that have been **verified** against the Blenda API. Check the Blenda AR metabox on the product edit page — it shows whether the product is verified, not found, or errored.

= Can I override the artwork slug per product? =

Yes — every product has an "Artwork Slug" field in the Blenda AR metabox. Leave it empty to use the WooCommerce product slug.

== External Services ==

This plugin connects to two external services:

**Blenda Art API (blenda.art)**
Used to fetch your artwork catalog and verify product links. The plugin sends your gallery subdomain and API key to authenticate. This service is provided by Blenda Art — see their [Privacy Policy](https://blenda.art/privacy) and [Terms of Service](https://blenda.art/terms).


== Screenshots ==

1. Settings page with gallery connection and sync controls.
2. Per-product Blenda AR metabox with verification status.
3. Frontend "View on your wall" button on a product page.

== Changelog ==

= 1.8.0 =
* **AR image picker** — when a product has multiple images, a thumbnail strip appears in the metabox. Click the clean artwork shot to use it for AR instead of the featured image (which may be a lifestyle or scene photo). Selection is respected by both single-push and bulk sync.

= 1.7.0 =
* **Faster bulk sync** — "Sync All Products" now uses a bulk API endpoint, sending up to 250 products per request instead of one at a time. Per-item errors are still written back to each product so failures are visible in the admin.

= 1.6.0 =
* **Auto-sync on save** — products in selected categories are pushed to Blenda automatically when saved in WooCommerce. Choose which categories trigger auto-sync in the plugin settings.
* **Push products to Blenda** — new bulk action button on the settings page to push all eligible products in one click.
* **Delete on trash** — trashing or deleting a WooCommerce product removes the corresponding artwork from Blenda automatically.
* Manual picker links are never overwritten by auto-sync.

= 1.5.0 =
* **Desktop QR modal** — on desktop browsers, clicking "View on your wall" now shows an inline QR code modal instead of opening a new tab. Customers scan the QR with their phone to launch the AR experience. Mobile clicks still go directly to the AR viewer.
* **Base URL moved to Advanced** — the "Blenda Base URL" field is now collapsed under an Advanced section so it doesn't clutter the main settings for regular users.

= 1.4.0 =
* **API key required** — the gallery list now requires authentication, so a competitor with just your subdomain can't enumerate your full catalog. Generate a key at Blenda → Settings → API Keys.
* **Picker fix** — picking an artwork now works reliably (the previous version used nested forms which are not allowed in HTML and broke clicks in some browsers).
* Renamed "Gallery Slug" to "Subdomain" in the UI for clarity (e.g. `studio-rosa.blenda.art` → enter `studio-rosa`).

= 1.3.0 =
* **Visual artwork picker** — link products to Blenda artworks by clicking a thumbnail instead of typing slugs. No more slug-mismatch errors.
* **Stable ID linking** — products are now linked to artworks by their permanent ID, so renaming an artwork in Blenda no longer breaks the link.
* **Auto-migration** — existing slug-based links are migrated automatically on first sync.
* **Orphan detection** — if a linked artwork is deleted from Blenda, the product is flagged as orphaned with a one-click way to relink or unlink.
* Removed the typed Artwork Slug field from the metabox (now handled invisibly via the picker).

= 1.2.0 =
* Distinguish "Gallery not found" vs "Artwork not found" vs "Artwork still processing" — the metabox and status column now show exactly what failed.
* Added "Test Gallery Connection" button on the settings page — verifies the gallery slug independently of any product.
* Added "Resolve API ↗" debug link in each product's metabox — opens the raw API URL in a new tab.
* Added an unmatched-products list on the settings page after sync — shows the WC slugs that didn't match anything in Blenda, with one-click test links.

= 1.1.0 =
* Added daily cron-based bulk sync.
* Added per-product status indicator in the products list.
* Added "Check Now" action in the metabox.
* WooCommerce HPOS compatibility declared.

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 1.8.0 =
No action required. The AR image picker appears automatically in the metabox if a product has multiple images.

= 1.7.0 =
No action required. Bulk sync is now significantly faster.

= 1.6.0 =
No action required. Configure auto-sync categories in Settings → Blenda AR if you want products pushed on save.

= 1.5.0 =
No action required. Desktop customers now see a QR code modal instead of a new tab.

= 1.4.0 =
**Action required:** generate an API key at Blenda → Settings → API Keys and paste it into the plugin settings. The picker will not load until the key is set.

= 1.3.0 =
Adds a visual artwork picker. Existing slug-based links are migrated automatically on first sync — no action required.

= 1.2.0 =
Better diagnostics for slug-mismatch errors. No action required after upgrade.

= 1.1.0 =
Adds automatic daily sync and per-product status indicators. No action required after upgrade.
