Registration completed page linked to from PayPal doesn't work after upgrading to Membership 3.

Hello. I just upgraded to Membership 3.5.1.5. This worked fine using version 3.5.1.4, but now does NOT work using version 3.5.1.5.

In my Membership > Options > Membership Pages, I have the Registration Completed Page set to a page called "My Membership Benefits"

I registered for an account on the website and then went to PayPal and completed the purchase for the membership. On the PayPal confirmation screen there are two buttons. One button leads the PayPal Account Overview. The other button returns the user to my website.

Clicking the button to return to my website leads to a page that shows a protected content error. The URL is bizarre. Here it is below. I left out my domain in the URL, but left the name of the page in it. It looks like it tries to send the user to the My Membership Benefits page (which I have set in the Options > Membership Pages as I explained above) but fails.

http://mydomain.com/protected/?redirect_to=http%3A%2F%2Fmydomain.com%2Fpremaccess3%2Fmy-membership-benefits%2F%3Fauth%3DAkCpFWqzRnj.O5Fxweb..Xr48T.x4m5M4I2k82BkADEHbCD6BXaWVQ6jp0Am6-G4rGq0JJVDabd-sPjQ3gSYNvg%26form_charset%3DUTF-8

Before I upgraded from 3.1.3.4 to 3.1.3.5, this worked fine and it would send me back to the My Member Benefits page fine. But now after upgrading it does not work and sends me to a page with a protected content error. After landing on that protected content page, if I manually enter in the URL to the My Membership Benefits page, the user is able to see the page fine. The problem is with the PayPal sending the user back to my website after clicking on the Return to Website button on PayPal after purchasing the membership.

Please help!

