wp-settings-framework/CHANGELOG.md
owaisahmed5300 270787dd37 fix: repair data handling and resolve tab data loss
This commit resolves critical bugs in data handling and saving. The
public `get()` method and the tabbed saving mechanism are now reliable.

1.  **Corrected `get()` Method:** The internal logic of the `get()` method
    has been completely rewritten. It was previously non-functional and
    now correctly fetches saved option values from the database, with proper
    fallbacks to default values.

2.  **Tabbed Saving Fix:** A data loss bug on tabbed pages is resolved.
    The `Sanitizer` is now state-aware, merging new input with existing
    saved options to ensure settings on other tabs are preserved.

These fixes were made possible by a complete internal refactoring,
which introduced a new `Config` class for state management and enforced
proper dependency injection throughout the framework.
2025-08-13 01:08:30 +05:00

2.9 KiB

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

[1.0.0] - 2025-08-11

This is the initial public release of the WPTechnix Settings Framework. This version represents a complete architectural overhaul from its internal, monolithic predecessor, refactoring it into a modern, decoupled, and highly extensible framework ready for public use.

Added

  • Complete Architectural Refactor: The entire framework has been broken down into small, single-responsibility classes, following modern object-oriented design principles.
  • Composer Support: The framework is now fully PSR-4 compliant and installable as a standard Composer package ( wptechnix/wp-settings-framework).
  • Dependency Injection (DI) Friendly Design:
    • Introduced a primary Settings class that acts as a cohesive manager for building a page and retrieving its data.
    • Added a Interfaces\SettingsInterface to allow for clean dependency injection and testability.
    • Removed all static accessors (SettingsRegistry) in favor of an object-oriented, injectable architecture.
  • Extensible Field System:
    • Created a FieldFactory and an AbstractField base class, making it simple to add new, custom field types.
    • All 20+ field types are now individual classes, making the system easier to maintain and extend.
  • Dedicated Asset Management: A new AssetManager class now handles all CSS and JavaScript enqueueing.
  • Intelligent Asset Loading:
    • The AssetManager automatically detects which field types are being used and only enqueues the necessary libraries (e.g., Select2, Flatpickr, CodeMirror modes).
    • Includes a fallback mechanism to prevent conflicts: it will not load a library from its CDN if a theme or another plugin has already registered it.
  • Configurable HTML Class Prefixing:
    • Introduced a new htmlPrefix option (defaults to wptechnix-settings) to prevent CSS and JS class name collisions in the WordPress admin.
    • This prefix is now consistently applied to all custom field elements and their containers.
  • Flexible Settings Builder:
    • The pageTitle and menuTitle are now optional in the Settings constructor, defaulting to WordPress's standard "Settings" text for simpler setups.
    • Added fluent setter methods (setPageTitle(), setMenuTitle()) for more flexible configuration.
  • Enhanced Code Editor Field: The code field now accepts a language parameter (css, javascript, html) to enable the correct syntax highlighting mode.
  • Full PHPDoc Coverage: Every class, method, and property is now fully documented according to PHPDoc and PSR-12 standards.
  • Comprehensive README.md and CHANGELOG.md: Added official documentation for installation, usage, and project history.