Skip to content

Backup: warn about known threats before restoring a backup - #53755

Merged
dhasilva merged 72 commits into
trunkfrom
add/known-threats-plugin-restore
Oct 22, 2026
Merged

dhasilva merged 72 commits into
trunkfrom
add/known-threats-plugin-restore

Conversation

@RafaelFunchal

@RafaelFunchal RafaelFunchal commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Proposed changes

Warns before restoring a backup that WordPress.com knows contains security threats, across the Backup dashboard and the Activity Log.

  • Sites hosted on WordPress.com (WoA) only, for now. Both dashboards learn from their initial state whether known threats are available. Elsewhere they make no known-threats request, a restore doesn't send acknowledge_threats (so WordPress.com keeps exempting it), and every screen behaves exactly as before.
  • Restore screen (/restore/<rewindId>):
    • Flagged backups: a warning notice ("This backup is known to contain N security threats. Restoring it may bring malware back to your site."), a "Show threats" toggle that lists each threat with where it is, when Scan first detected it and its status now, and a "Restore backup instead" link to the latest backup without known threats. Confirm restore stays disabled until the user ticks "I understand this backup contains known threats and want to restore it anyway."
    • While waiting for the tick, Confirm restore stays focusable. Its description, also shown as a tooltip on hover or focus, is "To restore this backup, confirm that you understand it contains known threats."
    • While the check runs: Confirm is disabled with "Checking this backup for known threats…". The card is aligned to the top, so its heading stays put when the warning arrives.
    • If the check is unavailable (no Scan, an error, an unreadable answer, or no answer within 12 seconds), the screen restores exactly as before, with no warning.
    • If the server refuses a restore anyway (threats_not_acknowledged, HTTP 409), the screen returns to the confirm step with the warning shown.
    • Opening another backup from the warning moves focus to the heading and drops the old acknowledgement.
  • Backups list: flagged backups get a "Known threats (N)" badge in a field of its own, so screen readers hear it, with the warning, as part of the row.
  • Backup details: the same warning, list, link and checkbox. "Restore to this point" stays focusable but inert, with the hint as its description and tooltip, until the box is ticked. The restore screen then opens already acknowledged. The acknowledgement travels in the router's history state, keyed to that backup, so no link can arrive pre-ticked.
  • Activity Log:
    • "Backup complete" rows of flagged backups get the same "Known threats (N)" badge below the event text, with the warning for screen readers.
    • "Restore backup" opens the in-admin restore screen when the Backup dashboard is on, through the new jetpack_activity_log_restore_url_template filter, and the Jetpack Cloud restore flow otherwise.
  • Screen readers hear the warning when it appears, and that Restore is available once the box is ticked. "No known threats found in this backup." is said only when a check answered that the backup is clean. Announcements made at the same moment are merged so neither cuts the other off.
  • Design system: the warning is a Notice, the threats sit in a Collapsible, the badge is Badge, and the acknowledgement is @wordpress/ui's CheckboxControl. Threat dates and the clean backup's name use the site's own date formats and timezone.
  • REST bridge:
    • POST /jetpack/v4/rewind/to/{rewind_id} sends acknowledge_threats to WordPress.com, as true or false, on WoA, and omits it elsewhere. A 409 threats_not_acknowledged comes back as that error instead of a generic upstream error.
    • New GET /jetpack/v4/rewind/backups/{rewind_id}/threats proxies one backup's known threats. Off WoA, and when the threats aren't available, it returns threats_unavailable (404).
    • New GET /jetpack/v4/rewind/backups/known-threats returns the counts for the newest 100 backups. With with_clean_rewind_id, it also finds when the latest clean backup finished, which the warning's link needs. A found answer is kept for a month and a missing one for five minutes.
    • New GET /jetpack/v4/activity-log/known-threats gives the Activity Log the same counts.
    • Both count routes ask WordPress.com for known_threats_only, which older servers ignore.

Screenshots

