Note: Plugin page has moved to here: http://ottopress.com/wordpress-plugins/simple-facebook-connect/
Plugin: Simple Facebook Connect
Version: 0.15
Last updated: 6 days ago.
Downloaded: 26,077 times.
Overview
Facebook Connect is somewhat difficult to integrate with WordPress sites. Many plugins exist to do this, but they are overly complicated, or have security problems, or just plain don’t do the things you want them to do.
It doesn’t have to be this way.
Download Now
Requirements
WordPress 2.9 or higher. Yes, this plugin is for WordPress 2.9, which has not been released as of this writing. Some pieces might work on 2.8, but some won’t.
Features
- Easy to install and use.
- Modular. Only use the pieces you want to use.
- Integrates easily into any theme.
- Simple control panel, only has the options you need for the pieces you activate.
- Secure. Uses the latest WordPress coding techniques to eliminate tricky security problems.
Current sub-modules
- Comment using Facebook Identity (with FB avatar support)
- Automatically Publish new posts to Facebook Profile
- Manually Publish posts to FB Profile or Applicaton/Fan Page
- Login with your Facebook credentials
- New user registration with Facebook credentials
- Share button and Shortcode
- Connect Button Widget and Shortcode
- User Status Widget and Shortcode
- Live Stream Widget and Shortcode
- Bookmark Widget and Shortcode
- Find us on Facebook button Widget and Shortcode
- Fan Box Widget
- Fan Count Chicklet and Widget
Future sub-modules
- Pull comments back from Facebook published posts into your site
- (whatever you like, send me suggestions!)
Installation Instructions
- Upload the files to the `/wp-content/plugins/simple-facebook-connect/` directory.
- Activate the base plugin through the ‘Plugins’ menu in WordPress.
- Configure Facebook Connect for your site by following the instructions on the Settings screen.
- Activate the sub plugins you want to use through the ‘Plugins’ menu in WordPress and configure them appropriately. Some require no configuration at all, some require minor theme changes.
Licensing
This plugin is licensed under the GPL Version 2 only.
Method to get support
You can email me directly, however I am also a moderator at the WordPress.org support forums, so you’ll find me there as well.

