Moderator
Jan Dembowski
(@jdembowski)
Forum Moderator and Brute Squad
Have you considered raising a support topic before raising a 1 star review?
https://wordpress.org/support/plugin/allow-wp-admin-access#postform
Reviews of “It didn’t work for me. Please fix it. 1 star.” aren’t very nice to the author.
Hello arunkw,
You have open “allow-wp-admin-access.php” this file and find “awa_ip” this function and replace to below code.
public function awa_client_ip_env() {
$ipaddress = ”;
if (getenv(‘HTTP_CLIENT_IP’))
$ipaddress = getenv(‘HTTP_CLIENT_IP’);
else if(getenv(‘HTTP_X_FORWARDED_FOR’))
$ipaddress = getenv(‘HTTP_X_FORWARDED_FOR’);
else if(getenv(‘HTTP_X_FORWARDED’))
$ipaddress = getenv(‘HTTP_X_FORWARDED’);
else if(getenv(‘HTTP_FORWARDED_FOR’))
$ipaddress = getenv(‘HTTP_FORWARDED_FOR’);
else if(getenv(‘HTTP_FORWARDED’))
$ipaddress = getenv(‘HTTP_FORWARDED’);
else if(getenv(‘REMOTE_ADDR’))
$ipaddress = getenv(‘REMOTE_ADDR’);
else if(getenv(‘HTTP_CF_CONNECTING_IP’))
$ipaddress = getenv(‘HTTP_CF_CONNECTING_IP’);
else
$ipaddress = ‘UNKNOWN’;
return $ipaddress;
}
//Blocks access to admin users unless from certain IPs. Regular users may be from anywhere.
public function awa_ip($user, $name, $pass) {
$disableip = get_option(‘awa-ip-field’);
$req_uri = $_SERVER[‘REQUEST_URI’];
$allow_ips = explode(“,”,$disableip);
if ($disableip !=”){
if (!in_array($this->awa_client_ip_env(), $allow_ips) && ( preg_match(‘#wp-admin#’, $req_uri))) {
echo ‘Access Forbidden’, __(‘ERROR: Access Forbidden.’);
die;
}
}
}
please check your on “what is my ip” in google and that ip put in a “Allow wp-admin access setting”
Moderator
Jan Dembowski
(@jdembowski)
Forum Moderator and Brute Squad
Side note: @brainvireinfo I really do not like anyone posting with multiple accounts. I really, really, really have a problem with that.
I’ve deleted your 5 star review with your other account. Please do not repeat that again.