=== LuckyUp for WooCommerce ===
Contributors: fotibout, freemius
Tags: spin wheel, gamification, email capture, coupons, woocommerce
Requires at least: 6.2
Tested up to: 7.1
Requires PHP: 7.4
WC requires at least: 7.0
Stable tag: 2.0.7
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Spin wheel and scratch card popup for WooCommerce: visitors enter their email to play, win a unique coupon and you grow your list.

== Description ==

LuckyUp for WooCommerce shows a spin wheel or scratch card popup. The visitor enters an email, plays and wins a prize. The code appears on screen with a copy button and is also emailed. Every code is a unique, single-use WooCommerce coupon.

* Two games: spin wheel and scratch card, with your colors, logo, a color per slice and your own cover image, and a live preview while you edit
* Themes: Brand colors and Flower shop, plus ready-made designs (Minimal, Christmas, Black Friday)
* Prizes: % discount, fixed discount, free shipping, gift product with the first order, spin again, no prize
* Probability per prize, checked to add up to 100%, and a maximum number of times per prize
* The prize is drawn on the server, never in the browser
* Average discount calculator: average discount per play, gift cost and expected cost per 1,000 plays
* Unique coupons with your own prefix, suffix and length, expiry date, minimum order, sale items option
* Play rules: once only, daily, weekly, monthly or every X days, and campaign dates
* Popup in the center or as a side panel; opens after some seconds, on scroll, on exit intent or only from the floating button
* Show on desktop, mobile or both, and on all pages, only some, or all except some
* Waits for the cookie banner or other popups to close
* [luckyup] shortcode to place the game inside any page
* Prize email through the site (WooCommerce email design) or a Brevo template
* Brevo integration: new contacts go to your list with the prize, code and expiry as attributes
* Statistics: plays, emails, codes used, orders, revenue, discount given and real average discount
* Data cleanup by date, automatic cleanup, WordPress personal data export and erase
* Compatible with HPOS and the Cart and Checkout blocks

= LuckyUp for WooCommerce Pro =

The Pro version adds two more games (gift boxes and mystery reveal) with your own images, Klaviyo and webhooks (Zapier, Make, n8n), and detailed statistics with a daily chart, lists of plays and orders and CSV export. Details: https://marketup.gr/wordpress-plugins/luckyup-for-woocommerce/

== Installation ==

1. Upload the plugin and activate it. WooCommerce must be active.
2. Go to WooCommerce > LuckyUp.
3. Set your prizes and design in Game Builder, then enable LuckyUp in General.

== Frequently Asked Questions ==

= Can visitors cheat the wheel? =

No. The prize is chosen on the server when the visitor plays. The browser only shows the result.

= Does it work with page caching? =

Yes. The game does not depend on cached nonces and the play request is never cached.

= Can the same person play many times? =

No. Email, logged-in customer and a browser cookie are checked, and optionally the IP address (stored only as a hash).

== External services ==

This plugin connects to these services only when you turn them on or agree to them:

