Skip to content

Commit eb42c2f

Browse files
elliottprogrammermatticbot
authored andcommitted
My Jetpack: Add red bubble & notice when Protect threats detected (#40719)
* Add redbubble & notice when protect threats are detected. Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/12600642610 Upstream-Ref: Automattic/jetpack@0655fb3
1 parent e15e211 commit eb42c2f

File tree

9 files changed

+204
-170
lines changed

9 files changed

+204
-170
lines changed

jetpack_vendor/automattic/jetpack-my-jetpack/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ This is an alpha version! The changes listed here are not final.
1111

1212
### Added
1313
- My Jetpack: Added a new status for when Protect detects threats on the site.
14+
- My Jetpack: Adds a red bubble and notice when Protect threats are detected.
1415
- My Jetpack: introduce feature cards for recommendations in My Jetpack.
1516

1617
### Changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<?php return array('dependencies' => array('jetpack-connection', 'jetpack-script-data', 'react', 'react-dom', 'react-jsx-runtime', 'wp-api-fetch', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => 'b1c6623ded15ad148fec');
1+
<?php return array('dependencies' => array('jetpack-connection', 'jetpack-script-data', 'react', 'react-dom', 'react-jsx-runtime', 'wp-api-fetch', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => '3a7c501ee17d67fa9338');

jetpack_vendor/automattic/jetpack-my-jetpack/build/index.js

Lines changed: 72 additions & 68 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jetpack_vendor/automattic/jetpack-my-jetpack/global.d.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,14 @@ interface Window {
416416
manage_url?: string;
417417
products_effected?: string[];
418418
};
419+
protect_has_threats?: {
420+
type: 'warning' | 'error';
421+
data: {
422+
threat_count: number;
423+
critical_threat_count: number;
424+
fixable_threat_ids: number[];
425+
};
426+
};
419427
};
420428
recommendedModules: {
421429
modules: JetpackModule[] | null;

jetpack_vendor/automattic/jetpack-my-jetpack/src/class-initializer.php

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -929,7 +929,8 @@ public static function add_red_bubble_alerts( array $red_bubble_slugs ) {
929929
return array_merge(
930930
self::alert_if_missing_connection( $red_bubble_slugs ),
931931
self::alert_if_last_backup_failed( $red_bubble_slugs ),
932-
self::alert_if_paid_plan_expiring( $red_bubble_slugs )
932+
self::alert_if_paid_plan_expiring( $red_bubble_slugs ),
933+
self::alert_if_protect_has_threats( $red_bubble_slugs )
933934
);
934935
}
935936
}
@@ -1056,4 +1057,24 @@ public static function alert_if_last_backup_failed( array $red_bubble_slugs ) {
10561057

10571058
return $red_bubble_slugs;
10581059
}
1060+
1061+
/**
1062+
* Add an alert slug if Protect has scan threats/vulnerabilities.
1063+
*
1064+
* @param array $red_bubble_slugs - slugs that describe the reasons the red bubble is showing.
1065+
* @return array
1066+
*/
1067+
public static function alert_if_protect_has_threats( array $red_bubble_slugs ) {
1068+
// Make sure we're dealing with the Protect product only
1069+
if ( ! Products\Protect::has_paid_plan_for_product() ) {
1070+
return $red_bubble_slugs;
1071+
}
1072+
1073+
$protect_threats_status = Products\Protect::does_module_need_attention();
1074+
if ( $protect_threats_status ) {
1075+
$red_bubble_slugs['protect_has_threats'] = $protect_threats_status;
1076+
}
1077+
1078+
return $red_bubble_slugs;
1079+
}
10591080
}

