=== DRBU Discount Rules Box for WooCommerce ===
Contributors: predragvujnovic88, freemius
Tags: woocommerce, quantity breaks, tiered pricing, volume discount, upsell
Requires at least: 6.4
Tested up to: 7.1
Requires PHP: 8.0
Stable tag: 2.9.48
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Quantity-break discounts for WooCommerce: automatic tiered "Buy Box" pricing with a live admin preview builder.

== Description ==

Discount Rules Box adds a tiered "Buy Box" to your WooCommerce product pages, letting customers pick a 1, 2, or 3-pack quantity and see the discount for each option before adding to cart. Discounts are calculated and applied to the cart automatically, without coupon codes.

**Free** includes the 2-pack buy box (1 & 2 pieces), automatic cart discounts, a live admin preview builder, all pricing models, and every text/display toggle.

**Pro** (30-day free trial) adds a 3rd pack tier, a Sales Analytics dashboard, Appearance customization (brand colors and style presets), and 1-Click language presets.

= Features =

* Tiered Buy Box with 2 or 3 pack options, strikeout pricing, per-unit cost, savings highlights, and stock/urgency badges.
* Live admin preview builder — layout, colors, text, and badges update in real time as you edit settings.
* Percentage or fixed-amount discount models.
* Analytics dashboard tracking tier adoption and added revenue (Pro).
* Custom colors, button/card radius, and style presets via CSS variables (Pro).
* Applies discounts at the WooCommerce cart level; compatible with Block Checkout, Classic Checkout, and High-Performance Order Storage (HPOS).
* Responsive layout for mobile screens.
* `[drbu_tiered_buy_box]` shortcode for use on any page, or automatic replacement of the default "Add to cart" button.
* 1-Click language presets for 13+ languages (Pro), or edit every string manually.

= Configurable display elements =

Each of these can be toggled independently:
* "Most Popular" / "Best Value" badge with custom text.
* Stock and urgency labels (e.g. "In stock", "Only 5 left").
* Free shipping badges or progress bars toward a free-shipping threshold.
* Per-pack savings amount and per-unit price.
* Footer trust badges (shipping time, guarantee, payment options — your own text).

= Developer hooks =

* Filter `drbu_tier_total` — override tier price calculations.
* Filter `drbu_pack_discounts_enabled` — enable/disable discounts based on custom conditions.
* Template override: copy `templates/tiered-buy-box.php` to your theme at `woocommerce/tiered-buy-box.php`.
* Frontend styles are scoped under `.drbu-buy`.

== Installation ==

1. Download the plugin ZIP file.
2. In your WordPress admin, navigate to **Plugins → Add New → Upload Plugin**.
3. Select the downloaded ZIP file and click **Install Now**.
4. Activate the plugin. (WooCommerce must be installed and active).
5. Navigate to **Discount Rules Box** in the admin menu to configure your tiers, colors, language presets, and display settings.
6. Enable automatic display on product pages or embed `[drbu_tiered_buy_box]` on any page or post.

== Frequently Asked Questions ==

= How does Discount Rules Box calculate discounts? =
Discounts are calculated dynamically based on your chosen pricing model (Percentage or Fixed amount per additional unit). When a customer selects a multi-pack, the discount is automatically applied to the cart line item.

= Can I use the plugin on specific products only? =
Yes. In **Discount Rules Box → Specific Product Restrictions**, search and select specific product IDs or categories (Pro feature). Leave it blank to apply to all simple products.

= Does it work with Block Checkout and HPOS? =
Yes! The plugin applies discounts natively to the WooCommerce Cart object (`WC_Cart`), making it fully compatible with Block Checkout, Classic Checkout, and WooCommerce High-Performance Order Storage (HPOS).

= How do I hide the default WooCommerce price on product pages? =
The **"Replace default Add to cart button & price header"** option automatically removes both the standard add-to-cart form and old price header when the buy box is active.

= Can I translate all texts into my own language? =
Yes! You can use our **1-Click Quick Language Presets** in the settings dashboard or customize every string manually (CTA buttons, badge texts, stock labels, notes, shipping prefixes). A `.pot` translation file is also included in `/languages/`.

