Skip to content

Commit

Permalink
Fix phpcs.
Browse files Browse the repository at this point in the history
  • Loading branch information
kagg-design committed Feb 1, 2025
1 parent 9cd6ddd commit 4176e9c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 15 deletions.
16 changes: 9 additions & 7 deletions src/php/Settings/EventsPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,9 @@ public function admin_enqueue_scripts(): void {
self::HANDLE,
self::OBJECT,
[
'ajaxUrl' => admin_url( 'admin-ajax.php' ),
'bulkAction' => self::BULK_ACTION,
'bulkNonce' => wp_create_nonce( self::BULK_ACTION ),
'ajaxUrl' => admin_url( 'admin-ajax.php' ),
'bulkAction' => self::BULK_ACTION,
'bulkNonce' => wp_create_nonce( self::BULK_ACTION ),
'succeed' => $this->succeed,
'failed' => $this->failed,
'succeedLabel' => __( 'Succeed', 'hcaptcha-for-forms-and-more' ),
Expand Down Expand Up @@ -292,12 +292,14 @@ private function delete_hcaptcha_events( array $ids ): bool {

$in = DB::prepare_in( $ids, '%d' );

$query = $wpdb->prepare(
"DELETE FROM $table_name WHERE id IN($in)"
// phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching
$result = $wpdb->query(
$wpdb->prepare(
// phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
"DELETE FROM $table_name WHERE id IN($in)"
)
);

$result = $wpdb->query( $query );

return (bool) $result;
}
}
18 changes: 10 additions & 8 deletions src/php/Settings/FormsPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,9 @@ public function admin_enqueue_scripts(): void {
self::HANDLE,
self::OBJECT,
[
'ajaxUrl' => admin_url( 'admin-ajax.php' ),
'bulkAction' => self::BULK_ACTION,
'bulkNonce' => wp_create_nonce( self::BULK_ACTION ),
'ajaxUrl' => admin_url( 'admin-ajax.php' ),
'bulkAction' => self::BULK_ACTION,
'bulkNonce' => wp_create_nonce( self::BULK_ACTION ),
'served' => $this->served,
'servedLabel' => __( 'Served', 'hcaptcha-for-forms-and-more' ),
'unit' => $this->unit,
Expand Down Expand Up @@ -275,13 +275,15 @@ private function delete_hcaptcha_events_by_forms( array $ids ): bool {

$where_clause = implode( ' OR ', $conditions );

$query = $wpdb->prepare(
"DELETE FROM $table_name WHERE $where_clause",
...$values
// phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching
$result = $wpdb->query(
$wpdb->prepare(
// phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.PreparedSQLPlaceholders.UnfinishedPrepare
"DELETE FROM $table_name WHERE $where_clause",
...$values
)
);

$result = $wpdb->query( $query );

return (bool) $result;
}
}

0 comments on commit 4176e9c

Please sign in to comment.