| @@ -15,9 +15,8 @@ | ||
| 15 | 15 | use WP_Defender\Traits\Formats; |
| 16 | 16 | use Calotes\Component\Behavior; |
| 17 | 17 | use WP_Defender\Model\Scan_Item; |
| 18 | 18 | use WP_Defender\Traits\File_Operations; |
| 19 | -use WP_Defender\Component\Quarantine as Quarantine_Component; | |
| 20 | 19 | use WP_Filesystem_Base; |
| 21 | 20 | |
| 22 | 21 | /** |
| 23 | 22 | * Class Plugin_Integrity |
| @@ -37,16 +36,14 @@ | ||
| 37 | 36 | */ |
| 38 | 37 | public function to_array(): array { |
| 39 | 38 | $data = $this->owner->raw_data; |
| 40 | 39 | $file = $data['file']; |
| 41 | - list ( $file_created_at, $file_size, $deleted ) = $this->get_file_meta( $file ); | |
| 40 | + list( $file_created_at, $file_size, $deleted ) = $this->get_file_meta( $file ); | |
| 42 | 41 | |
| 43 | - $is_quarantinable = $this->is_quarantinable( $this->owner->raw_data['file'] ); | |
| 42 | + if ( class_exists( 'WP_Defender\Component\Quarantine' ) ) { | |
| 43 | + $quarantine_data = wd_di()->get( \WP_Defender\Component\Quarantine::class )->scan_item_data( $this->owner ); | |
| 44 | + } | |
| 44 | 45 | |
| 45 | - $quarantine_data = class_exists( 'WP_Defender\Component\Quarantine' ) ? | |
| 46 | - wd_di()->get( Quarantine_Component::class )->scan_item_data( $this->owner ) : | |
| 47 | - array( 'is_quarantinable' => $is_quarantinable ); | |
| 48 | - | |
| 49 | 46 | return array_merge( |
| 50 | 47 | array( |
| 51 | 48 | 'id' => $this->owner->id, |
| 52 | 49 | 'type' => Scan_Item::TYPE_PLUGIN_CHECK, |
| @@ -140,13 +137,9 @@ | ||
| 140 | 137 | $res = $scan->ignore_issue( $this->owner->id ); |
| 141 | 138 | if ( ! $res ) { |
| 142 | 139 | return array( |
| 143 | 140 | 'type_notice' => 'error', |
| 144 | - 'message' => sprintf( | |
| 145 | - /* translators: %s: Scan issue name. */ | |
| 146 | - esc_html__( '%s is already marked as Ignored. It can’t be added to the Ignored list again.', 'defender-security' ), | |
| 147 | - $issue_name | |
| 148 | - ), | |
| 141 | + 'message' => $this->get_failed_ignore_result( $issue_name ), | |
| 149 | 142 | ); |
| 150 | 143 | } |
| 151 | 144 | |
| 152 | 145 | return array( |