= Does it work with shortcodes? =
Yes! You can place `[drbu_tiered_buy_box]` anywhere on your site. To specify a product, use `[drbu_tiered_buy_box id="123"]`.

= Is the Free version limited? =
No. The Free version is a fully working plugin for a 2-pack buy box (1 & 2 pieces) with automatic cart discounts and full display/text customization. Pro features are additive: a 3rd pack tier, the Analytics dashboard, Appearance customization, product/category restrictions, and 1-click language presets.

= How do I upgrade to Pro or start the trial? =
From your admin, open **Discount Rules Box → License** and click **Start 30-Day Free Trial** (no credit card required), or open the **Upgrade** tab to buy a plan directly. The trial unlocks every Pro feature for 30 days. After the trial you can purchase a Pro license or continue using the Free version.

== External services ==

This plugin uses Freemius to manage licensing, the 30-day Pro trial, and Pro purchases.

* On every load of this plugin's own admin pages, the site URL, plugin version, and PHP/WordPress version are sent to Freemius (`api.freemius.com`) to check license/trial status. No data is sent on the site's public-facing pages.
* If you open the Pro pricing/checkout screen, the checkout form itself (`checkout.freemius.com`) is loaded from Freemius, and any billing details you enter there are sent directly to Freemius to process the purchase — this plugin does not see or store payment details.
* Freemius Terms of Service: https://freemius.com/terms/
* Freemius Privacy Policy: https://freemius.com/privacy/

== Screenshots ==

1. High-converting 3-Tiered Buy Box on product page with savings highlights, unit pricing, and trust badges.
2. Live Interactive Admin Preview Builder with real-time settings and color controls.
3. Built-in Analytics Dashboard showing AOV boost, tier distribution, and upsell revenue metrics.
4. 1-Click Quick Language Presets for instant international store deployment.

== Changelog ==

= 2.9.48 =
* Changed: the Freemius SDK's `slug` was updated from `discount-rules-box` to `drbu-discount-rules-box`, matching the product slug now set on the Freemius Dashboard — keeps the Free package's own folder name and Freemius's update mechanism aligned with the plugin's actual name/slug going forward.

