• Resolved JKP

    (@jacekpoleszak)


    Hello there,

    I am running a small project where I allow people access to two specific pages.

    Users log in using Custom Login Page Customizer | LoginPress plugin (Pro version, with login redirections etc).

    I am afraid one of the plugins creates some kind of issue. LoginPress seem to be working just fine, however your plugin does not discover that user is logged in, and despite me setting the condition it still triggers an action for not logged in user.

    I am also using your User Menus – Nav Menu Visibility plugin to redirect logged in user to the right pages.

    The way it’s set up is this:
    1. LoginPress logs a user in using custom login URL (hides default wp-admin).
    2. User gets redirected (using LoginPress login redirection) to account page.
    3. Here I display a custom menu using your User Menus plugin.
    4. Link to a page in a menu is set up with your Content Control plugin to check if a user is logged in and a specific role.

    It seem to work fine in Microsoft Edge, it DOES NOT WORK in the latest Google Chrome internet browser (multiple tests done, clearing cookies, browsers setting etc done, even DNS resets on machines done).

    Content Control is set up so that for a specific page (content IS a Selected Page) it redirects back to the login page (redirected to custom login page by LoginPress).

    It seem to work on Microsoft Edge, not on Google Chrome.

    The set up is all done in Polish language, but I will try to display some settings of the plugins used just so you can have an idea of what’s going on.

    Content Control settings:
    1. General settings
    2. Protection settings
    3. Content settings

    My question is whether I am making a mistake in the [1]st step? I mean… by setting it up to Administrator AND desired user role? I do it only because I want to be able to test (and build page) as an admin too. Is it AND or OR logic used in this step by your devs?

    Page settings:
    1. Content control on the bottom of wordpress editor page settings

    Some links in a custom menu are displayed on the account page to logged in users only with a custom role set. This part works.

    What doesn’t work is what follows… user who CAN SEE the link is not recognised as logged in OR allowed user and redirected back to login page.

    I assume it must be the Content Control plugin doing this, I don’t understand WHY would it? The same settings are used (two roles – Administrator and Custom role) to limit the content visibility (Menus) and accessibility (Content Restriction).

    Please answer…
    1) What could be done to make it work in this sort of setup?
    2) Are the General settings of Content Control set by me correct to limit the content to users of a “Custom role”? Should I untick and ignore admin here? Could this be the problem?
    3) Any ideas what else can cause this issue? I’m happy to provide all the feedback needed in order to diagnose and solve it.

    Kind regards.

    • This topic was modified 4 years, 10 months ago by JKP.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter JKP

    (@jacekpoleszak)

    I am also using User Role Editor by Members – Best User, Role and Capability Management Plugin for WordPress

    So, I assume, here’s where we need to look for possible conflicts…?

    Plugin Author Daniel Iser

    (@danieliser)

    @jacekpoleszak – Not quite sure I understood what the actual issue your seeing is.

    Are you saying that you after logging in the redirect to login keeps happening? If so that would be strange as we do that redirect in PHP during template_redirect I believe. If we did it with JavaScript I could see caching being an issue but clearly they are making it to the server and getting redirected.

    If that is the case it would likely mean its unrelated to caching so skipping that for now, though usually if someone says it works in one browser and not another, first instinct is caching is #1.

    Looking over our code for that functionality only a couple things come to mind:

    If its redirecting and ignoring logged in status:

    Is this an infinite loop?
    – If so one of your other plugins isn’t playing nice most likely, need to narrow that down one by one. Anything related to login or redirect. (excludes user roles).

    Or only if they logged in using a specific method?
    – In which case that login form/method isn’t setting all the proper cookies or similar and WP’s is_user_logged_in function isn’t returning true as expected: https://github.com/JunglePlugins/Content-Control/blob/master/classes/Is.php#L44
    – Try disabling the login form plugin and using wp-login.php to see if the issue persists, if not then this is the most likely culprit, though why it works for one plugin (User Menus) and not the other (Content Control) wouldn’t make since as both use very similar conditional logic processing.

    Does it occur if you change the protection method to just add some restricted content?

    In general our redirects shouldn’t get cached, but if chrome is the only one with an issue you might need to try clearing out redirect cache for that site to see if it is just a glitch during your setup testing or something else.

    I would also try disabling any caching plugins and testing that way.

    Lastly you may just want to troubleshoot a compatibility issue in general and see if you can narrow it to a specific plugin/theme so we can take a deeper look.

    Thread Starter JKP

    (@jacekpoleszak)

    First of all @danieliser , thank you for your quick reply and so much useful information.

    What’s happening is that users, after they’re logged in, once they click on a link from the menu (available only to the logged in users of a certain role) get redirected to log in again. Once they’re logged in, they get taken to the my account page, and once they click on a link they get redirected to the login page over and over again. Since your plugin was the one set to redirect them from that page I assumed IT MUST BE THE ONE causing this issue. I am no longer so certain, however it might be a conflict with LoginPress that I’m experiencing there. The bigger problem is that I don’t know how should I even test it properly since it doesn’t seem to be happening on my end (in my browsers), for whatever reason…

    I find it very hard to test as I offered that website to non-techies and they’ve reported issued with latest Chrome and Firefox browsers too.

    I was using login redirects and custom login url (decided to build a regular Woocommerce login – my account – page instead) and ask people to log in through this link.

    If there is no issue I’d assume it must have been conflict with the way LoginPress is doing their login URL hiding or/and custom login redirections, that don’t pass login data to your plugin through cookies (at least) at the right time.

    I will report later once I get more feedback. The thing is, it all works fine on my end (and Chrome and Firefox browsers that I am using)… which only adds up to my confusion.

    Thank you so much and I will keep us updated once I have more relevant data in the subject.

    • This reply was modified 4 years, 10 months ago by JKP.
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Logging in not discovered – possible conflict.’ is closed to new replies.