Repository navigation
Conversation
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
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:
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. |
Code Coverage SummaryCoverage changed in 2 files.
9 files are newly checked for coverage. Only the first 5 are listed here.
Full summary · PHP report · JS report If appropriate, add one of these labels to override the failing coverage check:
Covered by non-unit tests
|
…ordpress/ui controls
2de20b6 to
f513428
Compare
Important
Rebased onto trunk (October 2026). Trunk now ships the real Protect dashboard as the
protect-dashboardmodule (packages/protect, behind thejetpack-protect-dashboardfeature flag). This spike no longer replaces it. It is its own module,protect-dashboard-spike, with a "Protect (spike)" menu item atadmin.php?page=jetpack-protect-spike, so the two pages can be compared side by side.@wordpress/ui(SwitchControl,Notice,TextareaControl,Link), as trunk's lint rule requires.add_filter( 'jetpack_feature_flag_enabled_jetpack-protect-dashboard', '__return_true' );wp jetpack module activate protect-dashboard protect-dashboard-spikeFixes #
Note
Exploration. This is a spike for comparing approaches to a Protect dashboard inside the Jetpack plugin. It is not ready to merge.
Proposed changes
protect-dashboardJetpack module (Settings › Modules › "Protect"). When it is active, a Protect item appears in the Jetpack sidebar, gated throughAdmin_Menu::add_menu( …, [ 'module' => 'protect-dashboard' ] ). The item goes away when the module is turned off.routes/protect-hub) loaded through the existingJetpack_WP_Build_Pageloader. It has two tabs:packages/scanthreat list and history, reused as-is. Sites without Scan get a plan notice instead of the list's misleading "You're set up" empty state.jetpack/v4/module/*(toggles and/data)jetpack/v4/settingsjetpack/v4/wafjetpack/v4/site/scan/*rsm_jetpack_ui_modernization_scan. Plugin and theme counts andWaf_Stats::get_blocked_requests()have no REST endpoint, so they are passed to the page as data at render time.Screenshots
Overview, using Scan's mock data (
&jps-mock=1) to show a site with Scan:Overview on a site without a Scan plan:
Scan results on a site without a Scan plan:
Open questions and known gaps
protectmodule is Brute Force protection, and My Jetpack's Protect product points at it. The new module shows as "Protect" in WP-CLI, which is easy to confuse with it.@automattic/jetpack-scan-page/src/js/*. A shared package would let the standalone Protect plugin adopt the same page.js-packages/scanproduces two CSS 404s.threats-data-views/styles.module.scssuses a plain@import "*.css", which Sass leaves as a runtime URL. This is existing code and also affects the standalone Scan page.Related product discussion/links
Does this pull request change what data or activity we track or use?
No. The page reads existing module, settings, firewall and scan data through existing endpoints. The Scan now button reuses the Scan package's existing
jetpack_scan_scan_nowTracks event.Testing instructions
jp build plugins/jetpack --deps, then connect Jetpack.wp jetpack module activate protect-dashboard. If it is missing from the module list, runwp eval 'Jetpack_Options::delete_option("available_modules");'first.wp jetpack module list.&jps-mock=1to the URL to preview the page with Scan data. The Scan now button and the threat counts should appear.