PluginProbe ʕ •ᴥ•ʔ
CloudSecure WP Security / 1.2.6
CloudSecure WP Security v1.2.6
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
61 lines
1 <?php
2
3 if ( ! defined( 'ABSPATH' ) ) {
4 exit;
5 }
6
7 class CloudSecureWP_Config extends CloudSecureWP_Common {
8 private const OPTION_KEY = 'cloudsecurewp_config';
9 private $conf;
10
11 function __construct( array $info ) {
12 parent::__construct( $info );
13 $this->load_option();
14 }
15
16 /**
17 * optionを取得
18 */
19 public function load_option(): void {
20 $conf_tmp = get_option( self::OPTION_KEY );
21 $this->conf = ( empty( $conf_tmp ) || $conf_tmp === false ) ? array() : $conf_tmp;
22 }
23
24 /**
25 * 指定の設定値を取得
26 *
27 * @param string $key
28 * @return
29 */
30 public function get( string $key ) {
31 return $this->conf[ $key ] ?? '';
32 }
33
34 /**
35 * 設定値の指定
36 *
37 * @param string $key
38 * @param $val
39 * @return void
40 */
41 public function set( string $key, $val ): void {
42 $this->conf[ $key ] = $val;
43 }
44
45 /**
46 * 設定値の保存
47 *
48 * @return void
49 */
50 public function save(): void {
51 update_option( self::OPTION_KEY, $this->conf );
52 }
53
54 /**
55 * 削除
56 */
57 public function rm(): void {
58 $this->conf = array();
59 }
60 }
61