=== Revoty – Photo Reviews & Free Shipping Bar for WooCommerce ===
Contributors: cagdasdag, wpcenter
Tags: photo reviews, free shipping bar, woocommerce reviews, customer reviews, free shipping
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 7.4
Stable tag: 1.1.0
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

WooCommerce photo reviews and a configurable free shipping progress bar. One plugin, two modules, both can be enabled independently.

== Description ==

Revoty adds two things to a WooCommerce store: photo reviews on product pages, and a free shipping progress bar that follows the customer through cart, checkout, and the mini-cart. Each module is independent — you can enable just one, or both.

The plugin is built on the WooCommerce extension API and the WordPress REST API. It does not replace the WooCommerce review system, the cart, or the checkout. It hooks into them.

= Why use it =

* You sell on WooCommerce and want customers to upload photos with their reviews — for product pages, jewelry, fashion, food, prints, anything where a buyer photo says more than a paragraph
* You offer free shipping above a threshold and want customers to actually see how close they are to qualifying — on cart, checkout, the mini-cart drawer, or anywhere via shortcode
* You don't want a 50-feature suite — just these two, working reliably

= Photo Reviews for WooCommerce =

The Photo Reviews module lets customers attach images to the standard WooCommerce review form. Photos render in two places: a grid below each individual review and an aggregated gallery at the top of the review section.

**Customer-side**

* The review form on every product page gets an "Upload Photos" field
* Customers select multiple images from their device
* Inline validation rejects oversized or over-limit files before submit, with an error message in the form
* "Photos required" mode prevents the review from being submitted without at least one image
* On submit, files are uploaded as standard WordPress attachments and linked to the review

**Display**

* Per-review grid: thumbnails appear below the review text, sized for mobile and desktop
* Product-level gallery: an aggregated grid of all customer photos for the product appears above the review list, with a configurable title (e.g. "Customer Photos") and a configurable photo count
* Photos that don't fit in the gallery are still visible in their individual reviews
* Pro: clicking a photo opens a lightbox with prev/next navigation, keyboard shortcuts (arrow keys, Esc), and a toggleable info bar showing the reviewer's name, rating, and comment

**Configuration**

* Maximum photos per review (Free: up to 3 / Pro: up to 10)
* Maximum file size (Free: up to 3 MB / Pro: up to 10 MB)
* Make photos required (on/off)
* Show the gallery (on/off), gallery title, and gallery photo count
* Pro: lightbox author / rating / comment toggles

**Storage and formats**

* Files are stored in the WordPress media library and attached to the parent product
* Accepted formats: JPG, PNG, WebP
* No external CDN, no third-party upload service

= Free Shipping Bar for WooCommerce =

The Free Shipping Bar reads your WooCommerce free shipping zone settings and shows the customer how much they need to add to qualify. It updates as the cart changes.

**Display surfaces**

* Cart page (classic and the WooCommerce Cart Block)
* Checkout page (classic and the WooCommerce Checkout Block)
* Mini-cart drawer — the bar renders inside the drawer's flex column so the checkout button stays visible (a common issue with shipping bar plugins that inject above the contents)
* Anywhere via the `[revoty_free_shipping_bar]` shortcode
* Anywhere via the "Free Shipping Bar" Gutenberg block — drop it in posts, pages, sidebars, or full-site-editing templates

**Messaging**

* Initial message (cart empty or below threshold)
* Progress message (with a `{amount}` placeholder for the remaining amount)
* Qualified message (cart at or above threshold)
* All three messages are editable per language

**Styling**

* Bar background color, progress bar color, text color
* Two layout styles: modern animated stripes, or a flat fill
* Live preview in the settings panel — you see what the bar will look like before you save
* Mobile-responsive

**Behavior**

* Reads the actual WooCommerce free shipping threshold from your shipping zone, including method min-amount conditions
* Refreshes when items are added or removed from the cart
* Hides automatically once the customer qualifies (optional)

= Free vs Pro =

The Free version covers everything above except: more than 3 photos per review, file sizes above 3 MB, and the lightbox (with its toggleable info bar) for Photo Reviews. Upgrades go through Freemius and are managed from the wp-admin dashboard.

= Compatibility =

* WooCommerce 7.0+
* WordPress 6.0+
* PHP 7.4+
* The classic WooCommerce cart and checkout shortcodes
* The WooCommerce Cart and Checkout Blocks
* The Mini-Cart Block (drawer)
* Block themes (the shipping bar block can be inserted into FSE templates and patterns)
* Classic themes (the bar still works via shortcode and automatic injection)
* Multisite (settings are per-site)

== Installation ==

1. Install from the WordPress plugin directory (Plugins → Add New, search "Revoty"), or upload the ZIP via Plugins → Add New → Upload Plugin
2. Activate the plugin
3. Open the **Revoty** menu in the admin sidebar
4. Enable the modules you want (Photo Reviews and/or Free Shipping Bar)
5. Configure each module from its settings page

= Configuring Photo Reviews =

1. Revoty → Photo Reviews
2. Set the maximum photos per review and maximum file size
3. Toggle "Photos required" if you want to make at least one photo mandatory
4. Configure the customer photos gallery (title and photo count)
5. (Pro) Configure the lightbox info bar
6. Save

The review form will start showing the photo upload field on the next product page load.

= Configuring the Free Shipping Bar =

1. Make sure you have a free shipping zone configured in WooCommerce → Settings → Shipping with a minimum order amount
2. Revoty → Free Shipping Bar
3. Customize the three messages (initial, progress, qualified). Use `{amount}` in the progress message to insert the remaining amount.
4. Pick colors and a layout style. The live preview updates as you change settings.
5. Save