I have SFC running on MU and am seeing issues with the display. The div id connect_with_fb does not hide properly. Any ideas?
Err.. there is no “connect_with_fb” div used anywhere in my code. So I’m not really sure what you’re talking about.
Hi,
I just downloaded your facebook plugin and i was wondering how i can add each plugin seperately to a custom page template.
i one of the page template i don’t have get_sidebar(); so i like to directly call the output function if possible
regards
That really depends on which plugin you’re talking about.
Honestly, for most of them, if you’re going to have to edit your theme anyway, you might as well just add the appropriate XFBML code to the theme. The base plugin enables the use of any XFBML code you like.
More info:
http://wiki.developers.faceboo......php/XFBML
hi otto,
tx for taking the time.
Adding the appropiate XFBML would be awesome, do you mean i could directly put
in my_custom_page.php
Because i tried but nothing is being parsed? How can i check if Simple Facebook Connect works??
I have done the settings and activate the main.
kind regards
oh can only xfbml be used directly??
like to use
You can use any XFBML you want anywhere on the site once the base plugin is working. As long as the site is showing the normal header and footer (wp_head() and wp_footer()), then the XFBML code will work.
hey dude, great plugin, but im using for wordpress and everytime i activate the plugin “SFC – Comments”, it works as in terms of everything visually lines up properly etc, and Fb connect successfully, but when i hit submit comment… it goes to a blank page
any help ..Thank Alot.
Hi Otto,
Is it possible to just have profile connect and nothing else? I want to have users sign up for a wordpress account and then if they want their posts and comments to show up on their facebook then just connect their wordpress account to their facebook account by clicking the button in their profile. This way I make sure all registrations are wordpress registrations so if facebook decides on changing their policies it wouldn’t affect any of the accounts. Plus some users aren’t comfortable typing their facebook username and password on a different site.
That is what the login and registration plugins do. They let users login or register with their Facebook credentials. Nothing more than that.
Yeah but I don’t want to do login or register with their facebook account. All I want is for them to be able to send their posts and comments to their facebook wall and that’s it. I want them to login with their wordpress acount.
Until they “Connect” their accounts in some way, they can’t send anything to Facebook at all. So you might as well have the Login plugin. It’s what lets them connect their accounts.
If you want a way to where they can post to Facebook without them actually supplying their credentials in some manner (via click a connect button and maybe even have to provide email/password to the popup from Facebook), then sorry, but that is not possible. Connecting is a prerequisite for all Facebook activity.
hey Otto,
first off great plugin- thanks!
I’m having a little trouble with the share button though. I’m using the XFBML version, and I’m wondering if there’s a way to set the size of the frame that pops up when you click the share button. When Facebook requires a CAPTCHA, it exceeds the size of the frame and there’s no way to scroll down to Submit. I tried flipping over to the javascript version, but for some reason that one makes the layout of my site go haywire. any thoughts?
will
I’ve got exactly the same problem. when facebook requires a CAPTCHA the size of the frame is exceeded. How has anyone else fixed this?
I’ve got exactly the same problem. with a CAPTCHA the text doesn’t all show. How has anyone else fixed this?
i’ve noticed that i get scroll bars in google chrome, allowing me to scroll down and submit the CAPTCHA, but no scroll bars in firefox or safari.
Unfortunately, the size and content of the popup is completely outside my control. Facebook generates and produces the popup, the plugin just calls their code to do it. So I can’t help you here.
nice one! thanks:-)
hey dude, great plugin, but im using for wordpress and everytime i activate the plugin “SFC – Comments”, it works as in terms of everything visually lines up properly etc, and Fb connect successfully, but when i hit submit comment… it goes to a blank page any help ..Thank Alot.
Can i get a reply please ??
[...] Simple Facebook Connect By Otto This plugin adds a series of smaller plugins, that let you add Facebook Connect features to your blog. Most useful, I think, is the support it adds for visitors to login to your comment system using their Facebook identities. [...]
I get this error when I try to authenticate with connect with facebook:
You must configure an email domain before requesting a user’s email address.
I’ve tried google, but I’m not quite sure what I need to do.
Well, this is just a thought, but did you try configuring an email domain?
Go to your Facebook Application and edit the settings for it. On the Advanced tab, there’s a field that is labeled “Email Domain”. Put your domain in there.
Detailed info: http://ottodestruct.com/blog/2.....plication/
Hi Otto,
And what about even simpler registration/login ? Best would be if user just connect with Facebook and WP account would be created automatically according to FB info.
Are you planning to do something like this ?
Already there, but disabled by default because most people would probably prefer a chance to edit their email address and name and such before creating a new user.
Still, if you want to try it, add this to your wp-config.php file:
define (‘SFC_REGISTER_TRANSPARENT’, true);
than you for quick response! it worked…
and next time i will know that i should read readme.txt
Otto, I get this error:
[application name] is under construction. Please try again later.
Configuration errors:
To fix this error, please set your Connect URL in the application settings editor. Once it has been set, users will be redirected to that URL instead of this page after logging in.
I don’t recall seeing this in the installation instructions… but I might have missed it – once I configured once I’m not sure how to get the original instructions to appear again.
Generally you get this error because you didn’t fill in your URL properly when creating the application in the first place.
To fix, go here:
http://www.facebook.com/developers/apps.php
Click “Edit Settings” on your application. Go to the Connect tab and fill in the URLs.
More info: http://ottodestruct.com/blog/2.....plication/
Hey, thanks for the response. I was thinking there was a lot missing on the application side, and there it was. I have a quick question, though… is this compatible with BuddyPress or will they interfere with each other? I had assumed this is mostly just a credential plugin … but I’ve noticed with the site that has BuddyPress connecting ‘works’ but it does not result in a logged in status nor a change in the comment form (I have that plugin active.) I have the registration and log-in plugins (as well as the main one) active, but still no dice. Deactivating BuddyPress does not help, but I’d still be interested to know.
Also, when entering the information for my application, the connect URL gave me a warning that it had to end with a ‘/’ or have a ‘?’ in it… so I just added a slash. Seemed odd.
Does this difference (having a slash in the connect URL but not the others) cause a problem?
Sorry for bothering you.
Slash vs. not: Doesn’t matter, really.
BuddyPress: I have no idea. I have heard feedback from people saying that it works fine. I have not tried it.
Comments form: You have to edit your theme to see any changes. See the readme.txt file. If you have already edited your theme and see no changes, then you have javascript errors on your page which you must solve first.
Otto,
It seems to work. Thanks!
By the way, funny stuff happens in Chrome (possibly WebKit too) when you reload the comments page after having logged in. In firefox it reloads your avatar / name fine, but not in Chrome.
I can tell I’m 95% of the way there, so I’m probably missing something simple. I’ve activated SFC-Publish. On the settings screen, there are three buttons to grant extended access. No matter which I click, I get a popup saying “You must be logged in to Facebook to use this feature.”
I’m definitely logged in. Any ideas where I should be looking for the fix?
You may be logged in, but have you connected the site to Facebook before?
Go to the Edit Post screen, and edit an existing post. There’s a box on that screen called “Facebook Publisher”. If it has a Facebook Connect box in it, then click that to connect your account to your site via Facebook. Once you’re connected, two Manual Publishing buttons will appear, letting you publish manually via popup.
If you can publish via those buttons, then the permissions buttons on the settings screen will work properly. That part of the Settings screen hasn’t been fully fleshed out yet to recognize when you’re not connected.
Thanks for the response. Yes, I tried that. The popup came up and immediately closed, and nothing appeared on Facebook. I tried publishing to both my profile and the fan page.
Do I need to finish creating an app first and publish that for the connection to work? The settings screen where I entered the api key etc. said most people won’t need to enter the fan page ID, but that’s what I’m doing since the fan page already exists. Is it possible I need to complete an app first to establish the connection, and then I can post to the fan page?
Well, yes, that’s your problem. Making a Facebook Application is not optional. Nothing works if you don’t have an Application.
The Fan Page is optional. The Application is not.
Okay, so I’m on the right track. I’ve set up the contact info for the app, but it doesn’t actually point to anything. What’s the minimum I need to configure so I can post to a fan page? If there’s documentation on Facebook that explains it, feel free to point me in the right direction. I’ve never built a Facebook app, so I don’t know where to start.
Hi Otto,
Really like the plugin. but lately its been acting rather weird. I can no longer publish to my fan page. It just says: Publish this story to the Page’s Wall? and thats it. not box, no publish button.
Also, when I am logged into facebook and go to the blog to log in it gives me some bizarre warning about can’t send email with out a set email domain.
I really wish people would stop emailing me about this.
Let me try to make this perfectly clear one more time: Facebook is wholly responsible for the contents of the pop up boxes. If they don’t show up, then Facebook is broken.
I can’t fix this.
I have no control over this.
It’s happening to everybody.
Wait for Facebook to fix it.
The thing about the email domain means that you need to edit your Facebook Application and set the email domain. More info here: http://ottodestruct.com/blog/2.....plication/
I didn’t see anything about the issue on fb, so i came over here to see if you could shed some light on the issue. sorry to bother you…
thanks for the info regarding the email domain. i don’t know how that got changed.
Heh. Sorry, but that was just like the 15th time I’ve been asked that today. Every time Facebook’s API goes down, I now get inundated with email. I need to set up a form reply or something.
Facebook doesn’t tend to announce it publicly when their system is broken. Quite annoying.
No worries. That’s where i was getting confused, b/c on the FB developer page it said basically “yea the api is fixed and running” and that was from yesterday. meantime, my client keeps calling me “i can’t get it to post to the facebooks. what am i doing wrong? when can you fix this?”
so i know where you’re coming from.
Bug report on this issue (which comes and goes from time to time):
http://bugs.developers.faceboo.....gi?id=8573
Hey Otto. Since upgrading, when I try to reactivate the Fan Box Widget, it gives me a fatal error within the wordpress plugins page:
Parse error: syntax error, unexpected ‘}’ in /home/pretty23/public_html/wp-content/plugins/simple-facebook-connect/sfc-fan-box-widget.php on line 135
Fanbox widget does not show up in widgets any longer. Help! Do you have a copy of 0.12 I can use until this gets fixed, or that i can use in case this is an isolated problem?
Thanks!
I had just the same problem. And there’s a solution:
In line 30 you have probably something like this.
if ($_GET['sfc-fanbox-css']) { ?>replace it with that line:
if ($_GET['sfc-fanbox-css']) {Sorry for the error. Version 0.14 has the fix for the Fanbox problem. Upgrade to that.
Note: There is no error in the Publish plugin. If you get an error with “undefined function has_post_thumbnail”, then you are not running version 2.9 or higher of WordPress. This plugin REQUIRES at least version 2.9.1 of WordPress. I don’t put in any support for older versions, and has_post_thumbnail() was introduced in WordPress version 2.9.0.
I removed the comments above all mentioning the same two errors, to eliminate clutter. Version 0.14 available here will fix the problem.
If this is somehow preventing you from logging in, then FTP to your site and remove or rename the sfc-fan-box-widget.php file. That will deactivate it and get you back in. Or, FTP and just upgrade it manually with the fixed file from version 0.14.
I’m running 2.9.2 and I’m still getting the error. The only modules I have activated are the base module and SFC_Publish.
And, possibly stupid question while I’m at it: The fan page I’m trying to publish to is *not* the fan page for an app, it’s a standalone fan page. Will this plugin publish to that?
Then you upgraded wrong somehow. The has_post_thumbnail() function is defined in wp-includes/post-thumbnail-template.php. Here’s the file in the core:
http://core.trac.wordpress.org.....te.php#L20
And yes, it’ll publish to a Fan Page, if Facebook has fixed their system to get rid of the publishing problems of the last two days.
OH! I just discovered something. The post-thumbnail-template only gets loaded if the theme supports it. Which is stupid, IMO, but okay. I had not considered a theme not supporting thumbnails.
Temporary workaround: Add this to your theme’s functions.php:
add_theme_support( ‘post-thumbnails’ );
I’ll have a fix in for this issue soon.
Edit: And done. It’s in 0.14. Wait 20 minutes, then download it and the fix will be in there. Also in the Share plugin, which also uses thumbnails.
Yup, theme issues. And I’m using a child theme, which has caused problems with enough other plugins that I should have thought of that.
I need to learn how to adapt themes. All the themes I tested does not support the “post-thumbnails” function that is in .14 updated or .15. I have 2 post that came from “FBC” accounts and neither of them display the FB Picture… grrr I read through the “functions.php” for the theme and could not figure out where to input the code..
Anyone have any suggestions on where to read up on it? I will edit the code if I knew where to start in it… I attempted to write the theme creator but their website is in another language and the “Contact Us” link has a Captcha in another language. So utterly screwed.. haha
Generally it will try to use images it finds in the post itself, or the post-thumbnail if the theme has support for them.
How to implement post thumbnails: http://markjaquith.wordpress.c.....il-images/
problem bro after update this plugin from .0.12 to .14 now when i am trying post i cant when me click on publish its comes one blank page please help me
If you are talking about the blank popup box when you try to Publish to a Fan Page, that’s a Facebook problem, not a problem with the plugin. I can’t fix that. They’ll fix it soon, hopefully.
He may be talking about this error when publishing a post, not publishing to facebook. I just started receiving this error when publishing a post after upgrading to SFC .14.
Fatal error: Call to protected method FacebookRestClient::get_uid() from context ” in /wp-content/plugins/simple-facebook-connect/sfc-publish.php on line 380
bro when me try to publish new post in my blog i got new nothing simply one blank page and in fb its not published
I can’t get that error, it works fine for me.
Still, try this version: http://plugins.svn.wordpress.o.....ublish.php
I removed the privacy setting thing from the publish there. See if that solves it.
I got this error too just now. Happened when I was publishing a new post, while logged into my other FB account (the one not governing my blog’s fan page).
I unchecked the automatic publishing option and the error seems to have gone away.
Have either of you tried the version I posted yesterday?
http://plugins.svn.wordpress.o.....ublish.php
I removed the change for the privacy thing, to see if that solves the problem. I still cannot replicate the problem myself, but that was the only change I had made in that area, so backing out the change should resolve the issue.
Just to verify, I did a bit more testing with version 0.14 and the error definitely has something to do with having the automatic publishing turned on. Every time I tried to publish a wordpress post with the auto publish turned on in SFC I received the error posted above even though the post did appear in my blog but not on FB.
I then over wrote the sfc-publish.php file from your trunk to my plugins folder and was able to publish both to my blog and FB automatically.
Let me know if you need more details.
One other unrelated question since you mentioned privacy… when commenting while connected w/ FB the comments show the commentors full FB name. Any plans to have an option to only show first name, like the fan box does?
thanks,
-dave
Well, I’m glad that fixed the issue. I put the change back into 0.14 too, so any future upgraders (after the first day) won’t have the issue.
No plans on making it use first name only, but it’s an easy change if you want to do so. In the sfc-comments.php file, around line 295, you’ll find this line:
$_POST['author'] = $user_details[0]['name'];
Change “name” to “first_name” and you’re done.
However, this is not necessarily a privacy issue. Facebook makes this information available publicly, to anybody, without any form of approval whatsoever: uid, first_name, last_name, name, locale, current_location, affiliations (regional type only), pic_square, profile_url, sex
Source: http://wiki.developers.faceboo.....rs.getInfo
I got the same error: Fatal error: Call to protected method FacebookRestClient::get_uid() from context ” in /wp-content/plugins/simple-facebook-connect/sfc-publish.php on line 384
That bug was fixed, but apparently some people didn’t get the update. Use version 0.15 now.
I am using 0.14 of the plugin. It resolved my issue with “Fan Page” posting. But when using the “Connect with Facebook” feature and hitting the cancel it goes into a tale spin and spawns 48 pages titled “xd” with the following added to my domain: “?xd_receiver=1#fname=_opener&%7B%22t%22%3A3%2C%22h%22%3A%22fbCancelLogin%22%2C%22sid%22%3A%220.887%22%7D” It does not do this on Firefox 3.5.8 but it does on Internet Explorer 7.0.5730.13
Hope this helps either resolve the bug or post up it is a known bug to prevent others from experiencing the problem.
What the “cancel” or any other button does is not a part of this plugin. Facebook generates the code inside those pop up dialogs on their own servers. I have no control over it. I can’t affect what “cancel” or “okay” or anything else inside a popup does.
Bottom line: If it’s something that happens in a popup, Facebook did it.
Understood. Found it odd that it is a problem in IE 7 but not in FF 3.5.8
When I use the “Facebook Share” from the “Addtoany” and hit the cancel it does not error out in IE 7. I am not overly concerned as I do not use IE 7.0. Figured it may be a problem with how the plugin references something or a setting I have in the application on FB.
Appreciate the response and your time spent developing the app. It works pretty good. I am currently setting up a instruction post on how to add accounts to my site based on your facebook login.
I’ve noticed the Cancel buttons not working at all in Facebook, from time to time. Their API is flaky as hell, IMO.
Fortunately I rarely have to hit cancel. I can understand the complexity of fixing problems as LARGE as Facebook has grown…
[...] writing the Simple Facebook Connect plugin, I investigated how the Settings API worked. It’s relatively new to WordPress [...]
Hi, great plugin, I just can’t get the comments working!
I edited my comments.php correctly, and the connect button shows in the comment area. When it’s clicked though I just get a popup window that goes to my blog’s home page.
I think it’s worth mentioning that originally when I clicked it the popup said that I had to set up my connect URL, and it’s after I rectified this that this has started to happen.
My blog is: http://blog.richardmilne.net
This is my first time working with XFBML, but I figured my connect URL must be the root to the blog, which contains xd_receiver.htm is this correct?
Hope someone can help!
Your theme doesn’t have the proper wp_footer() code in it. Edit your theme’s footer.php and add < ?php wp_footer(); ?> right before the ending tag.
awesome, cheers Otto!
Ok I think I have a super CRAZY problem. If anyone can help me it would be great. Do not want to sound nuts but when I visit my page using FF 3.5.8 and click on “Log In” I am immediately redirected to the register page. Each time I click on the Log in link it immediately places me back to the register page. This problem does not spawn itself when using Internet Explorer. When I go to Internet Explorer it works as expected. I can login with my account. It is compounded by the face that the “Cancel” redirect is not working as expected in IE. I think the process has a bug in it somewhere that is specific to my host provider, 1&1. To check out my problem with the login visit http://www.westout.com and click on Log in. As I said it only does it on FF.
When I logged into my account using IE I took a look at the Plugin Editor for SFC Register. I noticed in there a setting for “force a registration redirect if user is unknown” Now I must say that I am logged into Facebook on Firefox but not on Internet Explorer. Not sure if that will make a difference. So I logged out of my account and the same problem happened. I then decided to check my cookies as I cleared my cache and the problem had continued. Clearing of the westout.com and facebook.com cookies resolved the issue.
It appears that some how my cookie for my website had become corrupted and hung on to my FB session. Since I had not connected my facebook account to my profile it had no way of knowing that I was the same person.
Hope that this helps anyone else that runs into the same problem.
Appreciate you Otto for having this sounding board for users to iron out any wrinkles we run into!!
Hi Otto,
I’m running into an issue with the SFC – Publish component. When I activate it, the publish box in the Post Edit window displays the following error msg:
Fatal error: Call to undefined function has_post_thumbnail() in [...]/wp-content/plugins/simple-facebook-connect/sfc-publish.php on line 186
This breaks the edit window, which no longer displays the main body of the interface.
I’m running on the latest/greatest WP & SFC.
Any ideas?
That bug was fixed, but apparently some people didn’t get the update.
I’ve tagged 0.15 to fix the problem.
Note to everybody following this:
The plugin page for Simple Facebook Connect has moved to here: http://ottopress.com/wordpress.....k-connect/
I’m closing comments on this post. Please take any comments to the new site.