=== Scratch Coupon Popup ===
Contributors: webzmeta
Tags: popup, coupon, scratch card, discount, woocommerce
Requires at least: 5.0
Tested up to: 7.1
Requires PHP: 7.2
Stable tag: 1.0.0
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Add an interactive scratch-card popup to your WordPress site. Visitors scratch to reveal a hidden coupon code — just like a real lottery ticket.

== Description ==

**Scratch Coupon Popup** gives your visitors a fun, gamified way to receive discount codes. Instead of a plain popup, they scratch away a shiny layer with their mouse or finger to reveal a hidden coupon — just like a real scratch card.

No page builder needed. Install, configure from the WordPress dashboard, and it works on every page of your site.

= How It Works =

1. A popup appears after a configurable delay (default: 5 seconds).
2. The visitor scratches the metallic layer with their mouse or finger.
3. Once enough area is scratched, the coupon code is automatically revealed.
4. The visitor can copy the code with one click and use it at checkout.

= Features =

**Scratch Effect**

* Real canvas-based scratch card — works with mouse and touch (mobile friendly)
* Configurable scratch reveal threshold (how much to scratch before auto-reveal)
* Metallic shimmer effect on the scratch layer

**Popup Design**

* Change popup width and border radius
* 6 entrance animations: Fade In, Slide Down, Slide Up, Zoom In, Bounce In, Flip In
* Box shadow toggle
* All colors customizable: background, text, coupon code, button, scratch layer, overlay

**Typography**

* Choose from 10 font families
* Set body font size and coupon code font size separately

**Positioning**

* 9 positions: Top Left, Top Center, Top Right, Middle Left, Center, Middle Right, Bottom Left, Bottom Center, Bottom Right

**Coupon Content**

* Set popup title, description text, coupon code, button text and button URL
* Button can either copy the coupon code or redirect to a URL (e.g. your shop page)

**Display & Behavior**

* Enable or disable the popup with one click
* Set a delay (0–300 seconds) before the popup appears
* Show on: All Pages, Home Page Only, Specific Pages/Posts, or All Except certain pages
* "Don't show again" cookie — hide the popup for returning visitors for X days
* Close button (×), overlay click to close, and ESC key support

**Accessibility**

* ARIA dialog roles and labels
* Keyboard accessible (ESC to close)
* Respects `prefers-reduced-motion`

= Privacy =

This plugin stores a cookie in the visitor's browser (`scracopo_hide_popup`) only when the visitor checks "Don't show again". No personal data is collected, transmitted, or stored on the server. No external services are used.

= WooCommerce Compatible =

Set the button URL to any WooCommerce page — shop, cart, checkout, or a product page.

== Installation ==

**From your WordPress Dashboard:**

1. Go to **Plugins > Add New**.
2. Search for **Scratch Coupon Popup**.
3. Click **Install Now** and then **Activate**.
4. Go to **Scratch Popup** in your admin sidebar to configure.

**Manual Installation:**

1. Download the plugin ZIP file.
2. Go to **Plugins > Add New > Upload Plugin**.
3. Upload the ZIP file and click **Install Now**.
4. Activate the plugin.
5. Go to **Scratch Popup** in your admin sidebar to configure.

== Frequently Asked Questions ==

= Does this plugin work with any WordPress theme? =

Yes. The popup is injected into `wp_footer` and uses a high z-index so it displays correctly on top of any theme.

= Will it slow down my website? =

No. The plugin only loads its CSS and JavaScript on pages where the popup is enabled. The files are lightweight and load in the footer.

= Can I show the popup on specific pages only? =

Yes. Go to **Display Rules** tab, set "Show Popup On" to "Specific Pages / Posts", and enter the post or page IDs separated by commas.

= How do I stop the popup from showing again to the same visitor? =

Enable the **"Don't Show Again"** option. The visitor can check the checkbox in the popup, and a cookie will hide the popup for the number of days you configure.

= Can I change the scratch layer color? =

Yes. Go to **Design & Style > Colors > Scratch Layer Color** and pick any color with the color picker.

= Is it compatible with WooCommerce? =

Yes. Set the button URL to any WooCommerce page such as your shop, cart, or a specific product page.

= Does it work on mobile and tablets? =

Yes. The scratch effect fully supports touch events, so visitors can scratch with their finger on any mobile device or tablet.

= How do I get support? =

For direct support, contact ping@dakshb.co.in or use the plugin's support forum on WordPress.org.

= Does the plugin collect any data? =

No. The only data stored is a browser cookie (`scracopo_hide_popup`) when the visitor opts out of seeing the popup again. No data is sent to any external server.

= How do I update the coupon code? =

Go to **Scratch Popup > Settings > Coupon Content** and update the **Coupon Code** field. Save and it takes effect immediately.

== Screenshots ==

1. Frontend popup — scratch card visible before scratching
2. Frontend popup — coupon revealed after scratching
3. Admin settings — General tab
4. Admin settings — Coupon Content tab
5. Admin settings — Design & Style tab
6. Admin settings — Display Rules tab

== Changelog ==

= 1.0.0 =
* Initial release.
* Canvas-based scratch card effect with mouse and touch support.
* Full admin settings panel with tabs: General, Coupon Content, Design & Style, Display Rules, Advanced.
* 9 popup position options.
* 6 entrance animations.
* "Don't show again" cookie support.
* WooCommerce compatible.
* Accessible with ARIA roles and keyboard support.

== Upgrade Notice ==

= 1.0.0 =
Initial release. No upgrade steps required.

== Privacy Policy ==

Scratch Coupon Popup does not collect, store, or transmit any personal data. The only data written by this plugin is a browser cookie (`scracopo_hide_popup`) stored locally on the visitor's device when they opt out of seeing the popup again. This cookie is never sent to the plugin author or any third party.

If you use this plugin on a site subject to GDPR, CCPA, or similar privacy laws, you may wish to mention this cookie in your site's privacy policy.