The bar will appear on the cart, checkout, and mini-cart automatically. Use the shortcode or block to place it elsewhere.

== Frequently Asked Questions ==

= Does it require WooCommerce? =

Yes. WooCommerce 7.0 or later.

= Does it work with the new Cart and Checkout Blocks? =

Yes. It also works with the classic shortcodes. You don't have to choose.

= Does the shipping bar work in the mini-cart? =

Yes. The bar is injected into the mini-cart drawer in a way that doesn't push the checkout button below the viewport — a common bug in other shipping bar plugins.

= How does the bar know the free shipping threshold? =

It reads your WooCommerce shipping zone configuration, specifically the minimum amount on the free shipping method. You don't enter the threshold separately.

= What if I have multiple shipping zones? =

The bar uses the zone that applies to the customer's location, the same logic WooCommerce uses for shipping calculation.

= Where exactly do photos appear on a product page? =

Two places. (1) Below each individual review, as a thumbnail grid. (2) Above the review list, as an aggregated gallery of all customer photos for that product.

= Can a customer upload more photos than the limit? =

No. Validation runs in two layers: the browser blocks the form submission with an inline error if the count or size is exceeded, and the server rejects the submission again as a defense-in-depth check.

= What happens if a customer tries to submit a review without photos when "Photos required" is on? =

The submission is blocked. The customer sees a message asking them to add at least one photo before they can submit.

= What image formats are supported? =

JPG, PNG, and WebP. GIF and HEIC are not supported.

= Where are uploaded photos stored? =

In the WordPress media library, like any other attachment. They are linked to the parent product post.

= Can admins delete a photo from a review? =

Yes. Admin can manage attachments from the standard Comments / Reviews screen and from the Media Library.

= Is this plugin compatible with my theme? =

It uses standard WooCommerce hooks for both modules and standard block APIs for the shipping bar. It works with any theme that follows WooCommerce template conventions, including block themes (FSE) and classic themes.

= Is it compatible with WPML / Polylang / TranslatePress? =

The bar's three messages can be translated. The plugin is text-domain ready.

= Does it support RTL languages? =

Yes.

= Does it support multisite? =

Yes. Settings are per-site.

= Does it slow down my product pages? =

The Photo Reviews frontend script is a small file (≈3 KB minified) and only loads on product pages. The shipping bar script and styles only load where the bar appears. Photos use lazy loading.

= Where is the data stored? =

Inside your WordPress install. Photo attachments use the standard media library. Module settings live in the `wp_options` table.

= Does it use any external services? =

The free version does not. The Pro version uses Freemius to handle license activation and updates. No analytics or tracking.

= How do I report a bug or request a feature? =

Through the support forum on WordPress.org or on the GitHub repository linked from the plugin homepage.

= How does the upgrade to Pro work? =

From the wp-admin dashboard. Click any "Upgrade to Pro" button, complete checkout via Freemius, and the Pro features are activated automatically.

== Use Cases ==

= Stores selling visually-driven products =

Jewelry, fashion, prints, food, art, plants, makeup, candles. Photos of products in real settings build trust faster than text reviews.

= Stores running a free shipping promotion =

The bar reduces friction by telling customers exactly how much more they need to spend, instead of leaving them to figure it out at checkout.

= Stores using the WooCommerce Mini-Cart drawer =

The bar appears in the drawer alongside the cart contents without breaking the layout.

= Block-theme stores using FSE =

The Free Shipping Bar block works in templates, template parts, and patterns.

== Screenshots ==

1. Photo Reviews settings panel
2. Customer review form with photo upload field
3. Customer photos gallery on a product page
4. Pro lightbox with info bar
5. Free Shipping Bar settings with live preview
6. Shipping bar on the cart page
7. Shipping bar in the mini-cart drawer

== Changelog ==

= 1.1.0 =

New

* Free Shipping Bar module with Gutenberg block, `[revoty_free_shipping_bar]` shortcode, and WooCommerce Cart & Checkout Blocks support
* Live preview in the Free Shipping Bar settings panel
* Photo Reviews: client-side validation rejects over-limit and oversized files before upload, with an inline error message
* Photo Reviews: "Photos required" now blocks submission when no photo is attached

Fixes

* Photo Reviews: numeric settings persist correctly (a duplicate AJAX handler was short-circuiting saves and the sanitizer fell back to the Pro default on null input)
* Photo Reviews: removed silent server-side truncation of extra files
* Photo Reviews Pro: lightbox renders correctly (CSS asset path matched the webpack emit)
* Free Shipping Bar mini-cart: bar no longer pushes the checkout button below the viewport — it now renders inside the drawer's flex column
* Free Shipping Bar settings: stripe animation plays in the live preview
* Admin UI: Mantine dropdowns and color pickers retargeted to the scoped wrapper so they render correctly inside wp-admin
* Admin UI: "Upgrade to Pro" buttons navigate to the Freemius upgrade URL
* Admin UI: dashboard reads version from the localized settings object instead of a never-set global

Internal

* Refactor to a service-layer module structure
* Built assets removed from the repo (built at deploy)

= 1.0.0 =

* Initial release
* Photo Reviews module: upload, gallery, lightbox (Pro), configurable limits

== Upgrade Notice ==

= 1.1.0 =
Adds the Free Shipping Bar module and fixes Photo Reviews settings persistence, Pro lightbox rendering, and the mini-cart checkout button being hidden when the shipping bar is shown.