Thank you,
Nick

  • PC

    Hello there Nick,

    Thanks for posting on the forums.

    There have been a few bugs fixed in the latest version so we can not deny the possibility of an error. However just to make sure that its a bug and give us a right direction to work in, can you kindly downgrade to the older version of Membership plugin (download here : https://premium.wpmudev.org/download/1776073437_membership-3.5.1.4.zip ) and let me know if that works fine ?

    You can take a backup, remove the current version of the plugin and upload the older version.

    Please advise if that fixes the issue !

    Cheers, PC

  • Nick

    Hello @Mac, I have been using version 3.5.1.4 since the first day it came out weeks ago and have purchased a ton of memberships with PayPal using version 3.5.1.4 and clicking that return to website button has always returned me to the correct page. I will downgrade if you want me to, but I don't understand what that will show if I have already had success with this using 3.5.1.4 from weeks ago up until a few hours ago.

  • Nick

    Hi @Mac and @Rheinard,

    I have more details about this. I don't think it has anything to do with PayPal.

    Now when I log in as a user in the Pending Membership subscription, I get the protected content page if I try to access the My Membership Benefits page whether I click the link from the PayPal confirmation screen OR if I just enter the full URL to the My Membership Benefits page.

    For some reason, the plugin won't let any users in the Pending Membership role access the My Membership Benefits page. I have a bunch of access level shortcodes on that page to show different things to different subscriptions. I have some very specific content to be displayed to the users in the Pending Membership role. But they never get a chance because my website is sending them directly to the protected page redirect when trying to go to the page.

    This works fine in 3.5.1.4. Do you know what happened in 3.5.1.5 to not allow Pending Membership users to get hit with that protected page error when trying to go to the My Membership Benefits page?

    Thanks,
    Nick

  • Rheinard

    Hi @Nick,

    I found the cause. Its not so much a bug as a behaviour issue. The behaviour is that when a user registers with an actual subscription, then the "
    Registration completed page" will be viewable. If they have not registered for a subscription then it will be a protected page.

    This behaviour may not be entirely what you want by the sound of it. We've had this as a request from a number of users who use the "
    Registration completed page" to provide restricted content to members.

    I will flag this as an option to be included in 3.5.1.6 so that this can be an option to protect the "Registration completed page" or not (your case).

    If you're comfortable with code, to fix this issue for you immediately you can go to /membership/classes/Membership/Module/Protection.php and remove the following code from line 180 to line 184 (please don't remove anything else or protection will break).

    Remove:

    // If welcome page then redirect.
    if ( isset( $M_options['registrationcompleted_page'] ) && $post->ID == $M_options['registrationcompleted_page'] && ( !is_user_logged_in() || !Membership_Plugin::current_member()->has_subscription() ) ) {
    	membership_redirect_to_protected();
    	exit;
    }

    Or just replace this file with the one attached.

    Sorry for the confusion.

    Cheers,
    Rheinard

  • Nick

    Hi @Rheinard,

    Thank you for the fast response! I will test this now. It's weird that this worked fine for the past few weeks using version 3.5.1.4. I only ever encountered this issue after installing 3.5.1.5. In my website, I have access level shortcodes on the "Registration Completed Page" to control what subscriptions can see and what they can't.

    I think the reason why this is confusing is because to purchase a membership on a website using your plugin, two things must happen:
    1) The user must register for an account.
    2) The user must purchase a subscription.

    To me, the "Registration Completed Page" means the user registered for an account (completed step 1) but did NOT yet purchase a subscription. I know that's not how you use this page, but there has to be something for users who register an account but do NOT purchase a subscription. You know what I mean? There is nothing stopping the user from registering for an account and then leaving the site without purchasing a membership. It's two separate actions.

    And I can tell you the reason why the user gets the protected content page right after completing the purchase on PayPal is because it takes a few minutes for PayPal to notify the plugin that the user completed the purchase. So after a user completes the purchase on PayPal and then immediately clicks the button on PayPal to return to the website, the user will get the protected content page because PayPal has not yet notified the plugin the user paid.

    We are talking a matter of minutes, but I have to imagine other users must be experiencing this as well? For this situation, because of the lag between PayPal notifying the plugin the user paid and the user returning to the website, there has to be an option not to make that registration completed page protected. Do you see what I mean?

    If you haven't guessed form all these posts over the last few months, in my full time job I am the QA lead for a software company lol. I hope I am more of a help than a pain to you :slight_smile:

    Okay I'm off to test this!

    Best,
    Nick

  • Nick

    Hi @Rheinard,

    Your solution of commenting out those 4 lines of code worked. Great job identifying it so quickly! I am going to stay with version 3.5.1.5 since I know there were other bugs fixed with it.

    My other issue about cancelled users getting their premium access back after stopping payment with PayPal is still an issue, and was for the past few versions (https://premium.wpmudev.org/forums/topic/members-automatically-gain-back-premium-access-some-time-after-cancelling-their-account)

    I know you are busy so I will await your feedback on that issue.

    Thank you as always! Again, fantastic job figuring out a temporary fix to the issue on this thread.

    Best,
    Nick

  • Nick

    Hi @Rheinard,

    If I could ask you two quick questions I have been having a hard time understanding. These are 2 quick clarification questions that I want to make sure I understand so I can officially rule them out as causes to the Issues I am experiencing my site.

    #1) Subscription Mode and Period
    I have the Pending Membership subscription's mode set to "Indefinite" and the "Period" set to "1 Day" If the mode is set to "Indefinite", then it doesn't matter what I choose for the Period, right?

    I assumed having the Mode set to "Indefinite" meant the user would be stuck in that subscription forever UNTIL the user decides to purchase a membership through PayPal. Is that true?

    #2) Settings for Membership Renewal and Membership Upgrades
    Under Membership > Configuration, I have both the "Membership Renewal" and "Membership Upgrades" set to the max of 365 days. Knowing how my site works, does this setting affect anything on website? Should the number of days they are set to be something different?

    As you know, I do NOT allow upgrades on my site. Once a user registers for an account they are placed in the Pending Membership subscription. And then once they purchase a membership, they get moved to the Player's P**** Membership. That's it. They cannot upgrade or downgrade. Can you confirm these two settings are ONLY for websites that allow upgrading and downgrading, thus it does not matter what number of days I use for those two fields?

    You wouldn't consider a user moving from the Pending Membership (which is the default subscription for registered users) to the paid subscription of the Player's P**** Membership an "upgrade" (thus abiding by the values of those two fields) right? An "upgrade" or a "downgrade" with the Membership Plugin is if there are different access levels within a subscription, right?

    Thank you,
    Nick

  • PC

    Hello Nick,

    Thanks for posting back.

    I am sorry to ask you to do extra work, however I will request you to kindly post those new questions on a new thread so that we can avoid any confusions.

    Generally when we keep asking and answering different questions in a single thread, after a few iterations, the thread becomes so complex that its hard to identify what is going on and it impacts the quality of support we can provide.

    I hope you understand that. Please feel free to ask if you have more questions on the original topic and we are standing by to answer your other questions on a new thread :slight_smile:

    PS: Both of those questions are explained in the manual here : https://premium.wpmudev.org/wp-content/uploads/2010/05/Membership-Manual3450.pdf

    Page 61 Of 72
    &
    Page 29 Of 72

    Cheers, PC

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.