Membership 2 registration not working with yoast active

When user submits a registration, the page keeps loading but never redirect to the thank you page.
Memberships registering and checking out...I was getting complaints it was taking too long to register and would not checkout. Same issue when user click the orange checkout buttons after they are logged in here too https://domain.com/memberships/

see the videos:
https://www.screencast.com/t/NhpJCKJ1MWb6
https://www.screencast.com/t/frOThwWXIMs
https://www.screencast.com/t/D0n5u7He7cF0

  • Greg
    • The Exporter

    Paul Kevin

    Thanks. But, when looking at this https://github.com/Yoast/wordpress-seo/issues/8218 I am not sure if it is the same issue or just a parrellel issue.

    For us, it prevents proper registrations for M2P at /register and prevents checkouts too at /memberships .

    Who knows what else as well . . .

    It the git thread, "benvaassen" mentioned this "You can also contact the developer of the plugin and they can also create a PR if the issue can be fixed in our plugin." What is "PR" and are you able to do this to fix for the interim so we can turn Yoast back on?

    Then, on down the page I see you mention "Hello @benvaassen,

    Thank you for the response. I am currently working on the plugin at WPMU Dev. I will try and see if I can add a workaround for this. The error in the logs you shared seem to be a php config and can be adjusted by increasing the value of xdebug.max_nesting_level ." which was before (about 24 hours ago) the issue I just mentioned less that 12 hours ago.

    Will you folks at WPMUDEV be able to push out a work around on the git issue and this issue I have reported to be compatible with the current version of Yoast? When can they be done?

    We Yoast off, there is no sitemaps and cause may other SEO issues as you know.

    Can this and any other Yoast related issue be expediated please for the sake of us and all of the WPMUDEV members using M2P (as Yoast is on most sites and likely effecting a lot of people)?

    Thanks Paul.

    Please let me know ASAP what the plan is and a ETA?

    :slight_smile:

    Greg

    • Paul Kevin
      • Neo

      Hello Greg ,

      Hope you are well today. Unfortunately there is no patch that can be done in Membership 2 as the issue on Yoast affects the saving action of custom post types. This affects registration and creation of invoices and has also been seen to affect other plugins as https://github.com/Yoast/wordpress-seo/issues/8226 and https://github.com/Yoast/wordpress-seo/issues/8101 . Since Membership 2 uses custom post types, we can only hope that the issue is fixed on Yoast in the next release.
      I am currently working on improving and speeding up Membership 2. The next release will focus on fixing major bugs after which I will be working on custom database tables to increase performance (since using custom post types can be an issue especially when the number of members are many)

      I understand the frustration many members are facing with this, and I will continue trying to look for a workaround on this. Hopefully Yoast release a quick patch soon.

      Warm Regards
      Paul Kevin

  • Greg
    • The Exporter

    Paul Kevin Thanks for this info and insight! It is very much appreciated!

    Do you and WPMUDEV have any extra influence to speed Yoast along letting them know how important it is?

    Do they have a sense of urgency on this considering it is affecting other popular plugins like Woo etc?

    Again . . . thank you!

    :slight_smile:

    Greg

    • Paul Kevin
      • Neo

      Hey there Greg ,

      You are most welcome. I'm not sure we have any extra influence but from the tickets I have seen, Yoast are actively on the issue. Once again I would like to thank you for your patience on this matter :slight_smile: and thank you for your feedback on the matter.

      Warm Regards
      Paul Kevin

  • locomo
    • The Incredible Code Injector

    hey Paul Kevin

    for us the issue is manifesting in hundreds of duplicate invoices being created when a user signs up for a subscription - problem goes away when Wordpress SEO is disabled

    I have an idea about why this might be happening .. let me know what you think:

    the short version is that I think its not ideal for M2 to call wp_insert_post in the context of the_content filter

    in class-ms-controller-frontend.php the payment_table step is rendered by filtering the_content
    $this->add_filter( 'the_content', 'payment_table', 1 );

    in function payment_table the initial invoice is created by way of $invoice = $subscription->get_current_invoice();

    and a new invoice is ultimately created by calling wp_insert_post

    the problem is that other plugins (like Yoast) can hook save_post which can cause an infinite loop to occur

    for example in:
    https://github.com/Yoast/wordpress-seo/blob/trunk/admin/links/class-link-watcher.php

    Yoast hooks save_post which gets fired when M2 calls wp_insert_post. This Yoast hook ultimate calls $content = apply_filters( 'the_content', $content ); which then initiates another call to function payment_table in M2 and causes the infinite loop in M2

  • locomo
    • The Incredible Code Injector

    it seems like

    $this->add_filter( 'the_content', 'payment_table', 1 );

    should be used to manipulate the display of the payment table .. but shouldn't perform any logic around post creation etc .. the creation of the new invoice could be done with a hook that runs earlier

    • Paul Kevin
      • Neo

      Hey locomo ,

      Hope you are well. I do agree on this, the creation or database related matters should not be handled in "the_content" but from the logic of the step, it does this to ensure a valid response is returned after the step. I found out that in Yoast it only does the check for public posts. So setting the invoice post type to private removes this check in Yoast, but I think it still slows down the process.
      I will run afew tests on separating the save process in the payment table step and get back to you :slight_smile: (currently working on speeding up load time for many subscribers in the plugin and its coming up well)

      Warm Regards
      Paul Kevin

  • Greg
    • The Exporter

    Paul Kevin

    I am the original poster and have been busy and just seeing all this. My Yoast is still disabled. From the original post/issue, can you give me a update and did Yoast and/or you (with M2P) 100% fix this so I can enable it back now?

    In the meantime, I will review the replies too . . .

    Thanks in advance . . .

    Let me know?

    :slight_smile:

    Greg

    • locomo
      • The Incredible Code Injector

      hey Greg .. Yoast hasn't updated their plugin yet but there is an open issue on github about it

      however, i was able to reactivate Yoast without any problems after switching the file 'zip class-ms-model-invoice.zip' that Paul provided earlier in this thread

  • Greg
    • The Exporter

    Paul Kevin Is this https://premium.wpmudev.org/forums/topic/membership-2-registration-not-working-with-yoast-active#post-1286514 .zip file something we will have to remember every time there is a update to the M2P plugin? Or, have you added this fix into the subsequent versions of M2P so this will never happen again?

    How is it coming with increasing overall process speed etc?

    When is a general update coming with new enhancements on a permanent fix for the above workaround zip file in the link above and speed improvements etc?

    :slight_smile:

  • Kevin Knowlen
    • Flash Drive

    Hello all,
    I was experiencing the same issue as mentioned above, as of today. It does not sound like this thread is closed, or that the final fix has been made, so I thought I would chime in on what seemed to fix it for me. Having read everyones comments above that there is a problem with the Yoast Plugin, I did some experimentation, and what seems to work for me is that if you go into Yoast menu for titles and metas, and scroll to the bottom there are options for membership2 memberships, memberships2 invoices, and for custom post types. I put noindex and hide for all the options regarding memberships2 and for the custom post types. This seems like it fixed the do-loop for me. However, I am not 100% certain, which of the settings fixed it. I don't really care about SEO on the Memberships pages, and don't have custom post types of my own that I need SEO for, so I disabled them all.

    I hope this helps someone else having the same problem.

    Warm Regards,

    Kevin

    • MC
      • Site Builder, Child of Zeus

      Hi Kevin,

      Thanks for sharing that information!

      I can confirm that there is a temporary fix that WPMU provided, and it is working. We're still waiting for Paul Kevin to include it in a revision of the plugin.

      To "band aid" the problem, download the zip class-ms-model-invoice.zip file (above in this thread), and then upload it to the /wp-content/plugins/membership/app/model/ directory.

      Best,
      Michael

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.