Codeinwp / wp-maintenance-mode

Adds a splash page to your site that lets visitors know your site is down for maintenance. Full access to the back- & front-end is optional.
https://wordpress.org/plugins/wp-maintenance-mode/
159 stars 82 forks source link

The maintenance page is not displayed for previously logged in users. #321

Closed kushh23 closed 1 year ago

kushh23 commented 1 year ago

Description:

A user from wp.org reported that if a user apart from the admin role (a subscriber etc) is previously logged in to the dashboard then the wp-maintenance page will not be displayed for the user. Instead of the maintenance page, the user will see the homepage of the website. Although if he clicks any menu links or anything else he won't be able to access that, the homepage will be still visible. New visitors who are not logged in to the website will see the same page that you have selected for Maintenance mode.

By further investigating this issue, I could replicate the same behavior in my instance.

Note: The settings for frontend and backend access are set to default i.e only the administrator can have the access to frontend as well as the backend. Also, I have attached the screenshot of the plugin settings page below.

How to reproduce:

  1. Create a new demo user with any role. For example, subscriber.
  2. Open the website in a different browser or in a new incognito tab.
  3. Login with the credentials of this new account.
  4. Now Install the plugin and activate the Maintenance mode.
  5. Go to that tab where the user is logged in.
  6. Refresh the page or click any link.
  7. You will see that the Maintenance page that you have selected won't be displayed for the user.
  8. Now log out or open the link on a new browser and the maintenance page will be visible again.

Expected behavior:

The same Maintenance page should be visible to all users.

Current behavior:

The Home page of the website is visible to the Previously logged-in users during the maintenance mode.

Reference:

Plugin settings are set to default:

image

Screencast of issue : https://www.loom.com/share/336981d01b844630a3f4cb71dd38f3ad

The user reported here: https://wordpress.org/support/topic/maintenance-mode-not-showing-for-prev-logged-in-users/

If you want you can test this issue on this instance:

https://sleeptemper.s1-tastewp.com/ kushnamdev (admin) J2SXFOO2CHI

The demo user credentials: test (subscriber) 1234

Technical info

girishpanchal30 commented 1 year ago

Hey @kushh23

Mentioned issue is fixed. Please check with this PR https://github.com/Codeinwp/wp-maintenance-mode/pull/322

Thanks

kushh23 commented 1 year ago

Hey @girishpanchal30,

I checked the plugin build and the issue is fixed now.

Thanks

pirate-bot commented 1 year ago

:tada: This issue has been resolved in version 2.5.2 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: