Skip to content

Commit d0281d9

Browse files
authored
Merge pull request #412 from wpengine/chore-wpgraphql-logging-snags-sept-2025
chore: WP GraphQL Logging Snags
2 parents 5a6593c + 04879e8 commit d0281d9

23 files changed

+547
-501
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@wpengine/wpgraphql-logging-wordpress-plugin": patch
3+
---
4+
5+
chore: Various snags.

plugins/wpgraphql-logging/README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,35 @@ Once you have the composer repository setup, please run `composer req wpengine/w
4848

4949
Plugin should start logging data, once activated.
5050

51+
---
52+
53+
## Uninstallation and Data Cleanup
54+
55+
By default, WPGraphQL Logging preserves all logged data when the plugin is deactivated to prevent accidental data loss. If you want to completely remove all plugin data (including database tables) when deactivating the plugin, you must explicitly enable this behavior.
56+
57+
### Enabling Database Cleanup on Deactivation
58+
59+
To enable automatic database cleanup when the plugin is deactivated, add the following constant to your `wp-config.php` file or in a must-use plugin:
60+
61+
```php
62+
define( 'WP_GRAPHQL_LOGGING_UNINSTALL_PLUGIN', true );
63+
```
64+
65+
> [!WARNING]
66+
> **Data Loss Warning**: When `WP_GRAPHQL_LOGGING_UNINSTALL_PLUGIN` is defined as `true`, deactivating the plugin will permanently delete all logged data and drop the plugin's database tables. This action is irreversible.
67+
68+
### Manual Data Cleanup
69+
70+
If you prefer to manually clean up data without defining the constant, you can:
71+
72+
1. Use the plugin's admin interface to clear logs (when available)
73+
2. Manually drop the database table: `{$wpdb->prefix}wpgraphql_logging`
74+
3. Remove plugin options from the WordPress options table
75+
76+
---
77+
78+
@TODO add more info once we have configuration setup.
79+
5180
@TODO add more info once we have configuration setup.
5281

5382

plugins/wpgraphql-logging/composer.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,7 @@
5353
"phpstan/phpstan-strict-rules": "^2.0",
5454
"slevomat/coding-standard": "^8.0",
5555
"szepeviktor/phpstan-wordpress": "^2.0",
56-
"wp-cli/wp-cli-bundle": "^2.8.1",
57-
"wp-graphql/wp-graphql": "^2.3",
58-
"wp-graphql/wp-graphql-testcase": "^3.0.1"
56+
"wp-cli/wp-cli-bundle": "^2.8.1"
5957
},
6058
"config": {
6159
"allow-plugins": {

0 commit comments

Comments
 (0)