Skip to content

Commit

Permalink
Protect: Add WAF StatCards (#35739)
Browse files Browse the repository at this point in the history
* Add waf stats class blocked requests stats actions, and apply stat card components to firewall header

* Adjust approach for storing and retrieving stats

* changelog

* Fix phpcs enables

* Remove FirewallHeader stories edits

* Use options over an additional table

* Reorg and fix spacing

* Fix dynamic/static calls

* Make update_daily_summary public for tests

* use deprecated setMethods over onlyMethods to bypass PHP 7.0 project test failures

* Fix up project versions

* Disable summary updates if share data is disabled, and add conditions to stat card display

* Remove TODOs

* Improve changelog entries

* Restructuring, improvements, storybook fixes

* Make use of static methods consistent

* Add standalone mode handling for update_daily_summary

* Fix tests

* Add integration tests

* Revert unit test removal

* Fix naming

* Fix project versions

* Fix versions

* Remove IDC package

* Remove duplicate changelog entries

* Revert vscode settings.json changes

* changelog

* Undo wpcomsh plugin updates

* Revert prior changes to wpcomsh

* Fix versions

* Optimize FirewallStatCards

* Fix share data option check

* Fix styling

* Fix translation strings

* Ensure no duplicated code and extra debug data is logged appropriately

* Fix tests

* Fix phan errors

* Use supported phpunit method

* Use supported phpunit method

* Final test fixes

* Remove unused code, add plan check for new stats

* Fix method naming

* Add method for retrieving all time stats

* Make direct db connection persistent, add/fix tests

* Close db connection if initialized

* Add standalone mode direct db handling

* Fix project versions

* Ignore phpcs rules, data needs to be current

* Remove error_log

* Address phan errors

* Use standard approach

* Add update flag to initialization method so we aren't duplicating the action

* Fix initialization method calls

* Manually update phan baselines

* Revert versions updates

* Remove duplicate changelog entries

* Remove FirewallHeader stories from broken dir

* Update stories

* Updates to Blocklog Manager class

* Fix prop name

* Minor enhancements and compatibility improvements

* Statcard adjustments

* Revert phan baselines changes

* Reapply phan baseline changes

* Apply naming consistency, update FirewallSubheading to use IconTooltip

* Fixes

---------

Co-authored-by: Nate Weller <[email protected]>

Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/11001858186

Upstream-Ref: Automattic/jetpack@9bc7ce4
  • Loading branch information
dkmyta authored and matticbot committed Sep 23, 2024
1 parent 7deebc4 commit e525191
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 58 deletions.
2 changes: 1 addition & 1 deletion jetpack_vendor/automattic/jetpack-sync/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"automattic/jetpack-changelogger": "^4.2.6",
"yoast/phpunit-polyfills": "^1.1.1",
"automattic/jetpack-search": "@dev",
"automattic/jetpack-waf": "^0.19.0",
"automattic/jetpack-waf": "@dev",
"automattic/wordbless": "@dev"
},
"suggest": {
Expand Down
58 changes: 29 additions & 29 deletions vendor/composer/installed.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-a8c-mc-stats",
"reference": "8ccb28ffaa15c893e9732ab19cfdc7a70032b12a"
"reference": "2e114b9905043075e424e0bc79fcb424f82d97b6"
},
"require": {
"php": ">=7.0"
Expand Down Expand Up @@ -60,7 +60,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-admin-ui",
"reference": "883eb8c456abac6d11ab097e2b4f52b1d82863c5"
"reference": "7fa7870d77b97fd4878f0ecf614459a1b971dd84"
},
"require": {
"php": ">=7.0"
Expand Down Expand Up @@ -125,7 +125,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-assets",
"reference": "9029384827e3916d903e240140a0efa41f56ca25"
"reference": "69cc56841353d35acc925ea95e07dd4cf22e9fe5"
},
"require": {
"automattic/jetpack-constants": "^2.0.4",
Expand Down Expand Up @@ -194,7 +194,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-autoloader",
"reference": "41a3b6f2cc4c7cbf5e79b94ed82067ab7a2e518e"
"reference": "9e43a633d7091647af55779a79dcfb20e97ac5d5"
},
"require": {
"composer-plugin-api": "^1.1 || ^2.0",
Expand Down Expand Up @@ -261,7 +261,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-backup",
"reference": "60038d08040bf492c99402f370a62a995a5eda55"
"reference": "b037683378039035769ab76c77c452cf735afd11"
},
"require": {
"automattic/jetpack-admin-ui": "^0.4.5",
Expand Down Expand Up @@ -351,7 +351,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-backup-helper-script-manager",
"reference": "a10abe5e7cb08e0ec9fce85bb0d3102fe7e81f6a"
"reference": "b109b2413c610a72af9fe958b62c1821af0c0749"
},
"require": {
"php": ">=7.0"
Expand Down Expand Up @@ -411,7 +411,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-boost-core",
"reference": "fb5623cb11ce4f03e6a19752a2f7a80af25ece07"
"reference": "a781f0fa6a06de71bd77b4a1de8c170e47a0001c"
},
"require": {
"automattic/jetpack-connection": "^5.0.0",
Expand Down Expand Up @@ -479,7 +479,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-boost-speed-score",
"reference": "321d9843a44690f226f5f8f1ebc6d6dd88f8afb1"
"reference": "ea1a7c244c9acd4e29fde90e631a68cc40991d04"
},
"require": {
"automattic/jetpack-boost-core": "^0.2.12",
Expand Down Expand Up @@ -555,7 +555,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-composer-plugin",
"reference": "6735fbaa92ea33abb92b6c0c21a7f9723e96d162"
"reference": "2cfe3555d69a7c4226689ff89c838e1b1f8bed67"
},
"require": {
"composer-plugin-api": "^2.1.0",
Expand Down Expand Up @@ -615,7 +615,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-config",
"reference": "9c2b50d1ec8478bc8c6dc04e90bd660eb98a1463"
"reference": "85c508e56695ebe850cbdcc3a7dc9e4770585156"
},
"require": {
"php": ">=7.0"
Expand Down Expand Up @@ -690,7 +690,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-connection",
"reference": "f8d5a9238e38fa1a8a5ea588a27928d2219e14d8"
"reference": "331b178c43203dcc1f771fb75f0362cc16a5fb2a"
},
"require": {
"automattic/jetpack-a8c-mc-stats": "^2.0.2",
Expand Down Expand Up @@ -780,7 +780,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-constants",
"reference": "5b0887a248a8b2a7b89bc067846203820a1aca6d"
"reference": "83b6363153326f990bc89b8f474202b28a382fa6"
},
"require": {
"php": ">=7.0"
Expand Down Expand Up @@ -834,7 +834,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-device-detection",
"reference": "7ab893171114b59e7ee538995ec88b2809fd39bd"
"reference": "22c25bb8f7121dfced6c1cb77c402f8675f01a55"
},
"require": {
"php": ">=7.0"
Expand Down Expand Up @@ -887,7 +887,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-explat",
"reference": "0323129f43f6761440790d9cd2956c24d1d51905"
"reference": "5429a41fc6636c56e0d6b29e0e075431aa2759cc"
},
"require": {
"automattic/jetpack-connection": "^5.0.0",
Expand Down Expand Up @@ -962,7 +962,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-ip",
"reference": "2562bdbd117a6781c9a7e89843f11f605a19231e"
"reference": "8f0ee53bcd173f8f2f99d8a5616d1d100d90f40a"
},
"require": {
"php": ">=7.0"
Expand Down Expand Up @@ -1020,7 +1020,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-jitm",
"reference": "697f7466e015b4b0bd33aa236d9830efe71c7c02"
"reference": "7cd338bbd94c13b12e02d1ab42750ab3e1663a11"
},
"require": {
"automattic/jetpack-a8c-mc-stats": "^2.0.2",
Expand Down Expand Up @@ -1095,7 +1095,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-licensing",
"reference": "d42e584b682b715f7fc37131e76a950af8497573"
"reference": "11478215f0db2f9179c6a6173091778b1da99df9"
},
"require": {
"automattic/jetpack-connection": "^5.0.0",
Expand Down Expand Up @@ -1157,7 +1157,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-logo",
"reference": "6a18afc96628f08114e4ef339cc111c1cfe33421"
"reference": "b3c5cbe455ca3a4080720b7a66aef63e63ae32ba"
},
"require": {
"php": ">=7.0"
Expand Down Expand Up @@ -1210,7 +1210,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-my-jetpack",
"reference": "0fe5254756ba8877fa55a1600135a0480b65f795"
"reference": "ed44b7bedd756d802ed7a8724db9cd906f1018c4"
},
"require": {
"automattic/jetpack-admin-ui": "^0.4.5",
Expand Down Expand Up @@ -1312,7 +1312,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-password-checker",
"reference": "a20472549af50024f780886d1ae7b417c5e2b272"
"reference": "ae808900f5aed7dd0d379537b71b133f47f0c015"
},
"require": {
"php": ">=7.0"
Expand Down Expand Up @@ -1373,7 +1373,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-plans",
"reference": "00394bc3a920c75ab91bad152f26aa2d4048afbf"
"reference": "8c8138bb4df101d0c09ea39fb1b3339b11cb8801"
},
"require": {
"automattic/jetpack-connection": "^5.0.0",
Expand Down Expand Up @@ -1441,7 +1441,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-plugins-installer",
"reference": "d6fa3d67d4522a65994dd32b7dbb0e20a9fdb00d"
"reference": "30481c58f3a238d2abde24a11af8212ccc7fee99"
},
"require": {
"automattic/jetpack-a8c-mc-stats": "^2.0.2",
Expand Down Expand Up @@ -1497,7 +1497,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-protect-models",
"reference": "08029dfb223336a3263680b36266b26bb51ff3f3"
"reference": "8022336fed768e579bda78f217397d7464d46a50"
},
"require": {
"php": ">=7.0"
Expand Down Expand Up @@ -1567,7 +1567,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-protect-status",
"reference": "94d116337339cf219dc544eaa0061d24b9f42acc"
"reference": "233f58a20b17f575bc0f18c9df41ffba64392151"
},
"require": {
"automattic/jetpack-connection": "^5.0.0",
Expand Down Expand Up @@ -1642,7 +1642,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-redirect",
"reference": "b85920e5c9e7b22dba7457ba432bd8a846b16837"
"reference": "db51ba1382e515a36af3f4fbaf52aa71fd062c56"
},
"require": {
"automattic/jetpack-status": "^4.0.2",
Expand Down Expand Up @@ -1697,7 +1697,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-roles",
"reference": "2c64df8aeae85a959220d38ec96171d507cf00a7"
"reference": "09dcdaee7e5908b30635d1ecffb6a2df3d9d3bda"
},
"require": {
"php": ">=7.0"
Expand Down Expand Up @@ -1751,7 +1751,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-status",
"reference": "a065783fb233f354eb2b53b25f9d19f87112615d"
"reference": "282d617c63900e6f554640c7adcf64dce0df5ddf"
},
"require": {
"automattic/jetpack-constants": "^2.0.4",
Expand Down Expand Up @@ -1815,7 +1815,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-sync",
"reference": "b48b7711bfcf2a0052dd57e234164cf98029f596"
"reference": "cf63f67953055319849fe3ba304591e113b5b3fc"
},
"require": {
"automattic/jetpack-connection": "^5.0.0",
Expand All @@ -1829,7 +1829,7 @@
"require-dev": {
"automattic/jetpack-changelogger": "^4.2.6",
"automattic/jetpack-search": "@dev",
"automattic/jetpack-waf": "^0.19.0",
"automattic/jetpack-waf": "@dev",
"automattic/wordbless": "@dev",
"yoast/phpunit-polyfills": "^1.1.1"
},
Expand Down
Loading

0 comments on commit e525191

Please sign in to comment.