=== GT BOGO Engine for WooCommerce ===
Contributors: graphictshirts
Tags: bogo, buy one get one, woocommerce discount, free gift, promotional pricing
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 7.4
Stable tag: 3.16.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Enterprise Buy X Get Y automation for WooCommerce. 200 industry Pro Packs, 27 Superpowers, full white-label customer emails, and enterprise campaign tools — all automatic.

== Description ==

**GT BOGO Engine** is the most powerful BOGO (Buy X Get Y) plugin for WooCommerce. Designed for serious stores that need more than a basic discount plugin — it gives you complete enterprise-grade control over promotional pricing, applied automatically at checkout with zero friction for your customers.

No coupon codes. No manual intervention. Every deal fires automatically.

= Free Features =

* **Free Core Rule** — Configure a global Buy X Get Y rule with category and product targeting, priority, and scheduling
* **Product Badges** — Display BOGO badges on qualifying products in your shop
* **Cart Progress Bar** — Show customers how close they are to unlocking a deal
* Full WooCommerce compatibility (Simple, Variable, Grouped products)
* Lightweight — no bloat, no page speed impact

= PRO Features =

**200 Industry Pro Packs**
Ready-built rule sets covering every retail vertical — Food & Dining, Fashion & Apparel, Beauty & Wellness, Automotive, Tech & Software, Health, Education, Travel, Events, Sports & Fitness, B2B Wholesale, and more. Each pack includes 10 enterprise-grade BOGO rules ready to activate in one click. Rules are imported from purchased packs — manual rule creation is not available in PRO.

**Bundle License System**
* Starter Revenue Bundle — 5 packs
* Growth Acceleration Bundle — 9 packs
* Complete BOGO Arsenal — 15 packs
* One license key unlocks all packs in your bundle automatically
* License is domain-locked and non-transferable between owners
* Self-service domain transfer available at graphictshirts.shop/bogo

**Rule Management**
* Import rule templates in one click from the Pro Packs vault
* Priority ordering and conflict resolution across all imported rules
* Full rule conditions — category, product, cart value, customer type, user role targeting
* Category and product targeting on the free core rule
* Rule scheduling with start and end dates on all rules including the free core rule

**Enterprise Targeting**
* Customer Segmentation — First-time, returning, VIP, spend-based targeting
* Geographic Targeting — Country-level include/exclude lists
* Product Variant Rules — Target specific sizes, colors, or attributes
* Deal Lockout — Prevent stacking on sale items, set max discount caps

**Campaign Management**
* Campaign Scheduler — Auto-activate and deactivate rules by date and time
* A/B Testing — Split-test two rules and measure winner by conversion and revenue
* Multi-Currency — Override deal thresholds per currency (WPML/Aelia/WMC compatible)
* Deal Page Manager — Auto-generate a customer-facing deals page

**White-Label Customer Email System**
10 fully designed transactional email templates sent to your customers under your store brand. GT BOGO Engine is never visible to your customers. Emails include:

* BOGO Deal Confirmation
* Loyalty Tier Upgrade
* Streak Bonus Applied
* Referral Reward Earned
* VIP Status Unlocked
* Free Gift Added
* Deal Expiry Warning
* Cart Abandonment Nudge
* Threshold Almost Reached
* Winback Campaign

All emails use your store name, logo, and accent color pulled automatically from WooCommerce settings. Sent via wp_mail() with optional Mailchimp/Klaviyo extension.

**Analytics & Reporting**
* Real-time Dashboard — Live cart monitor, activity feed, KPI strip with 60-second polling
* Analytics — Revenue influenced, rules fired, orders affected, top rule leaderboard
* ROI Projector — Forecast revenue impact before launching a campaign
* PDF Export — Generate branded professional reports with dark navy UI
* Audit Log — Full history of rule and license changes

**Integrations & Developer Tools**
* REST API — 5 endpoints for headless WooCommerce, mobile apps, and Zapier
* Import / Export — Full JSON backup and restore with merge or replace mode
* Mailchimp & Klaviyo — Tag customers and fire events on deal redemption
* Webhook support — Fire POST requests on rule activation and redemption
* White Label — Rename the plugin, hide branding, set agency support URLs

**27 Superpowers**
12 per-rule superpowers embedded in Pro Pack rules: Nudges, Progress Bar, Badge Generator, FOMO Widget, Savings Calculator, Countdown Timer, Social Proof, Deal Comparison, Scarcity Bar, Deal Share, Loyalty Widget.

15 sitewide superpowers controlled from the Superpowers Hub: Exit Intent Popup, Announcement Bar, Dynamic Pricing Display, Bundle Spotlight, Cart Abandonment Nudge, Smart Popup, Quick Add Button, Deal Unlock, Mobile Drawer, VIP Badge, Geo Banner, Savings History, Bundle Configurator, Email Notifications.

All superpowers have per-superpower enable/disable toggles, intensity settings (Subtle/Moderate/Bold), and instant AJAX save with no page reload required.

= Why GT BOGO Engine? =

* **200 Pro Packs** — The largest library of ready-built BOGO rule sets for any industry
* **Luxury brand safe** — No hardcoded fonts or colors. Everything inherits your active theme
* **Zero customer friction** — Discounts apply silently in the cart. No codes, no pop-ups required
* **White-label emails** — Your customers only ever see your store brand, never GT BOGO Engine
* **Developer friendly** — Full REST API, import/export, webhook support, and WP-Cron scheduling
* **Conflict-free** — Built-in conflict resolver detects and manages overlapping rules automatically

= Purchase PRO =

Visit [graphictshirts.shop/bogo](https://graphictshirts.shop/bogo/) to purchase a PRO license or any of the 200 industry Pro Packs.

== Installation ==

1. Upload the plugin folder to `/wp-content/plugins/` or install via the WordPress plugin installer
2. Activate the plugin through the **Plugins** menu
3. Navigate to **GT BOGO Engine** in your WordPress admin sidebar
4. Configure your free global rule under **Free Core Rule**
5. Optionally activate your PRO license under **License** to unlock Pro Pack imports and all enterprise features

== Frequently Asked Questions ==

= Does this work with variable products? =
Yes. GT BOGO Engine supports Simple, Variable, Grouped, and External product types. Variant Rules let you target specific attribute combinations.

= Will it conflict with WooCommerce coupons? =
By default BOGO rules and coupons can coexist. Use Deal Lockout to prevent stacking if desired.

= Does it work with WPML or multi-currency plugins? =
Yes. Multi-Currency supports WPML/WooCommerce Multilingual, Aelia Currency Switcher, and WooCommerce Currency Switcher.

= Do my customers see GT BOGO Engine branding? =
Never. All customer-facing text, emails, cart notices, and checkout line items use your store name. GT BOGO Engine is completely invisible to your customers.

= How do Pro Packs work? =
Purchase a Pro Pack or Bundle from graphictshirts.shop/bogo. Your license key is emailed instantly. Enter the key in the plugin and your packs appear in the vault ready to import with one click. Rules cannot be created manually — all rules come from purchased Pro Packs.

= Can I transfer my license to a new domain? =
Yes. Use the self-service transfer form at graphictshirts.shop/bogo/#license-transfer. Transfers are limited to once every 90 days. A verification code is sent to your purchase email. After transferring, re-download your Pro Packs from the My Packs page.

= Is customer data stored? =
No customer PII is stored by the plugin. Analytics track aggregate metrics only.

= Will this slow down my store? =
No. Rules are cached via WordPress transients. The cart calculation hook runs only on cart and checkout pages.

== Screenshots ==

1. Dashboard — live cart monitor, KPI strip, and real-time activity feed
2. PRO Rules / Packs — 200 industry Pro Packs with bundle purchasing
3. Free Core Rule — global rule with category, product, and scheduling controls
4. Campaign Scheduler — schedule rules to fire automatically by date and time
5. Analytics — revenue influenced, rules fired, ROI tracking
6. Superpowers Hub — 25 customer-facing engagement features with instant AJAX save
7. Settings — customer email toggle and accent color picker
8. REST API — headless WooCommerce integration

== Changelog ==

= 3.16.0 =
* Added: WooCommerce Blocks compatibility — all 27 superpowers now support WC Blocks cart and checkout
* Added: Single MutationObserver frontend injector — one observer handles all superpower injections on Blocks pages
* Added: Theme Compatibility Matrix — 100+ WordPress themes across 20 CSS framework families
* Added: gtbogo_theme_compat_map filter — developers register custom themes without plugin update
* Added: Storefront Appearance settings — store owners configure accent color, danger color, widget background, text color, and border radius
* Added: CSS variable system — all superpowers read from :root CSS variables, fully customisable
* Added: Superpower Safety Wrapper — GT_BOGO_Frontend_Injector::is_allowed_page() blocks product page injection at architectural level
* Added: 13 forbidden hooks documented as $forbidden_hooks constant — architectural contract enforced in code
* Added: Onboarding wizard — four-step sequential guide for new PRO users (license → pack → rule → go live)
* Added: Multi-layer obfuscator v2 — XOR cipher layer, variable name mangling, dead code injection, split-key runtime decoding
* Added: badge_cart copy key added to GT_BOGO_Copy registry
* Fixed: White label violation — "saved with GT BOGO Engine" replaced with "saved with your rewards"
* Fixed: Badge Generator — forbidden woocommerce_product_thumbnails hook removed, moved to cart-only
* Fixed: Intel Listener — woocommerce_after_shop_loop_item replaced with wp_footer
* Fixed: Nudges — woocommerce_before_shop_loop replaced with wp_footer JS injection
* Fixed: VIP tier icons replaced with text labels — luxury brand compliant
* Fixed: Loyalty tier emoji removed — enterprise compliant
* Fixed: Nudge emoji removed — no customer-facing emoji in any string
* Updated: Documentation page — all 27 superpowers documented with full technical detail
* Updated: Schema LD+JSON softwareVersion to 3.16.0

= 3.15.0 =
* Added: Superpower audit — all product page hooks removed from all classes including widgets.php
* Added: All 200 pack JSONs verified — Group A superpowers confirmed as config data only
* Added: Cache busting covers all 11 major caching systems
* Added: Dynamic pricing removed from bootstrap, disabled in DB
* Fixed: Settings page — all options save and apply correctly
* Fixed: Customer portal account — VIP tier display
* Updated: Version constants aligned across all three locations

= 3.14.0 =
* Customer Intelligence System — lifecycle state tracking per customer
* VIP tier progression — Bronze, Silver, Gold, Platinum based on lifetime spend
* Streak tracking — consecutive order tracking with at-risk detection
* Email deduplication engine — per-template cooldowns, send log, no duplicate emails
* Rule application logger — every rule fire logged with discount and order data
* Anonymized sync to GT BOGO server — no PII, hashed states only
* Recovery on reinstall — VIP tiers and streaks restored from server
* Server-side aggregate stats — lifecycle counts, avg LTV, rule performance
* Daily lifecycle cron — detects at-risk (60d), lapsed (120d), winback (365d)
* WooCommerce role assignment — auto-assigns order milestone and VIP roles


* Added: Free core rule now supports category targeting, product targeting, priority, and start/end date scheduling
* Added: Category and product targeting respected by cart engine, auto-add, FOMO widget, nudges, and dynamic pricing
* Added: Scheduling (start/end date) respected by cart engine, auto-add, FOMO widget, nudges, and dynamic pricing
* Added: Enterprise product/category picker modal globally available on all admin pages
* Added: Superpowers instant AJAX save — all enable/intensity/animate controls save without page reload
* Added: Journey Map toggle switches fully wired to backend
* Added: Dashboard live polling — KPI strip (60s), activity feed (30s), cart monitor (30s)
* Added: Cross-page settings sync via localStorage broadcast
* Added: Pack download fingerprinting — every pack download embeds a customer-specific fingerprint for leak tracing
* Added: Domain lock on pack files — packs record the domain they were issued to
* Added: Per-customer download log in gtbogo_download_log with full fingerprint, IP, and domain
* Added: Security dashboard in business admin — multi-domain abuse detection, license revoke, license reissue, event log, download log
* Added: Self-service domain transfer at graphictshirts.shop/bogo/#license-transfer with 2-step email verification
* Added: Transfer API with 90-day cooldown, rate limiting, and server-side email lookup
* Added: Multi-layer code obfuscation — gzip + base64 + string reversal + chunked encoding
* Added: Legal notice on every admin page
* Added: Build script auto-cleans backup files before every build
* Added: Pack HMAC signature verification on import with admin alert on tamper detection
* Added: Domain fingerprint mismatch alert to admin on pack import
* Added: Security event logging to gtbogo_security_events with IP, user, and event data
* Added: Devtools detection with gradual UI degradation after repeated attempts
* Added: Runtime environment check detecting sandbox and decompiler contexts
* Added: Daily integrity check via WP-Cron
* Fixed: Free rule option key mismatch — engine now reads correct individual option keys
* Fixed: Duplicate wp_ajax_gtbogo_download_pack registration removed
* Fixed: ajax_toggle_superpower handler implemented
* Fixed: ajax_save_superpower_field handler implemented
* Fixed: settings --gt-subtle color corrected for proper visual hierarchy
* Fixed: Admin backup files excluded from obfuscated and clean zips
* Improved: Features section and How it works steps moved above pricing on all 16 sales pages

= 3.11.0 =
* Added: 200 industry Pro Packs covering every retail vertical
* Added: Bundle license system — one key unlocks all packs in Starter, Growth, or Complete bundles
* Added: White-label customer email system — 10 transactional email templates
* Added: Customer email toggle and accent color picker in Settings
* Added: IPN handler expanded to all 200 packs with keyword mapping
* Added: Email sender rebuilt — license-key-only delivery
* Added: send_bundle_license_email — single key email listing all included packs
* Added: PayPal SDK enqueued in wp_head for faster button render
* Fixed: Bundle PayPal buttons rendering correctly
* Fixed: Dashboard queried non-existent DB columns
* Fixed: Conflict Resolver resolution actions
* Fixed: Conditions page Match ALL/ANY buttons now clickable
* Added: REST API controller — 5 endpoints under gt-bogo/v1
* Added: WP-Cron scheduler execution
* Added: White Label admin hook

= 3.10.1 =
* Added: 7 new Superpower classes
* Added: 10 new enterprise admin pages
* Added: Per-superpower enable/animate toggles and intensity settings
* Added: Custom PHP obfuscator for customer distribution

= 3.10.0 =
* Major rebuild — enterprise admin UI system
* Added: Segment targeting, A/B testing, geo targeting
* Added: Campaign scheduler with WP-Cron integration
* Added: Analytics dashboard with Chart.js visualizations

== Upgrade Notice ==

= 3.16.0 =
Major architectural release. Adds WC Blocks compatibility, theme matrix covering 100+ themes, storefront appearance settings, superpower safety wrapper, onboarding wizard, and obfuscator v2. Upgrade recommended for all users.

= 3.15.0 =
Stability and audit release. All product page hooks removed, 200 packs verified, cache busting hardened. Upgrade recommended.

= 3.14.0 =
Feature release. Adds free core rule targeting and scheduling, pack fingerprinting, security dashboard, self-service domain transfer, enhanced obfuscation, and 25 superpowers with instant save. Upgrade recommended for all users.

= 3.11.0 =
Major feature release. Adds 200 industry Pro Packs, bundle license system, and white-label customer email system. Upgrade recommended for all users.