Local site, desktop 1440px and phone 390px. The site isn't hosted on WordPress.com, so the known-threats routes are faked: the 14/10 backup has three threats, and 15/10 is the newest clean one. Dates follow the site's d/m/Y setting.

Backups list and details Threats shown, with the link's tooltip
Backups list with the Known threats badge, and the details with the warning and Restore disabled Backup details with the threats listed and the clean-backup link's tooltip
Restore screen while the check runs Threats shown, box ticked
Restore screen with Confirm disabled while checking for known threats Restore screen with the warning, the threats listed and the box ticked
Phone Activity Log
Restore screen at phone width with the threats listed Activity Log with the Known threats badge below a backup's event text
A site that can't check (self-hosted, or the fake turned off): the same backup restores as before, with no request and no "Checking…"
Restore screen for the same backup with no warning and Confirm enabled

Code coverage

The coverage check fails only on Activity Log JS files this PR doesn't change, such as ActivityActor.tsx and UpsellCallout.tsx. Adding the package's first Jest setup makes the check count them for the first time. Hence the "Coverage tests to be added later" label; the Activity Log's older components can get tests separately.

Related product discussion/links

Part of TSCODE-757.

Does this pull request change what data or activity we track or use?

No. The screen reads threat information WordPress.com already has for the site, and on sites hosted on WordPress.com sends a boolean acknowledgement with the restore request.

Testing instructions

  • Unit tests: jp test js packages/backup, jp test js packages/activity-log, jp test php packages/backup and jp test php packages/activity-log.
  • On a site hosted on WordPress.com with Backup and Scan, where one backup contains a known threat (e.g. a file with the EICAR test signature that Scan detected before the backup ran):
    1. Open the Backup dashboard's restore screen for that backup. While the check runs, Confirm is disabled. Then the warning and checkbox appear without moving the heading, and Confirm stays disabled until the box is ticked. Hovering Confirm restore before ticking shows the hint as a tooltip.
    2. The Backup dashboard's list and the Activity Log show the "Known threats (N)" badge on that backup. Its details show the warning, and "Restore to this point" waits for the box. Once it's ticked, the restore screen opens already ticked.
    3. "Show threats" lists each threat with its path and dates, in the site's date format.
    4. Restoring a backup without known threats works as before, with no warning.
    5. On a site without Scan, the restore screen behaves as before.
  • On a self-hosted site, nothing changes: the network panel shows no known-threats or /threats request, and the restore request carries no acknowledge_threats.

🤖 Generated with Claude Code

RafaelFunchal and others added 5 commits October 18, 2026 01:34
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.

  • To test on WoA, go to the Plugins menu on a WoA dev site. Click on the "Upload" button and follow the upgrade flow to be able to upload, install, and activate the Jetpack Beta plugin. Once the plugin is active, go to Jetpack > Jetpack Beta, select your plugin (Jetpack or WordPress.com Site Helper), and enable the add/known-threats-plugin-restore branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack add/known-threats-plugin-restore
bin/jetpack-downloader test jetpack-mu-wpcom-plugin add/known-threats-plugin-restore

Interested in more tips and information?

  • In your local development environment, use the jetpack rsync command to sync your changes to a WoA dev blog.
  • Read more about our development workflow here: PCYsg-eg0-p2
  • Figure out when your changes will be shipped to customers here: PCYsg-eg5-p2

@github-actions

github-actions Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ Add a "[Status]" label (In Progress, Needs Review, ...).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖


Follow this PR Review Process:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Make sure to test your changes on all platforms that it applies to. You're responsible for the quality of the code you ship.
  3. You can use GitHub's Reviewers functionality to request a review.
  4. When it's reviewed and merged, you will be pinged in Slack to deploy the changes to WordPress.com simple once the build is done.

If you have questions about anything, reach out in #jetpack-developers for guidance!


Jetpack plugin:

No scheduled milestone found for this plugin.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Backup plugin:

No scheduled milestone found for this plugin.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Boost plugin:

No scheduled milestone found for this plugin.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Search plugin:

No scheduled milestone found for this plugin.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Protect plugin:

