PluginProbe
Defender Security – Malware Scanner, Login Security & Firewall / 3.1.0
Defender Security – Malware Scanner, Login Security & Firewall v3.1.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 / setting / main-setting.php

main-setting.php in Defender Security – Malware Scanner, Login Security & Firewall 3.1.0, at src/model/setting/main-setting.php

83 lines 1.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace WP_Defender\Model\Setting;
4
5 use Calotes\Model\Setting;
6
7 class Main_Setting extends Setting {
8 /**
9 * Option name
10 * @var string
11 */
12 public $table = 'wd_main_settings';
13
14 /**
15 * @var string
16 * @defender_property
17 */
18 public $translate;
19 /**
20 * @var bool
21 * @defender_property
22 */
23 public $usage_tracking = false;
24 /**
25 * @var string
26 * @sanitize_text_field
27 * @defender_property
28 */
29 public $uninstall_data = 'keep';
30
31 /**
32 * @var string
33 * @sanitize_text_field
34 * @defender_property
35 */
36 public $uninstall_settings = 'preserve';
37
38 /**
39 * @var bool
40 * @defender_property
41 */
42 public $high_contrast_mode = false;
43
44 protected function after_load() {
45 $site_locale = is_multisite() ? get_site_option( 'WPLANG' ) : get_locale();
46
47 if ( empty( $site_locale ) || 'en_US' === $site_locale ) { // @see wp_dropdown_languages() by default empty string for English.
48 $site_language = 'English';
49 } else {
50 require_once ABSPATH . 'wp-admin/includes/translation-install.php';
51 $translations = wp_get_available_translations();
52 $site_language = isset( $translations[ $site_locale ] )
53 ? $translations[ $site_locale ]['native_name']
54 : __( 'Error detecting language', 'wpdef' );
55 }
56
57 $this->translate = $site_language;
58 }
59
60 /**
61 * Define labels for settings key.
62 *
63 * @param string|null $key
64 *
65 * @return string|array|null
66 */
67 public function labels( $key = null ) {
68 $labels = array(
69 'translate' => __( 'Translations', 'wpdef' ),
70 'usage_tracking' => __( 'Usage Tracking', 'wpdef' ),
71 'uninstall_data' => __( 'Uninstall Data', 'wpdef' ),
72 'uninstall_settings' => __( 'Uninstall Settings', 'wpdef' ),
73 'high_contrast_mode' => __( 'High Contrast Mode', 'wpdef' ),
74 );
75
76 if ( ! is_null( $key ) ) {
77 return $labels[ $key ] ?? null;
78 }
79
80 return $labels;
81 }
82 }
83