• Whenever I activate the plugin, the login error box is shown at all times – not only when an error occurs. There is no text in the box, unless I manipulate the login error message like this:

    add_filter('login_errors','login_error_message');
    
    	function login_error_message($error){
    	    //check if that's the error you are looking for
    	    $pos = strpos($error, 'incorrect');
    	    if ($pos === false) {
    	        //its the right error so you can overwrite it
    	        $error = "Det indtastede brugernavn eller kodeord var forkert, prov igen.";
    	    }
    	    return $error;
    	}

    Any ideas on what could be the problem?

    https://www.ads-software.com/extend/plugins/limit-login-attempts/

Viewing 1 replies (of 1 total)
  • Plugin Contributor johanee

    (@johanee)

    My guess would be that you have some other filter that clears the error message. There has to be some error, or the box divs wouldn’t be shown.

    To get the original error message and find which filters are registered you could try something like this:

    <?php
    /*
      Plugin Name: Debug Login Errors
      Description: Debug the login_errors filter
      Author: Johan Eenfeldt
      Version: 0.1
    */
    
    // use the 'all' filter to make sure we get called first
    add_filter('all','debug_login_errors');
    
    function debug_login_errors($filter) {
    	if ($filter != 'login_errors')
    		return;
    
    	$args = func_get_args();
    	if (count($args) < 2)
    		return;
    
    	$error = $args[1];
    
    	// Original error
    	echo '<p>Original error:<br />';
    	var_dump($error);
    	echo '</p>';
    
    	// Filters
    	global $wp_filter;
    	echo '<p>Filters:<br />';
    	var_dump($wp_filter[$filter]);
    	echo '</p>';
    }
    ?>
Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: Limit Login Attempts] Empty login error div shown at all times’ is closed to new replies.