No scheduled milestone found for this plugin.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Videopress plugin:

No scheduled milestone found for this plugin.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.

@github-actions github-actions Bot added the [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. label Oct 18, 2026
@jp-launch-control

jp-launch-control Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Code Coverage Summary

Coverage changed in 9 files. Only the first 5 are listed here.

File Coverage Δ% Δ Uncovered
projects/packages/backup/src/rest/class-restore-bridge.php 298/305 (97.70%) 2.22% 1 ❤️‍🩹
projects/packages/backup/src/class-jetpack-backup.php 458/524 (87.40%) 0.25% 0 💚
projects/packages/backup/src/dashboard/components/activity-list/index.tsx 45/50 (90.00%) 1.11% 0 💚
projects/packages/backup/src/dashboard/components/backup-detail/index.tsx 31/36 (86.11%) 15.52% 0 💚
projects/packages/backup/src/dashboard/data/query-client.ts 28/28 (100.00%) 0.00% 0 💚

36 files are newly checked for coverage. Only the first 5 are listed here.

File Coverage
projects/packages/activity-log/packages/init/src/index.ts 0/1 (0.00%) 💔
projects/packages/activity-log/routes/dashboard/stage.tsx 0/3 (0.00%) 💔
projects/packages/activity-log/src/js/components/ActivityLog/ActivityActor.tsx 0/25 (0.00%) 💔
projects/packages/activity-log/src/js/components/ActivityLog/UpsellCallout.tsx 0/29 (0.00%) 💔
projects/packages/activity-log/src/js/components/ActivityLog/actions.tsx 0/19 (0.00%) 💔

Full summary · PHP report · JS report

Coverage check overridden by Coverage tests to be added later Use to ignore the Code coverage requirement check when tests will be added in a follow-up PR .

@RafaelFunchal
RafaelFunchal marked this pull request as ready for review October 18, 2026 07:56
@RafaelFunchal
RafaelFunchal marked this pull request as draft October 18, 2026 07:59
RafaelFunchal and others added 5 commits October 18, 2026 10:22
Other sites get threats_unavailable without a request to WordPress.com, so
their restore screen works as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…reen

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added [Package] Activity Log [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ labels Oct 18, 2026
RafaelFunchal and others added 7 commits October 18, 2026 10:50
A backup's period is when it started, so its "Backup complete" row's rewind id
is later than the period. The route now returns every period and the row uses
the newest backup at or before its rewind id, like the restore check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ackup rows only

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The warning box, "Restore this backup instead", the Known threats (N) toggle
and its list, and the checkbox, on the restore screen.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Restore to this point waits for the acknowledgement, which the restore screen
then starts with.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@CGastrell

Copy link
Copy Markdown
Contributor

Review: no blockers.

Checked

  • Unit tests pass: packages/backup PHP (492) and JS (1,091), packages/activity-log PHP (30) and JS (1).
  • Browser run on a local site that I made look like WoA, with mocked WordPress.com answers. I covered:
    • badges and warning, the Restore gate with keyboard and tooltip, and the acknowledgement handoff to the restore screen
    • the 409 return path, a check that never answers (it fails open), and a site without Scan
    • phone width, and a self-hosted control run (no known-threats requests, no acknowledge_threats)
  • I read the request and response shapes against the server-side changes (VaultPress and WordPress.com). They match.

Not tested: the real feature end to end. The server changes are not live. On a real WoA site today, the threats route returns 404, the backups list has no known_threats or latest_without_known_threats, and known_threats_only is ignored. So everything above ran against mocks.

Safe merge path

  1. Merge and deploy the server reads first: the backups list fields and the per-backup threats route.
  2. This PR can merge at any time. Until the reads are live it fails open: no badge, no warning, restores as before. The flag is sent only on WoA.
  3. Once both are live, test on a real WoA site with Scan and a flagged backup (EICAR). Check:
    • the badge, the threats list, and the "Restore … instead" link;
    • that a restore without the box ticked is refused;
    • that a ticked restore goes through and appears in the Activity Log.
  4. Deploy enforcement last. Old plugins that omit the flag stay exempt, so it can't block restores from versions that can't show the warning.

Small gap (not blocking): if counts exist but the per-backup route returns 403 (no Scan), the details view shows the badge but no warning. The restore screen shows the warning only after the first 409. WoA plans include Scan, so this should be rare.

— Terminator

RafaelFunchal and others added 6 commits October 21, 2026 12:57
In the Table layout the title and description share a row, so a badge
inside the description started under the description, past the title.
The cell now places the badge in the row itself, on a line of its own.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D5F1MsbPHYHzXLzuK4rCES
The list's known-threat counts cover only the newest 100 backups, so the
details of an older backup never showed its warning. They now ask about
that backup directly, as the restore screen does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D5F1MsbPHYHzXLzuK4rCES
With the threats shown, "Restore … backup instead" sat right under the
last line of the list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D5F1MsbPHYHzXLzuK4rCES
The acknowledgement sat below the warning, so the warning and the decision
it asks for read as two separate things. It is now the warning's last
part, below a rule, as on WordPress.com.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D5F1MsbPHYHzXLzuK4rCES
It is the decision the warning asks for, so it stands out as it does on
WordPress.com.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D5F1MsbPHYHzXLzuK4rCES
The minimal "Show threats" button has no background or border, so on the
warning's coloured background it didn't look like a button. It's now an
outline button labelled like the badge elsewhere, with a chevron, as on
WordPress.com. Screen readers hear "Known threats (N), show threats".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D5F1MsbPHYHzXLzuK4rCES
@RafaelFunchal

RafaelFunchal commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor Author

@dhasilva I pushed a few changes on top of your review fixes, after testing on a test site with real Scan data. Three of them (the last three) reverse choices you made, so here's the reasoning:

  • Activity Log badge alignment (97a4f33). In the Table layout the badge sat inside the description, so on its own line it started under the description, to the right of the title. It's now a full-width item of the title/description row, so it starts under the title.
  • Older backups' details (eb2b678). The list's counts cover the newest 100 backups, so the details of an older backup never warned. When the counts don't cover a backup, the details now check it on their own, as the restore screen does.
  • Spacing (eb63078). With the threats shown, "Restore … backup instead" sat right under the last line of the list.
  • Checkbox back inside the warning (3f1c614). It's the warning's last part again, below a rule, so the warning and the decision it asks for read as one block. This matches WordPress.com.
  • Bold acknowledgement label (725512b). This also matches WordPress.com, where the label is bold.
  • Threats toggle (9560001). On the warning's background the minimal button has no fill or border, so "Show threats" didn't read as a button. It's now an outline button labelled "Known threats (N)" with a chevron, and its accessible name is "Known threats (N), show threats" / "…, hide threats". This also matches WordPress.com.

New strings: "Known threats (%d), show threats" and "Known threats (%d), hide threats". "Show threats" and "Hide threats" are no longer used.

The backup JS tests pass (1092) and the activity-log tests pass (8). I checked each change on the test site.

Screenshots

A test site with real Scan data, at desktop width. Before is this PR before these commits (c660a3932f).

Activity Log

Before After
Activity Log badge before, under the description Activity Log badge after, under the title

Backup details

Before After
Backup details before, with the minimal Show threats button and the checkbox outside the warning Backup details after, with the outline Known threats (3) button and the checkbox inside the warning
Backup details before, threats shown Backup details after, threats shown, with space above the clean-backup link

Restore screen

Before After
Restore screen before Restore screen after

The older-backup details fix (eb2b678) has no screenshot, because the test site has fewer than 100 backups. A test covers it.

Resolve the plugin composer.lock conflicts by taking trunk's and updating
the monorepo packages again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D5F1MsbPHYHzXLzuK4rCES
@CGastrell

Copy link
Copy Markdown
Contributor

@RafaelFunchal The outline toggle in 9560001087f fixes the "doesn't look like a button" problem, and I'd keep it. One concern: the label "Known threats (N)" with the caution icon is the same as the badge in the backups list and the Activity Log. @simison's review said badges should not look like interactive elements. A button that looks like a badge brings back the same confusion.

Can you keep variant="outline" and change the label so it doesn't copy the badge?

  • Visible text: "Show threats (N)" / "Hide threats (N)".
  • Remove the caution icon and keep the chevron.
  • Accessible name: the visible text is enough, so the aria-label override can go. This also removes the two new strings.

I rendered both versions from this branch to check that it still reads as a button on the warning's background. It does.

Current Proposed (closed) Proposed (open)
Current: outline button labelled Known threats (3) with a caution icon Proposed: outline button labelled Show threats (3) with a chevron Proposed, open: Hide threats (3) with the threats list

The "Invalid date" in the "Restore … backup instead" link is from my test page, which has no site date settings.

…m the badge

With the caution icon and "Known threats (N)", the outline button copied
the badge in the backups list and the Activity Log, so the badge looked
clickable too. The button now reads "Show threats (N)" or "Hide threats (N)"
with its chevron, and its visible text is its accessible name.
@RafaelFunchal

RafaelFunchal commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor Author

@CGastrell An update after a few more rounds on the toggle. Where it ended up:

  • Toggle (e23092e): variant="outline", labelled "Show threats" / "Hide threats" with the chevron. There's no caution icon and no aria-label override, so its visible text is its accessible name. The count stays out of the label because the sentence right above the button already gives it ("This backup is known to contain 3 security threats…").
  • No badge in the warning: the backup details and the restore screen show the warning and the toggle only. With the sentence on screen, a "Known threats (N)" badge would only repeat the count.
  • The badge only appears where that sentence isn't shown: the backups list and the Activity Log. It's never a control, so a badge doesn't read as something to click.
  • The Activity Log badge shows the warning as its tooltip again (0f7b5d1). The trigger is the pill itself, not its full-width row, and screen readers still get the warning as hidden text. The backups list badge stays without a tooltip, because the row's button covers it (item 14 of @dhasilva's review). This adds @testing-library/user-event to the activity-log package for the hover test.

Strings: "Show threats" and "Hide threats" are used again. "Show threats (%d)", "Hide threats (%d)", "Known threats (%d), show threats" and "Known threats (%d), hide threats" are no longer used.

Checked on the test site: backup details, restore screen, backups list and Activity Log, including the tooltip on hover. Backup JS tests pass (1092), and the activity-log tests pass (3).

WordPress.com (Automattic/wp-calypso#115337) follows the same rule: the toggle is a button where the warning is shown, and the badge, with its tooltip, appears elsewhere.

Screenshots

On the test site, with real Scan data.

Backups list and details Threats shown
Backups list with Known threats badges on the flagged backups, and the details with the warning and an outline Show threats button Backup details with Hide threats and the three threats listed
Restore screen Activity Log badge tooltip
Restore screen with the warning, the outline Show threats button and the acknowledgement checkbox Activity Log row with the Known threats badge hovered, showing the warning as a tooltip

The toggle was a button labelled like the badge, so the badge looked like
something to click. The warning now shows the "Known threats (N)" badge,
which is never a control, and beside it a "Show threats" / "Hide threats"
link with a chevron that opens and closes the list. It's a button
underneath, styled as a link.
The warning already says how many threats the backup has, so the badge
beside the toggle repeated it. The warning keeps just the toggle, as an
outline button with a chevron, which reads as a button on the warning's
background.
The Activity Log doesn't show the warning beside the badge, so hovering
the badge now shows it, as on the legacy WordPress.com backup cards.
Screen readers still get it as hidden text in the badge. Adds
@testing-library/user-event for the hover test.
# Conflicts:
#	pnpm-lock.yaml
#	projects/packages/activity-log/package.json
@dhasilva

Copy link
Copy Markdown
Contributor

Re-check at 0f7b5d112b7

@RafaelFunchal thanks for testing against real Scan data. The older-backup details fix (eb2b678) and the badge layout (97a4f33) both hold up. I re-checked the PR with @simison's review in mind, since the latest commits touch exactly what it was about.

@simison's points at this head

Point Status
CheckboxControl from @wordpress/ui ✅ Still in place.
Badge from @wordpress/ui instead of a custom pill ✅ In both the backups list and the Activity Log.
Badges are not interactive ⚠️ The warning is fine: no badge, and an outline "Show threats" button. But 0f7b5d1 makes the Activity Log badge a tooltip trigger again (item 1).

The @wordpress/ui Tooltip usage guidelines are the reference for items 1–3: "Use tooltips as visual labels only. … Do not use tooltips for descriptions, instructions, disabled reasons, or dynamic status messages." They also note that tooltips are disabled on touch devices.

Findings

  1. [blocker] The Activity Log badge is a tooltip trigger again. ActivityEvent.tsx#L81-L94

    • It makes the badge something you hover, and the tooltip holds a description. That is what @CGastrell flagged for the toggle, citing @simison.
    • Only a mouse can open it. Base UI's Tooltip.Trigger adds no tabIndex, so the <span> trigger can't take focus. In a jsdom check, Tab goes from the element before the badge straight to the one after, and the tooltip never opens. Touch devices don't get it either.
    • Screen readers still get the hidden sentence, so dropping the tooltip loses nothing they rely on.
    • Suggest removing the tooltip and keeping the VisuallyHidden sentence, as the backups list does. The new @testing-library/user-event dependency and the hover test can go with it.
  2. [suggestion] Two tooltips explain why a button is disabled. One is on "Restore to this point" (backup-detail#L224-L236), the other on "Confirm restore" (restore.tsx#L305-L331).

    • These date from Oct 18, and my Oct 19 review missed them.
    • On the restore screen, hintInTooltip hides the visible hint in exactly this case, so on a touch device Confirm is disabled with no reason shown.
    • Dropping hintInTooltip lets the existing visible role="status" hint carry this reason, like it already does for "Select at least one item to restore."
  3. [suggestion] The "Restore … backup instead" link puts a description in a tooltip. known-threats/index.tsx#L277-L306

    • Touch users never see "It's the most recent backup with no known security threats."
    • The sentence is already in the DOM as hidden text. Showing it as small text under the link, or dropping it, both follow the guidelines.
  4. [suggestion] CSS overrides the checkbox's own label style. .jpb-known-threats__acknowledgement label { font-weight } (style.scss#L20-L30) bolds the CheckboxControl label from outside the component. I see it matches WordPress.com, but overrides like this tend to get the same design-system review comment as the custom pill did.

  5. [blocker] The PR conflicts with trunk, so CI hasn't run since Oct 21. The React 19 update (Update the monorepo to use React 19 #53882) conflicts with activity-log/package.json and pnpm-lock.yaml. With no merge ref, only "PR is up to date" and CodeQL ran on the last pushes.

    • Resolution: keep the three @testing-library/* devDependencies, take @types/react 19.3.0, take trunk's lockfile and run pnpm install.
    • On a trial merge, the backup JS tests (1092) and activity-log JS tests (3) pass, and typecheck is clean for both packages.

Checked, no change needed

  • The Oct 19 blockers (2, 3, 4 and 16) are still fixed. No PHP has changed since Oct 20.
  • Older backups' details (eb2b678): the extra request stays off where known threats aren't available, since a disabled query reports isPending. On WoA, a failed count read falls back to checking the backup itself.
  • Activity Log layout (97a4f33): the content row wraps, so the badge gets its own line under the title.
  • Trunk merge (9abe548): class-initial-state.php keeps both trunk's upgrade and this PR's restoreUrlTemplate / knownThreatsAvailable.
  • @CGastrell's gap: counts flagged plus a 403 per-backup read still means no warning in the details. It's rare on WoA plans, so I'd leave it.

Test results at 0f7b5d112b7

  • PHP: packages/backup 492 OK, packages/activity-log 30 OK.
  • JS: packages/backup 1092 passed, packages/activity-log 3 passed. Same on the trial merge with trunk.
  • Phan: packages/backup and packages/activity-log, 0 issues. No new suppressions or baseline entries.
  • ESLint on the changed files: 3 use-recommended-components errors, all on unchanged lines of files already in tools/eslint-excludelist.json.

Verdict

Needs changes before merge: items 1 and 5. Items 2–4 are worth clearing too, before @simison looks again.

Generated by Claude.

dhasilva and others added 4 commits October 22, 2026 12:17
A design-system badge isn't interactive, and its tooltip only reached
mouse users: the span trigger can't take focus, and touch devices get no
tooltips. Screen readers still hear the warning from the hidden text.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The design system keeps disabled reasons out of tooltips, and touch
devices never show them. Confirm restore's acknowledgement hint is back
in the visible status text beside it, like its other hints. Restore to
this point keeps its screen reader description; the warning's checkbox
right below it already shows why it's off.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The reason sat in a tooltip, which touch devices never show and which
the design system reserves for labels. It's now small text under the
"Restore … instead" link, which still names it as the link's
description.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…gn system

The rule reached into CheckboxControl's own label to bold it, which the
component doesn't offer and the design system's other checkboxes don't do.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dhasilva

Copy link
Copy Markdown
Contributor

Pushed fixes for the re-check above, one commit per item:

  1. Activity Log badge (d537b0d): no tooltip. Screen readers still get the warning from the hidden text. This drops @testing-library/user-event and the hover test.
  2. Disabled restore buttons (b920d7d): "Confirm restore" shows the acknowledgement reason in the visible status text beside it again, like its other two reasons. "Restore to this point" keeps its screen reader description, and the warning's checkbox right below it shows why it's off.
  3. "Restore … backup instead" (b7d2493): "It's the most recent backup with no known security threats." is now small text under the link, which still uses it as its description.
  4. Checkbox label (067a167): back to the component's own weight. The separator above it stays.
  5. Trunk merge: already done in c74aa2c, resolved the same way I'd tested.

No strings added or removed.

Checked: packages/backup JS tests (1092) and packages/activity-log JS tests (2) pass, typecheck is clean for both, and ESLint/Stylelint are clean on the changed files. The lockfile matches a fresh --resolution-only run.

Not checked: I haven't seen these in a browser. @RafaelFunchal, could you look at the "Restore … instead" link and the new line under it on your test site? It's the one visible layout change.

The Boost e2e failure on c74aa2c failed at setup ("Site URL could not be resolved") before any test ran, so it isn't related to this PR.

Generated by Claude.

dhasilva pushed a commit that referenced this pull request Oct 22, 2026
…iew-open-older-backups

Brings in #53755's review fixes (067a167), so this branch holds the
tip of the PR below it in the stack again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dhasilva
dhasilva merged commit f939ae4 into trunk Oct 22, 2026
133 checks passed
@dhasilva
dhasilva deleted the add/known-threats-plugin-restore branch October 22, 2026 16:00
@github-actions github-actions Bot added [Status] UI Changes Add this to PRs that change the UI so documentation can be updated. and removed [Status] Needs Review This PR is ready for review. labels Oct 22, 2026
@RafaelFunchal

Copy link
Copy Markdown
Contributor Author

Thanks for reviewing and suggesting improvements to this PR, @dhasilva 🙇‍♂️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Coverage tests to be added later Use to ignore the Code coverage requirement check when tests will be added in a follow-up PR [Package] Activity Log [Package] Backup [Plugin] Backup A plugin that allows users to save every change and get back online quickly with one-click restores. [Plugin] Boost A feature to speed up the site and improve performance. [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Plugin] Protect A plugin with features to protect a site: brute force protection, security scanning, and a WAF. [Plugin] Search A plugin to add an instant search modal to your site to help visitors find content faster. [Plugin] VideoPress A standalone plugin to add high-quality VideoPress videos to your site. [Status] UI Changes Add this to PRs that change the UI so documentation can be updated. [Tests] Includes Tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants