=== WPThemePrime Product Image Swap for WooCommerce ===
Contributors: wpthemeprime
Tags: woocommerce, product image, image swap, secondary image, image hover
Requires at least: 5.8
Tested up to: 7.0
Stable tag: 1.2.0
Requires PHP: 7.4
Requires Plugins: woocommerce
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Swap WooCommerce product images on hover with 8 animations. Auto gallery fallback, mobile tap support, live preview in settings.

== Description ==

**WPThemePrime Product Image Swap for WooCommerce** lets customers preview a second product image by hovering over any product card — in shop pages, categories, or home page grids.

**Key Features:**

* **8 Animation Types:** Fade, Slide Up/Down/Left/Right, Zoom In/Out, and Instant Swap.
* **Auto Gallery Fallback:** No secondary image set? The plugin automatically uses the first WooCommerce gallery image. Works immediately for stores that already have gallery images — zero setup per product.
* **Mobile Tap Support:** On touch devices, tap once to reveal the secondary image; tap again to navigate to the product.
* **Image Preloading:** Secondary images are preloaded on hover-intent to prevent flash or delay.
* **Live Settings Preview:** See your animation in real time on the settings page — with a Play button to simulate the effect.
* **Custom Speed:** Set animation duration from 50ms to 5000ms using a range slider.
* **Page Control:** Enable or disable independently for Shop, Home, and Single product pages.
* **HPOS Compatible:** Fully compatible with WooCommerce High Performance Order Storage.
* **Clean Uninstall:** All plugin data is removed from the database when the plugin is deleted.

**How to Use:**

1. Go to **Products > Edit Product**.
2. Find the **Secondary Product Image (Swap)** box in the right sidebar.
3. Click **Select / Upload Image**.
4. Save the product.
5. Configure animation and display options at **WooCommerce > Image Swap**.

== Installation ==

1. Upload the `product-image-swap-for-woocommerce` folder to `/wp-content/plugins/`.
2. Activate through the **Plugins** menu in WordPress.
3. Configure at **WooCommerce > Image Swap**.

== Frequently Asked Questions ==

= Does this work with all WooCommerce themes? =

Yes, with most WooCommerce-compatible themes that use standard WooCommerce templates. Themes heavily overriding WooCommerce templates may need minor CSS adjustments.

= Will it slow down my store? =

No. All transitions are CSS-based. Secondary image IDs are cached via WordPress object cache to prevent extra database queries on pages with many products.

= Does this work on mobile? =

Yes. The first tap on a product image reveals the secondary image. The second tap navigates to the product page. Tapping outside any product resets all.

= Does this work with WooCommerce Blocks? =

This plugin supports classic WooCommerce templates (shortcodes, PHP-based themes). WooCommerce Blocks (Gutenberg/FSE product loops) are not currently supported — this is a known limitation.

= What is the Auto Gallery Fallback? =

When enabled, if a product has no manually assigned secondary image, the plugin uses the first image from the WooCommerce product gallery automatically. Stores with existing gallery images work with zero per-product setup.

= What happens to my data when I delete the plugin? =

All plugin data is removed: the settings option and all secondary image assignments are deleted from the database.

== Screenshots ==

1. **Settings Page:** Configure animation type and speed with live preview.
2. **Product Editor:** Upload the secondary image from the sidebar meta box.

== Changelog ==

= 1.2.0 =
* Added: Auto gallery fallback.
* Added: Mobile tap-to-reveal.
* Added: Image preloading on hover.
* Added: Live animation preview on settings page with Play button.
* Added: Animation speed range slider.
* Added: Zoom Out, Slide Left, Slide Right animation types.
* Added: HPOS compatibility declaration.
* Added: Object cache for secondary image ID lookups.
* Added: WooCommerce activation check with admin notice.
* Fixed: border-radius not applied to secondary images.
* Fixed: Secondary images affected by lazy-load themes.
* Improved: Full prefix refactor to pisw_ — no collision with common terms.
* Improved: Security — all output escaped, all input sanitized.

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 1.2.0 =
Adds mobile tap support, auto gallery fallback, live settings preview, and new animation types. Recommended for all users.
