• Resolved denis24

    (@denis24)


    I’m getting ready to launch an ecommerce site which is protected by your coming soon page.

    I want my clients to be able to access the site without logging in, so that they can see what a non-logged-in visitor would see. I have whitelisted their IP addresses, but they still can’t get past the coming soon page.

    Any ideas?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter denis24

    (@denis24)

    Can you please respond to this question? It’s been 4 days and my clients are getting impatient….

    Plugin Support Vytis

    (@bvytis)

    Hi @denis24,

    Thank you for reporting the issue, I was able to replicate the problem and will report it to the development team for review.

    I’ve created a function that you can use until it’s fixed to target the IP address of the users that you want to exclude from the maintenance mode, you can add this code to the functions.php file of your theme:

    function wpmm_exclude_IP_address($ip) {
    
    	$ip = 'undefined';
    	
    	if (isset($_SERVER)) {
    		
    		$ip = $_SERVER['REMOTE_ADDR'];
    		
    		if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
    			
    			$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
    			
    		} elseif (isset($_SERVER['HTTP_CLIENT_IP'])) {
    			
    			$ip = $_SERVER['HTTP_CLIENT_IP'];
    		}
    		
    	} else {
    		
    		$ip = getenv('REMOTE_ADDR');
    		
    		if (getenv('HTTP_X_FORWARDED_FOR')) {
    			
    			$ip = getenv('HTTP_X_FORWARDED_FOR');
    			
    		} elseif (getenv('HTTP_CLIENT_IP')) {
    			
    			$ip = getenv('HTTP_CLIENT_IP');
    		}
    	}
    	
    	$ip = htmlspecialchars($ip, ENT_QUOTES, 'UTF-8');
    
        if ($ip == '0.0.0.0') {
            return true;
        }
        return false;
    }
    
    add_filter('wpmm_is_excluded', 'wpmm_exclude_IP_address', 10, 1);

    Of course, please change the 0.0.0.0 in the code to the IP address that you want to exclude.

    I hope it helps!

    Thread Starter denis24

    (@denis24)

    I’m glad my post helped to identify a bug. I will certainly update the plugin when an update is available. Meanwhile, this patch should help.

    But since more than one person will be reviewing the site, and they are working remotely, I will need to add more than one IP address. How should I modify this line to accept several addresses?

    if ($ip == '0.0.0.0')

    Thanks!

    Plugin Support Vytis

    (@bvytis)

    Hi @denis24,

    I’m sorry for the delay here, our development team needs a bit more information about your server architecture.

    May you share your server details with us by retrieving those as per this screenshot: https://vertis.d.pr/emZtrV

    As it’s a lot of text you can share the text by generating a unique link and sharing it here – https://pastebin.com/

    If you’re not comfortable with sharing server details here please send an email to [email protected] with that link and the URL of this thread, thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Whitelisting IP address not working’ is closed to new replies.