lukasjuhas / lj-maintenance-mode

Simple maintenance mode wordpress plugin.
https://plugins.itsluk.as/maintenance-mode/
24 stars 11 forks source link

Admin is logged in not detected when instalation is in subfolder #44

Open lukasjuhas opened 6 years ago

lukasjuhas commented 6 years ago

From wordpress org:

Just wanted to let you know that the plugin won’t detect an admin is logged in if the installation of WP is in a subfolder and then configured to work with the root URL.

ie, WP in: domain.com/wp/ with site url set to: domain.com/

The plugin will display maintenance mode but will not detect that I am logged in.

This is not a huge issue, but I hope it can be addressed in the future, as I love this plugin!

zu commented 6 years ago

I comment here instead of opening a new thread since I believe the issues belong together. We also use a structure like mentioned but I'm not sure if the problem is depending or not.

If WooCommerce is installed the "forgotten password" link cannot work since in WooCommerce hitchhikes the login to the frontend.

shaneparsons commented 6 years ago

I believe this is the same issue I'm having... only in my case, it's stopping me from viewing the settings page of the plugin, making it unusable.

i.e. Sorry, you are not allowed to access this page.

john-lang-86 commented 2 years ago

Hi Lukas,

This can be resolved with a current_user_can('administrator') condition added next to the existing current_user_can('super admin') check. It will gives the logged in user, who is an administrator, a free-bypass of the maintenance mode page for the entire site.

This works in well with the existing role based tick box settings that allows users with less privileged roles to fully test (& experience) the maintenance mode page in action (and still log in).

Working solution available in forked Milestone. All feedback is welcomed.