Facebook Connect keeps redirecting to the admin_url()

No matter if I select either choices in:

Ultimate Facebook settings -> Facebook Connect

I have checked allow users to register with Facebook, and Allow single-click registration checked.

Redirect on login: Site_Url selected.. nothing in the textbox, so it should redirect back to main page on login but instead it goes to the wp-admin.

I absolved the issue... it was in the wdfb_utilities.php-> I commented out the else return defined('BP_VERSION') line, and it was back to norm. I don't believe it was working with my version of buddy press which is currently Version 1.2.8. Might want to add options in the Facebook Connect to turn on off Buddypress check. I don't believe that version has the home_url defined, so it defaulted to admin.

Also a second issue I have is somehow the site still has two Facebook login buttons :S to see the issue in action mysendoff.com

Thanks in advance!

  • DavidM

    Hi mysendoff and welcome to WPMU DEV!

    Not sure what's occurring on your end but when I just logged in, using the basic login feature, I remained at the front page afterward.

    Perhaps that has to do with your being admin? If so, I imagine your admin account may be a special case. Users would still remain at the front page though. Would that work for you?

    I do see the 2 login buttons as well. I believe that may have to do with using the Connect widget as well as a login widget. Are you indeed using two different widgets?


  • mysendoff

    Hi David! :slight_smile:

    The issue was actually from this function in the wdfb_utilities.php:

    function wdfb_get_login_redirect ($force_admin_redirect=false) {

    $data = Wdfb_OptionsRegistry::get_instance();

    $url = $data->get_option('wdfb_connect', 'login_redirect_url');

    if ($url) {

    $base = $data->get_option('wdfb_connect', 'login_redirect_base');

    $base = ('admin_url' == $base) ? 'admin_url' : 'site_url';

    return $base($url);

    //else return defined('BP_VERSION') ? home_url() : $force_admin_redirect ? admin_url() : home_url();


    I commented out the else return, and it works as intended now. I think my current BP version might not have the home_url defined... not sure. But the commenting out that line makes the connect use the site_url, as selected in the settings.

    Just saying that maybe my version of the buddypress 1.2.8 isn't defining the home_url properly. But without that else statement it works fine now. That's what we wanted, the users to be able to login, but remain at the front page, which works as intended now.

    Yeah the two buttons been bugging me for a month now :slight_smile: has nothing to do with the update. This one is an old bug, I know its our site, just going crazy finding the little buggy.

    Thank you for your quick response! :slight_smile: I'm marking it as Resolved!

  • mysendoff

    Glad this helped someone else, drove me crazy too! :slight_smile: Just remember it won't break the plugin as all it does it tell it to ignore buddypress's url and use the admin or home one.

    The FIX would be that the plugin would need to know what version of buddypress it is, and if older than 1.2.8 to use admin or home. Or if the string version is empty, to use admin or home.

    Hope that helps the dev team as we all know they are always busy improving and fixing things!

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.