Repository navigation
Show the site report's result next to the button - #232
Merged
Merged
Conversation
After pressing "Send site report now", the page reloaded at the top and WordPress moved the result notice under the page title, away from the button, so it looked as if nothing had happened. The report is now sent before the settings page is printed, so the browser keeps showing the button, disabled with "Sending…" and a spinner, until the result is ready. The page then comes back to the Site report section, shows the result in an inline notice under the button and moves the focus to it. A page that had expired now says so instead of showing nothing. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused manual-report changes preserve authorization, nonce validation, and output escaping, with no unresolved findings.
No open issues 🎉
What changed in this PR
This PR improves feedback for manually sending a BCC Login site report by keeping the result beside the button instead of moving it to the top of the settings page.
Changes:
- Sends the report before page rendering and shows an inline success or escaped error message.
- Adds a sending indicator, returns users to the report section, and focuses the result.
- Explains expired nonces while preserving access checks and daily reporting behavior.
| File | Description |
|---|---|
| plugins/bcc-login/includes/class-bcc-login-site-report.php | Updates manual-send handling, progress feedback, inline results, and focus behavior. |
Review effort: Balanced
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.
Problem
After pressing Send site report now (Settings → BCC Login → Maintenance → Site report), there seemed to be no confirmation. The form posted back to the same page, which reloaded at the top. WordPress's
common.jsthen moved the result notice under the page title, far from the button. People either missed it at the top or scrolled back down to the button and found nothing there.Changes
load-settings_page_bcc_login), before anything is printed. The browser keeps showing the old page until the result is ready.#bcc-login-site-report, so the page comes back to the Site report section.inlineclass in place.#bcc-login-site-reportfrom the address, so the page's other forms (Delete subscribers, Flush Groups Cache), which post to the same address, don't return to this section.The daily report is unchanged.
Testing
In a throwaway WordPress 7.0.2 with a mock Auth0 and a mock API, using the built JavaScript from the v1.2.16 release. Tested in headless Chrome, WebKit (Safari's engine) and Firefox:
<script>in its description, shown as text) and an API 401.manage_options, get no form and send nothing.PHPStan with the CI config passes, and
php -lpasses on PHP 7.4 and 8.4.🤖 Generated with Claude Code