Skip to content

Commit b53a0c4

Browse files
committed
Update plugin docs and metadata for beta release. Updated PHP Doc Blocks.
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.
1 parent ffd97dc commit b53a0c4

File tree

8 files changed

+130
-24
lines changed

8 files changed

+130
-24
lines changed

plugins/wpgraphql-logging/CHANGELOG.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,3 @@
4343
### Patch Changes
4444

4545
- [#403](https://github.com/wpengine/hwptoolkit/pull/403) [`821908b`](https://github.com/wpengine/hwptoolkit/commit/821908b7a7b8743a44cdbdbd98eedfff7faac34a) Thanks [@colinmurphy](https://github.com/colinmurphy)! - chore: Added admin view, filters and CSV downloads.
46-
47-
## 0.0.1-beta
48-
49-
- Proof of concept. A plugin for logging data for WPGraphQL.
File renamed without changes.
Lines changed: 110 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,127 @@
11
=== WPGraphQL Logging ===
2-
Contributors: wpengine
2+
Contributors: colin-murphy, joefusco, thdespou, wpengine
33
Tags: GraphQL, Headless, WPGraphQL, React, Rest, Logging, Performance, Debugging, Monitoring
44
Requires at least: 6.5
5-
Tested up to: 6.8,2
6-
Requires PHP: 8.1
5+
Tested up to: 6.8.2
6+
Requires PHP: 8.1.2
77
Requires WPGraphQL: 2.3.0
88
Stable tag: 0.1.0
9-
License: GPL-2.0
9+
License: GPL-2.0-or-later
1010
License URI: https://www.gnu.org/licenses/gpl-2.0.html
1111

12+
A WPGraphQL logging plugin that provides visibility into the GraphQL request lifecycle, giving developers the observability needed to quickly identify and resolve bottlenecks in their headless WordPress application.
13+
1214
== Description ==
1315

14-
A WPGraphQL logging plugin that provides visibility into request lifecycle to help quickly identify and resolve bottlenecks in your headless WordPress application.
16+
**WPGraphQL Logging** is a comprehensive logging solution for WPGraphQL that tracks and records GraphQL query execution, providing developers with detailed insights into query performance, errors, and request lifecycle events.
1517

16-
= Features =
18+
**Note:** This plugin is currently in BETA. While it is functional and ready for testing, some features may be subject to change based on community feedback.
1719

18-
- Query event lifecycle logging:
19-
- Pre Request (`do_graphql_request`): logs query, variables, operation name
20-
- Before Execution (`graphql_before_execute`): logs request params snapshot
21-
- After Execution (`graphql_execute`): logs response, schema, request
22-
- Before Response Returned (`graphql_return_response`): inspects response errors and upgrades level to Error when present
20+
= Key Features =
2321

24-
- Pub/sub system:
25-
- Subscribe with priorities, publish events, and apply transforms to mutate payloads
26-
- WordPress bridges: `wpgraphql_logging_event_{event}` (action) and `wpgraphql_logging_filter_{event}` (filter)
22+
**GraphQL Request Lifecycle Logging**
23+
* Pre Request (`do_graphql_request`): Captures query text, variables, and operation name
24+
* Before Execution (`graphql_before_execute`): Records request parameter snapshot
25+
* After Execution (`graphql_execute`): Logs response data, schema context, and request details
26+
* Before Response (`graphql_return_response`): Inspects response for errors and automatically escalates log level when errors are present
2727

28-
- Monolog-based storage and context:
29-
- Default handler writes to a WordPress table (`{$wpdb->prefix}wpgraphql_logging`)
30-
- Processors include memory usage, web request, process ID, and GraphQL request details
28+
**Advanced Admin Interface**
29+
* View and filter all logged GraphQL requests in the WordPress admin
30+
* Search and sort by date, query name, log level, or custom criteria
31+
* Export logs to CSV for offline analysis
32+
* Configurable data retention policies with automatic cleanup
33+
34+
**Flexible Event System**
35+
* Built-in pub/sub architecture for subscribing to logging events
36+
* Priority-based event handling
37+
* Transform and mutate log payloads before storage
38+
* WordPress action/filter bridges: `wpgraphql_logging_event_{event}` and `wpgraphql_logging_filter_{event}`
39+
40+
**Powerful Storage & Context**
41+
* Built on Monolog for reliable, industry-standard logging
42+
* Default database handler stores logs in WordPress table (`{$wpdb->prefix}wpgraphql_logging`)
43+
* Extensible processor system includes:
44+
* Memory usage tracking
45+
* Web request context
46+
* Process ID tracking
47+
* GraphQL-specific request metadata
48+
49+
**Customization Options**
50+
* Add custom log processors via filters
51+
* Implement custom storage handlers
52+
* Define custom logging rules and conditions
53+
* Extend the admin interface with custom fields and tabs
54+
55+
= Use Cases =
56+
57+
* **Performance Monitoring**: Identify slow queries and execution bottlenecks
58+
* **Error Tracking**: Monitor and debug GraphQL errors in production
59+
* **Development & Testing**: Track query behavior during development
60+
* **Compliance & Auditing**: Maintain records of API access and usage
61+
* **Analytics**: Analyze query patterns and usage trends
62+
63+
= Requirements =
64+
65+
* WordPress 6.5 or higher
66+
* PHP 8.1.2 or higher
67+
* WPGraphQL 2.3.0 or higher
68+
69+
= Documentation =
70+
71+
For detailed documentation, guides, and examples, visit the [GitHub repository](https://github.com/wpengine/hwptoolkit/tree/main/plugins/wpgraphql-logging).
72+
73+
== Installation ==
74+
75+
1. Upload the plugin files to `/wp-content/plugins/wpgraphql-logging/`, or install the plugin through the WordPress plugins screen directly
76+
2. Activate the plugin through the 'Plugins' screen in WordPress
77+
3. Navigate to Settings > WPGraphQL Logging in the WordPress admin to configure settings
78+
4. View logged queries can be found in GraphQL Logs
3179

32-
== Upgrade Notice ==
3380
== Frequently Asked Questions ==
81+
82+
= Is this plugin production-ready? =
83+
84+
This plugin is currently in BETA. It is functional and ready for testing in staging environments. We recommend thorough testing before deploying to production.
85+
86+
= Does this plugin affect GraphQL query performance? =
87+
88+
The plugin is designed to have minimal performance impact. Logging operations are performed asynchronously where possible, and you can configure data retention policies to manage database size.
89+
90+
= Can I export my logs? =
91+
92+
Yes! The admin interface includes CSV export functionality for all filtered log entries.
93+
94+
= Can I customize what gets logged? =
95+
96+
Yes, the plugin provides extensive hooks and filters to customize logging behavior, add custom processors, and implement custom storage solutions.
97+
98+
= How do I delete old logs? =
99+
100+
The plugin includes configurable data retention settings. You can set automatic cleanup rules to delete logs older than a specified number of days.
101+
34102
== Screenshots ==
103+
104+
1. View all GraphQL query logs with filtering and search
105+
2. Detailed log entry view showing query, variables, and response
106+
3. Configuration settings for data retention and logging behavior
107+
4. Export logs to CSV for analysis
108+
35109
== Changelog ==
110+
111+
= 0.1.0 - 2025-01-22 =
112+
* Initial BETA release
113+
* Core logging functionality for WPGraphQL request lifecycle
114+
* Admin interface for viewing and filtering logs
115+
* CSV export functionality
116+
* Configurable data retention and cleanup
117+
* Extensible event system with pub/sub architecture
118+
* Monolog-based storage with custom processors
119+
120+
== Upgrade Notice ==
121+
122+
= 0.1.0 =
123+
Initial BETA release.
124+
125+
== Support ==
126+
127+
For support, feature requests, or bug reports, please visit our [GitHub issues page](https://github.com/wpengine/hwptoolkit/issues).

plugins/wpgraphql-logging/src/Admin/View/Templates/wpgraphql-logger-filters.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

33
declare(strict_types=1);
44

5+
/**
6+
* Log filters template.
7+
*
8+
* @package WPGraphQL\Logging
9+
*
10+
* @since 0.0.1
11+
*/
12+
513
if ( ! defined( 'ABSPATH' ) ) {
614
exit;
715
}

plugins/wpgraphql-logging/src/Admin/View/Templates/wpgraphql-logger-list.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/**
66
* Logs list view template using WP_List_Table.
77
*
8-
* @package WPGraphQL\Logger\Admin\View\List\Templates
8+
* @package WPGraphQL\Logging
99
*
1010
* @var \WPGraphQL\Logging\Admin\View\List\ListTable $list_table List table instance.
1111
*

plugins/wpgraphql-logging/src/Admin/View/Templates/wpgraphql-logger-view.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@
55
/**
66
* Log detail view template.
77
*
8+
* @package WPGraphQL\Logging
9+
*
810
* @var \WPGraphQL\Logging\Logger\Database\DatabaseEntity $log
11+
*
12+
* @since 0.0.1
913
*/
1014
?>
1115
<div class="wrap">

plugins/wpgraphql-logging/src/Events/Events.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66

77
/**
88
* List of available events that users can subscribe to with the EventManager.
9+
*
10+
* @package WPGraphQL\Logging
11+
*
12+
* @since 0.0.1
913
*/
1014
final class Events {
1115
/**

plugins/wpgraphql-logging/wpgraphql-logging.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Plugin Name: WPGraphQL Logging
44
* Plugin URI: https://github.com/wpengine/hwptoolkit
55
* GitHub Plugin URI: https://github.com/wpengine/hwptoolkit
6-
* Description: A WPGraphQL logging plugin that provides visibility into request lifecycle to help quickly identify and resolve bottlenecks in your headless WordPress application.
6+
* Description: A WPGraphQL logging plugin that provides visibility into the request lifecycle, giving developers the observability needed to quickly identify and resolve bottlenecks in their headless WordPress application.
77
* Author: WPEngine Headless OSS Team
88
* Author URI: https://github.com/wpengine
99
* Update URI: https://github.com/wpengine/hwptoolkit
@@ -23,6 +23,8 @@
2323
*
2424
* @author WPEngine Headless OSS Team
2525
*
26+
* @since 0.0.1
27+
*
2628
* @license GPL-2
2729
*/
2830

0 commit comments

Comments
 (0)