Repository navigation
Fixed cookie notice script output in footer - #1025
Open
girishpanchal30 wants to merge 2 commits into
Open
girishpanchal30 wants to merge 2 commits into
girishpanchal30 wants to merge 2 commits into
Conversation
Contributor
pirate-bot
requested changes
Nov 23, 2026
Contributor
There was a problem hiding this comment.
🟡 Changes requested
The hook move fixes issue #1014, but the Accept handler still throws when filtered markup has no checkbox.
Validation details
- Files reviewed: 4/4 changed files.
- PHPUnit at HEAD:
cd /repo && set -o pipefail; timeout 280 phpunit --do-not-cache-result --filter 'Test_Module_Policy_Notice::test_bar_scr…printedOK (1 test, 6 assertions)(run R3) - The new PHPUnit test fails against the pr-base
init.php(A/B helper, no run record). - Jest at HEAD passes both cases
cd /repo && set -o pipefail; timeout 250 npx jest --config tests/js/jest.config.js --verbose --testPathPattern policy-no…(run R6, exit 0). Against the pr-baseinit.php, both cases failcd /repo && B=/workspace/checks/C5/jest-base && rm -rf $B && mkdir -p $B && git archive HEAD tests obfx_modules/policy-n…printedCannot read properties of null (reading 'style')(run R7) - Sandbox (twentytwentyfive, module on): the front page prints the bar before the script. The login page prints neither
cd /workspace/checks/C7 && set -o pipefail; curl -fsSL --max-redirs 3 http://localhost:8080/ -o front.html; echo "front …(run R14, exit 0). - Browser: the bar shows, and Accept hides it and sets the cookie. The login page and the block editor show no null error
python3 - <<'PY' from pathlib import Path p=Path('/workspace/checks/C8/observations.md') s=p.read_text().replace('Initia…(run R18, exit 0).
Untested areas
- PHPCS and the full PHPUnit and Jest suites were not run. CI owns them.
- The repository has no end-to-end suite.
- The variant pass did not settle these places, where the fixed cause may still reach:
- not reached: the truncated Playground payload in requirements.md:29
🤖 Automated review · run code-review-agent_6b043a63cbacb3.78138197.
🤖 Review agent — review posted ✅ on 7df0464d · changes requested · 1 finding · 18 min
Run code-review-agent_6b043a63cbacb3.78138197 · trail
pirate-bot
approved these changes
Nov 23, 2026
Contributor
There was a problem hiding this comment.
🟢 Approved
The PR passes: the Accept handler now hides the bar directly, so filtered markup without the checkbox no longer throws.
Validation details
- Files reviewed: 4/4 changed files.
- Jest at HEAD passes all three cases
mkdir -p /workspace/checks/C2 && cd /repo && set -o pipefail; timeout 300 npx jest --config tests/js/jest.config.js --ve…printed3 passed(run R1). - With the init.php from 7df0464, the new Accept case fails
cd /repo && B=/workspace/checks/C2/base && rm -rf $B && mkdir -p $B/tests/js $B/obfx_modules/policy-notice && cp tests/j…printedCannot set properties of null (setting 'checked')(run R2). - Source read: the default notice span, checkbox and close label sit inside
#obfx-cookie-bar, so hiding it hides the whole notice. - PHPUnit order test and login and editor console checks are reused from run code-review-agent_6b043a63cbacb3.78138197 at 7df0464, not rerun. Commit 2cfe3eb does not touch that code.
Untested areas
- The login page console was not rechecked at HEAD.
- The browser check of Accept on the default bar has no harness run record.
- PHPCS and the full suites were not run. CI owns them.
- The repository has no end-to-end suite.
- The variant pass did not settle these places, where the fixed cause may still reach:
/workspace/review/requirements.md:29— unverified: The saved Playground payload is literally truncated, so its complete setup cannot be inspected. The separately recorded symptom and missing-element observation remain available at …
🤖 Automated review · run code-review-agent_6b043fa37646c9.96688054.
🤖 Review agent — review posted ✅ on 2cfe3eba · approved · 0 findings · 10 min
Run code-review-agent_6b043fa37646c9.96688054 · trail
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Refactored cookie notice asset injection to print scripts and styles after the notice bar markup via the
wp_footerhook instead ofwp_print_footer_scripts. Improved inline JavaScript handling and added comprehensive tests to verify the correct asset injection order and behavior.Check before Pull Request is ready:
Closes #1014