BuddyDev

Search

[Resolved] POssible conflict with Snax/Bimber

  • Participant
    Level: Initiated
    Posts: 5
    Sigfrido Maina on #27986

    Hello, i’m using your plugin (which i awesome),
    i have a compatibility problem with the Snax plugin in Bimber theme.
    The redirections i have setup in Member Types do not work when using
    the login popup from Snax.
    I have contacted them but they replied me this:

    “In our plugin we have this line of code:

    $redirect_url = apply_filters( ‘snax_login_redirect_url’, $redirect_url, $user );
    so the fix should be to be easy, apply the Buddypress Member Types “login_redirect” filter on our “snax_login_redirect” filter but it’s not. Your plugin has no public API and I can’t access its function that way. Please get back to the plugin author and ask him how to apply their redirect call on our filter. He should be able to help with this.”

    Can you help me? thanks in advance
    Sigfrido

  • Keymaster
    (BuddyDev Team)
    Posts: 24211
    Brajesh Singh on #27993

    Hi Sigfrido,
    Thank you for using our member types pro.

    It seems they created an unnecessary filter instead of using the standard ‘login_redirect’.

    I still appreciate them sharing the code snippet for their filter.

    Please allow me to add compatibility and provide an update in 1-2 hours.

    Thank you
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 24211
    Brajesh Singh on #27996

    Hi Sigfrido,
    I had a look and need some clarification

    1. Please ask the Bimber support about this. In the code below.

    
    $redirect_url = apply_filters( 'snax_login_redirect_url', $redirect_url, $user )
    

    is $user Object or numeric id?

    2. To answer their question about public API:- We did not consider people of even name a basic filter like login_redirect to their own preferences. It is plainly incorrect semantics on their part.

    There is no harm in offering a public API in future for the same.

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 5
    Sigfrido Maina on #28015

    Thanks Brajesh, i’ll ask them and let you know asap πŸ™‚

  • Keymaster
    (BuddyDev Team)
    Posts: 24211
    Brajesh Singh on #28023

    Thank you. I am looking forward to it πŸ™‚

  • Participant
    Level: Initiated
    Posts: 5
    Sigfrido Maina on #28069

    Hi Brajesh
    here’ the reply from the people at Bimber:

    Hi,

    The $user is a WP_User object returned, on success, from wp_signon() function.

    Below the full code of that function:

    function snax_ajax_login() {
    $credentials = array();
    $credentials[‘user_login’] = filter_input( INPUT_POST, ‘log’, FILTER_SANITIZE_STRING );
    $credentials[‘user_password’] = filter_input( INPUT_POST, ‘pwd’, FILTER_SANITIZE_STRING );
    $credentials[‘remember’] = filter_input( INPUT_POST, ‘rememberme’, FILTER_SANITIZE_STRING );
    // Verify reCaptcha.
    $use_recaptcha = snax_is_recatpcha_enabled_for_login_form();
    if ( $use_recaptcha ) {
    $recaptcha_token = filter_input( INPUT_POST, ‘g-recaptcha-response’, FILTER_SANITIZE_STRING );
    $recaptcha_valid = snax_verify_recaptcha( $recaptcha_token );
    if ( ! $recaptcha_valid ) {
    snax_ajax_response_error( snax_get_recaptcha_invalid_message() );
    exit;
    }
    }
    $secure_cookie = is_ssl();
    $user = wp_signon( $credentials, $secure_cookie );
    if ( is_wp_error( $user ) ) {
    $message = $user->get_error_message();
    snax_ajax_response_error( $message );
    exit;
    }
    $redirect_url = filter_input( INPUT_POST, ‘redirect_to’, FILTER_SANITIZE_STRING );
    $redirect_url = apply_filters( ‘snax_login_redirect_url’, $redirect_url, $user );
    // Strip snax vars.
    $redirect_url = preg_replace( ‘/?’ . snax_get_login_popup_url_variable() . ‘.*/’, ”, $redirect_url );
    $redirect_url = preg_replace( ‘/’ . snax_get_login_popup_url_variable() . ‘.*/’, ”, $redirect_url );
    $response_args = array(
    ‘redirect_url’ => $redirect_url,
    );
    snax_ajax_response_success( ‘Log in successfull’, $response_args );
    exit;
    }

  • Keymaster
    (BuddyDev Team)
    Posts: 24211
    Brajesh Singh on #28071

    Thank you.
    I appreciate their feedback.

    I will post an update within couple of hours.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 24211
    Brajesh Singh on #28078

    Hi Sigfrido,
    Thank you for the patience.

    Please upgrade to 1.4.0 and let me know if it works or not?

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 5
    Sigfrido Maina on #28087

    Hi Brajesh,
    It works like a charm, brilliant!
    Thank you very much πŸ™‚

    Regards
    Sigfrido

  • Keymaster
    (BuddyDev Team)
    Posts: 24211
    Brajesh Singh on #28093

    Hi Sigfrido,
    Thank you for confirming. I am glad it works now πŸ™‚

    Regards
    Brajesh

The topic ‘ [Resolved] POssible conflict with Snax/Bimber’ is closed to new replies.

This topic is: resolved