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/component/class-login-lockout.php +3 -17 5.7.0 → 6.3.0 View file →
@@ -161,9 +161,9 @@
161 161 *
162 162 * @param string $username The username used in the failed login attempt.
163 163 */
164 164 public function process_fail_attempt_compatibility( $username ) {
165 - if ( empty( $username ) ) {
165 + if ( ! is_string( $username ) || '' === $username ) {
166 166 return;
167 167 }
168 168
169 169 if ( in_array( $username, $this->model->get_blacklisted_username(), true ) ) {
@@ -204,9 +204,9 @@
204 204 * @param string $username The username used in the failed login attempt.
205 205 * @param WP_Error $error The error object associated with the login failure.
206 206 */
207 207 public function process_fail_attempt( $username, $error ) {
208 - if ( empty( $username ) ) {
208 + if ( ! is_string( $username ) || '' === $username ) {
209 209 return;
210 210 }
211 211
212 212 foreach ( $this->ip as $ip ) {
@@ -344,23 +344,9 @@
344 344 * @param string $scenario The scenario constant (e.g., SCENARIO_LOGIN_FAIL).
345 345 * @param string $message Additional message for the log.
346 346 */
347 347 public function log_event( $ip, $username, $scenario, $message = '' ) {
348 - $user_agent = defender_get_data_from_request( 'HTTP_USER_AGENT', 's' );
349 - $model = new Lockout_Log();
350 - $model->ip = $ip;
351 - $model->user_agent = isset( $user_agent )
352 - ? User_Agent::fast_cleaning( $user_agent )
353 - : null;
354 - $model->date = time();
355 - $model->tried = $username;
356 - $model->blog_id = get_current_blog_id();
357 -
358 - $ip_to_country = $this->ip_to_country( $ip );
359 -
360 - if ( isset( $ip_to_country['iso'] ) ) {
361 - $model->country_iso_code = $ip_to_country['iso'];
362 - }
348 + $model = Lockout_Log::create( $ip, $username );
363 349
364 350 switch ( $scenario ) {
365 351 case self::SCENARIO_LOGIN_FAIL:
366 352 $model->type = Lockout_Log::AUTH_FAIL;