PluginProbe
Hostinger Tools / 3.0.39
Hostinger Tools v3.0.39
3.0.77 3.0.76 3.0.75 3.0.74 3.0.73 3.0.72 3.0.71 3.0.70 3.0.69 3.0.68 3.0.67 3.0.66 1.8.1 1.8.2 1.8.3 1.9.1 1.9.4 1.9.5 1.9.6 1.9.7 1.9.8 1.9.9 2.0.0 2.0.1 2.0.4 All 108 releases
← All changes | includes/DefaultOptions.php +18 -2 3.0.713.0.39 View file →
@@ -19,13 +19,29 @@
19 19 }
20 20 }
21 21
22 22 public function configure_security_settings(): void {
23 - $hostinger_plugin_settings = get_option( HOSTINGER_PLUGIN_SETTINGS_OPTION, array() );
23 + $hostinger_plugin_settings = get_option( HOSTINGER_PLUGIN_SETTINGS_OPTION, [] );
24 24
25 + // Check and set bypass code
25 26 if ( empty( $hostinger_plugin_settings['bypass_code'] ) ) {
26 27 $hostinger_plugin_settings['bypass_code'] = Helper::generate_bypass_code( 16 );
27 - $this->update_plugin_settings( $hostinger_plugin_settings );
28 + $this->update_plugin_settings($hostinger_plugin_settings);
29 + }
30 +
31 + $this->configure_authentication_password();
32 + }
33 +
34 + public function configure_authentication_password(): void {
35 + global $wpdb;
36 + $hostinger_plugin_settings = get_option( HOSTINGER_PLUGIN_SETTINGS_OPTION, [] );
37 +
38 + // Check if website have authentication passwords
39 + $existing_passwords = (int)$wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM {$wpdb->usermeta} WHERE meta_key = %s", '_application_passwords' ) );
40 +
41 + if ( $existing_passwords === 0 ) {
42 + $hostinger_plugin_settings['disable_authentication_password'] = true;
43 + $this->update_plugin_settings($hostinger_plugin_settings);
28 44 }
29 45 }
30 46
31 47 private function update_plugin_settings( array $settings ): void {