jetpack_vendor/i18n-map.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
),
5151
'jetpack-my-jetpack' => array(
5252
'path' => 'jetpack_vendor/automattic/jetpack-my-jetpack',
53-
'ver' => '5.3.0-alpha1735919739',
53+
'ver' => '5.3.0-alpha1735921291',
5454
),
5555
'jetpack-password-checker' => array(
5656
'path' => 'jetpack_vendor/automattic/jetpack-password-checker',

vendor/composer/installed.json

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"dist": {
88
"type": "path",
99
"url": "/tmp/jetpack-build/Automattic/jetpack-a8c-mc-stats",
10-
"reference": "75d0ec6ab60cf0bf9916dc6eb58b846ca0c5f2d1"
10+
"reference": "2767d3fa01972f9ec2cbac031dadad5544689816"
1111
},
1212
"require": {
1313
"php": ">=7.2"
@@ -63,7 +63,7 @@
6363
"dist": {
6464
"type": "path",
6565
"url": "/tmp/jetpack-build/Automattic/jetpack-admin-ui",
66-
"reference": "e79a3f60eb9209c76ef7d31f3575c366aab47b79"
66+
"reference": "6fb7d2242254d1cc394e3a4ccba34e957cd58c0f"
6767
},
6868
"require": {
6969
"php": ">=7.2"
@@ -131,7 +131,7 @@
131131
"dist": {
132132
"type": "path",
133133
"url": "/tmp/jetpack-build/Automattic/jetpack-assets",
134-
"reference": "50f52ef6b387c7dab4e52430b80592a36a7da477"
134+
"reference": "c688effb056db14b4f2c2728c38af0639dbc33b5"
135135
},
136136
"require": {
137137
"automattic/jetpack-constants": "^3.0.1",
@@ -203,7 +203,7 @@
203203
"dist": {
204204
"type": "path",
205205
"url": "/tmp/jetpack-build/Automattic/jetpack-autoloader",
206-
"reference": "d35ce217aaacb04b0f2291681dc79eb865a7d398"
206+
"reference": "6b21eb6c7edb324815f936c3b59dafc3b1c9cb84"
207207
},
208208
"require": {
209209
"composer-plugin-api": "^2.2",
@@ -274,7 +274,7 @@
274274
"dist": {
275275
"type": "path",
276276
"url": "/tmp/jetpack-build/Automattic/jetpack-boost-core",
277-
"reference": "1a6090b6c6f19f8c4b1aadf941b3e683a6cb81e5"
277+
"reference": "552da2f15f992b7b909224122c9dfb2f78f7de10"
278278
},
279279
"require": {
280280
"automattic/jetpack-connection": "^6.2.2-alpha",
@@ -345,7 +345,7 @@
345345
"dist": {
346346
"type": "path",
347347
"url": "/tmp/jetpack-build/Automattic/jetpack-boost-speed-score",
348-
"reference": "826544f6b6c2f0bd2c28819fd9f7efff06359285"
348+
"reference": "70954c39c276c0bdc36588c328b653969bb1db34"
349349
},
350350
"require": {
351351
"automattic/jetpack-boost-core": "^0.3.3",
@@ -424,7 +424,7 @@
424424
"dist": {
425425
"type": "path",
426426
"url": "/tmp/jetpack-build/Automattic/jetpack-composer-plugin",
427-
"reference": "fa2894271000922aa14c96530b1092f13ee72d88"
427+
"reference": "8d603bce4a4f5a9c0665239ae763a43ac0631c5e"
428428
},
429429
"require": {
430430
"composer-plugin-api": "^2.2",
@@ -487,7 +487,7 @@
487487
"dist": {
488488
"type": "path",
489489
"url": "/tmp/jetpack-build/Automattic/jetpack-config",
490-
"reference": "d99bdb3348a107d5a90d86332b5ecaf33bfcc0ba"
490+
"reference": "897b9e40916149e36208ef301a1be8c8e75b6edd"
491491
},
492492
"require": {
493493
"php": ">=7.2"
@@ -562,7 +562,7 @@
562562
"dist": {
563563
"type": "path",
564564
"url": "/tmp/jetpack-build/Automattic/jetpack-connection",
565-
"reference": "67fdfc0d6c9f7f2c2862f036c9ad02871cbcbd61"
565+
"reference": "88c0db3f13387d3b636e9e4ad5327683a38dcc3f"
566566
},
567567
"require": {
568568
"automattic/jetpack-a8c-mc-stats": "^3.0.0",
@@ -655,7 +655,7 @@
655655
"dist": {
656656
"type": "path",
657657
"url": "/tmp/jetpack-build/Automattic/jetpack-constants",
658-
"reference": "447af11c2616f45613d6f0803b847d86255b0641"
658+
"reference": "a3ab78576cf9434338b59e7e7dee932a7e4a4839"
659659
},
660660
"require": {
661661
"php": ">=7.2"
@@ -712,7 +712,7 @@
712712
"dist": {
713713
"type": "path",
714714
"url": "/tmp/jetpack-build/Automattic/jetpack-device-detection",
715-
"reference": "57057add37756c615292a3698d569ec4e8080f60"
715+
"reference": "bbc9aa6affe9780fdb1f208952a0f5d2562dbd27"
716716
},
717717
"require": {
718718
"php": ">=7.2"
@@ -768,7 +768,7 @@
768768
"dist": {
769769
"type": "path",
770770
"url": "/tmp/jetpack-build/Automattic/jetpack-explat",
771-
"reference": "e3bdc3f2a38757e9978a3034063e35ba2678b6a5"
771+
"reference": "292d88fc212a2235fef29bb93fcf3523a65167f7"
772772
},
773773
"require": {
774774
"automattic/jetpack-connection": "^6.2.2-alpha",
@@ -846,7 +846,7 @@
846846
"dist": {
847847
"type": "path",
848848
"url": "/tmp/jetpack-build/Automattic/jetpack-image-cdn",
849-
"reference": "832f2f6234fd015bbdca04c99b6d081948ec756a"
849+
"reference": "1202225657380b96caf739260ef8879ae7fba6a8"
850850
},
851851
"require": {
852852
"automattic/jetpack-assets": "^4.0.2",
@@ -915,7 +915,7 @@
915915
"dist": {
916916
"type": "path",
917917
"url": "/tmp/jetpack-build/Automattic/jetpack-ip",
918-
"reference": "7966eb7bce8baaad3137fc09a7447c6b367d3f06"
918+
"reference": "a3a3149423a9142d78fc55b4a2335b2f2a52f6d5"
919919
},
920920
"require": {
921921
"php": ">=7.2"
@@ -976,7 +976,7 @@
976976
"dist": {
977977
"type": "path",
978978
"url": "/tmp/jetpack-build/Automattic/jetpack-jitm",
979-
"reference": "dea14889c5ce4d9b20f16a1c05876dd9c987d200"
979+
"reference": "f499762c2e33958f7e12a22ab0e74aae265ab0e6"
980980
},
981981
"require": {
982982
"automattic/jetpack-a8c-mc-stats": "^3.0.0",
@@ -1054,7 +1054,7 @@
10541054
"dist": {
10551055
"type": "path",
10561056
"url": "/tmp/jetpack-build/Automattic/jetpack-licensing",
1057-
"reference": "80a9f80a1f47558df98833e3d48453e29c1a991b"
1057+
"reference": "7850deacbb787791d58c64d81cc516694c5d9dfe"
10581058
},
10591059
"require": {
10601060
"automattic/jetpack-connection": "^6.2.2-alpha",
@@ -1119,7 +1119,7 @@
11191119
"dist": {
11201120
"type": "path",
11211121
"url": "/tmp/jetpack-build/Automattic/jetpack-logo",
1122-
"reference": "5f39e0ce0d707c6545ce9dbbf7e4c33faa4e971c"
1122+
"reference": "143daf700b641ce621057e245a1a4b07e8242df5"
11231123
},
11241124
"require": {
11251125
"php": ">=7.2"
@@ -1170,12 +1170,12 @@
11701170
},
11711171
{
11721172
"name": "automattic/jetpack-my-jetpack",
1173-
"version": "5.3.0-alpha.1735919739",
1174-
"version_normalized": "5.3.0.0-alpha1735919739",
1173+
"version": "5.3.0-alpha.1735921291",
1174+
"version_normalized": "5.3.0.0-alpha1735921291",
11751175
"dist": {
11761176
"type": "path",
11771177
"url": "/tmp/jetpack-build/Automattic/jetpack-my-jetpack",
1178-
"reference": "272aaf52933ded272a141d7dc2a302e2a9f90ee6"
1178+
"reference": "ddb5f0f5ca32a35eb9cd14e8f676e1f0f9a1fdc8"
11791179
},
11801180
"require": {
11811181
"automattic/jetpack-admin-ui": "^0.5.1",
@@ -1280,7 +1280,7 @@
12801280
"dist": {
12811281
"type": "path",
12821282
"url": "/tmp/jetpack-build/Automattic/jetpack-password-checker",
1283-
"reference": "f34207c8b9813e0b3f57af6718473707edd9c6d4"
1283+
"reference": "49b468a8e8a387185bc77674edef926d7b55a956"
12841284
},
12851285
"require": {
12861286
"php": ">=7.2"
@@ -1344,7 +1344,7 @@
13441344
"dist": {
13451345
"type": "path",
13461346
"url": "/tmp/jetpack-build/Automattic/jetpack-plans",
1347-
"reference": "22cc0d1b554e835c0e4beebb499485f63b0d75d1"
1347+
"reference": "225269529e0742bc38292f3c9c94abf2c38d092b"
13481348
},
13491349
"require": {
13501350
"automattic/jetpack-connection": "^6.2.2-alpha",
@@ -1415,7 +1415,7 @@
14151415
"dist": {
14161416
"type": "path",
14171417
"url": "/tmp/jetpack-build/Automattic/jetpack-plugin-deactivation",
1418-
"reference": "2906c12e4ef72326d8c92b0d651ec7f94a4a4357"
1418+
"reference": "8b57b26c66cf32a603a037ea07330dd19a1c7fcf"
14191419
},
14201420
"require": {
14211421
"automattic/jetpack-assets": "^4.0.2",
@@ -1486,7 +1486,7 @@
14861486
"dist": {
14871487
"type": "path",
14881488
"url": "/tmp/jetpack-build/Automattic/jetpack-plugins-installer",
1489-
"reference": "9f85a2365b37b07541335f81dc02796c078eef13"
1489+
"reference": "9e006b466c9eabfc2c5f67aab1258d986e9f962f"
14901490
},
14911491
"require": {
14921492
"automattic/jetpack-a8c-mc-stats": "^3.0.0",
@@ -1545,7 +1545,7 @@
15451545
"dist": {
15461546
"type": "path",
15471547
"url": "/tmp/jetpack-build/Automattic/jetpack-protect-models",
1548-
"reference": "9d37c5c0307ac5b0dd77f514b3f098a0faf9fc66"
1548+
"reference": "8defa19401a8fb7ab11e6f5bbdb26dad39b2f641"
15491549
},
15501550
"require": {
15511551
"php": ">=7.2"
@@ -1618,7 +1618,7 @@
16181618
"dist": {
16191619
"type": "path",
16201620
"url": "/tmp/jetpack-build/Automattic/jetpack-protect-status",
1621-
"reference": "c3e0fbd2e0c8f246638b475e5a9b6392cc9670ae"
1621+
"reference": "eb871fd17c4c160e96ed576ff9f4139b9765dd17"
16221622
},
16231623
"require": {
16241624
"automattic/jetpack-connection": "^6.2.2-alpha",
@@ -1696,7 +1696,7 @@
16961696
"dist": {
16971697
"type": "path",
16981698
"url": "/tmp/jetpack-build/Automattic/jetpack-redirect",
1699-
"reference": "4b45995b6901114a8b340f43474a86760937932d"
1699+
"reference": "b9d679945a78fe4b14341d2fb9900488f6c5ba93"
17001700
},
17011701
"require": {
17021702
"automattic/jetpack-status": "^5.0.1",
@@ -1754,7 +1754,7 @@
17541754
"dist": {
17551755
"type": "path",
17561756
"url": "/tmp/jetpack-build/Automattic/jetpack-roles",
1757-
"reference": "4f45a683c20afdead9c1cbb144342289194f3d45"
1757+
"reference": "45ce6f7318302114118d09b4fa6cde4e08d9f2d3"
17581758
},
17591759
"require": {
17601760
"php": ">=7.2"
@@ -1811,7 +1811,7 @@
18111811
"dist": {
18121812
"type": "path",
18131813
"url": "/tmp/jetpack-build/Automattic/jetpack-schema",
1814-
"reference": "376156b7a1b9c619ef52450ff9d52a4fa314dd48"
1814+
"reference": "19cfd98a6095719294dce014068ce2421451697e"
18151815
},
18161816
"require": {
18171817
"php": ">=7.2"
@@ -1884,7 +1884,7 @@
18841884
"dist": {
18851885
"type": "path",
18861886
"url": "/tmp/jetpack-build/Automattic/jetpack-status",
1887-
"reference": "1bda296caf6c8b82e21e90f40fc3d9942e078f41"
1887+
"reference": "7bec4b1cde9e92d59bc9e1419ffd80bf2eddf642"
18881888
},
18891889
"require": {
18901890
"automattic/jetpack-constants": "^3.0.1",
@@ -1951,7 +1951,7 @@
19511951
"dist": {
19521952
"type": "path",
19531953
"url": "/tmp/jetpack-build/Automattic/jetpack-sync",
1954-
"reference": "2750783bd317876ce5d3b3135b149215cd929974"
1954+
"reference": "1007141ad609836f1bfe6c926c92b269d583e7c7"
19551955
},
19561956
"require": {
19571957
"automattic/jetpack-connection": "^6.2.2-alpha",
@@ -2032,7 +2032,7 @@
20322032
"dist": {
20332033
"type": "path",
20342034
"url": "/tmp/jetpack-build/Automattic/jetpack-wp-js-data-sync",
2035-
"reference": "6cb94b3b47c9907ab57e21469010177b888f2225"
2035+
"reference": "7954eaad3bdb7a4ebd1a8ce0766386676ae9442b"
20362036
},
20372037
"require": {
20382038
"automattic/jetpack-schema": "^0.2.0",

0 commit comments

Comments
 (0)