| @@ -56,9 +56,9 @@ | ||
| 56 | 56 | return; |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | // Determine which sites are already activated and skip those. |
| 60 | - $activate = array(); | |
| 60 | + $activate = []; | |
| 61 | 61 | $sites = get_sites(); |
| 62 | 62 | foreach ( $sites as $site ) { |
| 63 | 63 | if ( in_array( $site->siteurl, $_POST['sites'] ) && get_blog_option( $site->id, 'patchstack_clientid' ) == '' ) { |
| 64 | 64 | array_push( $activate, $site->siteurl ); |
| @@ -71,9 +71,9 @@ | ||
| 71 | 71 | return; |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | // Add the site to the app and retrieve the license for each site. |
| 75 | - $licenses = $this->plugin->api->get_site_licenses( array( 'sites' => $activate ) ); | |
| 75 | + $licenses = $this->plugin->api->get_site_licenses( [ 'sites' => $activate ] ); | |
| 76 | 76 | |
| 77 | 77 | // Did an error happen during the multisite license activation? |
| 78 | 78 | if ( isset( $licenses['error'] ) ) { |
| 79 | 79 | $this->error = '<span style="color: #ff6262;">' . $licenses['error'] . '</span><br /><br />'; |
| @@ -97,27 +97,27 @@ | ||
| 97 | 97 | private function save_settings() { |
| 98 | 98 | switch ( $_POST['option_page'] ) { |
| 99 | 99 | // Save hardening options |
| 100 | 100 | case 'patchstack_hardening_settings_group': |
| 101 | - $options = array( 'patchstack_auto_update', 'patchstack_json_is_disabled', 'patchstack_register_email_blacklist', 'patchstack_move_logs', 'patchstack_basicscanblock', 'patchstack_userenum', 'patchstack_hidewpversion', 'patchstack_activity_log_is_enabled', 'patchstack_activity_log_failed_logins', 'patchstack_xmlrpc_is_disabled', 'patchstack_captcha_on_comments', 'patchstack_captcha_login_form', 'patchstack_captcha_registration_form', 'patchstack_captcha_reset_pwd_form', 'patchstack_captcha_type', 'patchstack_captcha_public_key', 'patchstack_captcha_public_key_v3', 'patchstack_captcha_public_key_v3_new', 'patchstack_captcha_private_key', 'patchstack_captcha_private_key_v3', 'patchstack_captcha_private_key_v3_new', 'patchstack_application_passwords_disabled' ); | |
| 101 | + $options = [ 'patchstack_auto_update', 'patchstack_json_is_disabled', 'patchstack_register_email_blacklist', 'patchstack_move_logs', 'patchstack_basicscanblock', 'patchstack_userenum', 'patchstack_hidewpversion', 'patchstack_activity_log_is_enabled', 'patchstack_activity_log_failed_logins', 'patchstack_xmlrpc_is_disabled', 'patchstack_captcha_on_comments', 'patchstack_captcha_login_form', 'patchstack_captcha_registration_form', 'patchstack_captcha_reset_pwd_form', 'patchstack_captcha_type', 'patchstack_captcha_public_key', 'patchstack_captcha_public_key_v3', 'patchstack_captcha_public_key_v3_new', 'patchstack_captcha_private_key', 'patchstack_captcha_private_key_v3', 'patchstack_captcha_private_key_v3_new', 'patchstack_application_passwords_disabled' ]; | |
| 102 | 102 | $this->save_options( $options ); |
| 103 | 103 | break; |
| 104 | 104 | |
| 105 | 105 | // Save firewall settings |
| 106 | 106 | case 'patchstack_firewall_settings_group': |
| 107 | - $options = array( 'patchstack_geo_block_countries', 'patchstack_geo_block_enabled', 'patchstack_geo_block_inverse', 'patchstack_ip_block_list', 'patchstack_basic_firewall', 'patchstack_autoblock_blocktime', 'patchstack_autoblock_attempts', 'patchstack_autoblock_minutes', 'patchstack_basic_firewall_roles', 'patchstack_disable_htaccess', 'patchstack_add_security_headers', 'patchstack_prevent_default_file_access', 'patchstack_block_debug_log_access', 'patchstack_index_views', 'patchstack_proxy_comment_posting', 'patchstack_image_hotlinking', 'patchstack_firewall_custom_rules', 'patchstack_firewall_custom_rules_loc', 'patchstack_blackhole_log', 'patchstack_whitelist', 'patchstack_firewall_ip_header' ); | |
| 107 | + $options = [ 'patchstack_geo_block_countries', 'patchstack_geo_block_enabled', 'patchstack_geo_block_inverse', 'patchstack_ip_block_list', 'patchstack_basic_firewall', 'patchstack_autoblock_blocktime', 'patchstack_autoblock_attempts', 'patchstack_autoblock_minutes', 'patchstack_basic_firewall_roles', 'patchstack_disable_htaccess', 'patchstack_add_security_headers', 'patchstack_prevent_default_file_access', 'patchstack_block_debug_log_access', 'patchstack_index_views', 'patchstack_proxy_comment_posting', 'patchstack_image_hotlinking', 'patchstack_firewall_custom_rules', 'patchstack_firewall_custom_rules_loc', 'patchstack_blackhole_log', 'patchstack_whitelist' ]; | |
| 108 | 108 | $this->save_options( $options ); |
| 109 | 109 | break; |
| 110 | 110 | |
| 111 | 111 | // Save login settings |
| 112 | 112 | case 'patchstack_login_settings_group': |
| 113 | - $options = array( 'patchstack_mv_wp_login', 'patchstack_rename_wp_login', 'patchstack_block_bruteforce_ips', 'patchstack_anti_bruteforce_blocktime', 'patchstack_anti_bruteforce_attempts', 'patchstack_anti_bruteforce_minutes', 'patchstack_login_time_block', 'patchstack_login_time_start', 'patchstack_login_time_end', 'patchstack_login_2fa', 'patchstack_login_whitelist' ); | |
| 113 | + $options = [ 'patchstack_mv_wp_login', 'patchstack_rename_wp_login', 'patchstack_block_bruteforce_ips', 'patchstack_anti_bruteforce_blocktime', 'patchstack_anti_bruteforce_attempts', 'patchstack_anti_bruteforce_minutes', 'patchstack_login_time_block', 'patchstack_login_time_start', 'patchstack_login_time_end', 'patchstack_login_2fa', 'patchstack_login_whitelist' ]; | |
| 114 | 114 | $this->save_options( $options ); |
| 115 | 115 | break; |
| 116 | 116 | |
| 117 | 117 | // Save cookie notice settings |
| 118 | 118 | case 'patchstack_cookienotice_settings_group': |
| 119 | - $options = array( 'patchstack_enable_cookie_notice_message', 'patchstack_cookie_notice_message', 'patchstack_cookie_notice_accept_text', 'patchstack_cookie_notice_backgroundcolor', 'patchstack_cookie_notice_textcolor', 'patchstack_cookie_notice_privacypolicy_enable', 'patchstack_cookie_notice_privacypolicy_text', 'patchstack_cookie_notice_privacypolicy_link', 'patchstack_cookie_notice_cookie_expiration', 'patchstack_cookie_notice_opacity', 'patchstack_cookie_notice_credits' ); | |
| 119 | + $options = [ 'patchstack_enable_cookie_notice_message', 'patchstack_cookie_notice_message', 'patchstack_cookie_notice_accept_text', 'patchstack_cookie_notice_backgroundcolor', 'patchstack_cookie_notice_textcolor', 'patchstack_cookie_notice_privacypolicy_enable', 'patchstack_cookie_notice_privacypolicy_text', 'patchstack_cookie_notice_privacypolicy_link', 'patchstack_cookie_notice_cookie_expiration', 'patchstack_cookie_notice_opacity', 'patchstack_cookie_notice_credits' ]; | |
| 120 | 120 | $this->save_options( $options ); |
| 121 | 121 | break; |
| 122 | 122 | } |
| 123 | 123 | } |