Compatibility with Membership2Pro

Hello,
There is a problem I am having with the Oneall WordPress plugin. Whenever signing up with a social network, a membership is not automatically assigned. This looks really bad when a user visits the account page and it looks like they did not register at all. Can someone from the Oneall team please review this thread opened with WPMU DEV to see if a solution to fix this problem can be reached?

Thread URL: https://premium.wpmudev.org/forums/topic/compatibility-between-membership2pro-and-oneall-social-login

Thanks.

Best Answer

  • Fred_PinelFred_PinelMember
    Answer ✓
    Hi,
    Linking accounts by matching email address is a feature that is activated with this plugin setting: If the user's social network profile has a verified email, should we try to link it to an existing account? (so, it is normal, and can be disabled).
    To unlink, click on the Twitter icon in your profile.

    The warning can be removed with this:
    function modify_registration_redirect($redirect_to, $user_data) { error_log('OA registration redirect to: '. $redirect_to); return $redirect_to; } add_filter ('oa_social_login_filter_registration_redirect_url', 'modify_registration_redirect', 10, 2);
    Regards.

Answers

  • I ended up creating a default membership so that it would be auto assigned to everyone. The problem is that OneAll seems to sort of bypass the normal user creation system.
  • Hello,
    I understand that. What is the solution?

    Thanks.
  • Hi,
    Copied over from your post at WPMU DEV:
    Can compatibility be added so that when someone logs in with OneAll and it is a new account, that they are redirected to the membership page to sign up with a membership? Or if no membership is picked on sign up, can the default free one be automatically assigned?
    In the Oneall plugin setting, you can redirect new users to a URL of your choice. Maybe you can find the membership page URL and set it there.
    Setting a default membership is feasible, because there are hooks you can use. That would require to look into the membership pro plugin, which can do to some extent.

    Let us know what you prefer, and if the redirect URL to membership works for you.

    Regards.
  • Hello,
    The page redirect feature is not working and here is why it will not. When a user clicks the Login link and completes the social login process, the site is setup to automatically return the user to the referring page. I do not think the plugin has enough priority over my code to instead redirect to the memberships page.
    We will have to use hooks, sorry.

    Thanks.
  • Hi,
    Ok then. What is tricky is that we're interacting with other code.
    So, do you know how (a hook?) the current redirect to referring page occurs?
    There are several Oneall hooks, plus the standard ones (plus perhaps other modules'), you could use. We need to identify one that is triggered before your current redirect.

    For information, here are Oneall hook triggers, in order, for registration:
    - filter: 'oa_social_login_filter_new_user_fields' before user insert
    - action: 'oa_social_login_action_before_user_insert'
    - the standard wp_user_insert() actions and filters
    - action: 'user_register'
    - action: 'oa_social_login_action_after_user_insert'
    - action: 'oa_social_login_action_before_user_login'
    - action: 'wp_login'
    then the redirect hooks, which may not all get executed:
    - filter: 'registration_redirect'
    - filter: 'oa_social_login_filter_registration_redirect_url'
    - action: 'oa_social_login_action_before_user_redirect'
    then the redirect call (which you report is not executed)

    Regards.
  • Hello,
    I have no idea really even how to code. This does not help me.

    Thanks.
  • Hi,

    Do you know how the site is setup so that it redirects to the referring page?
    We'll see if we can reproduce this error with the free trial of membership2 pro.

    Regards.
  • edited April 2016
    Hello,
    I used these functions in header.php.

    <a href="<?php echo wp_login_url( get_permalink() ); ?>" title="Login">Login</a> <a href="<?php echo wp_logout_url( get_permalink() ); ?>">Logout</a>

    Thanks.
  • Hi,
    Thank you.

    The filter below should allow you to modify the redirect URI for new users registering with Oneall.
    You add this code to the theme functions.php file (accessible via the admin: Appearance | Editor | Theme functions).
    The example filter below just logs (debug.log) the redirect URI.
    We can check that the Oneall login process reaches this point.
    function modify_registration_redirect($redirect_to, $user_data) { error_log('OA registration redirect to: '. $redirect_to); return $redirect_to; } add_filter ('oa_social_login_filter_registration_redirect_url', 'modify_registration_redirect', 10, 1);
    If this does get executed, then you would need to point to the Membership URI you wish.

    Regards
  • Hello,
    I got the following error on redirect.

    Warning: Missing argument 2 for modify_registration_redirect() in /public_html/wp-content/themes/wpex-thoughts/functions.php on line 430

    Warning: Cannot modify header information - headers already sent by (output started at /public_html/wp-content/themes/wpex-thoughts/functions.php:430) in /public_html/wp-includes/pluggable.php on line 1228

    Thanks.
  • Hello,
    I give up with this. To much coding. Also some how my Twitter picture is now attached to my account just because it is the same email address. Tried disconnecting Twitter, did not work, revoked access in Twitter settings, did not work. I will not put my users through this, I deactivated the plugin. If you wish, please delete my account.

    Thanks.

Welcome!

Please sign in to your OneAll account to ask a new question or to contribute to the discussions.

Please click on the link below to connect to the forum with your OneAll account.