Title: chrwp's Replies | WordPress.org

---

# chrwp

  [  ](https://wordpress.org/support/users/chrwp/)

 *   [Profile](https://wordpress.org/support/users/chrwp/)
 *   [Topics Started](https://wordpress.org/support/users/chrwp/topics/)
 *   [Replies Created](https://wordpress.org/support/users/chrwp/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/chrwp/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/chrwp/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/chrwp/engagements/)
 *   [Favorites](https://wordpress.org/support/users/chrwp/favorites/)

 Search replies:

## Forum Replies Created

Viewing 1 replies (of 1 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[User Locker] [Plugin: User Locker] Bad attempts are not reset after valid login](https://wordpress.org/support/topic/plugin-user-locker-bad-attempts-are-not-reset-after-valid-login/)
 *  [chrwp](https://wordpress.org/support/users/chrwp/)
 * (@chrwp)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/plugin-user-locker-bad-attempts-are-not-reset-after-valid-login/#post-2381756)
 * I like this plugin too and encounter the same bug. A user, who is a good fellow,
   gets eventally locked because of some typos now and than. In my opinion an uncolicited‘
   password reset’ or a successful ‘login’ should always reset the lock counter.
   I suggest the following patch:
 *     ```
       --- user-locker.php.orig        2011-10-24 21:22:38.000000000 +0200
       +++ user-locker.php     2012-02-20 18:55:51.000000000 +0100
       @@ -181,12 +181,14 @@                                                                                                                                                                                                                        
   
               // Reset account lock on pass reset
               function password_reset( $user ) {
       +               update_user_option( $user->ID, 'ul_bad_attempts', 0, false );
                       $this->unlock_user( $user->ID );
               }                                                                                                                                                                                                                                    
   
               // Reset account lock on valid login
               function wp_login( $username ) {
                       $user = get_userdatabylogin( $username );
       +               update_user_option( $user->ID, 'ul_bad_attempts', 0, false );
                       $this->unlock_user( $user->ID );
               }
   
       @@ -634,4 +636,4 @@
   
        } // END
   
       -?>
       \ No newline at end of file
       +?>
       ```
   
 * Regards!

Viewing 1 replies (of 1 total)