Title: Simple update for hooks
Last modified: August 22, 2016

---

# Simple update for hooks

 *  [kitchin](https://wordpress.org/support/users/kitchin/)
 * (@kitchin)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/simple-update-for-hooks/)
 * I’d suggest the following mod, which adds almost no execution time or complexity
   and would have the side benefit of removing the scare notice, “This plugin hasn’t
   been updated in over two years”. It would allow plugin authors to implement logging.
 *     ```
       @@ -367,6 +373,7 @@
        		$lockouts = array();
        	}
       	if(isset($lockouts[$ip]) && time() < $lockouts[$ip]) {
       +		do_action( 'limit_login_attempts_retry', $ip, 0, 'lockedout' );
        		return;
        	}
   
       @@ -396,6 +403,9 @@
        		 * Not lockout (yet!)
        		 * Do housecleaning (which also saves retry/valid values).
        		 */
       +
       +		do_action( 'limit_login_attempts_retry', $ip, $retries[$ip], 'ok' );
       +
        		limit_login_cleanup($retries, null, $valid);
        		return;
        	}
       @@ -412,11 +422,13 @@
        	 * done as usual for whitelisted ips , but no lockout is done.
        	 */
        	if ($whitelisted) {
       +		do_action( 'limit_login_attempts_retry', $ip, $retries[$ip], 'whitelisted' );
        		if ($retries[$ip] >= $retries_long) {
        			unset($retries[$ip]);
        			unset($valid[$ip]);
        		}
        	} else {
       +		do_action( 'limit_login_attempts_retry', $ip, $retries[$ip], 'lockout' );
        		global $limit_login_just_lockedout;
        		$limit_login_just_lockedout = true;
       ```
   
 * [https://wordpress.org/plugins/limit-login-attempts/](https://wordpress.org/plugins/limit-login-attempts/)

Viewing 1 replies (of 1 total)

 *  [2020media](https://wordpress.org/support/users/2020media/)
 * (@2020media)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/simple-update-for-hooks/#post-5337974)
 * Great suggestion, we still use this plugin and it’s well worth maintaining.

Viewing 1 replies (of 1 total)

The topic ‘Simple update for hooks’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/limit-login-attempts.svg)
 * [Limit Login Attempts](https://wordpress.org/plugins/limit-login-attempts/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/limit-login-attempts/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/limit-login-attempts/)
 * [Active Topics](https://wordpress.org/support/plugin/limit-login-attempts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/limit-login-attempts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/limit-login-attempts/reviews/)

## Tags

 * [logging](https://wordpress.org/support/topic-tag/logging/)

 * 1 reply
 * 2 participants
 * Last reply from: [2020media](https://wordpress.org/support/users/2020media/)
 * Last activity: [11 years, 7 months ago](https://wordpress.org/support/topic/simple-update-for-hooks/#post-5337974)
 * Status: not resolved