Login With Facebook On Any WordPress, WPMU, or BuddyPress Site Using WP-FB-AutoConnect

Big news for WordPress blogs and BuddyPress came last weekend with a new plugin that enables logging in with a Facebook account on any BuddyPress installation. You knew it was coming and there are many reasons to welcome it. Creating new accounts for every site you visit can really be a pain sometimes, especially when there are activation emails involved. Nobody wants the trouble of selecting a new username and password just to use your website. Break down that barrier on your WordPress and BuddyPress sites with the new WP-FB-AutoConnect plugin. Visitors will be far more likely to become members and participate on your site if all they have to do is login with their existing Facebook account. Adding this convenience to your blog is an almost guaranteed way to see a spike in your user numbers. This is a yummy new addition for all of you social networking junkies who love to have everything hooked up to your Facebook account. :)

WP-FB-AutoConnect Plugin Features

  • No user interaction is required – the login process is transparent to new and returning users alike.
  • Existing WP users who connect with FB retain the same local user accounts as before.
  • New visitors will be given new WP user accounts, which can be retained even if you remove the plugin.
  • Custom logging options can notify you whenever someone connects with Facebook.
  • Custom actions allow you to modify connecting users according to their Facebook accounts.
  • No contact with Facebook servers after the login completes – so no slow pageloads.
  • Simple, well-documented source makes it easy to extend and customize.
  • Won’t bloat your database with duplicate user accounts, extra fields, or unnecessary complications.
  • Built-in BuddyPress support.

How to Install WP-FB-AutoConnect on your WordPress / BuddyPress Site

It’s not difficult but it does require a few more steps than your ordinary plugin. I’m going to make it simple for you. There are two parts to getting it working:

1. Create a Facebook Application for your site

Go to: http://www.facebook.com/developers/createapp.php. Give your application a name. This is what Facebook will show on the login popup. Copy the API Key and Secret, because you’ll need them in a minute. Click the “Connect” tab and enter your site’s URL under “Connect URL.” Last step is to click the “Advanced” tab and enter your site’s domain under “Email Domain” (i.e. example.com). Save changes.

2. Install, Activate, Drag and Drop the Widget

Appearance -> Widgets, and add the WP-FB AutoConnect widget to your sidebar, OR if you’re using BuddyPress, a Facebook button will be automatically added to its built-in login panel.

How is this different from other Facebook Connect options?

Most Facebook connect options do not offer auto user creation, which is what I believe makes this plugin far superior to all previous options. It also does not require users to manually “Connect” their WordPress account to their Facebook one before they can login. Here’s what truly makes this plugin big news for the WordPress community:

What other kinds of cool stuff can I do when a user connects?
See the Facebook API for ideas. By the time the ‘wpfb_login’ hook gets called you’ve already got a valid session and matching local user, so the bulk of the work is done for you – all that’s left is to pull the information you want from Facebook and use it on your site however you wish.

Chew on that for a minute and hopefully it will spark up some innovative ideas of your own!

I’ve tested this plugin with WordPress 2.9.2 , WP 2.9.2 + BuddyPress 1.2.2.1, as well as WPMU 2.9.2 + BuddyPress 1.2.2.1 and it works flawlessly in all scenarios.

The homepage for the plugin has even more detailed information about installing, customizing, and troubleshooting. This is a very well done plugin with lots of documentation for extending it. Many thanks to Justin Klein for this exciting new plugin for the BuddyPress community. Somebody please buy him a coffee. ;)

Comments (38)

  1. Yes, the email will be saved in the ‘email’ database field ;)

    If the user was created before connecting with this plugin, and the FB email and your WP account email are the same, you will be able to login into your ‘old’ user account using FB.

    But if the email doen’t exist, a new user is created (with a rare name like fb_12345 but with the email showed in FB).

  2. Great! Installed it and worked perfectly for current members of the site.
    However, a new user, with an existing facebook acccount had the following problem: His facebook username had symbols in that won’t work with buddypress/wordpress. So a new account was created successfully, but because of an invalid username nothing else worked for the user.
    Hopefully this is a rare occurance – a great plugin. Thanks

  3. I love this plugin but the user creation end of it needs some tweaking. Users created this way do not have accessible profiles on my BP install (1.2.3). Not sure if this is just something I’m having trouble with — would be curious to know if anyone else is having this issue.

  4. my site is running in wordpress-mu im using the plugin wp fb connect. when the user login into my site using fb connect without bp filter (inside the option of wp-fb connect) it successfully create a new account, but when the existing user create a “blog” then when the user reloggin the wp-fb-connect create another user. hope you understand my thoughts.

  5. The problem of wordpress user_nicename having a space between the names was a problem because the plugin was taking the fb display name.

    I have rectified the problem by editing the _process_login.php file in the plugin folder

    I removed the $user_data['user_nicename'] = $fbuser['name'];

    And made it $user_data['user_nicename'] = $fbuser['first_name'];

    Now the url to the member profile is there first name

    Since the username being created is based on the fb id not there name i wonder if it will cause any problems if more than one person has the same name.

    How do i setup the user’s WordPress avatar to their Facebook icon i’m not a developer and i don’t know what code i have to insert

  6. I was wondering if they were going to come up with a way for me to use this feature in my wp admin, it does get tremendously tedious to keep track of all your logins and passwords. I use roboform for this but half the time the login window isn’t recognized by the program, but my main intrest is the quick account set up and seamless- quick set up… I really get tired of filling in all those forms again and again and with fb connect I can set everything up without worrying about the site stealing my data, it’s like using paypal to buy something online to hide your cc number right? Thanks for listening!

    Ken

  7. After creating my app ID and Secret, I tried to connect in the settings page, this error came up

    ERROR: Facebook could not validate your session key and secret! Are you sure you’ve entered them correctly?

    I have entered the key correctly

  8. What about those who don’t have facebook and don’t want to join? There are many sites I can’t access because I don’t have a facebook account. We all know that facebook is trying to collect a max of information on the users. Is it not a way to force them to join in?iIs it not unfair? And wha about security? A person who violates a facebook account would have all the other accounts of the user at the same time!!!!

  9. this function is what I need. However, the function is only for the BuddyPress. The plugin is not compatible with my own wordpress customize theme.

    Anyway, this is a great theme and plugin.

Participate