Refactor/inc Structure#27
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 singlewarder-cookie-consent.phpfile (~851 lines) has been decomposed into five focused modules —admin.php,ajax.php,defaults.php,frontend.php, andsettings.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:
warder-cookie-consent.phpinto five dedicatedinc/modules:defaults.php(default options),settings.php(settings registration and validation),admin.php(admin page rendering),ajax.php(AJAX handlers), andfrontend.php(script enqueueing and localization).inc/files rather than containing all logic inline.Admin UI Corrections:
Documentation and Developer Guidance:
dev.mdto adocs/subdirectory and rewrote its contents to reflect the v2.0.0 architecture, including the newinc/file structure and updated data flow documentation.README.md,readme.txt, andCHANGELOG.mdto document the v2.0.0 rename changes and the structural refactor for end users and contributors.Files Changed:
CHANGELOG.md(Modified)README.md(Modified)package.json(Modified)readme.txt(Modified)warder-cookie-consent.php(Modified)docs/dev.md(Added)inc/admin.php(Added)inc/ajax.php(Added)inc/defaults.php(Added)inc/frontend.php(Added)inc/settings.php(Added)dev.md(Deleted)