WPBook: WordPress Facebook Plugin

WordPress rocks. Here’s a plugin for bringing your WordPress blog posts into Facebook, and enabling users to comment and share those posts.


Note: I’ve disabled comments and pings on this page – instead, please comment on the blog post specific to each version release. This will help separate issues with older versions from issue with the latest release.

I’ve also added this page: Using WPBook? where people can add their WPBook powered blog addresses.

I am no longer updating this page with new releases. See the WPBook site or the plugin page at WordPress.org for up to date info

Update: 8/16/10: Once More with Feeling: WPBook 2.0.3

Update: 8/15/10: WPBook 2.0.2: Tabs, Stream Publishing, Comment Imports

Update: 7/11/10: WPBook 2.0.1: Beta Testers Still Needed

Update 7/7/10: Beta Testers Needed for WPBook (WPBook 2.0.0)

Update: 6/26/10: WPBook 1.5.7 release

Update: 6/24/10: WPBook 1.5.6 release

Update: 4/30/10: WPBook 1.5.5 release

Update: 4/5/10: WPBook 1.5.4 released

Update: 3/28/10: Sunday Coding – ReTweeter, WPBook (WPBook 1.5.3)

Update: 3/15/10: WPBook 1.5.2 released

Update: 3/7/10: WPBook 1.5 released

Update: 1/4/10: WPBook 1.4 released (followed by 1.4.1 the following day for a minor bug fix)

Update: 3/27/09: WPBook 1.3.1 released (bug fix release)

Update: 3/22/09: WPBook 1.3 released

Update: 2/14/09: WPBook 1.2 Released

Updated: 2/9/09: WPBook 1.1 Released.

Updated: 1/19/09: WPBook Goes 1.0.

Updated: 1/17/09: WPBook 0.9.7 released. Now includes “Share this post” button.

Updated: 1/14/09:

Note that if you are having trouble getting the application to show up in profile boxes on pages, try copying the “default FBML” provided in the WordPress settings page for the plugin and adding it to the User Profiles tab of the Facebook application setttings as well as the Pages tab. Not sure why it is required in both, but that is what seems to work.

(Related: Blog post covering 0.9.3, 0.9.2, 0.9.1)

Updated: 1/13/09

Updated: Now has an option to require or not require email from your comment authors within Facebook. Also tested now with WordPress 2.7.

This plugin enables you to pull recent blog posts from your blog in to facebook, and allow facebook users to enter comments. Their comments show up on your blog whether accessed directly or through facebook, and regular blog comments will show up in facebook as well.

Also enables users to invite their friends to your application, provided you enable the appropriate setting inside WordPress admin.

You can see this plugin in action (on Facebook) at OpenParenthesis – a facebook version of this blog’s most recent posts.

Download WPBook from the WordPress plugin directory.

33 responses

  1. Hello,
    I find this plug-in very interesting, but I cannot get it really working. Once installed following the installation procedure on wordpress plugin directory, I get this error:

    Parse error: syntax error, unexpected ‘{‘ in /home/mhd-01/www.tecnopolis.eu/htdocs/blog/wp-content/themes/wp-facebook/config.php on line 28

    my canvas url:

    many thanks for any help.
    regards, Alex

  2. Alex – I updated to WPBook 0.7.2 – perhaps you were using PHP4, which doesn’t support try{ } catch{ }.

    Download and try out 0.7.2 and let me know if that works for you.

  3. John,

    Perhaps I am stupid…

    But I get a blank page on my Facebook canvas page.

    I see it is because my WP install can’t handle the querystring parameters coming from facebook’s page request.

    This, in turn, is because the page on my site is not using your template. It’s using the template I designed.

    So what do I do?

    Am I supposed to merge them both? (Both index.php files??)

    Or is it supposed to be able to get my WP install to bypass my own theme in favour of yours automatically or something??

    Thanks for your help.


    PS. Please email my your reply as I cannot “subscribe” to your comments here.

  4. Hi John,

    To make it short. I have exactly the same problem as Alister reg. my wpbook plugin. I’m getting a blank page on my Facebook canvas page Here.

    I thought it might have something to do with the ‘call back url’ which I experimented with to no avail. In my last attempt I set the facebook application c.b url to:

    As for now I’ve used my main blog to test the plugin (which is an excellent idea). And if I get it working I have another site in the pipeline where the wpbook plugin would be, to say the least, an excellent additional resource.

    Please help me,


  5. Ricky – I’ve replied offline in email to try to narrow down your problem.

    For all users – the callback url you give facebook should just be your regular blog url.

    If you are using a “custom home page” which is not the default wordpress blog homepage, you may run into issues I am investigating.

  6. Hey Jon, great update 0.9.3, as it fixed the Comment Post.

    Is there a way to add this as a widget to your page, just like in your profile? As I have added it and can see it listed in Applications section on Page Edit, but it does not display on my Page. And if you click edit, it just goes to the feed.

    Thanks for any help on this.

  7. You can add it to pages – check the wpbook settings inside WordPress – you need to go enable adding to pages and set the “default FBML” inside the application settings in Facebook – the wpbook settings in wordpress will tell you exactly what to put in the default FBML box.

  8. ok, Im baffeled… as for some reason its not working for me.. sry im kind of a noob at facebook.

    I have this set in my facebook.
    Authentication Settings > Who can use your application? [x] Users [x] Facebook Pages.

    Facebook Pages Settings > Default Action Profile FBML >

    am I still missing something else?

    thanks for the help.

  9. Noticed an issue in the wp-facebook theme javascript which likely prevented the add-to-profile from working. Please update to 0.9.4 (be sure to replace the wp-facebook theme directory) and try again, allowing for Facebook caching.

  10. Thanks…the plugin you co-developed is really well made! I actually integrated it with the sociable facebook plugin, I just had to redirect the calls in your plugin to the facebook-client files in the sociable facebook plugin, which has a few additional features (mainly on when viewing a blog outside of facebook). I also had to update the client to the most recent version that facebook has released, but other than that it’s working great! Of course, I still have a lot of testing to do as I’ve only been using it for two days, but I have high hopes. I’ll inform you of any glitches I encounter.

    I’ll also let you know once I get 0.9.4 installed. I have one blog that the add-to-profile is working, and another where it doesn’t. I’ll let you know if this version fixes that.

  11. Thanks Andrew. I think the Facebook Client files in WPBook are the latest Facebook release – I just upated them around the time of 0.9.2 or so.

    I’ll check out the sociable facebook plugin as well.

    In terms of where add-to-profile works or doesn’t, two things to look out for:
    – the location of xd_receiver.html – this is called via javascript in index.php, inside the wp-facebook theme folder, in two different spots. If the javascript doesn’t find the right xd_receiver.html it will not produce the add to profile button.

    – the application settings in facebook – you need to enable users to add to profile and can optionally allow users to add to page. (If you allow add to page, you also have to set the Default FBML in the facebook settings – look in the WordPress settings page for wpbook to find out what to set it to.

  12. Thanks Jon for the update, well I deleted my old files from WP and installed the new 0.9.4 and still the same issue, I add it to my page and I can see it in my aps section, but it doesnt display to my page like the widget in my profile does.

    Now I have just noticed a few new post in the Developers section on face book for FBML/FBJS or errors happening with FB errors, not sure if its related.

  13. I just installed WPBook 0.9.7 automatically. I saw that one of the updates between 0.9.4 and 0.9.7 addressed the incompatibilities with other facebook plugins. I unfortunately am still showing issues. I didn’t get an error message as frequently, but it still appeared. It’s also possible that my api and secret api key were displayed in the url after one of these error…I’ll have to verify that when I next receive the error. This would definitely be a problem. For now, I’ll revert back to redirecting your files to searching for my other facebook plugin’s facebook client files (after I test out for that error a couple more times).

    My blog also still does not display anything in user profile boxes, while another blog I setup with your plugin does. I’m still not quite sure what the difference in, but I believe it might have something to what the number of recent posts is set to within the blog’s admin control panel. I’m currently undergoing some server changes on my website, once that is done I’ll be sure to let you know if changes with this theory fix the problem.

    In reply to your comments above, the second solution I know I have enabled, however, I don’t know if the xd_receiver.html is in the right location. What exactly did you mean by this, and what would be the fix if that is the case?

    I haven’t enabled the add-to-pages ability, but I’ll test it out sometime soon.


  14. I was mistaken, it does not show both the api and secret api keys in the url of the error message, just the regular api key (since it’s not secret, I guess it’s not too big a deal…). In regards to that error…here it is below with unnecessary info cut out:

    Fatal error: Uncaught exception ‘FacebookRestClientException’ with message ‘Failed when fetching the data from http://www.***.com/blog/wp-content/plugins/wpbook/theme/recent_posts.php?fb_sig_in_iframe. Error: The requested URL returned error: 404′ in /***/***/***/***/***/domains/***.com/html/blog/wp-content/plugins/fbconnect/facebook-client/facebookapi_php5_restlib.php:1733 Stack trace: #0 /***/***/***/***/***/domains/***.com/html/blog/wp-content/plugins/fbconnect/facebook-client/facebookapi_php5_restlib.php(739): FacebookRestClient->call_method(‘facebook.fbml.r…’, Array) #1 /***/***/***/***/***/domains/***.com/html/blog/wp-content/plugins/wpbook/theme/config.php(49): FacebookRestClient->fbml_refreshRefUrl(‘http://www.drex…’) #2 /***/***/***/***/***/domains/***.com/html/blog/wp-content/plugins/wpbook/theme/index.php(3): include_once(‘/nfs/c04/h01/mn…’) #3 /nfs/c04/h01/mnt/***/domains/***.com/html/blog/wp-includes/template-loader. in /nfs/c04/h01/mnt/***/domains/***.com/html/blog/wp-content/plugins/fbconnect/facebook-client/facebookapi_php5_restlib.php on line 1733

    This error message does not occur for me anymore when I first go to my app on facebook, but rather after I click “Add-to-profile”, then “x” out of it. Sometimes the error message won’t occur after x’ing out of it, but it will redirect to my blog, but use the wpbook theme.

    In addition, I also get the exact same error when I try to view a specific blog post (but this also is inconsistent, sometimes it will happen, others not).

    Essentially the same exact error message listed above pops up occasionally…any thoughts?

    To follow up with my attempts to be able to use the profile box feature, I changed the number of recent posts to show on my blog, yet 10 are still appearing on the recent post list on my facebook app. I thought this was forced to 5 in your theme, but I could be wrong… The automatic update should have removed all the old files and replaced them with whatever was in the update…so that leaves me to think the problem has to do with either the xd_receiver.html, or something entirely different. Hopefully we can figure out this problem too…

    I hope you’re finding this input helpful. Thanks again for the hard work on this plugin!


  15. Thanks for the detail of the error message. Just FYI, if you’re ever concerned that your “secret key” has been revealed, you can reset it from the Facebook Developer application and get a new one.

    I’m not certain where this error is coming from, since it is generated by the FacebookRestClient. Does the address pointed to – http://www.domain.com/blog/wp-content/plugins/wpbook/theme/recent_posts.php – return a 404 when you hit it normally?

    The recent posts list is indeed hardcoded – to 5 most recent for the Profile Box stuff and to 10 for the list at the bottom of the canvas page (main page of the app).

    In a later version (1.0 perhaps) I might make this a setting.

    If you’d like more assistance, please email me and tell me the url of your blog outside facebook and the address of your Facebook app, and I will see if I can identify anything that might be having an impact.

Comments are closed.