From dfaee0bca6469ce408a1c90740142cebf4dcf7d0 Mon Sep 17 00:00:00 2001 From: peptiderepo <273788462+peptiderepo@users.noreply.github.com> Date: Sat, 13 Jun 2026 09:50:41 +0000 Subject: [PATCH] PHPCS: use disable/enable blocks for multi-line SQL interpolation phpcs:ignore only suppresses the immediately following line; the SQL queries span multiple lines so the InterpolatedNotPrepared violation fires on the string continuation lines. Replaced with phpcs:disable/ enable pairs that wrap the full get_results/get_var call. Applies to all three DB queries in class-prv-ai-visibility-collector.php. Agent-Session: pr-vision rename v0.1.1 --- .../collector/class-prv-ai-visibility-collector.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/includes/collector/class-prv-ai-visibility-collector.php b/includes/collector/class-prv-ai-visibility-collector.php index 0120b19..852aa90 100644 --- a/includes/collector/class-prv-ai-visibility-collector.php +++ b/includes/collector/class-prv-ai-visibility-collector.php @@ -91,7 +91,7 @@ class PRV_Ai_Visibility_Collector implements PRV_Data_Collector { } // ── Standings: latest result per peptide ──────────────────────── - // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching + // phpcs:disable WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching $standing_rows = $wpdb->get_results( "SELECT peptide_slug, peptide_label, MAX(cited) AS cited, @@ -102,7 +102,7 @@ class PRV_Ai_Visibility_Collector implements PRV_Data_Collector { WHERE run_id = (SELECT run_id FROM {$table} ORDER BY captured_at DESC LIMIT 1) GROUP BY peptide_slug, peptide_label", ARRAY_A - ); + ); // phpcs:enable WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching $standings = array(); foreach ( (array) $standing_rows as $row ) { @@ -117,10 +117,8 @@ class PRV_Ai_Visibility_Collector implements PRV_Data_Collector { } // ── Run metadata ──────────────────────────────────────────────── - // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching - $last_run = $wpdb->get_var( - "SELECT MAX(captured_at) FROM {$table}" - ); + // phpcs:disable WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching + $last_run = $wpdb->get_var( "SELECT MAX(captured_at) FROM {$table}" ); // phpcs:enable WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching return array( 'trendline' => $trendline,