Membership 2 causes weird WP behaviour

Installed Membership 2 Pro. Set up one SUBSCRIBER user with the membership that protects one category of posts. Defined to NOT show the admin bar to subscribers when logged in. Simple right? The menu shows "Member Content". When selected, the page prompts for a login, as it should.

1) When the SUBSCRIBER logs in the Account page shows up AND a BLANK admin bar. If the SUBSCRIBER then tries to get to the dashboard /wp-admin/ he'll get there and see what an EDITOR sees. That SUBSCRIBER could then edit, delete, create all sorts of havoc with Posts and Pages and some plugins!! But since the admin bar is blank, there is no way for that SUBSCRIBER to log out.

2) When the Membership 2 Pro is active and all users LOGGED OUT, the WP prompt "Edit this entry" on pages, or posts, or widget content is visible everywhere in the site (in all browsers). If you click on it, you are prompted to log in with the WP login screen.

3) When I deactivate the Membership 2 plugin all "Edit this entry" prompts disappear and when the SUBSCRIBER logs in via WP login, all he sees is his Profile as he should.

Sorry, it seems that every time I post something at WPMU it concerns some kind of a bug in your plugins. Perhaps I should get paid as a tester?
I have screen prints, but couldn't attach them here.

  • Tyler Postle

    Hey Pixeldrummer,

    Hope your weekend is going well!

    1) When the SUBSCRIBER logs in the Account page shows up AND a BLANK admin bar. If the SUBSCRIBER then tries to get to the dashboard /wp-admin/ he'll get there and see what an EDITOR sees. That SUBSCRIBER could then edit, delete, create all sorts of havoc with Posts and Pages and some plugins!! But since the admin bar is blank, there is no way for that SUBSCRIBER to log out.

    Do you have the member capabilities add-on activated? It sounds like the editor role may be linked to your membership and it's applying the editor's capabilities. I've tested this on my install and it doesn't give the editor capabilities unless I'm using the member capabilities add-on and instruct it too.

    As for the admin bar, when turning off the admin bar tools it should remove all the options. I do think that leaving a blank admin bar there looks a little off though, I'll message the developer and see if just completely removing the admin bar altogether is a possibility.

    If you are wanting to leave admin bar options there then it sounds like you may want to just have a customized admin bar instead and still have the logout option. Our Ultimate Branding plugin allows you to create a custom admin bar: https://premium.wpmudev.org/project/ultimate-branding/

    2) When the Membership 2 Pro is active and all users LOGGED OUT, the WP prompt "Edit this entry" on pages, or posts, or widget content is visible everywhere in the site (in all browsers). If you click on it, you are prompted to log in with the WP login screen.

    I'm not seeing this at all on my installation, it could be related to the member capabilities add-on as mentioned above. If you don't have that turned on then can you grant support access so we can have a closer look at your settings?

    You can grant support access via WPMU DEV > Support > Support Access > Grant Access.

    3) When I deactivate the Membership 2 plugin all "Edit this entry" prompts disappear and when the SUBSCRIBER logs in via WP login, all he sees is his Profile as he should.

    This may also be related to the member capabilities add-on as well. Same as above, if that already is turned off then please grant support access so we can have a closer look at your settings.

    Look forward to hearing back!

    Cheers,
    Tyler

  • Pixeldrummer

    Do you have the member capabilities add-on activated? It sounds like the editor role may be linked to your membership and it's applying the editor's capabilities. I've tested this on my install and it doesn't give the editor capabilities unless I'm using the member capabilities add-on and instruct it too.

    Yes I did have the Member Capabilities add-on active. I had this add-on active but did not yet configure anything with it. So, this add-on caused the SUBSCRIBER user DEFAULT to have Editor priveleges AND to show "Edit this entry" links everywhere when no users were logged in. When I deactivated this add-on the user privileges (SUBSCRIBER) were normal and the "Edit..." links disappeared. FYI, I only have Administrator and Subscriber users, so perhaps this add-on should be check further for bugs, because it should not give Subscribers added privileges and put 'Edit this entry' links on the site BY DEFAULT, just by turning it on.

    When you test this further turn on the Additional Automated Messages, Category Protection and Invitation Codes with that Member Capabilities and see if you can't duplicate this weirdness.

  • Tyler Postle

    Hey Pixeldrummer,

    Glad we found the cause of the issue there :slight_smile:

    I tested it further with the add-ons you mentioned active but I'm still not getting the issue. Would you mind granting support access then I can temporarily activate the add-on just to see the issue on your site? Could help me replicate it on my own or just see what the problem is. if not, I totally understand as you may not want that add-on activated again for any amount of time.

    If so though then just let me know and I'll have a closer look :slight_smile:

    Cheers,
    Tyler

  • Tyler Postle

    Hey Pixeldrummer,

    I checked the add-on issue and the reason it was doing what it was is because Bahai community membership was added to each user role, so new users were getting the abilities of all the roles.

    If you remove them then it will stop doing that and you can still use Membership capabilities if you need too :slight_smile: or just leave it deactivated if you don't need it at all.

    The site is excruciatingly slow too. Perhaps you'll have some insights. The site is only half built.

    The site is loading quite quickly for me right now. All pages look to popup within 1-2 seconds or so.

    Is there certain pages you find are especially slow? This could be a question for a new topic as well.

    We do have a good blog post on ways to speed up your site: https://premium.wpmudev.org/blog/5-quick-ways-to-speed-up-your-wordpress-site/

    Here are a couple other useful tools for optimizing a site:

    Speed test: https://gtmetrix.com/gtmetrix-for-wordpress-plugin.html

    Plugin performance tester: https://wordpress.org/plugins/p3-profiler/

    As usual, any further questions just let us know :slight_smile:

    Cheers,
    Tyler

  • Pixeldrummer

    Thanks for checking. I am confused though. I a membership is NOT assigned to Author, but is to Subscriber, does that mean that Author does have no access? That's not clear.

    I checked the add-on issue and the reason it was doing what it was is because Bahai community membership was added to each user role, so new users were getting the abilities of all the roles

    Your response on this is kind of strange. User roles separate access in WP. So how is it that your membership plugin assigns additional privileges to users who clearly are denied them in WP. That makes no sense. And in my case no NEW users were added, the users were there before I installed the Membership 2 plugin. Your plugin should not in any way be able to change WP roles. Can you explain that?

  • Tyler Postle

    Hey Pixeldrummer,

    The way the membership capabilities add-on works is that when a member has a membership with a user role selected for it then it adds the capabilities of the user role to the member, not the role itself. You won't actually see the user role change for the user, but they will have the abilities.

    For example, let's say your Bahai community membership was assigned to the "Author" role. Now, all members and all future of members that have that membership will be given the capabilities of the author user role. However, when you see the list of users, they will still have the subscriber role. It's adding the capabilities to the user, not changing the role itself in any way.

    It's important to note that only members of that membership would have the additional capabilities now. Not all subscribers.

    Does that clear things up? If you need any further explanation just let me know what you aren't clear on still and I'm more than happy to help :slight_smile:

    Cheers,
    Tyler

  • Pixeldrummer

    Sorry I am dense. So when I set up a membership I can activate the membership capabilities add-on and assign to that MEMBERSHIP a capability which in WP is called a role. So the membership carries that capability with it for ALL members who are assigned to it regardless of their WP role? And if the membership capability add-on is NOT active, all user roles revert to normal WP roles?

  • Tyler Postle

    Hey Pixeldrummer, no problem and don't worry, I had the developer explain it to me awhile back because I wasn't completely sure how it worked then either.

    Each WP user role comes with a set of capabilities. These are what allow and disallow them from doing certain actions within WordPress. ie. Subscriber role has a default capability of only "read", it can't do much; however, editor would have the capability of "edit_posts" among others so they can edit posts.

    When you assign a membership to the "editor" role, it means that when a user gets that membership they are now given the capabilities that the editor role has, so they would be given the "edit_posts", "publish_posts", etc. capabilities. Once they lose that membership or if the add-on is deactivated then those capabilities are removed again and they are back to just a regular user.

    So you're above description is accurate, just that capabilities aren't the same as user roles, capabilities are what user roles are made up of.

    If you still have any questions just let me know :slight_smile:

    Cheers,
    Tyler

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.