You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+30Lines changed: 30 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,36 @@ All notable changes to this project will be documented in this file.
5
5
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
8
+
## [2.2.4] - 2026-02-07
9
+
10
+
### Fixed
11
+
12
+
#### wc-coupon-in-thankyou Validator Not Applied in Main Scanner Flow
13
+
14
+
-**Issue:** The context-aware validator existed and passed unit tests, but the primary `check-performance.sh` coupon check path still used legacy matching without validator filtering.
15
+
-**Impact:** False positives persisted for commented-out hooks and non-thank-you contexts when scanning real projects.
16
+
-**Fix:** Wired `dist/bin/validators/wc-coupon-thankyou-context-validator.sh` into the main WooCommerce coupon thank-you check loop in `dist/bin/check-performance.sh`.
17
+
- Exit `1` findings are now suppressed as false positives.
18
+
- Exit `2` findings are marked with `[NEEDS REVIEW]`.
19
+
20
+
#### cached_grep Single-File Directory Regression (Paths with Spaces)
21
+
22
+
-**Issue:**`cached_grep` handled paths with spaces for multi-file directories, but failed for directories containing exactly one PHP file by grepping the cache list file instead of the actual PHP file.
23
+
-**Impact:** Missed findings in common local paths with spaces (for one-file plugin/theme repro cases).
24
+
-**Fix:** Updated `cached_grep` in `dist/bin/check-performance.sh` to:
25
+
- Scan direct file targets via `PATHS` when `--paths` is a file.
26
+
- Use null-delimited cached list processing (`tr ... | xargs -0`) for any cached directory scan with one or more PHP files.
27
+
28
+
### Added
29
+
30
+
-**Regression checks:** Added scanner-level regression test script:
31
+
-`dist/bin/test-fix-audit-regressions.sh`
32
+
- Covers:
33
+
- checkout hook false positive suppression
34
+
- commented hook false positive suppression
35
+
- thank-you true positive retention
36
+
- one-file and multi-file path-with-spaces unsanitized superglobal detection
Two recent fixes are partially implemented and not fully effective in end-to-end scanner execution:
13
+
14
+
1.`wc-coupon-in-thankyou` context-aware validator is not applied in the primary scan path, so false positives still appear for commented/safe-hook scenarios.
15
+
2.`cached_grep` path-with-spaces fix works for multi-file scans but fails when a directory has exactly one PHP file due to cache file path handling.
16
+
17
+
## Scope
18
+
19
+
- Fix integration of validated pattern execution for `wc-coupon-in-thankyou`.
20
+
- Fix single-file cached path handling in `cached_grep`.
21
+
- Add regression tests for both failure modes.
22
+
- Update changelog/version metadata for release consistency.
23
+
24
+
## Non-Goals
25
+
26
+
- Broad refactor of all legacy hardcoded checks.
27
+
- Pattern architecture redesign beyond required wiring for this incident.
28
+
- New detection rules unrelated to these two regressions.
29
+
30
+
## Acceptance Criteria
31
+
32
+
-[x] Commented-out hook fixture is not flagged by full scanner run.
33
+
-[x] Safe checkout hook fixture is not flagged by full scanner run.
34
+
-[x] True thank-you hook fixture is flagged by full scanner run.
35
+
-[x] Unsanitized superglobal is detected in a path containing spaces with exactly one PHP file.
36
+
-[x] Unsanitized superglobal is detected in a path containing spaces with multiple PHP files.
37
+
-[x] Existing validator unit tests continue to pass.
38
+
-[x] CHANGELOG and scanner version are aligned with delivered fix.
39
+
40
+
## Implementation Plan
41
+
42
+
### Phase 1: Validator Integration Repair
43
+
44
+
-[x] Chosen minimal-risk approach: integrated context-aware validator directly into existing legacy `wc-coupon-in-thankyou` scanner block in `dist/bin/check-performance.sh`.
45
+
-[x] Added validator-based suppression handling (exit `1`) and manual-review marking (exit `2`) in main scanner flow.
46
+
-[x] Verified false-positive suppression and true-positive retention with full scanner fixture runs.
47
+
48
+
### Phase 2: cached_grep Single-File Path Fix
49
+
50
+
-[x] Corrected `cached_grep` single-file handling to scan `PATHS` directly when `--paths` is a file.
51
+
-[x] Preserved path-with-spaces safety (`xargs -0`) for cached directory scans (one or more files).
52
+
-[x] Verified no regression for single-file directory and multi-file directory scans.
53
+
54
+
### Phase 3: Regression Test Coverage
55
+
56
+
-[x] Added scanner-level integration test script: `dist/bin/test-fix-audit-regressions.sh`.
57
+
-[x] Added scanner-level regression checks for path-with-spaces scenarios:
58
+
- one PHP file
59
+
- multiple PHP files
60
+
-[x] Kept tests lightweight and executable in local/dev CI contexts.
61
+
62
+
### Phase 4: Release Hygiene
63
+
64
+
-[x] Updated `CHANGELOG.md` with concrete fixed behaviors and regression coverage.
65
+
-[x] Aligned `dist/bin/check-performance.sh` header version and `SCRIPT_VERSION` SOT value to `2.2.4`.
66
+
-[x] Updated this project task document status/progress.
add_json_finding "wc-coupon-in-thankyou""error""$COUPON_THANKYOU_SEVERITY""$file""$line_num""Coupon logic in thank-you/order-received context (should be in cart/checkout hooks)""$code"
@@ -5389,10 +5410,16 @@ if [ "$COUPON_THANKYOU_FINDING_COUNT" -gt 0 ]; then
5389
5410
fi
5390
5411
if [ "$OUTPUT_FORMAT"="text" ];then
5391
5412
echo"$COUPON_THANKYOU_ISSUES"| head -5
5413
+
if [ "$COUPON_THANKYOU_VALIDATOR_SUPPRESSED"-gt 0 ];then
5414
+
text_echo "${BLUE} (${COUPON_THANKYOU_VALIDATOR_SUPPRESSED} suppressed by validator)${NC}"
5415
+
fi
5392
5416
fi
5393
5417
add_json_check "WooCommerce coupon logic in thank-you context""$COUPON_THANKYOU_SEVERITY""failed""$COUPON_THANKYOU_FINDING_COUNT"
5394
5418
else
5395
5419
text_echo "${GREEN} ✓ Passed${NC}"
5420
+
if [ "$OUTPUT_FORMAT"="text" ] && [ "$COUPON_THANKYOU_VALIDATOR_SUPPRESSED"-gt 0 ];then
5421
+
text_echo "${BLUE} (${COUPON_THANKYOU_VALIDATOR_SUPPRESSED} suppressed by validator)${NC}"
5422
+
fi
5396
5423
add_json_check "WooCommerce coupon logic in thank-you context""$COUPON_THANKYOU_SEVERITY""passed" 0
0 commit comments