*** Simple Role Based Pricing Changelog ***

2026-05-24 - version 2.4.0
* Fixed: Plan minimap stays synced with block order and persists across page reloads (single blockOrder source of truth).
* Fixed: Reordering blocks in the Plan (including All Products / Specific Categories) now updates the page layout, not only the list; categories can move into the stack below when not first in the plan.
* Fixed: Block order AJAX save uses proper JSON decoding (no sanitize_text_field on the payload).
* Added: Minimap-style Plan panel with draggable previews reflecting block size and collapsed state.
* Added: Full-width page layout map above the settings (zoomed-out wireframe matching the real page: role row + full-width stack); sidebar panel shows role context only.
* Added: Fractal layout map — block-specific previews (overview table grid, categories twin lists, etc.) and empty column slots.
* Added: Empty slot placeholders (dashed “Empty slot” in the products column when categories are in the stack; drop zones between stack blocks).
* Added: Drag-and-drop directly on the layout map to move blocks between the products column and stack slots, with live preview while dragging.
* Added: Page layout map collapsed by default; expand with the same toggle control as pricing blocks.
* Fixed: Dragging All Products back into the top column slot now sticks (order read from the map, not stale positions).
* Added: Context panel block list for scroll-to-block navigation only (reorder stays on the layout map).
* Changed: All Products moves to the top column only when dropped on that column slot, not when it is first in the stack order (empty column slot stays visible).
* Fixed: Unpinning All Products (stack only, same block order) now saves `pinned=0` and survives page reload (layout config via `simprobaAdmin` + `data-categories-pinned`).

2026-05-24 - version 2.3.8
* Fixed: On wide screens, Specific Categories block offset 72px below Select Role so Select2 dropdown stays visible.

2026-05-24 - version 2.3.7
* Fixed: Planning Start/End dates both visible on mobile (stacked layout, full-width datetime inputs).

2026-05-24 - version 2.3.6
* Fixed: Responsive layout for Apply To / Specific Categories (top row, category lists, selected category rows).

2026-05-24 - version 2.3.5
* **Fix**: All Products discounts were not applied on the storefront (PriceCalculator now reads discount data from the `global` JSON structure).
* **Fix**: Category rules with type Global now correctly inherit the role default discount.
* **Fix**: Default discount type and value fields stay visible in Specific Categories mode (defines what Global means per category).

2026-05-24 - version 2.3.4
* **Fix**: Clicking a category name in Selected Categories now selects the row (same as Available Categories).
* **Tweak**: Category name shows pointer cursor in selected list.

2026-05-24 - version 2.3.3
* Bump: readme version was still in 2.3.1.

2026-05-24 - version 2.3.2
* Fix 2.3.1: restore working Enable toggle (revert to 2.2.0 label pattern)

2026-05-24 - version 2.3.1
* **Fix**: Enable toggle was not clickable after the 2.3.0 layout change (restored label association and full hit area on the switch).

2026-05-24 - version 2.3.0
* **Admin workspace**: New block-based settings layout with collapsible sections, drag-and-drop reordering, and a sticky “Plan” sidebar for quicker navigation.
* **Clearer role setup**: Removed the redundant “Role configuration” block. The Enable switch now sits directly under Select Role and Apply To.
* **Apply To–driven UI**: The main content block title follows your Apply To choice (All Products / Specific Categories). Discount type and value appear for All Products; the category picker appears for Specific Categories.
* **Per-role Apply To**: Switching roles restores the correct Apply To value for that role.
* **Rule status badge**: Live indicator next to Enable (Inactive, Active, Scheduled, Expired) based on enable state and planning dates.
* **Unsaved changes**: Warning banner when editing without saving; confirmation before switching roles; browser prompt when leaving the page with unsaved changes.
* **Review notice**: Optional WordPress.org review prompt after 30 days of use (dismissible).
* **Fix**: Block order no longer corrupted after save when blocks are moved by the three-column layout (prevents missing UI and “critical elements missing” JS error).
* **Fix**: Consolidated admin script/style enqueue into a single handler (removed duplicate enqueue).
* **Fix**: Restored the Role Based Pricing settings description text (no longer hidden by CSS).
* **Compatibility**: Tested up to WordPress 7.0.

2026-05-05 - version 2.2.0
* Removal of the mbstring dependency — it was limiting and causing friction during activation

2026-05-04 - version 2.1.1
* **Internationalization Complete**: All text strings are now properly prepared for translations (i18n). Ready for multiple languages.

2026-05-03 - version 2.1.1
* **Database Optimization**: Fully deprecated the legacy SQL schema.
* **Data Migration**: Successfully moved all standalone columns ('discount_type', 'discount_value', 'categories') into a unified 'rules' JSON blob.
* **Logic Fix**: Corrected category name retrieval in the Overview table (no more "ID: 1" fallback).
* **Currency Support**: Switched to native WooCommerce currency symbols for global compatibility.

2026-05-02 - version 2.1.0
* **Major Architecture Overhaul**: Migrated data storage to a centralized JSON format for superior flexibility and future-proofing.
* **Smart Time-Based Rules**: Introduced a scheduling system to define specific start and end dates for role-based discounts.
* **Per-Category Granularity**: Enabled unique discount types and values for each category individually, independent of global role settings.
* **Advanced Admin Interface**: Implemented a dynamic category selector with real-time JSON rule generation and improved UI feedback.
* **Optimized Pricing Engine**: Refactored the calculation logic into a dedicated class for better performance and easier debugging.
* **Enhanced Data Integrity**: The system now dynamically filters active rules based on date validity at the point of calculation.

2026-04-30 - version 2.0.3
* Improvement: Added a clear notice in the settings to explain how individual user price overrides work.

2026-04-30 - version 2.0.2
* UI: Added expandable category previews in the Role Overview table for better configuration tracking.

2026-04-30 - version 2.0.1
* Fix: Resolved role selector UI freeze caused by WooCommerce Select2 overlay. Bug present since 1.2.0 i'm truely sorry for didn't paying attention.
* Fix: Implemented jQuery-based event listeners to properly detect role changes when Select2 is active.
* Debug: Restored admin console logging to improve real-time troubleshooting of DOM interactions.

2026-04-30 - version 2.0.0
* Major: Complete pricing engine refactor. Fully migrated from the "Legacy Coupon" system to a "Native Filter" architecture (improved performance and stability).
* New Feature: User-Specific Pricing (Granularity). You can now set custom discounts for individual users that override global role-based rules.
* Stability: Implemented an anti-loop static flag ($is_calculating) to prevent server crashes during recursive price calls.
* Compatibility: Added REST API and Admin-side detection to ensure prices remain original during data exports or back-office management.
* Logic: Improved conflict management. The plugin now automatically yields if a product is already on native sale or if an "Individual use" coupon is applied to the cart.
* Tweak: Tested and confirmed compatibility with WooCommerce 10.7 and WordPress 6.7.
* Cleanup: Conditionnal Class Loading and Removed redundant debug logs and optimized class loading for a lighter footprint.

2026-04-03 - version 1.2.2
* Fix: Add missing 'enable' column and move DB setup to activation.

2026-04-03 - version 1.2.1
* Fix: Some console logs were badly commented.

2026-04-02 - version 1.2.0
* Performance: Cleaned up all debug logs and console.log for production use.
* Fix: Added explicit WooCommerce activation check.
* Fix: Declared full High-Performance Order Storage (HPOS) compatibility.
* Fix: UI Overhaul - Removed custom background styles to match WooCommerce Native UI.

2026-03-13 - version 1.1.9
* Made Specific Categories fully free and usable without Pro restrictions.

2026-03-10 - version 1.1.8
* Improvement: Switched to modern WooCommerce pricing flow using native get_price filters for item prices, subtotals, and totals (no artificial coupon needed on WC >= 3.2).
* Fix: Correct category handling for variable products (now uses $product->get_category_ids() instead of wp_get_post_terms on variation ID).
* Added: Automatic cart recalculation on user login to apply role-based prices if user logs in after adding items to cart.
* Added: Explicit set_price() calls on woocommerce_before_calculate_totals hook for maximum reliability.
* Changed: Coupon 'simproba_role_discount' is no longer created or applied on WooCommerce >= 3.2 → cleaner checkout display (no mystery discount line).
* Tweak: Refactored pricing logic into a reusable method to reduce duplication and improve maintainability.
* Note: Fully backward compatible – coupon logic remains active only for very old WooCommerce versions (< 3.2).

2025-11-01 - version 1.1.7
* Changed: Long time deprecated ${var} by {$var} , stopping all related php 8+ warnings by the way

2025-08-31 - version 1.1.6
* Added / Fixed: Discount wasn't applied at checkout. At all. So coupon method was applied for clearness.

2025-08-29 - version 1.1.4
* Added: Pro version indicator for "Specific Categories" option in the Apply To selector with a modern inline notification.

2025-08-26 - version 1.1.3
* Fixed: Css overstep beyond role-pricing tab + overthrow main woocommerce aspect with first rule

2025-08-23 - version 1.1.2
* Fixed: Table name interpolation is to be ignored.

2025-08-23 - version 1.1.1
* Fixed: Added missing translators comments in product-fields.php for internationalization.
* Fixed: Corrected SQL queries in multiple files to properly use $wpdb->prepare() without backticks.
* Fixed: Enhanced sanitization for $_POST categories input in admin-settings.php.
* Fixed: Replaced all %s strings that define tables names in prepared request
by identifier %i.

2025-08-22 - version 1.1.0
* Fixed: Addressed security issues from QIT tests (data sanitization, SQL queries, nonces).
* Fixed: Corrected WordPress.org Plugin Check violations (internationalization, WP_Filesystem).
* Fixed: Corrected SQL syntax errors in database queries.
* Fixed: Improved log file permission handling.

2025-08-21 - version 1.0.9
* Added: changelog.txt file for WooCommerce Marketplace submission.
* Tweak: Ensured compliance with WooCommerce submission requirements.

2025-07-01 - version 1.0.8
* Added: Changelog section to readme.txt for WooCommerce Marketplace submission.
* Tweak: Updated documentation for clarity.

2025-07-01 - version 1.0.7
* Fixed: Improved compatibility with WooCommerce 9.0.
* Added: Support for variable product pricing per user role.
* Tweak: Optimized debug logging for better performance.

2025-06-13 - version 1.0.6
* Added: Category restriction option for role-based pricing.
* Fixed: Bug in Quick Edit pricing for specific user roles.

2025-05-25 - version 1.0.5
* Added: Crash Handling.
* Fixed: This plugin won't crash anymore if the required packages are not installed but simply warn the user.

2025-05-25 - version 1.0.4
* Added: Dynamic Translation.

2025-05-24 - version 1.0.3
* Added: Translation.

2025-05-24 - version 1.0.2
* Fixed: Better Category Handling.

2025-05-21 - version 1.0.1
* Added: New Style.

2024-05-21 - version 1.0.0
* Added: First version.
