WordPress.org

Forums

Private Site Members Plugin (12 posts)

  1. sonamlucky
    Member
    Posted 1 year ago #

    Using the Redirect all logged-out users to the login page before allowing them to view the site option.
    But would like them to register as well, but it seems block the sign up page as well.
    Any Help would be appreciated.
    Thanks

    https://wordpress.org/plugins/members/

  2. bcworkz
    Member
    Posted 1 year ago #

    You must have a plugin conflict or Members conflicts with your theme. I have Members installed on my site (child theme of twentyeleven), so I tried the Private Site option. It worked as expected, and new users were able to register and get logged in with no trouble at all.

  3. sonamlucky
    Member
    Posted 1 year ago #

    i am using Peters Login/redirect plugin and thought initially that it was the fault but after various attempts it doesnt seem to be. I use a bare bone boiler plate template so that shouldnt cause a problem.
    The site link is http://www.chubbmarketinglibrary.com/

  4. sonamlucky
    Member
    Posted 1 year ago #

    Any Help would be appreciated.
    Thanks

  5. sonamlucky
    Member
    Posted 1 year ago #

    hi i figured out the problem. i had gravity forms user registration set as the register page. So for some reason it was not going to the page.

  6. bcworkz
    Member
    Posted 1 year ago #

    I know little of Gravity Forms, but this is what I think is happening.

    Members in Private Site mode essentially calls auth_redirect() on every page load to force a login if the user is not already logged in. The one exception is the wp-login.php page, because it sets up a circular situation where loading the page causes a redirect to the login page, in which by loading causes a redirect to the login page, in which by loading... You get the idea. Thus a built in exception for wp-login.php

    By using a gravity forms page, Members does not recognize it as a login page so it redirects to the login page, which in turn causes a redirect to the... here we go again! But there is no built in exception for gravity forms, causing a problem of runaway redirects.

    The solution would be to get Members to recognize your Gravity Forms registration page and not redirect when it loads. This is done in members/components/private-blog/default.php. The problem is your custom code here could be overwritten when the plugin updates. There is no filter hook you can use to do this cleanly. It would have to be a dirty hack.

  7. sonamlucky
    Member
    Posted 1 year ago #

    yeah, i think that was the issue, it just kept re looping. well at least we learn new things everyday, and thats the beauty of gaining knowledge.
    Only Issue i have with the members plugin is that i have custom fields on the pages. so even with the plugin activated to hide from users. You can still see the contents of the custom fields.
    If you look at the link you will see what i mean.
    http://www.chubbmarketinglibrary.com/uk/

    Thanks again for your help.

  8. sonamlucky
    Member
    Posted 1 year ago #

  9. bcworkz
    Member
    Posted 1 year ago #

    Strangely, I don't see any custom fields. But I am also not getting redirected to a login page, so things are clearly not working right. I suspect both plugins are hooked into 'template_redirect' action in a way that conflicts with the other. I'm not sure how the conflict occurs in this case, no idea for a possible fix or workaround.

    It seems safe to say the two plugins are incompatible with the other.

  10. sonamlucky
    Member
    Posted 1 year ago #

    i Removed the redirect login for the moment.
    If you look at the main page you can see it says:

    Sorry, but you do not have permission to view this content.
    Please Login Here to access all Features.

    and below is a text that says:
    Corporate Marketing Materials (which when clicked expands to some pdfs)

    Now i want to hide this Corporate Marketing Materials contents. As you can see it still shows. And thats the issue i have. Do you know a way to hide this content ? Thanks

  11. bcworkz
    Member
    Posted 1 year ago #

    I guess you've put the redirect back in, because I don't see that page any more. That's OK, I don't know where the fields are coming from anyway. You can literally hide the fields with CSS, but the data is still sent to the user's browser, so I doubt that will satisfy you.

    To prevent the fields from being sent to not logged in visitors, locate the code that is outputting the content and enclose it in a conditional that checks is_user_logged_in(). Like so:

    if ( is_user_logged_in() ) {
       // existing code that outputs custom fields
    }
  12. sonamlucky
    Member
    Posted 1 year ago #

    hi yes i changed it. i just blocked the whole site as of now if the user is not logged in they dont see any content.
    Many Thanks for your help.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags