From 2957658edd3555d4d88dce3a46ecb4b145f0b844 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 24 Mar 2026 20:23:56 +0000 Subject: [PATCH 1/2] Initial plan From a4ccf5fa1d0f2daf0bc749cc5f86fb69522321e9 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 24 Mar 2026 20:32:11 +0000 Subject: [PATCH 2/2] Fix bash local-outside-function errors in simple-pattern runner loop Co-authored-by: noelsaw1 <56978803+noelsaw1@users.noreply.github.com> Agent-Logs-Url: https://github.com/Hypercart-Dev-Tools/WP-Code-Check/sessions/397b10f8-799b-48e4-9bfc-c930e3b7780d --- CHANGELOG.md | 2 ++ dist/bin/check-performance.sh | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 35f5562..c9ec7a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,8 @@ All notable changes to this project will be documented in this file. ### Fixed +- Fixed bash `local: can only be used in a function` errors that appeared on every scan invocation. The simple-pattern runner loop uses `local` in top-level scope; replaced with plain variable assignments + - N+1 pattern findings now include the actual source code line in the report. Previously the `code` field was empty because `find_meta_in_loop_line` only returned the line number without extracting the source text ### Tests diff --git a/dist/bin/check-performance.sh b/dist/bin/check-performance.sh index 81a9f78..3c9b1c2 100755 --- a/dist/bin/check-performance.sh +++ b/dist/bin/check-performance.sh @@ -6054,10 +6054,10 @@ if [ -n "$SIMPLE_PATTERNS" ]; then include_args="--include=*.php" fi - local exclude_file_globs="" - local exclude_line_patterns="" - local exclude_file_contains="" - local current_exclusion_block="" + exclude_file_globs="" + exclude_line_patterns="" + exclude_file_contains="" + current_exclusion_block="" while IFS= read -r json_line; do case "$json_line" in