-
Notifications
You must be signed in to change notification settings - Fork 2
chore: Internal Testing & Validation WPGraphQL Logging Plugin #456
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
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
🦋 Changeset detectedLatest commit: 6c3eb8b 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 |
…cks. Expanded and clarified the readme.txt with detailed features, requirements, installation, and FAQ for the WPGraphQL Logging plugin beta release. Updated contributor list, license, and tested PHP/WP versions. Added and improved PHPDoc blocks in templates and event class for consistency. Renamed TESTING.md to docs/how-to/run_tests.md for better documentation structure. Minor description update in main plugin file.
Renamed admin view template files to use the WPGraphQLLogger* naming convention for consistency. Updated all references in code, documentation, and psalm.xml to match the new filenames.
Wrap CACHE_DURATION in apply_filters to allow customization of the configuration cache duration via the 'wpgraphql_logging_config_cache_duration' filter.
Introduces a filter 'wpgraphql_logging_allowed_orderby_columns' to whitelist allowed columns for ORDER BY in find_logs() queries, enhancing security against SQL injection. Documentation updated with usage details and examples; code now validates both column and direction, falling back to defaults if invalid values are provided.
Introduces Monolog's BufferHandler for database logging and adds the 'wpgraphql_logging_default_buffer_limit' filter to customize buffer size. Updates tests to flush buffer before asserting log counts and documents the new filter. Also adds an index for 'level_name' in the database entity.
… for DatabaseSanitization
Introduces LogEntityInterface defining the contract for log entities and implements it in WordPressDatabaseEntity, which provides methods for creating, saving, and managing log entries in a WordPress database. This lays the foundation for structured logging within the WPGraphQL Logging plugin.
Refactored LogEntityInterface to require a constructor and static from_array method, and removed the create method. Added LogServiceInterface for CRUD operations on log entities. Updated WordPressDatabaseEntity to implement the new interface, including a new constructor, from_array, and static get_table_name. Added WordPressDatabaseLogService to provide database-backed CRUD operations for log entities.
Replaces direct repository usage with LogStoreService for log retrieval in DownloadLogService, improving extensibility. Adds get_query() to LogEntityInterface and implements it in WordPressDatabaseEntity to extract GraphQL queries from log context. Updates related tests to use the new service and interface.
Replaces direct dependency on LogsRepository with LogServiceInterface in DataDeletionScheduler. Updates instantiation to use LogStoreService and modifies log deletion to use the new service method for improved abstraction and flexibility.
Replaces direct usage of LogsRepository with LogServiceInterface in ViewLogsPage for improved abstraction and flexibility. Updates method to retrieve logs via the log service and adds a protected getter for the log service instance. Removes unused LogsRepository import from the related test file.
af8a84c to
9b5ee54
Compare
…processing for Database Service.
Replaces direct usage of DatabaseEntity with LogStoreService in WordPressDatabaseHandler. This change centralizes log entity creation and storage, improving maintainability and consistency.
… the plugin to use interface methods instead so developers can replace the service via the log store service.
Moved LoggingRuleInterface to a new Api namespace and updated all references accordingly. Cleaned up admin asset enqueuing logic, improved documentation in EventManager, and made minor code style improvements. No functional changes to logging logic.
Added jQuery UI CSS and JS, and the jQuery Timepicker Addon assets to the wpgraphql-logging plugin for enhanced date/time selection in the log view. Also moved the logging view JS file to a new directory and updated the ViewLogsPage PHP to reference the new assets.
…pengine/hwptoolkit into wpgraphql-logging-internal-testing-448
Implemented various improvements to the WPGraphQL Logging Plugin, including performance enhancements and better error handling.
colinmurphy
previously approved these changes
Nov 4, 2025
colinmurphy
approved these changes
Nov 5, 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 PR performs internal testing and validation of the WPGraphQL Logging Plugin to ensure it is ready for GA.
Fixes in the PR
Related Issue
#448
Dependant PRs
Type of Change
How Has This Been Tested?
Screenshots
Checklist