Repository navigation
Add a Scanner tab and dashboard widget backed by tuwebcumple.es - #20
Merged
Merged
Conversation
The Scanner tab sends the site's home URL to the tuwebcumple.es scan API when an administrator clicks "Scan my site", follows the scan until it finishes and lists the grade, headline and per-requirement results. A dashboard widget shows the last grade with a link to the tab. Requests are made server-side through admin-ajax (manage_options and a nonce); the status endpoint only asks about the scan this site started. A 10-minute cooldown per site sits on top of the API's own rate limits. The result is sanitized and stored in the frontconsent_scan_result option. The external service is documented in readme.txt. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
The status message kept "Analyzing your site…" after the pending result (which shows the same line with a spinner) was rendered, so it appeared twice. Clear the message whenever a result is rendered, and cover the start and error paths of scanner.js with node tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
Adds a Scanner tab to the FrontConsent settings page and a dashboard widget, both showing the site's cookie-compliance result from the tuwebcumple.es scan API.
home_url()toPOST https://tuwebcumple.es/api/v1/scans, then the browser polls (everypoll_after_seconds, max 40 polls) through admin-ajax until the scan finishes. Shows grade, score, headline, fail/warning/pass counts, each requirement with icon + text label, and a link to the full result.manage_optionsonly): last grade, headline and counts, with a link to the tab. Polls too if a scan is in progress.includes/Admin/Scanner.php, registered inPlugin_Main; assetsassets/admin/scanner.js/scanner.css(vanilla JS, no jQuery), added tobin/build-assets.js.Protection and privacy
manage_optionsand a nonce.frontconsent_scan_resultoption; all output is escaped.readme.txt"External services" documents tuwebcumple.es (the only server-side request, and only on click). Filters:frontconsent_scanner_api_url,frontconsent_scanner_site_url.Depends on closemarketing/app-tuwebcumple#18 (public scan API), which must be deployed before releasing this.
Notes
Tests
tests/Unit/ScannerTest.php(12 tests, API mocked viapre_http_request): tab position, start/store/cooldown, no API call while pending or within cooldown, status polls only the stored uuid, 422/429 handling, capability check, output escaping, compact widget output, widget registration for administrators only.composer lintandcomposer phpstanclean.🤖 Generated with Claude Code