PluginProbe
Defender Security – Malware Scanner, Login Security & Firewall / 6.2.0
Defender Security – Malware Scanner, Login Security & Firewall v6.2.0
6.3.0 6.2.3 6.2.4 6.2.0 6.2.1 6.2.2 6.1.0 5.3.1 5.4.0 5.4.1 5.5.0 5.5.1 5.6.0 5.6.1 5.6.2 5.7.0 5.7.1 5.7.2 5.8.0 5.8.1 5.9.0 6.0.0 6.0.1 3.0.1 3.1.0 All 141 releases
defender-security / src / model / notification / class-malware-report.php

class-malware-report.php in Defender Security – Malware Scanner, Login Security & Firewall 6.2.0, at src/model/notification/class-malware-report.php

93 lines 2.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Malware Scanning report notification stub for free version.
4 *
5 * @package WP_Defender\Model\Notification
6 */
7
8 namespace WP_Defender\Model\Notification;
9
10 /**
11 * Malware Scanning – Reporting.
12 */
13 class Malware_Report extends Free_Report {
14
15 /**
16 * Table name.
17 *
18 * @var string
19 */
20 protected $table = 'wd_malware_scanning_report';
21
22 /**
23 * Slug identifier for the malware report.
24 *
25 * @var string
26 */
27 public const SLUG = 'malware-report';
28
29 /**
30 * Sets default values.
31 */
32 protected function before_load(): void {
33 $this->import(
34 array_merge(
35 $this->base_defaults(),
36 array(
37 'slug' => self::SLUG,
38 'title' => esc_html__( 'Issue - Reporting', 'defender-security' ),
39 'description' => esc_html__(
40 'Automatically run regular scans of your website and email you reports.',
41 'defender-security'
42 ),
43 'configs' => array(
44 'always_send' => false,
45 'error_send' => false,
46 'template' => array(),
47 ),
48 )
49 )
50 );
51 }
52
53 /**
54 * Define settings labels.
55 *
56 * @return array
57 */
58 public function labels(): array {
59 return array(
60 'report' => esc_html__( 'Issue - Reporting', 'defender-security' ),
61 'always_send' => esc_html__( 'Send alerts when no issues are detected', 'defender-security' ),
62 'report_subscribers' => esc_html__( 'Recipients', 'defender-security' ),
63 'day' => esc_html__( 'Day of', 'defender-security' ),
64 'day_n' => esc_html__( 'Day of', 'defender-security' ),
65 'time' => esc_html__( 'Time of day', 'defender-security' ),
66 'frequency' => esc_html__( 'Frequency', 'defender-security' ),
67 );
68 }
69
70 /**
71 * Returns 'Never' — report cannot run in the free version.
72 *
73 * @return string
74 */
75 public function get_next_run_for_hub(): string {
76 return esc_html__( 'Never', 'defender-security' );
77 }
78
79 /**
80 * Additional converting rules.
81 *
82 * @param array $configs The configuration data.
83 *
84 * @return array The type-casted configuration data.
85 */
86 public function type_casting( $configs ): array {
87 $configs['always_send'] = (bool) ( $configs['always_send'] ?? false );
88 $configs['error_send'] = (bool) ( $configs['error_send'] ?? false );
89
90 return $configs;
91 }
92 }
93