PluginProbe
Defender Security – Malware Scanner, Login Security & Firewall / 6.3.0
Defender Security – Malware Scanner, Login Security & Firewall v6.3.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
← All changes | src/controller/class-password-reset.php +4 -22 5.8.0 → 6.3.0 View file →
@@ -51,9 +51,8 @@
51 51 $this->model = $this->get_model();
52 52 $this->service = wd_di()->get( \WP_Defender\Component\Password_Protection::class );
53 53 $default_values = $this->model->get_default_values();
54 54 $this->default_msg = $default_values['message'];
55 - add_filter( 'wp_defender_advanced_tools_data', array( $this, 'script_data' ) );
56 55 $this->register_routes();
57 56 if ( $this->model->is_active() ) {
58 57 // Update site url on sub-site when MaskLogin is disabled.
59 58 if (
@@ -64,9 +63,9 @@
64 63 }
65 64 add_action( 'validate_password_reset', array( $this, 'handle_reset_check_password' ), 10, 2 );
66 65 add_action( 'profile_update', array( $this, 'handle_update_user' ), 10, 2 );
67 66 add_action( 'password_reset', array( $this, 'handle_password_reset' ), 10 );
68 - add_action( 'wp_authenticate_user', array( $this, 'handle_login_password' ), 999, 2 );
67 + add_filter( 'wp_authenticate_user', array( $this, 'handle_login_password' ), 999, 2 );
69 68 // No use 'user_profile_update_errors' because there aren't checks for password resetting for logged user in.
70 69 }
71 70 }
72 71
@@ -131,11 +130,11 @@
131 130 *
132 131 * @param WP_Error $errors Error object.
133 132 * @param WP_Error|WP_User $user WP_User object or WP_Error.
134 133 *
135 - * @return null|WP_Error
134 + * @return void
136 135 */
137 - public function handle_reset_check_password( WP_Error $errors, $user ) {
136 + public function handle_reset_check_password( WP_Error $errors, $user ): void {
138 137 if ( is_wp_error( $user ) ) {
139 138 return;
140 139 }
141 140
@@ -151,9 +150,9 @@
151 150 $errors->add( 'defender_password_reset', $message );
152 151 // Remove the one time cookie notice once it's displayed.
153 152 $this->service->remove_cookie_notice( 'display_reset_password_warning' );
154 153
155 - return $errors;
154 + return;
156 155 }
157 156
158 157 $login_password = $this->service->get_submitted_password();
159 158 $user_id = isset( $user->ID ) ? $user->ID : 0;
@@ -167,13 +166,9 @@
167 166 esc_html__( 'This password has been used already. Please choose a different one.', 'defender-security' ),
168 167 array( 'strong' => array() )
169 168 );
170 169 $errors->add( 'defender_password_reset', $message );
171 -
172 - return $errors;
173 170 }
174 -
175 - return $errors;
176 171 }
177 172
178 173 /**
179 174 * Update the time when a user resets their password.
@@ -201,21 +196,8 @@
201 196 return;
202 197 }
203 198
204 199 $this->service->handle_password_updated( $user );
205 - }
206 -
207 - /**
208 - * Provide data to the frontend via localized script.
209 - *
210 - * @param array $data Data collection is ready to passed.
211 - *
212 - * @return array Modified data array with added this controller data.
213 - */
214 - public function script_data( array $data ): array {
215 - $data['password_reset'] = $this->data_frontend();
216 -
217 - return $data;
218 200 }
219 201
220 202 /**
221 203 * Save settings.