=== Blenda Art: Preview Artwork on Your Customer's 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.9.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Add a "View on your wall" button to WooCommerce product pages. Customers see artwork at true size on their own wall. No app required.

== Description ==

Blenda 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. Sign up at [blenda.art](https://blenda.art) and paste your API key into the plugin settings. Your gallery is detected automatically.
2. Push your products to Blenda with one click (or upload artwork on blenda.art and link products with the visual picker. No slug typing.)
3. Linked products show the wall preview button automatically. Links are by stable artwork ID, so renaming the artwork in Blenda never breaks them.

**Features**

* One-field connect: paste your API key and your gallery is detected automatically.
* Size variations: the preview follows the selected variation, using its own width/height or a size parsed from the variation name (like "50x70" or standard paper sizes A0-A6).
* Push products to Blenda in bulk, or link them one by one with a visual picker.
* Daily auto-sync verifies all products against your Blenda gallery.
* Manual "Verify links" button on the settings page.
* Per-product status badge in the WooCommerce products list.
* Per-product metabox with status 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. The preview 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 Art** and paste an API key from your Blenda dashboard (Settings → Developer → API Keys). Your gallery is detected automatically.
4. Click **Verify links** to match 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.

= Where do I find my API key? =

In your Blenda dashboard under Settings → Developer → API Keys. Paste it into the plugin settings; your gallery is detected automatically from the key.

= Does the wall preview 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 wall preview button on products that have been **verified** against the Blenda API. Check the Blenda metabox on the product edit page. It shows whether the product is verified, not found, or errored.

= Can I link a product to a different artwork? =

Yes. Open the product and click **Link Blenda artwork** in the Blenda metabox to pick any artwork from your gallery. Picker links are never overwritten by automatic sync.

= Does the preview follow my size variations? =

Yes. On variable products, the preview uses the selected variation's own width and height (Product data → Variations). If a variation has no dimensions, the plugin reads the size from the variation name, like "50x70" or standard paper sizes (A0-A6).

== 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 API key to authenticate; your gallery is resolved from the key. 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 metabox with verification status.
3. Frontend "View on your wall" button on a product page.

== Changelog ==

= 1.9.0 =
* **One-field connect** - paste your API key and your gallery is detected automatically. The subdomain field is gone; the key also proves you own the gallery you connect.
* **Variation sizes** - on variable products the wall preview now follows the selected variation: it reads the variation's own width/height (Product data → Variations), or falls back to parsing the size out of the variation name ("50x70", or standard paper sizes A0-A6). The displayed dimensions and the QR modal update too.

= 1.8.1 =
* Copy: the button and admin labels now say "wall preview" / "View on your wall" instead of "AR" - same feature, clearer wording for shoppers.
* Fixed the API-key field hint to show the correct `blenda_live_…` key format.

= 1.8.0 =
* **Artwork image picker** - when a product has multiple images, a thumbnail strip appears in the metabox. Click the clean artwork shot to use it for the wall preview 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 open the wall preview. Mobile clicks still go directly to the preview.
* **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 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.9.0 =
No action required. Your existing connection keeps working; the subdomain field is simply gone (it's detected from your API key now). If you sell size variations, set width/height on each variation, or name them like "50x70" or "A3", and the preview follows the chosen size.

= 1.8.1 =
No action required. Wording-only update. The button works exactly the same.

= 1.8.0 =
No action required. The artwork 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 Art 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.
