Skip to content

Commit ce30d73

Browse files
committed
Removed admin user rule.
As some of the requests cannot detect correctly if the user is an admin. We removed this rule.
1 parent 1223a8f commit ce30d73

File tree

7 files changed

+0
-157
lines changed

7 files changed

+0
-157
lines changed

plugins/wpgraphql-logging/docs/index.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ Once the plugin is activated, you can activate and configure the plugin under Se
8787
- **Enabled**: The master switch to turn logging on or off.
8888
- **IP Restrictions**: A comma-separated list of IPv4/IPv6 addresses. When set, only requests originating from these IPs will be logged. This is particularly useful for developers who wish to log only their own queries.
8989
- **Exclude Queries**: A comma-separated list of GraphQL query or mutation names to be excluded from logging. This helps reduce noise by ignoring frequent or uninteresting operations.
90-
- **Admin User Logging**: A toggle to control whether queries made by users with administrative privileges are logged.
9190
- **Data Sampling Rate**: A dropdown to select the percentage of requests that will be logged. This is useful for managing log volume on high-traffic sites by only capturing a sample of the total requests.
9291
- **Log Points**: A multi-select field to choose the specific WPGraphQL lifecycle events for which data should be logged.
9392
- **Log Response**: A toggle to determine whether the GraphQL response body should be included in the log. Disabling this can reduce the size of your log data.
-126 KB
Loading

plugins/wpgraphql-logging/src/Admin/Settings/Fields/Tab/BasicConfigurationTab.php

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,6 @@ class BasicConfigurationTab implements SettingsTabInterface {
3838
*/
3939
public const DATA_SAMPLING = 'data_sampling';
4040

41-
/**
42-
* The field ID for the user-based logging select.
43-
*
44-
* @var string
45-
*/
46-
public const ADMIN_USER_LOGGING = 'admin_user_logging';
47-
4841
/**
4942
* The field ID for the log point selection select.
5043
*
@@ -100,14 +93,6 @@ public function get_fields(): array {
10093
__( 'e.g., __schema,GetSeedNode', 'wpgraphql-logging' )
10194
);
10295

103-
$fields[ self::ADMIN_USER_LOGGING ] = new CheckboxField(
104-
self::ADMIN_USER_LOGGING,
105-
self::get_name(),
106-
__( 'Admin User Logging', 'wpgraphql-logging' ),
107-
'',
108-
__( 'Log only for admin users.', 'wpgraphql-logging' )
109-
);
110-
11196
$fields[ self::DATA_SAMPLING ] = new SelectField(
11297
self::DATA_SAMPLING,
11398
self::get_name(),

plugins/wpgraphql-logging/src/Admin/Settings/Templates/admin.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@
6969
<ul class="wpgraphql-logging-feature-list">
7070
<li><?php esc_html_e( 'Enable/disable logging', 'wpgraphql-logging' ); ?></li>
7171
<li><?php esc_html_e( 'Set IP restrictions', 'wpgraphql-logging' ); ?></li>
72-
<li><?php esc_html_e( 'Log only for admin users', 'wpgraphql-logging' ); ?></li>
7372
<li><?php esc_html_e( 'Data sampling', 'wpgraphql-logging' ); ?></li>
7473
<li><?php esc_html_e( 'Log specific queries', 'wpgraphql-logging' ); ?></li>
7574
<li><?php esc_html_e( 'Exclude queries', 'wpgraphql-logging' ); ?></li>

plugins/wpgraphql-logging/src/Logger/LoggingHelper.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
namespace WPGraphQL\Logging\Logger;
66

77
use WPGraphQL\Logging\Admin\Settings\Fields\Tab\BasicConfigurationTab;
8-
use WPGraphQL\Logging\Logger\Rules\AdminUserRule;
98
use WPGraphQL\Logging\Logger\Rules\EnabledRule;
109
use WPGraphQL\Logging\Logger\Rules\ExcludeQueryRule;
1110
use WPGraphQL\Logging\Logger\Rules\IpRestrictionsRule;
@@ -82,7 +81,6 @@ protected function get_rule_manager(): RuleManager {
8281
$this->rule_manager->add_rule( new QueryNullRule() );
8382
$this->rule_manager->add_rule( new SamplingRateRule() );
8483
$this->rule_manager->add_rule( new EnabledRule() );
85-
$this->rule_manager->add_rule( new AdminUserRule() );
8684
$this->rule_manager->add_rule( new IpRestrictionsRule() );
8785
$this->rule_manager->add_rule( new ExcludeQueryRule() );
8886
apply_filters( 'wpgraphql_logging_rule_manager', $this->rule_manager );

plugins/wpgraphql-logging/src/Logger/Rules/AdminUserRule.php

Lines changed: 0 additions & 41 deletions
This file was deleted.

plugins/wpgraphql-logging/tests/wpunit/Logger/Rules/AdminUserRuleTest.php

Lines changed: 0 additions & 97 deletions
This file was deleted.

0 commit comments

Comments
 (0)