| @@ -14,10 +14,51 @@ | ||
| 14 | 14 | */ |
| 15 | 15 | class Behavior extends Component { |
| 16 | 16 | |
| 17 | 17 | /** |
| 18 | - * The component this behavior tied to | |
| 18 | + * The component this behavior tied to. | |
| 19 | 19 | * |
| 20 | 20 | * @var object |
| 21 | 21 | */ |
| 22 | 22 | public $owner; |
| 23 | + | |
| 24 | + /** | |
| 25 | + * Get a failed ignore result. | |
| 26 | + * | |
| 27 | + * @param string $issue_name Name of scan issue. | |
| 28 | + * | |
| 29 | + * @return string | |
| 30 | + */ | |
| 31 | + public function get_failed_ignore_result( string $issue_name ): string { | |
| 32 | + return sprintf( | |
| 33 | + /* translators: %s: Scan issue name. */ | |
| 34 | + esc_html__( '%s is already marked as Ignored. It can’t be added to the Ignored list again.', 'defender-security' ), | |
| 35 | + $issue_name | |
| 36 | + ); | |
| 37 | + } | |
| 38 | + | |
| 39 | + /** | |
| 40 | + * Get a failed restore result. | |
| 41 | + * | |
| 42 | + * @param string $issue_name Name of scan issue. | |
| 43 | + * | |
| 44 | + * @return string | |
| 45 | + */ | |
| 46 | + public function get_failed_restore_result( string $issue_name ): string { | |
| 47 | + return sprintf( | |
| 48 | + /* translators: %s: Scan issue name. */ | |
| 49 | + esc_html__( '%s is already marked as Issue. It can’t be added to the Issue list again.', 'defender-security' ), | |
| 50 | + $issue_name | |
| 51 | + ); | |
| 52 | + } | |
| 53 | + | |
| 54 | + /** | |
| 55 | + * Get issue name. | |
| 56 | + * | |
| 57 | + * @param array $raw_data Array of raw data. | |
| 58 | + * | |
| 59 | + * @return string | |
| 60 | + */ | |
| 61 | + public function get_issue_name( $raw_data ): string { | |
| 62 | + return $raw_data['name']; | |
| 63 | + } | |
| 23 | 64 | } |