Support » Plugin: WP Maintenance Mode » There is an issue when the mode activated

  • Resolved Mehmet Baris

    (@gecedergi)


    Hi there.

    There is an issue when the maintenance mode is activated.

    for example we have a domain.

    http://www.domain.com

    we activate the mode to maintenance

    we can access the site via http://www.domain.com/wp-admin or etc…

    when we type an other character or number after the wp-admin;
    the website opening a Nothing Found Page on the wp-admin. And this movement opening directly the front-end website.

    for example:
    http://www.domain.com/wp-admin12345 link opening the maintenance mode activated website.

    this is a big trouble.

    can you fix it?

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author George J

    (@georgejipa)

    Hello @gecedergi,

    Sorry to hear that. I just did some tests, but I can’t reproduce the issue. The 404 page should appear ONLY if you’re logged-in with a username that has access to the frontend.
    Have you checked this in a different browser / incognito window? 🙂

    Thanks.

    hello again.

    i checked again with different websites and all of has the same issue.

    i am writing again the issue by steps.

    1-install your plugin any wordpress website.

    2-activate the plugin.

    3-log-out admin panel.

    4-the front-end website on the maintenance. thats ok for now.
    you can see it on this screenshot.
    https://i.hizliresim.com/ERnqjA.jpg

    5-close the browser, if you want to clean all of browser cache. but doesn’t meter.

    6-open a new browser. type “your website name” + “/wp-login” on browser address bar. or “/wp-login.php12345” or “/wp-login.php,,,,,,,”
    you can see it on this screenshot.
    https://i.hizliresim.com/ZEgVv3.jpg

    So,
    http://www.domain.com is ok, in maintenance.
    http://www.domain.com/wp-login.php is ok, this is login page

    but what we type after “/wp-login” this action open the front-end site.

    is this understandable?

    Thanks for interest :]

    • This reply was modified 2 years, 12 months ago by Mehmet Baris. Reason: spell check
    Plugin Author George J

    (@georgejipa)

    Hello @gecedergi,

    Now I get it, but in your first comment you said /wp-admin … not /wp-login.php. That’s why I couldn’t reproduce the issue. 🙂

    You can delete “wp-login” & “login” from plugin’s settings > General > Exclude list.

    Maybe in a future version I’m gonna try to make a better exclude system, but right now this is how it works.

    Thanks.

    Later edit: after you delete that rules from Exclude list, everything should be fine.

    • This reply was modified 2 years, 12 months ago by George J.
    • This reply was modified 2 years, 12 months ago by George J.
    • This reply was modified 2 years, 12 months ago by George J.
    • This reply was modified 2 years, 12 months ago by George J.
    • This reply was modified 2 years, 12 months ago by George J. Reason: spelling errors, edit advice

    Hello again, sorry for wp-admin and wp-login mess :] i wrote wrong.

    By the way, i have a few quest

    İ know that ex-list

    But if we delete that, how can we reach the admin panel?

    And if we delete all of them,
    We must use /wp-login.php to Login our website.

    The issue will continue anyway. Bcs if we type /wp-login.php1224 or any characters after /wp-login.php front-end website Will open again

    Plugin Author George J

    (@georgejipa)

    @gecedergi: you can delete that rules because the plugin excludes wp-login.php by default.

    See example:
    /wp-login.php
    /wp-login.php43434

    Hi George J. again :]

    it’s resolved my default login problem.
    i deleted all of exclude list. like you said, wp-login.php works so default.
    and any characters after that can not open front-end website. thats cool, its ok.

    but i am using Hide Backend some of my websites.
    for example: http://www.domain.com/wp-login.php not working bcs i dont want to use it.
    for example i am using http://www.domain.com/george to access admin panel.

    and i am adding “george” to exclude list bcs i have to do it for reach panel you know…

    and thats the problem again :]

    because any of exclude name we add your plugin exclude list, thats makes this problem.

    when i type http://www.domain.com/george12345 or etc. i can access front-end again.

    can you make something about that. i think the problem about your plugin exclude list part.

    thanks for interest again :]

    Plugin Author George J

    (@georgejipa)

    @gecedergi: well… the exclude list is not really public, so you have to guess the excluded slugs/pages (if you want to bypass the maintenance page).

    Anyway, what you want/need is to exclude a page only if it is an exact match. By default… the plugin is not doing this, but you can use wpmm_is_excluded filter.

    Here’s an example:

    
    // put the code in functions.php of your active theme (or child theme, if you use)
    function wpmm_exclude_exact_match($is_excluded, $excluded_list) {
    	$request_uri = isset($_SERVER['REQUEST_URI']) ? trim($_SERVER['REQUEST_URI'], '/') : '';
    	$ip_address = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '';
    
            // $excluded_list is the list from plugin's settings
    	foreach ($excluded_list as $item) {
    		$item = trim($item, '/');
    		
    		if (empty($item)) { // just to be sure :-)
    			continue;
    		}
    
    		if ($request_uri === $item || $ip_address === $item) {
    			return true;
    			break;
    		}
    	}
    
    	return false;
    }
    
    add_filter('wpmm_is_excluded', 'wpmm_exclude_exact_match', 99, 2);
    

    I think I will introduce the exact match option in a future version of the plugin. 🙂

    • This reply was modified 2 years, 12 months ago by George J.
    • This reply was modified 2 years, 12 months ago by George J.
    • This reply was modified 2 years, 12 months ago by George J. Reason: change code comment

    Hello George J.

    i pasted the code on my function.php page and its works!

    thanks a lot, the problem has fixed now:]
    i am really grateful.

    by the way; i’m kindly advise something about your plugin.
    Your plugin is my favorite maintenance plugin. i am using it many website i developed.

    if the plugin desing settings page had this options it will be amazing for me :]
    1) additional meta tags (for webfonts, font-awesome or etc.)
    2) inline css area
    3) in my opinnion no needs “heading” area, we can add it in textarea

    i think, thats could be easy things for you :]

    thanks a lot again.

    have a nice work!

    Plugin Author George J

    (@georgejipa)

    @gecedergi: you’re welcome. thanks for your suggestions! 🙂

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘There is an issue when the mode activated’ is closed to new replies.