-
Notifications
You must be signed in to change notification settings - Fork 2
chore: WPGraphQL Logging Snags & Automated Tests #423
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
colinmurphy
merged 19 commits into
main
from
chore-wpgraphql-snags-sept-2025-iteration-2
Oct 1, 2025
Merged
chore: WPGraphQL Logging Snags & Automated Tests #423
colinmurphy
merged 19 commits into
main
from
chore-wpgraphql-snags-sept-2025-iteration-2
Oct 1, 2025
Conversation
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
Refactored SettingsPage to use a getter for the field collection and improved template path handling. Removed special email and URL sanitization from TextInputField, now using only sanitize_text_field. Added new and expanded unit tests for SettingsFieldCollection, MenuPage, TextIntegerField, and improved test coverage and docblocks for existing field and settings page tests. Renamed Settings_Page_Test.php to SettingsPageTest.php for consistency.
…ed queries field.
🦋 Changeset detectedLatest commit: ef373fa The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
📦 Plugin Artifacts Ready!Download from GitHub Actions run Available plugins:
See the "Artifacts" section at the bottom of the Actions run page |
…r after finding a few bugs.
Updated QueryFilterLogger to only add logging headers if the RESPONSE_HEADERS_TO_SEND event is selected in the configuration. Added is_selected_event helper and corresponding unit tests to ensure correct behavior based on configuration.
theodesp
approved these changes
Oct 1, 2025
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.
Description
This pull request introduces several improvements and refactors to the WPGraphQL Logging plugin's settings infrastructure, focusing on standardizing tab interfaces, improving configuration access, and simplifying code. The changes enhance maintainability and testability, and bring coverage above 90%.
Settings Tab Interface and Usage Standardization:
SettingsTabInterface
to require staticget_name()
andget_label()
methods, and updated all tab classes (BasicConfigurationTab
,DataManagementTab
) and their usages to use these static methods instead of instance methods. This ensures consistent tab identification and labeling across the codebase. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]Configuration Helper Improvements:
ConfigurationHelper
methods to use static tab names and labels, improving reliability and reducing hardcoded strings. Added a newget_option_value()
method for more direct option retrieval, and removed the unusedreload_config()
method. [1] [2] [3] [4] [5] [6] [7]Codebase Simplification and Cleanup:
LoggingSettingsService
class, consolidating configuration access throughConfigurationHelper
.SettingsFormManager
to accept aConfigurationHelper
instance in its constructor for improved dependency injection and testability. [1] [2]Field and Input Handling:
TextInputField::sanitize_field()
method to always usesanitize_text_field
, removing special handling for email and URL input types.Other Notable Changes:
These changes collectively make the settings architecture more robust, easier to extend, and better covered by tests.
Related Issue
#412
Dependant PRs
Type of Change
How Has This Been Tested?
Screenshots
Checklist