-
Notifications
You must be signed in to change notification settings - Fork 800
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Protect: Add Threat History (#38117)
- Loading branch information
1 parent
d66e0db
commit b7a5de7
Showing
75 changed files
with
2,365 additions
and
425 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
projects/packages/protect-models/changelog/add-protect-threat-history
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: minor | ||
Type: added | ||
|
||
Add Scan History model. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
117 changes: 117 additions & 0 deletions
117
projects/packages/protect-models/src/class-history-model.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
<?php | ||
/** | ||
* Model class for Protect history report data. | ||
* | ||
* @package automattic/jetpack-protect-models | ||
*/ | ||
|
||
namespace Automattic\Jetpack\Protect_Models; | ||
|
||
/** | ||
* Model class for the Protect history report data. | ||
*/ | ||
class History_Model { | ||
/** | ||
* The date and time when the history was generated. | ||
* | ||
* @var string | ||
*/ | ||
public $last_checked; | ||
|
||
/** | ||
* The number of threats. | ||
* | ||
* @var int | ||
*/ | ||
public $num_threats; | ||
|
||
/** | ||
* The number of core threats. | ||
* | ||
* @var int | ||
*/ | ||
public $num_core_threats; | ||
|
||
/** | ||
* The number of plugin threats. | ||
* | ||
* @var int | ||
*/ | ||
public $num_plugins_threats; | ||
|
||
/** | ||
* The number of theme threats. | ||
* | ||
* @var int | ||
*/ | ||
public $num_themes_threats; | ||
|
||
/** | ||
* WordPress core. | ||
* | ||
* @var array<Extension_Model> | ||
*/ | ||
public $core = array(); | ||
|
||
/** | ||
* Status themes. | ||
* | ||
* @var array<Extension_Model> | ||
*/ | ||
public $themes = array(); | ||
|
||
/** | ||
* Status plugins. | ||
* | ||
* @var array<Extension_Model> | ||
*/ | ||
public $plugins = array(); | ||
|
||
/** | ||
* File threats. | ||
* | ||
* @var array<Extension_Model> | ||
*/ | ||
public $files = array(); | ||
|
||
/** | ||
* Database threats. | ||
* | ||
* @var array<Extension_Model> | ||
*/ | ||
public $database = array(); | ||
|
||
/** | ||
* Whether there was an error loading the history. | ||
* | ||
* @var bool | ||
*/ | ||
public $error = false; | ||
|
||
/** | ||
* The error code thrown when loading the history. | ||
* | ||
* @var string | ||
*/ | ||
public $error_code; | ||
|
||
/** | ||
* The error message thrown when loading the history. | ||
* | ||
* @var string | ||
*/ | ||
public $error_message; | ||
|
||
/** | ||
* Status constructor. | ||
* | ||
* @param array $history The history data to load into the class instance. | ||
*/ | ||
public function __construct( $history = array() ) { | ||
foreach ( $history as $property => $value ) { | ||
if ( property_exists( $this, $property ) ) { | ||
$this->$property = $value; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,5 +12,5 @@ | |
*/ | ||
class Protect_Models { | ||
|
||
const PACKAGE_VERSION = '0.1.0'; | ||
const PACKAGE_VERSION = '0.2.0-alpha'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Significance: patch | ||
Type: changed | ||
Comment: Updated composer.lock. | ||
|
||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Significance: patch | ||
Type: changed | ||
Comment: Updated composer.lock. | ||
|
||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
5 changes: 5 additions & 0 deletions
5
projects/plugins/jetpack/changelog/add-protect-threat-history
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Significance: patch | ||
Type: other | ||
Comment: Updated composer.lock. | ||
|
||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
5 changes: 5 additions & 0 deletions
5
projects/plugins/migration/changelog/add-protect-threat-history
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Significance: patch | ||
Type: changed | ||
Comment: Updated composer.lock. | ||
|
||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: minor | ||
Type: added | ||
|
||
Security Scanning: add threats history view |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.