Repository navigation
Client reports: approval before sending, Approve & send all, and Dec 1 audit fixes - #64
Merged
Merged
Conversation
…ec 1 Dec 1 is the first run where clean reports email clients with nobody looking, so a report that is wrong without being flagged goes straight out. Five reviewers went over the run path, every section, both emails and the operator screens; each finding was checked against the code. Holds for review (each a client email that would have been wrong or unexplained): - a Sucuri SiteCheck hit on a site whose malware row comes from a clean Companion scan (SiteCheck results were never read when Companion ran) - a core-file or blocklist problem earlier in the month hidden by a later clean check - no malware scan or blocklist check finished all month while on - a vulnerability list older than 48h, or a plugin whose lookup has never succeeded (#22): the refresh now records each plugin's last successful lookup - 429-blocked time of an hour+, maintenance mode of 2h+ (both count as up) - files-only backups, a failed backup read, or a read from before the month ended; SpinupWP's database half is stored apart so an empty dump can't hide behind the files - a care plan switched off after the month ended (Bill.com's 01:30 UTC sync on the 1st made the run skip the month); the sync now logs its flips, locally only Client-facing fixes: Updates-tab updates showed the raw log line; plugin names with HTML entities; a scoreless speed test as a red 0/100; zero visits for real requests; a short outage rounded to 100%; the preheader ignored the template; a site added late on Nov 1 (25-hour day) held as partial; an uploaded logo was a broken /storage link in every inbox. Operator fixes: unchecking Enable did nothing and saving a paused schedule re-enabled it; edited recipients didn't reach held reports; sends to one report are now locked (no double send); recipients are de-duplicated ignoring case; Send on a sent report warns; a draft Run no longer adds a second live report; the recipient push no longer writes an old Companion snapshot back; client_email is text. Report schema 8, so unsent reports are recompiled under these rules. Tracker, feature doc and changelog updated; what wasn't fixed is listed in the tracker as #23 onward. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q7rExPQo27K9h3tzxiNMw6
… send all ready Reports no longer reach clients by themselves. With approval on (the default), the monthly run compiles and checks every report and emails nothing, whatever the schedule's delivery mode: each lands as Ready to send or Needs review. - Reports list: "Approve & send all ready (N)" sends every Ready to send report of the period; "Send selected" sends the ticked ones (a ticked held report too: ticking it is the approval). Up to 25 per press, through the same ClientReportSender as Send (locked per report, each delivery recorded), skipping outdated, replaced and already-sent ones, and stamping each schedule's last_sent_at. - Scheduling tab: a switch for client_reports.require_approval, logged as client_report_approval_changed. Off restores Automatic schedules emailing clean reports by themselves. - Run, Send now, the schedule form and the send confirmation say what happens with approval on. - Confirm dialogs submit through the clicked button (requestSubmit on the next tick), so a button's formaction and value survive the dialog; the hidden-field copy of the value no longer lingers after Back. Tests for the approval-off behaviour now switch approval off; new tests cover the run, both bulk sends and the switch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q7rExPQo27K9h3tzxiNMw6
# Conflicts: # CHANGELOG.md
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
Gets client reports ready for the December 1 run. Two parts:
Approval and bulk send
client_reports.require_approvalsetting, on by default (ScheduledReportRunner::approvalRequired()). With it on, every schedule runs like a draft: the report is compiled, checked, and left Ready to send or Needs review.last_sent_at.client_report_approval_changed.resources/js/confirm-modal.js) now submit through the clicked button (requestSubmit), so a button'sformactionand value survive the dialog. Checked in a browser with Playwright.Audit fixes
Reports that could have gone out wrong are now held for review:
site_backups.database_bytes).What the client reads:
/storage/…link in every inbox. It's now embedded from disk, and a non-public logo URL is never linked.Operator screens:
client_reports.client_emailis now text, so long recipient lists don't fail.Report schema is now 8.
Deploy steps
Then clear the view cache and run
php artisan queue:restart. After deploy, approval is on: nothing is emailed until someone sends it from the Reports tab.Also needed before Dec 1: a valid AWS key for the backup relay (tracker #11). Until then every relay site is held.
Testing
mainin this environment: the installer tests need MySQL, and the storage-permission test runs as root.Generated by Claude Code