WPBook: WordPress Facebook Plugin Goes 1.0

UPDATE 2 (1-28-09): Seems that the WPBook plugin conflicts with the BadBehavior plugin – I’m looking into options to see if the conflict can be eliminated, but if your WPBook install is not working try disabling BadBehavior.

UPDATE (1-26-09): As noted in the comments below, there is a bug in the copy of the Facebook library included with the Sociable Facebook Connect plugin. If you’re using that plugin, you’ll need to patch their copy of the Facebook client library as follows.

Change line 170 of /wp-content/plugins/fbconnect/facebook-client/facebook.php from:

http_header('Location', $url);


header('Location', $url);

This will eliminate the conflict between these two plugins.

Today I’m releasing version 1.0 of WPBook, the WordPress plugin for embedding your blog in Facebook.

If you have earlier versions installed, you should see an auto-update notification on the plugins page of your WordPress dashboard. (Note that WordPress checks for updates only every 12 hours).

This version includes the following new features:

  • Added option for “Share this Post” – user determines whether or not to show “Share” links on posts
  • Added option for user to enable or disable comments from Facebook – does not affect comments left on the blog directly
  • Moved the “Invite Friends” (also an option) to the top of the application next to the “Add to Profile” link – these two options should be high visibiility to encourage use
  • Added option for “Give Credit” which shows a “This Facebook Application powered by the WPBook plugin for WordPress” byline at the bottom of the Facebook canvas pages.

Here’s what the new admin looks like:

WPBook Options Page (Click for Full Size)
WPBook Options Page (Click for Full Size)

It also includes the following bugfixes:

  • Added simplexml44 library (BSD Licensed) for the php4client, eliminating the need for user to locate and install
  • Cleaned up CSS for “recent posts” in main page – list items were not enclosed in a <ul> tag
  • Added fix to facebookapi_php5_restlib.php which affected hosts where curl libraries were not present or enabled

As well as, of course, the existing features from earlier releases (see 0.9.7 and 0.9.3 for more on these):

  • Canvas page showing recent blog posts in a Facebook iFrame, meaning blog posts can contain video, flash, javascript, etc – not that Facebook does impose some restrictions.
  • Profile Boxes listing 5 most recent blog posts which can be added to user profiles and pages
  • Share this Post links, enabling default Facebook “send a message or post to profile” functionality for individual blog posts
  • Invite Friends option to enable users to invite their Facebook friends to install the app

Get WPBook 1.0 on this blog or at WordPress.org.

UPDATE: Comments closed here. Check this page for most recent launch announcement and comment on the most recent version.


  1. That 403 is not to be expected, and is what is preventing the app from showing in Facebook.

    Looks like a permissions issue with one of the directories along the path – could be:

    All of these need to be executable and readable by whatever user the web server runs under. This generally means 755 permissions on directoryies and 644 for files.

    Generally this isn’t a problem – but it is dependent on how you’re getting the files in place and what permissions are already in place on your WordPress install.

  2. Sorry to hear it Beau – but lots of others have gotten it to work, so we need to figure out what’s different about your setup.

    What are you putting as your “Callback URL” in Facebook?

    I assume your blog “lives” at http://beaugiles.net/?

    I’m having a hard time getting that URL this morning – maybe Facebook can’t reach it either?

  3. @Beau – looks like a conflict of some kind with the FBConnect plugin.

    If you hit this url:

    That actually mocks what will be seen inside the Facebook app, and it throws this error:
    Fatal error: Call to undefined function http_header() in /home/beaug/public_html/wp-content/plugins/fbconnect/facebook-client/facebook.php on line 170

    I know there are others successfully using WPBook alongside Facebook Connect plugins – maybe the facebook client used by the particular plugin your have is out of date? What WPBook is doing is checking first to see if the Facebook class has been declared – if it is, I don’t try to redeclare it. That means that if some other plugin has already included the Facebook library I won’t re-include it, but then I’m dependent on their version.

    Sorry the plugin isn’t working on your blog.

  4. That is truly odd. Do you have another plugin which generates the recent_posts.php in the sidebar?

    The plugin just calls this function: wp_recent_posts(5);

    It first checks to see if that function is already declared, and if not, declares it’s own.

    Also, any chance that the post which gets repeated had many revisions?

  5. Can you add an option or explain how to notify the subscribers on facebook that a new blog entry has been made?

  6. Shawn – one of the items on the goal list for a later release would be to publish a “story” in your news feed on Facebook when your write a new post, as well as (potentially) a “notification” or “update” (these terms have specific meaning in Facebook) to all the folks who have the app installed.

    But I don’t know how soon that will be.

    In the meanwhile, if users have added the app to their profile, they will have the list of 5 most recent posts in their profile box, which is updated automatically when you post.

    Also, after you write a post, you can go to the app and click the “Share this Post” button (if you have it enabled in the settings) and post that blog post to your profile or send a message to any of your friends.

  7. Not sure what you mean about it never stops loading – though it does look to me like perhaps there are some javascript conflicts with some of your other plugins and the Facebook “automatic resize iframe” code – which sets the height (length) of the page at load time.

    That’s why the main landing page seems to scroll off the bottom of the screen – that height never gets set.

    Or, perhaps, you don’t have the iFrame set correctly? Using the Facebook Developer application, go to “edit settiings” for your Facebook app, and look at the “canvas” tab – where it is set to iFrame, your iFrame must be set to “resizable” radio button.

  8. Garrett – which Facebook Connect plugin are you using?

    Have you verified that the error goes away if you disable the Facebook Connect plugin?

  9. Hey John,

    I’m excited by this plugin. It’s just what I need. Have enabled the “Show Invite Friends Link” but still get the following error message from the “Invite Friend” link inside Facebook:

    Errors whilst loading page from application
    Received HTTP error code 400 whilst loading http://myblog.com/blog/index.php?is_invite=true&fb_force_mode=fbml

    Any thoughts on what may be causing this?

    Also, can’t seem to post comments from inside Facebook. The page sets stuck at the following blank url:


    Would appreciate any advice.

    Thanks again,

  10. @Boogieboa Not sure what might be going on.

    What’s the url of your blog outside Facebook?

    What’s the url of your Facebook application?

    If you don’t want to post here use the contact form on the blog and email me directly.

  11. If you are using the Sociable Facebook Connect plugin you will experience errors.

    In the copy of the Facebook client that Sociable ships with it’s plugin, there is an error.

    In the file:

    Line 170 (of their version) looks like this:
    http_header('Location', $url);

    You’ll have to change that to:

    Not sure why that plugin is using a version of the facebook library with this bug in it, but I guess they don’t use the redirect function and therefore don’t suffer from the bug – I will contact the author and let him know.

  12. John – Thanks for your help earlier.

    Thought I’d let you know that the bug fix at line 170 (/wp-content/plugins/fbconnect/facebook-client/facebook.php) in SFC’s plugin doesn’t solve the conflict problem between that plugin and your WPBook. At least, not on my set-up.

    The link that shows WPBook’s content outside Facebook still shows as a blank page with no error message when both plugins are activated after the fix. It works fine with Sociable Facebook Connect removed.

    Any thoughts on other possible reasons for this conflict? I’ll check my PHP logs for error messages and let you know.


  13. Hmm. A more radical approach might be to replace the facebook.php and the facebookapi_php5_restlib.php in the Sociable Plugins facebook-client directory with the ones from the wpbook “client” directory.

    The fix I’ve suggested above (for line 170 in Sociable’s version of the Facebook client) only addressed the one error I’ve been able to trigger – so your report suggests to me that we’ve only fixed one of potentially multiple issues in Sociable’s copy of the facebook client.

    Of course, if you replace their copy of the client with mine, potentially something in Sociable’s plugin will break.

    Meanwhile, I’ll keep looking – I do have a test blog into which I can install Sociable’s plugin for testing purposes.

  14. Hi John,

    Thanks for the app, it is exactly what I’m looking for to simulcast my own personal website blog posts to facebook.

    I followed all instructions and have a canvas that accurately reflects the blog contents:

    However, when I add this to my profile I get a little box that says “No content to display. This box will not be visible to people who view your profile until this application adds content to it.”

    Any ideas? I’ve tried just about everything I can think of.


  15. There seems to be some kind of bug in the code which tries to programmatically set the “default FBML” for profiles.
    Grab the “default FBML” shown at the bottom of the wpbook settings page (in WordPress) and paste it in the appropriate boxes in the application settings (in facebook). There’s one setting for User Profile and another for Pages, if you allow the app to be added to pages (which is itself a setting in facebook under authentication.

  16. I can work nothing out from the raw log files, John. I’m new to this game. Sociable Facebook Connect is now deactivated. So, no conflict there.

    But I still can’t get WPbook working in Facebook: http://apps.facebook.com/blogofboakye/

    My blog’s content shows up. It’s just not possible to add friends or post comments without getting a blank screen – no error message. I get the same problem as Will trying to add a narrow profile box.

    Any help, appreciated.

  17. Hey John,

    I tried this before and just gave it another shot: no dice. I pasted the default FBML url () in both places in the facebook app settings.

    I removed and added the facebook app to my profile. No luck, same message.

    I think others are having this problem, I saw two or three other comments along this line. I don’t have any other facebook applications installed in my profile (no connect stuff, etc).

    Any other ideas?


  18. The “add to profile” bug I think I have identified – but setting the default FBML as instructed on the WPBook settings page should fix that problem – lots of folks have this working fine in 1.0.

    The other problem with submitting comments seems to be a plugin conflict of some kind – I know it works on my three test blogs as well as many others.

    Have you validated that the problem with submitting comments is true even when the sociable plugin is disabled?

    I just tried to check now but clearly Sociable (or some other Facebook Connect plugin) is still enabled, as it is showing the “publish to facebook” checkbox next to the comment form.

  19. Will – in testing out your facebook app I get some odd errors which suggest that this directory isn’t present:

    Are you using version 1.0 of the plugin? The theme directory for that version should stay exactly where it is, inside /plugins/wpbook/theme/

    That would explain why the default FBML would not work.

    This url: http://will.sitch.org/wp-content/plugins/wpbook/theme/recent_posts.php?fb_sig_in_iframe

    Should return your five most recent posts – instead it gives me a 404 error.

  20. Hey Jon,

    I seem to be having a new issue which I can not locate what its is yet…

    I have now 2 facebook app feeds setup, form 2 different sites, both are on the same wp 2.7 and running the new version WPBook 1, now on my SB site, its seem to loose the feed at times , when you click the link your get a error, however the new links were posted to side widget in FB.

    Now to get the feed back, I go back in and check my settings both my accounts Aps I have working to compare the settings and save on a few pages, then recheck my feed and then it pulls. So I really dont know what is causing it…

    This has not happened 2x in the last week, all after installing ver 1

  21. @Rich – trying to understand the issue here. You have two facebook applications set up, both pointing to the same WP 2.7 blog.

    Can you be more explicit about what you mean here: “now on my SB site, its seem to loose the feed at times, when you click the link your get a error”?

    Do you mean that the “recent posts” links, which the app automatically adds to the user profile in Facebook (if the user has authorzed, of course) return an error when users click on them?

    Is it that the URLs are somehow incorrect, or that the urls are correct but that your blog doesnt always respond quickly enough for Facebook (Next time one gives you an error, copy the link and save it somewhere)?

  22. John, Yes I have to Blogs and 2 Facebook apps.

    It just happened again.. Im not sure where this hash code is coming from… as I have it setup the same way as my bluealienfeed, but its not happening to my other feed. Error (The page you requested was not found.)


    I think I will do a full download and reupload, incase the auto update messed up…

  23. Well deleted WPbook from WP and added it back (v1), I have verified my keys, no back spaces after data entered in, I just dont know where the extra HASH code is being generated in the Side Widget, the app page feed info is ok, its just the widget that this is affecting. Any ideas? For some reason now I cant get it back to working like before.

  24. Don’t worry about the extra HASH code – that’s from Facebook.

    One problem you have your Facebook app as SiteBoxFeed rather than siteboxfeed.

    If I hit that same url but make the facebook canvas bit (“siteboxfeed”) all lower case it works fine – change that setting in your WordPress settings.

    Second, your permalinks point to /scripts/blog-post-title – what do your permalinks looks like outside Facebook, ignoring the domain part?

  25. John,

    Thanks, I get it working again, something was caching that Cap version somewhere in facebook even after I changed it, I finally got the widget to drop it when I deleted it and readded..

    Just weird it was working intermittently setup that way…

    My Permalinks are the same on my site too:

  26. Thought I’d have one more go at making WPBook work for me. Disabled all my other plugins and tried again. Bingo – “Invite Friends” now works in Facebook!

    Bad Behavior 2.0.25 had caused a conflict with WPBook disabling all of its functions in Facebook. Now I have a lesser problem. The page gets chopped off and won’t scroll down to the bottom. Anybody else faced with this issue?


  27. @Boogieboa -glad to hear it’s (mostly) working.

    The issue with the “chopped off” page is that the Facebook JavaScript which is supposed to resize the iFrame to fit the content is failing.

    This is caused by one of three things:

    1. The xd_receiver.html is not where the page expects it to be, or is not web-browseable. This should not be the case in an install of this plugin unless you’ve moved files or have permissions problems on the server
    2. There is another plugin on your WordPress install which is trying to do something in JavaScript which interferes with Facebook’s JavaScript. This gets complex pretty quickly given the number of other WordPress plugins that use JavaScript to change the page at load.
    3. There is a plugin or an included .css file (not just the one from your default theme – likely one added by a plugin, again) which sets the height of the body tag or the html tag to 100%. This interferes with the ability of the Facebook provided JavaScript to set the height of the iFrame

    Unfortunately, the only way to troubleshoot items 2 and 3 is to remove plugins, then re-add one at a time. Each time you add a plugin back in, you have to make sure you’re not getting a cached page in Facebook but that the plugin has really been disabled or re-enabled.

    If you disable ALL plugins and still see this behavior, or if you identify which plugins cause conflicts, please let me know so that I can at least update the README with known conflicts, but more hopefully find a way to solve the conflict. (It’s tricky, though, since it’s a conflict between two things I don’t control – someone else’s plugin and Facebook’s JavaScript!).

  28. For me DISQUS is a much cleaner way to entice Facebook Friends to my blog. I’ve therefore got rid of the Sociable Facebook Connect plugin.

    I’m still looking to install yours:

    The xd_receiver.html file is where it should be.
    I disabled all plugins, yet the “chopped-off” pages persist.
    With all plugins disabled, there shouldn’t be a problem with any included css file, should there?

    Stuck again.

  29. Looks to me like there are lots of javascript tags being added by plugins when I pull up your Facebook app. While viewing your app, in Firefox, right click and choose “view frame source” to get the source of the iframe.

    There’s an events calendar, a delicious “playtagger,” a spell checking plugin, an audio player, quicktags, comment quicktags, javascript pll quotes, platinum SEO pack, podpress, simple forum, and others.

    I’m also still seeing a socialble.css call.

    Remember that when you disable plugins on your site, then go hit the facebook app – there may be some caching going on. You have to wait until all the associated js and css calls go away before you’d know if you’re really getting the right result.

    I don’t see any javascript errors on the error console, so I’m looking into css – but it is difficult when you have so many extra css and js files.

    Also a Google Maps API call – I’ve heard those cause issues inside Facebook iFrames too.

  30. Hi John,
    A really great app. Can you point me to a step by step guide to install for the new facebook. As if I try to reach my canvas url – http://apps.facebook.com/venkateshsridharblog/ – I get the following error:

    Warning: include_once(/home/venkates/public_html/wp-content/plugins/wpbook/client/facebook.php) [function.include-once]: failed to open stream: No such file or directory in /home/venkates/public_html/wp-content/plugins/wpbook1/theme/config.php on line 5

    Warning: include_once() [function.include]: Failed opening ‘/home/venkates/public_html/wp-content/plugins/wpbook/client/facebook.php’ for inclusion (include_path=’.:/usr/local/php52/pear’) in /home/venkates/public_html/wp-content/plugins/wpbook1/theme/config.php on line 5

    Fatal error: Class ‘Facebook’ not found in /home/venkates/public_html/wp-content/plugins/wpbook1/theme/config.php on line 30

    Any clue as to what I am doing wrong?

  31. John – You’re right. Too many plugins. I’ve now deleted all but the essentials, and believe it or not, my pages load a lot faster now. Miraculous!

    WOW – Even the profile box in Facebook is working this morning, showing the 5 latest posts. But still the truncated Canvas Page. Hmmm!

    Don’t know what else to do. I’ll search the Facebook Developers Forum to see if there’s any solution there.

    Cheers, again.

  32. Got it working!

    The Canvas Page was set to smartsize instead of resizeable in My Applications.

    Looks great – works even better.

    Thanks for your help, John. Good work. Nice plugin. Friendly support. Credit where credit is due!



  33. Hi John,

    I’ve installed the WPBook plugin and setup the application – but I’m getting an error when I try to view the app in facebook. I’ve also copied the default FBML into both the User and Page fields. Here’s the error:

    Errors while loading page from application
    Parse errors:
    FBML Error (line 45): illegal tag “body” under “fb:canvas”

    When I view the page on my site it displays properly – here’s the URL:


  34. Hi John –

    Thanks for the great plugin! Once you get the stories/notifications (hint hint, lol) it will be absolutely perfect! :) I do have a question about the comments. Is there a way (maybe in the code?) to refrain from using the whole facebook name, perhaps just their first name? This isn’t an issue on FB side, but rather when I go back to my blog, the full FB name shows, with maiden and last names. I know 95% of my FB friends would KILL me for that since my blog is, of course, public. ;) Thanks for any help you can offer!

  35. Hi, thank you for this plug-in, and I am two little tweak away from getting it to work.

    When I click on a post link from my Facebook page, it always takes me to the home page of my site rather than that specific post.

    Where is the setting for my blog url being established in this app or in the Facebook app so I can correct it to the full url? Or is there some other way I should be approaching this?

    Errors while loading page from application
    Parse errors:

    FBML Error (line 20): illegal tag “base” under “fb:canvas”

    FBML Error (line 22): illegal tag “body” under “fb:canvas”

    There are still a few kinks Facebook and the makers of clicwithcollegeblog are trying to iron out. We appreciate your patience as we try to fix these issues. Your problem has been logged – if it persists, please come back in a few days. Thanks!

    Any assistance you could offer would be greatly appreciated, thank you!

  36. Without looking into it in detail, I would guess you have your Facebook Application set up for FBML, not for iFrame.

    Or did, anyway, since it looks like it is working now.

  37. Hi, John, not sure if the 12:46 am reply was to me. The settings are for iFrame and resizable, per your instructions, but getting the frame is not the issue. It’s just that each of the individual post links, when clicked, open the home page of my blog in the iframe, rather than that individual post. Is that the intention? With feeds, usually clicking on the name of a post opens that particular post.

    I still can’t find where the path is being set so I can maybe fix it – I am assuming it is defaulting to the home page because it cannot find the single post pages based on a faulty path?

  38. @dmitcha I was talking about the “illegal parse errors” about illlegal fbml tags – that’s usually a sign of not being in iFrame mode.

    The path is set in the wpbook file in a function which filters calls to the_permalink() and wraps them in the right path inside Facebook.

    Thus the path of a post like this: http://www.theclic.net/blog/index.php/plan-for-college-free-test-prep/

    Gets turned into: http://apps.facebook.com/clicwithcollegeblog/index.php/plan-for-college-free-test-prep/

    which should return that post inside facebook, but returns your blog’s home page instead. (I think this is just wordpress’s built in permalink parsing falling back to the home page when it doesn’t get a match).

    What’s the home page of your blog?

    It looks to be http://www.theclic.net/blog/index.php/clic-blog/ – is that what you’ve put for your callback URL?

    My guess is you are doing something with permalink rewriting which is causing trouble for the Facebook plugin – I can’t determine (through trial and error) what the path to an individual post should be .

    It may just be your custom “home page” that is the issue – something is non-standard in the relationship between your blog’s “home page” (the callback url) and the permalinks.

  39. Thanks, John, yes, that’s the home page for the blog and the callback URL, thanks. I don’t (yet?) know how to do anything with permalink rewriting, so I don’t think it’s something I’ve done. But as suspected, it’s probably just not working with an unconventional blog home page. Darn! Thank you for checking – I did try every pattern I could from fbook to get it to work; I will give it a try inside of the wpbook file.

  40. As in the ability to create a tab on the users profile, or as in the ability to create tabs within the application?

    Currently neither are supported. If you have specific ideas about what you’d like to see in a future release, I’m happy to hear them and add them to the list of potential improvements.

  41. I am guessing I mean a tab in the users profile.

    I’d like to see the blog as a tab on my profile page.

    I have a few other questions that may have been asked. is theire more detailed documentation for this?

    So far the only way a person can get access to the app is 1-to know about it or 2-for me to share a posting.

    So far as the comments. Is there a way to intercept facebook wall comments? or am I in drream land. LOL.

  42. What does “add to my profile” do?

    After you add the app and view the blog page for the 1st time.. I clicked it, but have zero idea of what it does.


  43. Me again. The wordbook thing works, BUT it does not allow me to link (of course) to your plug in. WHat I’d like to see is wordbook functionality in your plugin that would give the option of making the link that appears in the facebook page either redirect to the blog home url or the WPbook url.

    Integration. :)


    Hope that was clear. LOL.’

  44. I see you just released 1.1 and I’ve been hoping for updates so this is compatible with Sociable.es Facebook Connector. Do you have a changelog for 1.1?

  45. The changelog is in the bottom of the README.txt that ships with the plugin – I’m planning to blog the release later tonight or tomorrow.

    In terms of compatibility with the Sociable.es Facebook Connector I have not tested/validated that yet. I have wrapped my calls to the Facebook libraries in a check to see if they were already declared, but I’m afraid the Sociable.es plugin is using a non-standard copy of the Facebook client libraries. I’ve reached out to the authors there about it but have not heard back.

    Please do let me know if you get a chance to try it and if it fails with what error(s).

  46. Brilliant thanks

    In the app settings:

    Warning: Missing argument 5 for setAdminOptions(), called in /home2/rareexc/public_html/obrienstore/wp-content/plugins/wpbook/wpbook.php on line 126 and defined in /home2/rareexc/public_html/obrienstore/wp-content/plugins/wpbook/wpbook.php on line 74

    As well for argument 6 and 7


    Warning: Missing argument 8 for setAdminOptions(), called in /home2/rareexc/public_html/obrienstore/wp-content/plugins/wpbook/wpbook.php on line 126 and defined in /home2/rareexc/public_html/obrienstore/wp-content/plugins/wpbook/wpbook.php on line 75

    through argument 12

    That clears when admin settings are set.

    In facebook, on the app page I get the following (http://apps.facebook.com/obrienstore/):

    Errors while loading page from application
    Parse errors:

    FBML Error (line 196): illegal tag “body” under “fb:canvas”

    FBML Error (line 274): illegal tag “iframe” under “fb:canvas”

    FBML Error (line 330): illegal tag “iframe” under “fb:canvas”

    FBML Error (line 663): illegal tag “embed” under “fb:canvas”

    CSS Error (line 689 char 8): Unrecognized at-rule or error parsing at-rule.

    Runtime errors:

    HTML error while rendering tag “script”: App exceeded maximum number of script references

    HTML error while rendering tag “script”: App exceeded maximum number of script references

    HTML error while rendering tag “script”: App exceeded maximum number of script references

    HTML error while rendering tag “script”: App exceeded maximum number of script references

    HTML error while rendering tag “script”: App exceeded maximum number of script references

    HTML error while rendering tag “script”: App exceeded maximum number of script references

    HTML error while rendering tag “script”: App exceeded maximum number of script references

    HTML error while rendering tag “script”: App exceeded maximum number of script references

    HTML error while rendering tag “script”: App exceeded maximum number of script references

    HTML error while rendering tag “script”: App exceeded maximum number of script references

    HTML error while rendering tag “script”: App exceeded maximum number of script references

    HTML error while rendering tag “script”: App exceeded maximum number of script references

    HTML error while rendering tag “script”: App exceeded maximum number of script references

    HTML error while rendering tag “script”: App exceeded maximum number of script references

  47. Ha Ha! I’m so proud of myself… beaming!

    As far as I can tell I’ve got it working with a simple change from the FBML render method on the canvas to iFrame.

    I’m going to play with it more and won’t post another comment unless I have something to share. I look forward to hearing about anything you discover. Bottom line, use IFrame and it seems to work.

  48. darn…. everything looks good except the the app in my profile which reads, “No content to display.

    This box will not be visible to people who view your profile until this application adds content to it.” Even after new posts which should appear there. Now I’m lost.

  49. @paul – you’ve commented on the 1.0 version – are you seeing this error with 1.1? What’s the url of your facebook app, and your blog?

    (All – I’m going to close comments here on this 1.0 post and encourage folks to visit the 1.1 release post and comment there.)

Comments are closed.