Skip to content

Commit fddbb3a

Browse files
committed
lint: phpcs fixes
1 parent d6f7eed commit fddbb3a

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

plugins/wpgraphql-logging/src/Admin/View/List/List_Table.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,22 +126,19 @@ public function process_bulk_action(): void {
126126
return;
127127
}
128128

129-
// Nonce action WordPress uses for bulk actions is 'bulk-' . $this->_args['plural']
130129
$nonce_action = 'bulk-' . $this->_args['plural'];
131130
$nonce_value = $_REQUEST['_wpnonce'] ?? '';
132131

133-
// Ensure nonce is a string for wp_verify_nonce
134132
$nonce = is_string( $nonce_value ) ? $nonce_value : '';
135133

136-
// Fix for PHPStan: wp_verify_nonce returns int|false, need explicit boolean check
137134
$nonce_result = wp_verify_nonce( $nonce, $nonce_action );
138135
if ( false === $nonce_result ) {
139136
wp_die( esc_html__( 'Nonce verification failed!', 'wpgraphql-logging' ) );
140137
}
141138

142139
$deleted_count = 0;
143140

144-
// WordPress sometimes sends 'delete' for selected items
141+
// WordPress sometimes sends 'delete' for selected items.
145142
if ( in_array( $action, [ 'delete', 'bulk_delete' ], true ) && ! empty( $_REQUEST['log'] ) ) {
146143
$ids = array_map( 'absint', (array) $_REQUEST['log'] );
147144
// Remove redundant empty check since array_map always returns array
@@ -160,7 +157,6 @@ public function process_bulk_action(): void {
160157
}
161158

162159
if ( $deleted_count > 0 ) {
163-
// Preserve filters during redirect
164160
$preserved_filters = [];
165161
$filter_keys = [ 'level_filter', 'start_date', 'end_date' ];
166162

plugins/wpgraphql-logging/src/Logger/Database/LogsRepository.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,7 @@ public function delete(int $id): bool {
114114
*/
115115
public function delete_all(): void {
116116
global $wpdb;
117-
// Use DatabaseEntity::get_table_name() to get the table name
118117
$table_name = DatabaseEntity::get_table_name();
119-
$wpdb->query( "DELETE FROM {$table_name}" ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery
118+
$wpdb->query( $wpdb->prepare( "DELETE FROM %i", $table_name ) ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery
120119
}
121120
}

0 commit comments

Comments
 (0)