* Brevo (https://www.brevo.com/), when you enable the Brevo integration or choose a Brevo template for the prize email. The visitor's email, name (if asked), prize, coupon code and expiry date are sent to the Brevo API (api.brevo.com) each time someone plays. Brevo terms: https://www.brevo.com/legal/termsofuse/ and privacy policy: https://www.brevo.com/legal/privacypolicy/
* Freemius (https://freemius.com/), for optional usage data, which is only sent if the site admin opts in, and for license activation if you buy the Pro version. Data sent: site URL, WordPress, PHP and plugin versions, and the admin's name and email. Freemius terms: https://freemius.com/terms/ and privacy policy: https://freemius.com/privacy/

== Changelog ==

= 2.0.7 =
* Plugin Check fixes: all database queries use placeholders, output escaping, headers.
* Requires WordPress 6.2 or newer.

= 2.0.6 =
* The scratch card game is now part of the free version.

= 2.0.5 =
* Free version now includes the Flower shop theme and presets, all prize types, the calculator, all play rules and all display and targeting options. Pro: more games, Klaviyo, webhook, detailed statistics.

= 2.0.4 =
* WordPress.org ready: the free version only contains free features; Pro adds its options through hooks.
* Probability total shown under the prize table.

= 2.0.3 =
* Fix for the Freemius build.

= 2.0.2 =
* Pro code moved to separate files that are not part of the free version.

= 2.0.1 =
* Connected to the Freemius product (ID 45931). Pro features need a license.

= 2.0.0 =
* Free and Pro versions with Freemius licensing. Pro features unlock with a license; stored settings are kept when a license expires.
* Freemius SDK 2.13.5 included. Until the product ID is set, all features stay unlocked (development mode).
* Uninstall cleanup runs through the Freemius uninstall hook.

= 1.7.0 =
* Statistics: sub-tabs Overview, Plays, Orders, Export and data; date filter (today, 7 days, 30 days, this month, last month, all, custom); daily chart; paginated tables with search and filters (prize, game, used or not); Used column with order link; CSV export that follows the filters.
* "Codes used: X of Y" instead of a bare percentage.
* Optional daily deletion of expired, unused LuckyUp coupons; "LuckyUp" filter in the WooCommerce coupons list.

= 1.6.1 =
* Fix: while the wheel spun, a scrollbar appeared at the bottom of the popup and the popup moved.

= 1.6.0 =
* Coupon code settings in Play rules: prefix, suffix, number of random characters (4 to 20), letters and numbers, numbers only or letters only, avoid look-alike characters, live example.

= 1.5.2 =
* Game Builder: the calculator is now really at the bottom (1.5.1 only changed the version number).

= 1.5.1 =
* Game Builder: the average discount calculator moved to the bottom (1. Game, 2. Prizes, 3. Design, 4. Calculator).

= 1.5.0 =
* Klaviyo integration: profile with prize properties, list subscription with consent, "LuckyUp Prize Won" event for flows, connection test.
* Game Builder tab: game, prizes, calculator and design on one page with one live preview and section links.

= 1.4.0 =
* New Game & Design tab: pick the game with visual cards, theme, main colors, logo, wheel colors and all game options next to the live preview.
* General tab keeps only the basics (status, form, shortcode).
* Settings of the same section saved from different tabs no longer reset each other.

= 1.3.2 =
* Prizes tab: the preview follows the chosen game (wheel, scratch card, gift boxes, mystery reveal) with a working play button and a Change game link.
* Slice and text color columns only for the wheel; compact color swatches; preview moves under the table on smaller screens.
* Warnings when a label does not match its prize (for example 20% OFF with value 10, or free shipping with another type).

= 1.3.1 =
* Fix: the wheel slices rotated around the corner instead of the center and flew out of the wheel when spinning.

= 1.3.0 =
* Design tab: colors for all games, scratch card cover (color, gradient or own image), cover text, brush size, gift boxes colors, 3 to 5 boxes, own closed and open box images, mystery reveal shapes (gift, envelope, own image).
* Presets: Flower shop, Minimal, Christmas, Black Friday, and Reset to theme.
* Live preview with a working game in the admin.
* Fix: form and hints stayed visible after winning.

= 1.2.2 =
* Recommended logo dimensions shown under the logo field.

= 1.2.1 =
* Popup position: left panel option (center on mobile).

= 1.2.0 =
* Respect other popups: wait for the cookie banner, do not open over another popup, optional one popup per visit, wait time after the other popup closes.

= 1.1.0 =
* New wheel design (rim, pin pointer, two-line labels), slice and text color per prize, live preview.
* Popup position: center or right panel (always center on mobile).
* New prize types: Spin again, No prize.
* Data settings moved to Statistics with a "Never delete" option.

= 1.0.0 =
* First release (phase 1).
