Support » Plugin: Limit Login Attempts » Same IP address for all users on my site

  • All users on my site have same IP address so when somebody brute-forsed my site and was blocked – I am blocked too.

    $_SERVER['REMOTE_ADDR'] – is not good enough for getting IP address, because in rare cases it does not work correctly.

    For getting real IP address better to use this code:

    <?php
    if ( !empty( $_SERVER['HTTP_CLIENT_IP'] ) ) { //check ip from share internet
    	$ip = $_SERVER['HTTP_CLIENT_IP'];
    } elseif ( !empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) { // to check ip is pass from proxy, also could be used ['HTTP_X_REAL_IP ']
    	$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
    } else {
    	$ip = $_SERVER['REMOTE_ADDR'];
    }
    ?>

    http://wordpress.org/extend/plugins/limit-login-attempts/

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Same IP address for all users on my site’ is closed to new replies.