Membership not fully assigned in some cases

We have some instances where membership doesn't appear to be assigned fully.

When viewed in 'All Members', the correct membership is assigned to the user, but when they login, they do not have access to the functionality that they should have, e.g. menus specific to the membership (through protection rules).

Also, when viewing the membership page, instead of seeing the option to 'cancel' their membership, they see 'signup'

Could you please have a look at this?

  • Jude
    • DEV MAN

    Howdy @Johanna

    Thanks for getting in touch. I took a look at the site and created a account for myself. Can you tell me specifically which membership has the issues you described and also maybe links to protected pages not accessible to them ?

    Cheers
    Jude

  • Michael Bissett
    • Recruit

    Hey @Johanna, Michael here!

    I tried replicating this on my own site, as well as yours, but I found myself unable to replicate this, I'm able to access the content protected by the membership on both sites.

    In looking at those two members you mentioned on your site, I'm not seeing a particular pattern yet as to what's causing them to not be assigned memberships, may I ask if any other examples exist?

    And when did this behavior start to occur?

    Please advise,
    Michael

  • Johanna
    • The Incredible Code Injector

    Hi Michael,

    The problem is occurring in about 1 and 40 registrations. These two users registered on the 10th October and 21st November

    There are no error messages in the log files corresponding to the registrations, so really very little to go on.

    We had one more case earlier in the week which I corrected by removing and re-assigning the membership in Admin, which clears the problem.

    Thanks,
    Johanna

  • Jude
    • DEV MAN

    Hey @Johanna

    Can you please check your PHP error logs and also the MySQL logs during those times for anything strange ? Im guessing that for some reason the assign operation was not successful the first time round. The logs should give us the exact issue

    Cheers
    Jude

  • Johanna
    • The Incredible Code Injector

    Hi Jude,

    As I stated in my last post: we cannot find anything in any error logs that correspond to the problem.

    We have just has another user - 367 - who registered on the 17th November. I have tried to re-set their membership in admin by removing and re-assigning the relevant membership, and that is still not set properly. The menu item is not showing, although the membership options is now showing 'cancel' rather than sign-up. Maybe this is one we can have a look at?

    I have changed the email & username for this user so that the actual user can sign up again from scratch, leaving this user ID for investigation purposes

    Kind Regards
    Johanna

  • Michael Bissett
    • Recruit

    Hey @Johanna,

    Since you mentioned that this started on the 10th of October, may I ask if you made a particular change around that time to your site?

    We're trying to narrow down just what the cause of this behavior might be, as looking at the user presently shows that the "what", but not the "why".

    I'd also ask if your host has some logs of their own, seeing as the logs that you have access to aren't revealing anything (though I would still be curious to know what entries existed around the time of user 367 registering, if you can share that to pastebin.com, and post the link here).

    Kind Regards,
    Michael

  • Jude
    • DEV MAN

    Hey @Johanna

    Also can I ask if you can turn on logging at this point going forward for atleast a week ?

    At 2 points, one being the DB, to check if an update operation to the ms_* table failed

    http://stackoverflow.com/questions/6479107/how-to-enable-mysql-query-log

    This is to specifically file to see if the handler may crashes before the membership is assigned

    https://digwp.com/2009/07/monitor-php-errors-wordpress/

    Let me know if this is possible to do

    Also Happy Thanksgiving

    Cheers
    Jude

  • Johanna
    • The Incredible Code Injector

    Hi Michael, Jude

    No big mystery around the 10th October - that's when users were given access to the website to start registering. The first problem user we identified was id 14.

    I had a lengthy conversation with my hosting company yesterday before my last post, and there are no additional error logs that we have not investigated. The only errors in the error log around that time is https://premium.wpmudev.org/forums/topic/fatal-error-adding-membership-class-ms-addon-searchindexphp-on-line-286 of which we get hundreds a day, but the errors are all reported against Google Bot's IPs

    I'll enable logging as requested, but cannot guarantee we'll get something within the week.

    Kind Regards
    Johanna Heath

  • Johanna
    • The Incredible Code Injector

    I have managed to reproduce the problem, but unfortunately I didn't have any logging switched on at the time.

    I only completed the first part of the sign-up, i.e. the registration. I never got round to 'Join Membership'. Looking at all members, the membership is assigned against the user, but the privileges have not been assigned

    I don't know if this helps at all.

    Kind Regards
    Johanna

  • Michael Bissett
    • Recruit

    Hey @Johanna, really sorry for the delay here!

    Before we go any further, could you please try updating to version 1.0.2.4 of Membership 2 Pro, and seeing if that helps?

    If not, then to continue on this point:

    I only completed the first part of the sign-up, i.e. the registration. I never got round to 'Join Membership'. Looking at all members, the membership is assigned against the user, but the privileges have not been assigned

    I see that you've removed the "Username" field, which is currently preventing me from testing this on your site, but may I ask what you got after clicking on the "Register My Account" button? If you didn't see the page with the "Join Membership" button (which would also include an invite code field, if I recall correctly), what page did you see?

    And I'm seeing that support access has expired for freelancedietitians.org, could you please re-enable it?

    Thanks! :slight_smile:

    Kind Regards,
    Michael

  • Johanna
    • The Incredible Code Injector

    Hi Michael,

    I have enabled support access again.

    1.0.2.4 was installed on the 1st December, before my post where I encountered the problem.

    Username has always been disabled - It is taken from the email address. Feel free to use dummy email addresses within my own domain for test purposes if you need to.

    I cannot remember what I saw after the initial registration, but I very definitely didn't enter an invitation code. A few users have reported something similar - about not entering the invitation code, but I put it down to them being confused!

    I went to a different browser (trying to replicate a scenario where users don't do the whole registration process in one session). When I logged in on the second browser, I didn't have the option to sign up to the membership as I had expected.

    I tried about 15 times to replicate the problem again, following the same steps but to no avail.

    Interestingly, one user has had the same problem more than once when registering.

    Kind Regards
    Johanna

  • Michael Bissett
    • Recruit

    Hey @Johanna,

    Ah okay, I see you've also got http://www.freelancedietitians.org set up as a registered site, that'd explain why I saw a different version of Membership 2 Pro coming up here (as freelancedietitians.org was the address tied to the thread).

    Looking into this, when I tried registering initially for your FDG Members membership (testing with testweasel@freelancedietitians.org as the email address), I ran afoul of a spam filter provided by the "Anti-Spam by CleanTalk" plugin (had to remove the address from the blacklist first). Perhaps you ran into that before?

    (I did notice that the CleanTalk plugin is a few versions behind, I'm curious if updating that would help with things)

    Once I got past that spam filter though, I was able to enter an invitation code, and afterwards register for your membership successfully, afterwards being able to access your content.

    I tested this inside of Google Chrome, may I ask what browsers you've tested with so far?

    Please advise,
    Michael

  • Johanna
    • The Incredible Code Injector

    Hi Michael,

    There is only one site - I changed the URL a few days ago for unrelated reasons.

    Spam Cleantalk is at an older version of the plugin because the latest version was letting through spam registrations. Reverting to the older version got rid of the problem. The issue has been raised with Cleantalk support. This is ongoing.

    As per one of my other support posts, https://premium.wpmudev.org/forums/topic/login-issues-on-internet-explorer-please-wait#post-993810, we seem to be having problems with Internet Explorer - please refer to that post for more detail. Chrome seems to be OK but we cannot dictate the use of Chrome. I've also tested Firefox & Safari

    Most of the time users are able to register without a problem, but out of 140 we've had about 10 instances of the problem reported in this post.

    Kind Regards
    Johanna

  • Michael Bissett
    • Recruit

    Hey @Johanna,

    Since you mentioned Internet Explorer 11, I just tried registering for your site with that browser (twice), curiously enough, though, it worked just fine for me. :disappointed:

    I'm thinking that we'll want to have a deeper look at what's going on here, could you please send in the following via our secure contact form:

    - Mark to my attention, the subject line should contain only: ATTN: Michael Bissett
    - Do not include anything else in the subject line, doing so may delay our response due to how email filtering works.
    - Link back to this thread
    - Include WordPress admin access details (login address, username & password)
    - Include FTP log-in details (hostname, username & password)
    - Include any relevant URLs for your site

    IMPORTANT: Please make sure you select "I have a different question" for your topic, so it doesn't go back to the forums - this and the subject line ensure that it gets assigned to me.

    https://premium.wpmudev.org/contact/

    Thanks a bunch! :slight_smile:

    Kind Regards,
    Michael

  • Johanna
    • The Incredible Code Injector

    Hi Michael,

    I have done.

    It works 95% of the time - that's what makes it so frustrating! Unfortunately we can't let it go, especially coupled with the login issue, as we're hoping to roll this functionality out to a much wider audience

    Kind Regards
    Johanna

  • Michael Bissett
    • Recruit

    Hey @Johanna,

    I agree, this is definitely a frustrating situation. In looking at this further, it's looking like something that we'll want to call in our second level support staff for, to get their insight on the matter.

    I've gone ahead and flagged them for you, though I should note, that with the type of tasks they handle, their response can be longer than a normal support response.

    Kind Regards,
    Michael

  • Predrag Dubajic
    • Support

    Hi Johanna,

    Responding here due to the mention of the ticket his this discussion:
    https://premium.wpmudev.org/forums/topic/membership-2-pro-error-500-on-paging-through-archives-when-membership-pro-is-enabled#post-1368135

    Is this issue still happening at the same rate as before?
    It seems to me that this could be cache related since the issues are happening at random intervals.
    Do you have any server-side caching and if you do can you try disabling it temporarily to see if the issue will happen to any of the members during that time?

    Best regards,
    Predrag

  • Johanna
    • The Incredible Code Injector

    This was happening long before we had any caching enabled on the site. I would say the incidence is about the same ratio as before, given that we have fewer members signing up now.
    How would you suggest that caching has anything to do with it, or is it just a stab in the dark?

  • Predrag Dubajic
    • Support

    Hi Johanna,

    Issues like these that are not consistent are usually related to caching because of the code executed from the plugin is the same for everyone, so if there was an error directly in one of the functions it will not work for anyone.
    So what can happen is that certain data is stored by caching and thus affecting only some users.

    When you say that you didn't have any caching on site you are referring to caching plugins, is that correct?
    Do you have any caching directly on your server and would it be possible to temporary disable that?

    How would you suggest that caching has anything to do with it, or is it just a stab in the dark?

    If the issue is not consistent so we can't replicate it on either on your end or ours we have to check the stuff that is known to cause similar issues.

    Best regards,
    Predrag

  • Johanna
    • The Incredible Code Injector

    Hi Pedrag
    Yes, I am referring to caching plugins. We have never used server caching.
    The symptoms of this problem is as follows: Once the user has signed up for their selected membership, this membership would show against their user, but they would not have the permissions associated with the membership, e.g. specific menu items. Access to this is set through Membership II protection rules. So to me, it looks like the process (behind the scenes) of setting up the membership was interrupted for some reason.
    Users signing up would typically be totally new to the website, and especially so when we first set the website up.
    The rate of sign-up to the membership has now decline from the original numbers when the website was established, so instances are less frequent.

  • Adam Czajczyk
    • Support Gorilla

    Hi Johanna

    Thank you for this additional explonation.

    The Membership 2 Pro is not assigning any permissions (e.g. to the specific menu or page) to the user who signed up as a member. The way it works is slightly different: the information about the membership is assigned to the user account. If it shows that the user is an active member of the specific membership, that means that this user should have all the necessary access already and there's no "missing permissions".

    The "permission check" happens "on the fly" when a user attempts to visit/check specific protected content (e.g. menu). Only then, before displaying it, the plugin is checking which user is requesting that content, then checks what membership(s) that user is a member of and compares that with the list of memberships that should be allowed to access that content. If that comparison is positive the content is being served.

    That's why in most cases issues like this are actually related to some sort of caching - when the "cached" content is served, there's no "check" performed and, depending on what's actually been cached (and sometimes some other influences of some other plugins), wrong - e.g. protected page - content is served or the user is not recognized as a member.

    However, while this is the most common reason, there's always a chance that something else is interrupting here. Would you mind enabling support access to the site in question so we could take a closer look at its configuration - to see if we could spot something that could possibly be involved?

    To enable support access, go to the "WPMU DEV -> Support" page in your site's back-end, click on "Grant support access" button and let us know here once it's done.

    Best regards,
    Adam

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.