Skip to content

Refactor/inc Structure#27

Merged
jasperf merged 6 commits into
mainfrom
refactor/inc-structure
May 28, 2026
Merged

Refactor/inc Structure#27
jasperf merged 6 commits into
mainfrom
refactor/inc-structure

Conversation

@jasperf

@jasperf jasperf commented May 28, 2026

Copy link
Copy Markdown
Contributor

This pull request delivers the v2.0.0 release of the Warder Cookie Consent plugin, centered on a significant structural refactor that splits the previously monolithic plugin file into a modular inc/ directory. The single warder-cookie-consent.php file (~851 lines) has been decomposed into five focused modules — admin.php, ajax.php, defaults.php, frontend.php, and settings.php — improving long-term maintainability and separation of concerns. Alongside the structural changes, two admin UI label regressions were corrected, ensuring the Settings sidebar and admin page title display the correct plugin name. Developer documentation was reorganized and rewritten to reflect the new architecture and v2.0.0 conventions.

Plugin Architecture Refactor:

  • Extracted plugin logic from warder-cookie-consent.php into five dedicated inc/ modules: defaults.php (default options), settings.php (settings registration and validation), admin.php (admin page rendering), ajax.php (AJAX handlers), and frontend.php (script enqueueing and localization).
  • The main plugin file is retained as the bootstrap entry point, delegating responsibility to the inc/ files rather than containing all logic inline.

Admin UI Corrections:

  • Fixed the Settings sidebar menu label to display "Warder Consent" rather than an incorrect string introduced during the rename.
  • Fixed the admin page title to correctly read "Warder Cookie Consent", ensuring consistency across the WordPress admin interface.

Documentation and Developer Guidance:

  • Relocated dev.md to a docs/ subdirectory and rewrote its contents to reflect the v2.0.0 architecture, including the new inc/ file structure and updated data flow documentation.
  • Updated README.md, readme.txt, and CHANGELOG.md to document the v2.0.0 rename changes and the structural refactor for end users and contributors.

Files Changed:

jasperf added 6 commits May 28, 2026 14:00
Move all functions from the monolithic warder-cookie-consent.php into
five focused files under inc/ (defaults, settings, ajax, admin, frontend).
Add WARDER_PLUGIN_FILE constant so plugin_dir_url(), get_plugin_data(),
and register_activation_hook() resolve correctly from inc/ context.
Main file is now 26 lines: header, constants, and require_once calls only.
Bump version across warder-cookie-consent.php, package.json, readme.txt,
and CHANGELOG.md for the inc/ refactoring milestone.
@jasperf
jasperf merged commit 0a4aa5b into main May 28, 2026
2 checks passed
@jasperf
jasperf deleted the refactor/inc-structure branch May 28, 2026 07:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant