Membership 2 Pro login redirects when Chat plugin enabled

I want to use both Membership 2 Pro & Chat for support sessions with clients. They will be sent an invitation code to register using Membership 2 Pro.
When I have Membership 2 Pro activated, and Chat deactivated, the Membership 2 Pro login works correctly.
When I have Chat and Membership 2 Pro activated, users that try to login via the Membership 2 Pro login are redirected to the wp-login.php. They do get successfully logged in from the wp login page, however users have to enter their login details twice, and the desired result is for users to login via the Membership 2 Pro login.
I have tried disabling all other plugins, and this still happens when only Membership 2 Pro and Chat are activated. I have also tested with a default wp theme, and get the same result.
Is there a fix so that users can log in via the Membership 2 Pro login form when Chat is activated without being redirected to the wp-login.php?
I have grated support access.
Thanks for your help!

  • Kasia Swiderska
    • Support nomad

    Hello Debbie,

    Looks like we have a bug here. Membership do that redirect because Ajax script is not working - and it is not working because one of the Chats JS is throwing error:

    ReferenceError: wpmudev_chat_localized is not defined

    So one broken JS breaks other javascripts on the page.

    I'm marking this as bug and letting developer know about the problem. As soon I'll get fix for that problem I'll update post.

    kind regards,
    Kasia

  • Debbie
    • Webb Weaver

    Hi Panos

    Thank you for this fix, it solves the login problem!

    However, now the chat box does not display on the page after the user is logged in. When I switch back to the old wordpress-chat.php file the chat box displays, although there is still the problem of the user being redirected to the WordPress login screen.

    Thanks,
    Debbie

  • Debbie
    • Webb Weaver

    Hi Panos ,

    The chat box is not displaying again. I tried changing back to the original wpmudev-chat.js that's in the 2.2 version download, but that didn't help. I've now switched the file back to your above fix, and it's still not displaying.

    I've granted support access. Thanks!

  • Panos
    • SLS

    Hi Debbie ,

    I could replicate this too!

    It's the login_footer hook in the MS_View_Shortcode_Login::login_form that seems to be causing this. I removed it and it's working fine on my site now. So I have attached file
    wp-content/plugins/membership/app/view/shortcode/class-ms-view-shortcode-login.php

    which you can replace. I have simply commented out line 331 which should contain:
    do_action( 'login_footer' );

    If you prefer you can also comment this line out instead of replacing :slight_smile:

    Hope this helps!

  • Lindeni Mahlalela
    • Recruit

    Hello Debbie

    I hope you are doing great today.

    With regards to the 404 file not found on the page '/coffeetalk/' that might be because the page does not exist and so WordPress is considering the page to be a directory or a subsite of a multisite. If it is a page then make sure it exists, if it is a subsite in a multisite install then double check if you have the correct .htaccess as specified the time you were creating the network in "Settings > Network Setup" page. Please double check this as I have also had redirect issues when loading your website.

    With regards to the chat on login page, please replace the /wp-content/plugins/wordpress-chat/wordpress-chat.php with the one attached in the zip file.

    It is also a good idea to grant staff access so we can have a closer look if you are still having issues with regards to this. To grant staff access to your website, follow this quick guide: https://premium.wpmudev.org/manuals/wpmu-dev-dashboard-enabling-staff-login/

    Let us know how that goes and don't hesitate to ask if you need more help.

    Cheers,
    Mahlamusa

  • Lindeni Mahlalela
    • Recruit

    Hello Debbie,

    I am sorry the fix didn't work for you. As I was trying to login to your website using staff access I got logged out by the Defender plugin with the following error message.

    You have been locked out due to too many attempts to access a file that doesn’t exist.

    I have no way to get into your website except by temporarily disabling the Defender plugin. Would you please disable the plugin by going to your wordpress root directory and go to '/wp-content/plugins/' and rename 'wp-defender' to anything like 'wp-defender-disabled' and once we are sure I can get in then we can re-enable it.

    Would you please send in the FTP or cPanel login so we can do all we need to do without waiting for your reply. Please send the credentials through our secure contact form https://premium.wpmudev.org/contact/ like in the screenshot below, mark the subject "Attn: Lindeni Mahlalela"

    In the email include:
    - Alternate wordpress login
    - FTP credentials: host/port/username/password
    - cPanel credentials if possible login url/username/password
    - Link bank to this thread for reference

    Once I have received the credentials I will continue troubleshooting your website issues.

    Thank you for your patience as we resolve this issue.

    Cheers,
    Mahlamusa

  • Lindeni Mahlalela
    • Recruit

    Hello Debbie,

    I'm so sorry I forgot to mention that you should include database access like phpmyadmin of you do not have cPanel login. If you provide cPanel then that should be enough but if you don't have cPanel then include database login url, username and password in the email above. This is really important.

    Thank you for working with us in resolving this.

    Cheers,
    Mahlamusa

  • Debbie
    • Webb Weaver

    Hello Mahlamusa ,

    That site wasn't working properly today, so I needed to restore it to a backup from April 23 to get it working properly again.
    I've re-enabled support access, and I disabled the Defender plugin so you should be able to login now.

    I'm not sure if this is related, but since the problems have been related to a conflict between Membership & Chat it might be: on April 19 when I saw the chat not displaying, I also noticed that when you click on the home page to sign up the message displays "Registration is currently not allowed." I do have the membership set to require an invitation code, although when I turn that off the "registration not allowed" message still displays

    While I appreciate you wanting to really dive in to get this problem resolved, because of the site not working at all until I restored it to the April 23 backup, I'd feel more comfortable if you can first see if you can resolve the problem via support access.

    Thanks for your help!
    Debbie

  • Lindeni Mahlalela
    • Recruit

    Hello Debbie,

    Thank you for granting access again. I am sorry that you have to go through all that trouble because the site gets broken.

    I have gone through your website settings again and the Chat won't load because of one reason: The file '/coffeetalk/wp-content/plugins/wordpress-chat/wpmudev-chat-ajax.php'. As my colleague Panos mentioned above, most of the problems here have nothing to do with the Membership plugin, they are due to the file not found issue.

    See the screenshot below, the 'wpmudev-chat-ajax.php' file is not found with both Membership 2 and Chat plugins installed and activated.

    And still not found with Membership plugin deactivated. See below:

    I see the plugin will not work until this 404 issue is resolved. But unfortunately, nothing I can do from my side since I do not have all the access I need on the website.

    I have a question with regards to the settings on "Settings > General". I see the "WordPress Address (URL)" and "Site Address (URL)" are different and I was wondering if you have any special reason for doing such as this is usually the same.

    Is the 'coffeetalk' a real folder that is a subfolder in your 'public_html' and you have installed WordPress on this folder? if this is a real folder, what other files are stored besides this folder, is it another wordpress install or other website files?

    Would you mind sharing the .htaccess file for your wordpress install and would you give at least a screenshot of your website's root folder so we can have an idea of the structure of your install. I must say it is hard to work such situations with limited access.

    I hope this helps.

    Please enjoy your day further.

    Cheers,
    Mahlamusa

  • Debbie
    • Webb Weaver

    Hello Mahlamusa ,

    Thank you for all your detailed investigation. I wish I thought of this sooner, since it seems that have WordPress installed in a subdirectory (coffeetalk) is causing the 404 error. I try to install in a subdirectory whenever possible to help with security. Since this is a problem for this site, I've moved the installation to the root directory & that has solved the problem with the Chat appearing :slight_smile:

    I am still experiencing the problem of the message "Registration is currently not allowed" displaying on /membership-registration/, which you get to when you click on the home page to sign up.
    I set up an invitation code to send to clients so they can register. However, if this problem is not easily fixed I can get all my clients added & provide them with their username & password. They might prefer not to have to signup anyway.

    Thanks for your help!
    Debbie

  • Lindeni Mahlalela
    • Recruit

    Hello Debbie,

    I am very happy to know that the Chat issue has been resolved.

    With regards to the registration issue, would you please go to your WordPress dashboard and click on "Settings > General" and scroll to "Membership" option. Check the checkbox next to "Anyone can register", make sure "Subscriber" is selected for for "New User Default Role" then save the settings. See screenshot below:

    After that, try visiting the "/membership-registration/" page again and see if you have the same issue again.

    I hope this helps.

    Cheers,
    Mahlamusa

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.