PluginProbe ʕ •ᴥ•ʔ
CloudSecure WP Security / 1.2.0
CloudSecure WP Security v1.2.0
1.4.10 1.4.9 trunk 0.9.0 1.0.2 1.1.0 1.1.1 1.1.2 1.1.3 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.3.1 1.3.10 1.3.11 1.3.12 1.3.13 1.3.14 1.3.15 1.3.16 1.3.17 1.3.18 1.3.19 1.3.2 1.3.20 1.3.21 1.3.22 1.3.23 1.3.24 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.4.8
cloudsecure-wp-security / modules / config.php
cloudsecure-wp-security / modules Last commit date
admin 2 years ago lib 2 years ago captcha.php 2 years ago cloudsecure-wp.php 2 years ago common.php 2 years ago config.php 2 years ago disable-author-query.php 2 years ago disable-login.php 2 years ago disable-restapi.php 2 years ago disable-xmlrpc.php 2 years ago htaccess.php 2 years ago login-log.php 2 years ago login-notification.php 2 years ago rename-login-page.php 2 years ago restrict-admin-page.php 2 years ago server-error-notification.php 2 years ago two-factor-authentication.php 2 years ago unify-messages.php 2 years ago update-notice.php 2 years ago
config.php
56 lines
1 <?php
2 class CloudSecureWP_Config extends CloudSecureWP_Common {
3 private const OPTION_KEY = 'cloudsecurewp_config';
4 private $conf;
5
6 function __construct( array $info ) {
7 parent::__construct( $info );
8 $this->load_option();
9 }
10
11 /**
12 * optionを取得
13 */
14 public function load_option(): void {
15 $conf_tmp = get_option( self::OPTION_KEY );
16 $this->conf = ( empty( $conf_tmp ) || $conf_tmp === false ) ? array() : $conf_tmp;
17 }
18
19 /**
20 * 指定の設定値を取得
21 *
22 * @param string $key
23 * @return
24 */
25 public function get( string $key ) {
26 return $this->conf[ $key ] ?? '';
27 }
28
29 /**
30 * 設定値の指定
31 *
32 * @param string $key
33 * @param $val
34 * @return void
35 */
36 public function set( string $key, $val ): void {
37 $this->conf[ $key ] = $val;
38 }
39
40 /**
41 * 設定値の保存
42 *
43 * @return void
44 */
45 public function save(): void {
46 update_option( self::OPTION_KEY, $this->conf );
47 }
48
49 /**
50 * 削除
51 */
52 public function rm(): void {
53 $this->conf = array();
54 }
55 }
56