Skip to content

Commit

Permalink
Protect: Add fixer status to initial state (#39125)
Browse files Browse the repository at this point in the history
  • Loading branch information
nateweller authored and matticbot committed Sep 16, 2024
1 parent 9ff57e9 commit 4ca6611
Show file tree
Hide file tree
Showing 13 changed files with 113 additions and 86 deletions.
2 changes: 1 addition & 1 deletion jetpack_vendor/automattic/jetpack-my-jetpack/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"automattic/jetpack-plans": "^0.4.10",
"automattic/jetpack-status": "^4.0.1",
"automattic/jetpack-sync": "^3.13.0",
"automattic/jetpack-protect-status": "^0.1.5"
"automattic/jetpack-protect-status": "^0.2.0-alpha"
},
"require-dev": {
"yoast/phpunit-polyfills": "^1.1.1",
Expand Down
8 changes: 8 additions & 0 deletions jetpack_vendor/automattic/jetpack-protect-models/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.3.0-alpha] - unreleased

This is an alpha version! The changes listed here are not final.

### Changed
- Adds a fixable_threats status property

## [0.2.1] - 2024-08-26
### Changed
- Updated package dependencies. [#39004]
Expand All @@ -17,5 +24,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Initial version. [#37864]

[0.3.0-alpha]: https://github.com/Automattic/jetpack-protect-models/compare/v0.2.1...v0.3.0-alpha
[0.2.1]: https://github.com/Automattic/jetpack-protect-models/compare/v0.2.0...v0.2.1
[0.2.0]: https://github.com/Automattic/jetpack-protect-models/compare/v0.1.0...v0.2.0
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"extra": {
"autotagger": true,
"branch-alias": {
"dev-trunk": "0.2.x-dev"
"dev-trunk": "0.3.x-dev"
},
"changelogger": {
"link-template": "https://github.com/Automattic/jetpack-protect-models/compare/v${old}...v${new}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
*/
class Protect_Models {

const PACKAGE_VERSION = '0.2.1';
const PACKAGE_VERSION = '0.3.0-alpha';
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ class Status_Model {
*/
public $status;

/**
* List of fixable threat IDs.
*
* @var string[]
*/
public $fixable_threat_ids = array();

/**
* WordPress core status.
*
Expand Down
8 changes: 8 additions & 0 deletions jetpack_vendor/automattic/jetpack-protect-status/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.2.0-alpha] - unreleased

This is an alpha version! The changes listed here are not final.

### Changed
- Adds a fixable_threats status property

## [0.1.5] - 2024-09-05
### Changed
- Update dependencies.
Expand Down Expand Up @@ -32,6 +39,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- Updated package dependencies. [#37894]

[0.2.0-alpha]: https://github.com/Automattic/jetpack-protect-status/compare/v0.1.5...v0.2.0-alpha
[0.1.5]: https://github.com/Automattic/jetpack-protect-status/compare/v0.1.4...v0.1.5
[0.1.4]: https://github.com/Automattic/jetpack-protect-status/compare/v0.1.3...v0.1.4
[0.1.3]: https://github.com/Automattic/jetpack-protect-status/compare/v0.1.2...v0.1.3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"automattic/jetpack-connection": "^4.0.4-alpha",
"automattic/jetpack-plugins-installer": "^0.4.3",
"automattic/jetpack-sync": "^3.13.0",
"automattic/jetpack-protect-models": "^0.2.1",
"automattic/jetpack-protect-models": "^0.3.0-alpha",
"automattic/jetpack-plans": "^0.4.10"
},
"require-dev": {
Expand Down Expand Up @@ -43,7 +43,7 @@
"extra": {
"autotagger": true,
"branch-alias": {
"dev-trunk": "0.1.x-dev"
"dev-trunk": "0.2.x-dev"
},
"changelogger": {
"link-template": "https://github.com/Automattic/jetpack-protect-status/compare/v${old}...v${new}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,10 @@ private static function normalize_api_data( $scan_data ) {

if ( isset( $scan_data->threats ) && is_array( $scan_data->threats ) ) {
foreach ( $scan_data->threats as $threat ) {
if ( isset( $threat->fixable ) && $threat->fixable ) {
$status->fixable_threat_ids[] = $threat->id;
}

if ( isset( $threat->extension->type ) ) {
if ( 'plugin' === $threat->extension->type ) {
// add the extension if it does not yet exist in the status
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
class Status {

const PACKAGE_VERSION = '0.1.5';
const PACKAGE_VERSION = '0.2.0-alpha';
/**
* Name of the option where status is stored
*
Expand Down
4 changes: 2 additions & 2 deletions jetpack_vendor/i18n-map.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@
),
'jetpack-protect-models' => array(
'path' => 'jetpack_vendor/automattic/jetpack-protect-models',
'ver' => '0.2.1',
'ver' => '0.3.0-alpha1726505426',
),
'jetpack-protect-status' => array(
'path' => 'jetpack_vendor/automattic/jetpack-protect-status',
'ver' => '0.1.5',
'ver' => '0.2.0-alpha1726505426',
),
'jetpack-search-pkg' => array(
'path' => 'jetpack_vendor/automattic/jetpack-search',
Expand Down
Loading

0 comments on commit 4ca6611

Please sign in to comment.