= 2.9.47 =
* Added: `premium_slug` in the Freemius SDK config, so a Pro install lives in its own folder (`drbu-discount-rules-box-for-woocommerce-premium`) instead of sharing the Free version's folder name — prevents a folder collision if a site ever has both installed during an upgrade.
* Added: Freemius's `wp_org_gatekeeper` build-time marker, per Freemius's own integration instructions for the auto-generated Free ZIP (removed automatically from the Free package by Freemius's Deployment tool; has no effect on the GA/Premium code).

= 2.9.46 =
* Fixed: clicking "Deactivate License" on the License tab did nothing — it silently failed to detach the license from Freemius because it called a Freemius SDK method (`_delete_account()`) that doesn't actually exist. Now uses Freemius's own native deactivation flow directly, verified live to actually deactivate the license and revert the site to the Free plan.

= 2.9.45 =
* Fixed: the DRBU Analytics page loaded with none of the plugin's own CSS/JS (reported by the user as "no styling"). WordPress derives the admin `$hook_suffix` for a submenu page from its page *title* rather than its slug in some cases — for Analytics that produced `discount-rules-box_page_discount-rules-box-upsell-analytics`, which doesn't contain "drbu" anywhere, so the plugin's own check for "is this one of my admin pages" never matched. Fixed by also matching the Analytics page's own slug explicitly (now a shared `DRBU_Settings::ANALYTICS_SLUG` constant), in both the CSS/JS enqueue check and the favicon check.

= 2.9.44 =
* Fixed: Freemius's own Account/Pricing admin pages, hidden from the sidebar menu via `remove_submenu_page()`, were completely inaccessible ("Sorry, you are not allowed to access this page") even to administrators — this broke the "Manage Billing"/"Open Customer Portal" links on the plugin's own Account tab, and the redirect Freemius sends after a successful trial/license activation. Switched to hiding those sidebar links with CSS instead, which keeps the pages themselves fully functional.
* Changed: after activating a license (via the "Activate License" dialog), the redirect now lands on the plugin's own settings page instead of Freemius's native Account page, since that's where this plugin's own Account/Upgrade tabs already live.

= 2.9.43 =
* Fixed: the Freemius webhook secret was still leaking, in a different spot than the one fixed in 2.9.38 — the full saved settings array (including the raw secret) was embedded as JSON in every plugin admin page's `<script>` tag for the live preview builder, regardless of which tab was open. The secret field is now stripped out of that JS data.

= 2.9.42 =
* Fixed: the "Activate License" dialog got permanently stuck on "Activating license..." for a site that had never connected/opted in to Freemius (the plugin's default, privacy-friendly starting state). The native dialog assumes the site is already registered; it now falls back to registering the site and activating the license together in one step when that isn't the case yet — verified live against a real Freemius trial license.

= 2.9.41 =
* Fixed: **`is_premium` was hardcoded to `false`** in the Freemius SDK init call (`discount-rules-box-upsell.php`). This is a separate mechanism from the `__premium_only` file/method stripping — Freemius's Deployment tool does not rewrite this literal automatically — so `Freemius::is_premium()`, and therefore `is__premium_only()` (which every `__premium_only`-gated feature in this plugin checks before rendering: 3rd tier, Appearance panel, restriction pickers, Sales Analytics), could never return `true`, for any user, including a real customer with a fully valid paid license. Changed to dynamically detect the running package by checking whether a `__premium_only` file physically exists on disk — `true` in the Premium package, `false` in the Free package, exactly mirroring how Freemius's own stripping already works.

= 2.9.40 =
* Changed: **every Pro plan on the Upgrade tab now always starts with the 30-day free trial** instead of charging immediately. The "Buy Now — $X/yr" buttons on the Single Site / 5 Sites / 10 Sites pricing cards previously opened Freemius Checkout with `trial: false` (instant purchase, no trial) — they're now "Start 30-Day Free Trial" buttons using the same trial-first checkout flow already used everywhere else in the plugin.

= 2.9.39 =
* Changed: two Free-mode upgrade prompts still said the generic "Upgrade to Pro" with no mention of the 30-day free trial (the Plugins-list "Start Free Trial" row action link, and the 1-Click Quick Language Presets CTA/tooltip) — verified after the full `__premium_only` refactor that every other Pro-gated feature already correctly nudges toward "Start Free Trial", and brought these two in line for consistency.
* Changed: added a 🔒 lock icon to the Sales Analytics upsell panel's heading, matching the lock-icon convention used on every other Pro-gated feature's Free-mode messaging.

= 2.9.38 =
* Fixed: **critical pricing bug** — Pricing Model C ("Fixed Package Price") charged the same fixed total no matter how many units a customer set on the WooCommerce Cart page's quantity field (e.g. editing a "3-pack, $39.99" line to quantity 300 still charged $39.99 total). The fixed price now scales proportionally with the actual cart quantity, matching how Models B/D already behave.
* Fixed: stored XSS in the admin product-restriction picker — a product title containing HTML/script tags (settable by any user who can edit products) executed when an admin searched for it while adding product restrictions. Product names are now HTML-escaped before being inserted into the picker.
* Fixed: the Freemius webhook secret (License tab) was echoed into the page's HTML source in full, readable via view-source by any Shop Manager despite being a masked password field. The field is now always rendered blank; leaving it blank on save keeps the existing stored value.
* Fixed: the cart's "you saved $X" text could show a bigger discount than what was actually charged if a Pro license/trial expired while an item was already in the cart. It's now clamped the same way the actual charged price already was.
* Fixed: "Deactivate License" required `manage_options` while the rest of the License tab only requires `manage_woocommerce`, so a Shop Manager's click silently did nothing.
* Fixed: the plugin's own `Version:` header and `DRBU_VERSION` constant had fallen behind this readme's Stable tag/changelog since 2.9.36 (only the built ZIP's copy was ever version-stamped, not the tracked source file).
* Fixed: uninstalling no longer leaves the `drbu_license_last_sync` option orphaned in the database.
* Added: `build.sh` now also produces an unpacked, ready-to-inspect copy of the release (`release/drbu-discount-rules-box-for-woocommerce/`) alongside the ZIP.

= 2.9.37 =
* Fixed: two more non-standard file types were still shipping in the built ZIP after the prior review pass — 39 Sass `.scss` source files under the bundled Freemius SDK's `assets/scss/` folder (the compiled `.css` the SDK actually loads already ships separately) and a root-level `keyword.csv` working file. Both excluded from `build.sh`.
* Fixed: the Sales Analytics dashboard's full rendering (KPI cards, tier breakdown, top-products table, recent-orders table) was still present in the Free-shipped `class-drbu-settings.php`, gated only by a runtime license check — same "Pro code physically present, merely disabled" pattern already fixed elsewhere in 2.9.36. Extracted into `render_analytics_page__premium_only()`, physically stripped from the Free ZIP by Freemius's deployment pipeline; Free users still see only the existing "Analytics is a Pro Feature" upsell panel.

= 2.9.36 =
* Fixed: readme.txt "Tested up to" was still 6.7; updated to the current WordPress stable release (7.1), per a WordPress.org plugin review.
* Fixed: the bundled Freemius SDK's dev-only `patches/` folder (a Composer patch file, not needed at runtime) was shipping inside the built ZIP; excluded from `build.sh`.
* Changed: the buy box shortcode is now registered only under the prefixed tag `[drbu_tiered_buy_box]`, per WordPress.org's unique-naming guideline. The previous generic tags (`[tiered_buy_box]`, `[order_now_5]`, `[poruci_odmah_5]`, `[poruci_odmah_4]`) were removed — the plugin has no published users yet, so no back-compat aliasing was needed.
* Fixed: several Pro-only features (3rd buy-box tier row, Appearance color/preset panel, product & category restriction pickers, and their AJAX product-search backend) had their full working markup/logic present in the free-shipped PHP files, merely disabled/hidden at runtime — flagged by WordPress.org as not permitted for a hosted Free listing. Moved into `__premium_only`-suffixed methods (the real Freemius SDK convention, `freemius()->is__premium_only()`), which the Freemius deployment pipeline physically strips from the Free ZIP.

= 2.9.35 =
* Fixed: Freemius's own "Account" and "Upgrade" sidebar submenu items (redundant with the Account/Upgrade tabs on the main Discount Rules Box page) were reappearing in the WordPress admin menu. The code that hides them ran on `admin_menu` priority 999 — far earlier than Freemius's own priority (999999999) for registering them — so the removal silently had nothing to remove yet. Now runs after Freemius registers its menu items.

= 2.9.34 =
* Changed: Split the "Pro" tab into two dedicated tabs — **Account** (email, plan, billing/payment method, invoices — via Freemius) and **Upgrade** (the same Single/5-Site/10-Site pricing cards, prices, and guarantee badges shown on discountrulesbox.com). The License tab keeps license key activation/deactivation/sync only. All three now share consistent styling with the marketing site.

= 2.9.33 =
* Changed: Renamed to "DRBU Discount Rules Box for WooCommerce" (from "Discount Box – Quantity Discounts for WooCommerce"), slug drbu-discount-rules-box-for-woocommerce — keeps "Discount Rules" in the name for search findability, while placing the distinctive "DRBU" prefix at the start and "WooCommerce" at the end (the safe pattern WordPress.org's own guidance recommends) to reduce similarity to the existing "Discount Rules for WooCommerce" plugin.

= 2.9.32 =
* Changed: Replaced remaining "Discount Rules Box" mentions across the admin UI (menu labels, notices, header text) with the new "Discount Box" name for full consistency.
* Fixed: readme.txt's "Tested up to" WordPress version.

= 2.9.31 =
* Changed: Renamed to "Discount Box – Quantity Discounts for WooCommerce" (from "Discount Rules Box – Quantity Breaks & Upsell for WooCommerce") and new slug, per a WordPress.org naming-guideline review.
* Changed: Pro-only code (Analytics dashboard, the 3rd buy-box tier, 1-Click language presets) is now split out using Freemius's `__premium_only` convention instead of being shipped everywhere and hidden behind a runtime check — required by WordPress.org's guideline that no disabled/locked code may exist in the hosted Free version.
* Fixed: The full 1-Click language preset dataset previously shipped unlocked in the shared admin JS, with only a client-side `disabled` attribute standing between a Free install and using it. It's now served from the backend only when a Pro license is active.
* Removed: The "Category & Shop Quick Modal" feature, which never had a working server-side handler for either Free or Pro.
* Fixed: The admin menu icon's sizing CSS is now enqueued via `wp_add_inline_style()` instead of being echoed as a raw `<style>` tag.
* Changed: Rewrote the readme description and added an External Services section documenting Freemius.

= 2.9.30 =
* Fixed: The Freemius webhook endpoint (License tab → Webhook secret) never actually worked — it checked for a signature header Freemius doesn't send and documented the wrong kind of secret. Now reads the correct `X-Signature` header and the field is documented as your product's own Secret Key (Freemius Dashboard → your product → Settings), matching Freemius's own reference implementation.
* Fixed: The webhook's event allow-list contained four event names that don't exist in the Freemius API (silently never matching anything since it was written) and was missing several real, relevant ones — including `license.deleted`, which is what happens when a license is removed from the Freemius Dashboard. The list now matches Freemius's real event catalog.
* Changed: A supported webhook event now immediately forces a real Freemius license/plan sync for this site (previously it only refreshed a local, mostly-inert cache), so a change made on the Freemius Dashboard (cancel, delete, downgrade a license, etc.) is reflected here right away instead of waiting for the next automatic sync or a lucky page load.
* Added: A "🔄 Sync License Now" button on the License tab that forces the same real sync on demand.
* Fixed: The AJAX handler behind the post-checkout sync (and the new button) now performs a real Freemius sync itself, instead of relying only on a separate JS-side fetch happening first.

= 2.9.29 =
* Added: After starting a Pro trial through the Freemius Checkout overlay, the admin page now shows a persistent notice confirming whether the license was activated automatically, or — if not — pointing you to check your email for the license key and paste it on the License tab. Previously this feedback was lost in the automatic page reload that follows checkout.
* Changed: Disabled Freemius's own "sticky" trial promotion notice (the plugin already shows a persistent "Start 30-Day Free Pro Trial" button in its own header on every page).
* Removed: The plugin's own dismissible "Unlock Pro" admin notice, since it duplicated the same call-to-action already shown in the page header.
* Fixed: Added `wp-header-end` markers after the dashboard and Analytics page headers so WordPress positions any remaining admin notices below the header instead of injecting them in the middle of it.

= 2.9.28 =
* Fixed: Escaped a currency-formatted value in the Analytics dashboard's Ad ROI insights banner that was output without escaping (WordPress Plugin Check error).
* Fixed: The order lookup behind the Analytics dashboard now uses a `meta_query` instead of raw `meta_key`/`meta_value` query args, resolving the "possible slow query" notices from WordPress Plugin Check.
* Fixed: Documented the deliberate `null` version on the externally-hosted Freemius checkout script so WordPress Plugin Check no longer flags it as a missing resource version.

= 2.9.26 =
* Changed: Upgrade page's 5-Sites and 10-Sites plan cards now show a monthly-equivalent per-store price hint — "⚡ Only $1.58/mo per store ($19/yr)" and "🔥 Only $1.03/mo per store ($12.40/yr)".

= 2.9.25 =
* Changed: On the Account page, the "Disconnect • Sync" action links (previously plain text) are now styled as proper pill buttons, with Disconnect/Deactivate License highlighted in red as destructive actions. The "Plan: PRO Trial Expires in 4 weeks Upgrade" row is now visually highlighted (background, left accent border, bigger badge and Upgrade button) instead of blending into the rest of the table.

= 2.9.24 =
* Changed: Removed the "$83 You save $14" / "$119 You save $24" / "$155 You save $31" strikethrough pricing hints from the Upgrade page's plan cards — since there are no monthly plans the annual price is discounted against, that line implied a discount that doesn't exist.

= 2.9.23 =
* Fixed: The License tab always showed "0 / N sites" under Activations even when the license was actively in use on the site. It was reading `Freemius::get_sites()`, which is an unrelated WordPress multisite helper (returns network subsites, always empty on a normal single-site install) — not the license's actual activation count. Now reads the real `activated` count from the license object.

= 2.9.22 =
* Added: The Upgrade page's Freemius pricing cards no longer show "No Support" — a JS patch now replaces it with "Includes 30-Day Free Trial", adds the same feature bullets, tagline, "Most Popular" badge, and "was $X / you save $Y" pricing shown on the discountrulesbox.com landing page, without requiring Freemius Dashboard changes.

= 2.9.21 =
* Changed: Extended the brand font (Outfit) to the DRBU Analytics headings and KPI/stat numbers (revenue, tier adoption, etc.) for full typographic consistency with the rest of the redesigned admin UI.

= 2.9.20 =
* Changed: Admin UI now matches the discountrulesbox.com landing page design — self-hosted Outfit/Geist brand fonts (replacing the plain system font stack), the same Emerald Green accent color for savings/trust indicators, and matching trust badges (14-Day Money-Back Guarantee, 30-Day Free Trial, Cancel Anytime) on the License, Pro, and Upgrade tabs.
* Added: "Test Pro Free for 30 Days" banner on the Upgrade page, matching the landing page's pricing section copy.

= 2.9.19 =
* Fixed: The License tab showed "Lifetime / n/a" as the Expiration for an active Pro Trial instead of the real trial end date. Trial expiration is tracked separately from a regular license's expiration date; the License tab now checks the correct source for trials.

= 2.9.18 =
* Fixed: The top-level menu icon was still oversized after the 2.9.17 fix. Added an explicit CSS rule (loaded on every admin page) that forces the standard 20x20px sizing regardless of what else might be overriding it.

= 2.9.17 =
* Fixed: The top-level "Discount Rules Box" menu icon was oversized. It now uses WordPress's recommended base64 SVG data-URI format, which forces the standard 20x20px sizing used by every other admin menu icon.

= 2.9.16 =
* Changed: Removed the "Settings" menu item (Account/Upgrade are still reachable from the License tab). The top-level "Discount Rules Box" menu now has 2 items: Discount Rules Box and DRBU Analytics.
* Added: Custom menu icon for the top-level "Discount Rules Box" admin menu.

= 2.9.15 =
* Changed: "Discount Rules Box" is now its own top-level admin menu tool instead of a submenu under WooCommerce, with 3 items: Discount Rules Box, DRBU Analytics, and Settings (Account & Upgrade).
* Improved: Removed redundant "Discount Rules Box" text next to the logo on the dashboard, Account, and Upgrade pages, and hidden the Upgrade page's duplicate logo/title block.

= 2.9.14 =
* Fixed: The "Have a License Key?" button on the License tab could fail with "Invalid license key." even with a genuinely valid key, while activating the exact same key via Plugins → Discount Rules Box → Manage License always worked. The button now opens that same, proven-reliable Freemius activation dialog directly instead of using a separate implementation.
* Added: The plugin's logo now appears on the Discount Rules Box dashboard, DRBU Analytics, Account, and Upgrade pages for consistent branding.

= 2.9.13 =
* Added: The Freemius Account and Upgrade/Pricing pages now match the plugin's own visual design (same brand color, rounded buttons, card styling) instead of looking like generic WordPress admin pages.

= 2.9.12 =
* Fixed: The License tab always showed "1970-01-01" as the Expiration date regardless of the actual license expiration, because the date was parsed as a raw Unix timestamp instead of the date string Freemius actually returns.
* Improved: The "Have a License Key?" Activate button no longer shows a misleading "Invalid license key." message when activation fails for an unrelated reason — it now shows Freemius's actual error message when available, and otherwise an honest message pointing to the Plugins → Manage License page as a working alternative.

= 2.9.11 =
* Fixed: The Upgrade/Pricing widget showed annual plans broken down as a monthly-equivalent price ("$5.75/mo, billed annually"). Since this plugin doesn't offer a monthly plan, the widget now shows the actual annual price directly.

= 2.9.10 =
* Fixed: The "Have a License Key?" Activate button always failed with "Activation request failed. Please try again.", regardless of the license key entered. The AJAX request was missing a `module_id` field that the Freemius SDK requires internally to register its license-activation handler — without it, the server silently never registered the handler and WordPress returned an empty error response. The request now includes `module_id`, so activation reaches Freemius correctly.

= 2.9.9 =
* No functional changes — rebuild of 2.9.8 for live licensing verification testing.

= 2.9.8 =
* Fixed: The Freemius `public_key` hardcoded in the plugin (`pk_dfe22e467625e3754b0f91553f0f6`) did not match the current key shown in the Freemius Developer Dashboard's integration snippet (`pk_1ed69d2634756f08c2a7bf2187d37`), so every signed request to the Freemius API (pricing widget, license sync, trial activation) was rejected with "Invalid Authorization header" — trials/purchases never unlocked Pro, and the in-dashboard pricing widget stayed stuck loading. Corrected in all three places it was hardcoded.

= 2.9.7 =
* No functional changes — rebuild of 2.9.6 for live licensing verification testing.

= 2.9.6 =
* Fixed: The 2.9.5 trial/purchase sync fix called a Freemius SDK method that doesn't actually exist, so it silently did nothing — the dashboard could stay on "Free" after a real trial/purchase despite the "Last sync" time updating. Now uses Freemius's actual public sync endpoint, so trial/purchase status reflects immediately after checkout.

= 2.9.5 =
* Security: Removed a local "sk_" text-match fallback that let anyone unlock Pro by typing any string into the License Key field, with no real Freemius validation — manual key entry now activates exclusively through Freemius's own server-verified AJAX endpoint.
* Security: Free-plan restrictions could previously be skipped on Save by leaving any text in the License Key field; enforcement now depends solely on the live Freemius license status.
* Security: The 3-pack (Pro) pricing tier and its discount values are no longer trusted from URL/session data — the cart layer re-checks the live license on every add-to-cart and totals calculation, so a stale or expired license can no longer be used to apply Pro pricing.
* Fixed: Several Freemius lifecycle hook names (license activation/deactivation, account connection) never matched the SDK's actual hook names, so related cache refreshes and admin notices silently never fired; corrected to use the SDK's real `after_license_change` / `after_account_connection` hooks.
* Fixed: Starting a trial or purchase from the in-dashboard checkout overlay now syncs with Freemius immediately, instead of requiring a manual license key entry to unlock Pro features.

= 2.9.4 =
* Improved: Enabled Freemius anonymous mode bypassing intrusive opt-in screens upon activation, ensuring immediate 1-click access to settings on all servers.

= 2.9.3 =
* Fix: Replaced external account redirection links for Deactivate License with built-in admin action handler, instantly clearing license keys and restoring Free status without permission errors.

= 2.9.2 =
* Fix: Kept Freemius account page registered in WP admin page registry while hiding sidebar submenus, resolving "Sorry, you are not allowed to access this page" permission error on Manage Account click.

= 2.9.1 =
* Improved: Updated License Key Management controls allowing instant key clearing and deactivation, with dynamic Pro Trial (30 Days) title formatting.

= 2.9.0 =
* Feature: Added user-friendly License Key instructions banner in License tab explaining email license key activation fallback (`sk_...`) and hosting firewall whitelisting for `api.freemius.com`.

= 2.8.9 =
* Cleaned: Removed redundant Account and Upgrade submenus from WordPress admin sidebar for a streamlined WooCommerce admin menu structure.

= 2.8.8 =
* Feature: Added direct License Key activation field (`sk_...`) in License settings tab enabling instant 1-click Pro & trial activation.

= 2.8.7 =
* Improved: Enhanced trial button detection and explicit CSS class binding (`drbu-open-trial`) ensuring 30-day trial CTA opens 0-cost free trial modal without prompting for credit card details.

= 2.8.6 =
* Feature: Integrated direct Freemius FS.Checkout JavaScript overlay for product 37209 and plan 61804 enabling instant in-page trial activation and checkout popups.

= 2.8.5 =
* Critical Fix: Updated Freemius SDK Public Key to matching product key (`pk_dfe22e467625e3754b0f91553f0f6`) resolving pricing API authentication rejection.

= 2.8.4 =
* Fixed: Configured Freemius SDK menu parent slug mapping to WooCommerce (`woocommerce`) so pricing, trial, and checkout pages load natively in WordPress Admin.
* Fixed: Removed target="_blank" attributes on internal upgrade and trial CTA links for seamless in-page admin checkout execution.

= 2.8.3 =
* Removed: Category & Shop pages upsell popup feature removed for streamlining and polish in upcoming major release.
* Improved: Unified single product display toggles into single clean "Replace default Add to cart button & price header" option.
* Cleaned: Removed developer webhook settings block from License tab for a streamlined merchant UI.

= 2.8.2 =
* Fixed: Resolved admin JavaScript syntax error in language presets handler that blocked tab navigation and live preview rendering.
* Fixed: Made tab switching handler global and resilient across all admin tabs.
* Improved: Synchronized full and minified admin CSS/JS assets for seamless production deployment.

= 2.8.1 =
* Improved: Updated Freemius SDK integration to version 2.13.4 with single-codebase in-place upgrade and after_uninstall hook support.
* Removed: Standalone `uninstall.php` file in accordance with Freemius release requirements.

= 2.8.0 =
* Added: Freemius licensing integration. Free version keeps the complete 2-pack buy box; Pro (30-day free trial) unlocks the 3-pack buy box, Sales Analytics Dashboard, Category & Shop Quick Modal, Appearance customization, and 1-Click Quick Language Presets.
* Added: New "Pro" tab in settings with feature overview, trial CTA, and license management.
* Added: Dismissible admin notice promoting the 30-day free Pro trial.
* Technical: `DRBU_License` now wraps the Freemius SDK (`can_use_premium_code()`) with a graceful fallback when the SDK is absent; Pro gating is centralized in `DRBU_Settings` (`pro_free_values()`).

= 2.6.1 =
* Refined: Cleaned up "Most Popular" / "Best Value" badge text defaults and language preset strings across all 13 supported languages.
* Improved: Harmonized discount rounding calculations so `unit_price × quantity` matches total price down to the exact sub-currency unit for fiscal compliance.
* Fixed: Preserved exact formatting in admin preview builder when switching quick language presets.

= 2.6.0 =
* Added: Integrated Analytics Dashboard tracking AOV improvement, tier distribution (Pack 1, Pack 2, Pack 3, Pack 3+), and total added upsell revenue.
* Added: Category & Archive Add-to-Cart Quick Modal popup to capture upsells before checkout.
* Added: Live Interactive Admin Preview Builder for instant real-time visual editing of colors, texts, and layout options.
* Added: 1-Click Quick Language Presets for 13 global languages.

= 2.4.2 =
* Simplified: Step 1 (Packaging / Tiers) table consolidated for maximum admin clarity.
* Centralized: All text editing (Package Titles, Subtitles/Notes, CTA Buttons, Badges) unified in Step 4 (Texts & Badges).

= 2.4.1 =
* Added: Direct HEX color code input fields (`#HEX`) with uppercase formatting and auto-prefix `#` handling in Step 3 Appearance settings.
* Added: Synchronized visual color picker swatches with live HEX input fields.
* Added: Legacy shortcode aliases `[poruci_odmah_5]` and `[poruci_odmah_4]`.

= 2.0.5 =
* Added: Choice between 2 or 3 packaging tiers ("Packaging (tiers)" section).
* Added: Display toggles for free shipping, footer badges, savings, "Best Value" badge, per-unit price, and strikeout price.

= 2.0.4 =
* Updated: Converted all plugin admin strings, default texts, and notices to English for WordPress.org repository compliance.
* Updated: Regenerated `.pot` catalog.

= 2.0.3 =
* Added: Appearance color pickers (Primary color, CTA text color, Best Value badge color, Card background).
* Added: "Hide default product price" option for Block and Classic themes.
* Added: Comprehensive mobile responsiveness (≤600px and ≤480px breakpoints).

= 1.0.0 =
* Initial public release on WordPress.org / WooCommerce ecosystem.

== Upgrade Notice ==

= 2.6.1 =
Minor update with refined badge text defaults and enhanced price calculation precision. Recommended for all users.

= 2.6.0 =
Major release introducing Analytics Dashboard, Live Admin Preview Builder, and 1-Click Quick Language Presets.
