WPBook 1.5 Released – Let the Streaming begin!

WPBook

So for a while I’ve been working on and beta testing the next version of WPBook. Tonight I’ve just tagged it for release, so it will be available for download shortly. (I’ve already been running it here for a while and testing it on a few other test blogs).

The main improvement in WPBook 1.5 is that it now knows how to use stream.publish, meaning that it will automatically post to your wall in Facebook when you publish a post in WordPress. Your friends should see that notification as well in their streams. (We’re not, however, sending application updates or tracking all users’ user id’s – instead you enter your own userid into the settings and it uses that to post to your wall). Included are attachments (first image attached to the post is used) and excerpts (if you hand craft excerpts they will be used in the wall post).

The other main improvement is that WPBook now requires PHP5, and as such can wrap Facebook calls in Try/Catch blocks. For the non-programmer, this means those awful, dramatic “fatal uncaught exception” error screens are gone. WPBook isn’t doing anything terribly meaningful with those errors yet – still working on that- but at least it traps them.

In this release:

Next steps?

What else would you like to see?

Update: Closing comments on this post. For troubleshooting please use the support forums instead.

Did you like this? Share it:
48 Comments. Leave a comment or send a Trackback.
  1. #1 • JetarR said on March 8 2010:
     

    Hey I’m having some problems with the stream functionality:
    When I click the “click here to grant WPBook the permission to publish to your stream.”
    It gives me a new tab with some text and the intended link but further down on the page it says:
    “You are also listed as the admin of these pages:
    Warning: Invalid argument supplied for foreach() in /var/www/sites/ps3expert.dk/public_html/wp-content/plugins/wpbook/theme/index.php on line 75″
    Also, when I click the “Click here to trigger extended permissions dialog box” link it gives me the top of a permissions box, and then just gives me the page again without the surrounding facebook frame.

    Bottom line: My streams don’t work.

    Suggestions?

  2. #2 • JetarR said on March 8 2010:
     

    I forgot: Keep up the brilliant work :)

  3. #3 • John Eckman said on March 8 2010:
     

    JetaR – hmm, forgot to test with a user who is not a page admin of any pages.

    When the page reloads without the facebook frame around it, can you still click on the ‘Click here to trigger extended permissions’ link? If you do, does the permissions dialogue box open?

    I will add a check for empty results for the foreach loop that is throwing the error.

  4. #4 • John Eckman said on March 8 2010:
     

    JetaR – just checked in a fix and tagged it 1.5.1 – not sure how quickly the repository will show it.

    Auto update inside WordPress only checks once every 24 hours I think, but you can grab it from the repository at wordpress.org/extend/plugins/wpbook

  5. #5 • jonolan said on March 8 2010:
     

    I’m getting the following error every time I publish a post now that I’ve turned on the streams functionality:

    Fatal error: Call to undefined method FacebookRestClient::stream_publish() in /homepages/16/d92277137/htdocs/wordpress/wp-content/plugins/wpbook/wpbook.php on line 899

  6. #6 • JetarR said on March 8 2010:
     

    Hi John, thanks for the speedy reply.
    same error with 1.5.1.
    And the first time i clicked the link in the facebookless window i got the dialog, subsequently i just get booted to the front page og my app. which I guess would be working as intended.

    When I post I also get the “Fatal error: Call to undefined method FacebookRestClient::stream_publish() in /homepages/16/d92277137/htdocs/wordpress/wp-content/plugins/wpbook/wpbook.php on line 899″
    I just thought it was i fluke, thus it was not mentioned in the first post. Sorry about that.

  7. #7 • JetarR said on March 8 2010:
     

    Erhhh… not entirely the same message, mine’s:
    “Fatal error: Call to undefined method FacebookRestClient::stream_publish() in /var/www/sites/ps3expert.dk/public_html/wp-content/plugins/wpbook/wpbook.php on line 899″

    Note to self: Think before writing so as to not spam poor john.

  8. #8 • jonolan said on March 8 2010:
     

    I believe that JetarR and I are experiencing identical errors, both with the permissions link and the publishing.

  9. #9 • David said on March 8 2010:
     

    I’m getting something different. A little help and or how do how do I revert to the old version.

    Parse error: syntax error, unexpected ‘{‘ in /home/content/a/s/i/asiamahd/html/CTM/wp-content/plugins/wpbook/wpbook.php on line 842

  10. #10 • John Eckman said on March 8 2010:
     

    Hmm. Is it possible you are using another Facebook Plugin, like the FB Connect one?

    It seems like you have an outdated version of the Facebook Client, which does not have the streaming in it.

    If you are using another FB related plugin, try disabling that first.

  11. #11 • John Eckman said on March 8 2010:
     

    David – you’re on version 1.5.1, or 1.5?

    To revert to an older version just delete the version you have and download an older version from the repo here:

    http://wordpress.org/extend/plugins/wpbook/download/

  12. #12 • JetarR said on March 8 2010:
     

    Deactivating WP-FB Connect does the trick… any recommendations as to which “log on to my WP with your facebook” plugin works with WP book?

    Btw is it possible to change the text that is “streamed”? The name of the person is shown twice:
    “Henrik Jacobsen Henrik Jacobsen has published a new blog post at PS3expert.dk”
    The first one is the FB name link the other is plain text.

    Also: I’d be cool if the app could push updates to the members stream, I read that you choose not to do this, why?

  13. #13 • John Eckman said on March 8 2010:
     

    Don’t know – I don’t use any “log onto my WP with your Facebook” plugins.

    The issue isn’t that plugin, it’s that the plugin includes an outdated version of the Facebook client library – you could probably replace the Facebook client they provide (in some kind of /client subdirectory) with the one from WPBook and re-enable.

    Pushing updates to the member stream requires:
    1. Each of the members to grant the app permission to publish to their stream
    2. WPBook to keep track of all the uids of all the users who have granted permission

    Wouldn’t rule it out in a later version but figured it made sense to start with the core use case which is the author.

    To change the text streamed, look at line 858:

    $message = $my_author .’ has published a new blog post at ‘. get_bloginfo(‘name’);

    It’s only the same in your case because you are publishing to your own wall – if you also published to a Page’s wall, you’d see something different (or if another author on your blog posted).

    Next step I think is to accept an array of uids in the admin – this would let multiple authors work.

  14. #14 • jonolan said on March 8 2010:
     

    The problem and resolution are confirmed. Disabling the FaceBook Connect plugin allowed WPBook to function correctly.

    Thanks!

  15. #15 • JetarR said on March 8 2010:
     

    Ah, that makes sense. Thanks for all the help, I’ll replace the client library and see what I get :)

  16. #16 • JetarR said on March 8 2010:
     

    Replacing the Facebook Client library in WP FB Connect did the trick. Both plugins seem to work now.

  17. #17 • David said on March 9 2010:
     

    1.4.2 now. I can’t remember if I ever made it to 1.5 but I know 1.51 didn’t work and when I stepped down to 1.5 I had the same issue. The frame didn’t fit. Requiring one to scroll to the right to experience the whole page. Any ideas why it didn’t fit? At any rate its an awesome program. Thanks much for developing it.

  18. #18 • Esp said on March 9 2010:
     

    I’ve been waiting for WPBook 1.5 for a long time. Thank You for that job John!

    I have a problem. Whenever I’m trying to connect WPBook with FB I get that info:
    “his page has NOT granted stream.publish permissions to this app”

    Where can I change that?
    In page preferences I have only “Publish last activity”, no “publish stream”. Am I able to change that?

  19. #19 • John said on March 10 2010:
     

    Esp – you change that on exactly the same page where you are seeing it say “this page has NOT granted permissions.”

    In WPBook’s settings page inside your WordPress install, there is a link which says “click here to grant WPBook permission to publish to your streaam”

    Click on that link, and in the page that loads, click on the link which says “Click here to trigger extended permissions dialog box”

    In the dialogue box that opens, there is a dropdown labelled “Allow setting for: ” and a list of the pages for which you are an admin.

  20. #20 • John said on March 10 2010:
     

    David – the issue you’re having with the grame not being the right size seems a different issue.

    Can you open a thread in the WordPress forums

    Go to http://wordpress.org/extend/plugins/wpbook/ and click on the “see what others are saying” link

  21. #21 • Esp said on March 10 2010:
     

    Hi John, thanks for the answer, but I still have one problem – FB publish my WP posts in “Boxes” tab, not on the wall, where I would like to get them. Can I handle that?
    (http://www.facebook.com/pages/Zlomnik/209438124617)

  22. #22 • John said on March 10 2010:
     

    Esp – if your posts are published to your “boxes” tab, that’s the old mechanism, which has been around since 1.2 I think.

    The new stream.publish based option will show up on your wall.

    So when you go to the “Click here to grant WPBook permission to publish to your stream” is the page to which you are trying to publish listed? Does it say permission has been granted?

  23. #23 • Dean said on March 10 2010:
     

    Hello John, thanks for the wonderful plugin. I got it installed, everything seems to be working except my latest blog posts do not show up in my Facebook wall, instead they show up in the “box”.

    You mentioned in the reply above “Click here to grant WPBook permission to publish to your stream”… where do I look for this setting?

  24. #24 • Dean said on March 11 2010:
     

    Ignore my earlier question. I have found the link eventually — it is in the WPBook settings page in my WordPress blog, under the header of “Stream Publishing Options”

    I kept looking at the settings in my Facebook, that was why I couldn’t find it. Thanks again for the great plugin! Love it already!

  25. #25 • Esp said on March 11 2010:
     

    Yes it does. It says
    “You are also listed as the admin of these pages:
    * Z?omnik (209438124617), This page has granted stream.publish permissions to this app”

  26. #26 • Dean said on March 11 2010:
     

    Wait a second… I spoke too soon. Although I have clicked the permission link, which seems like I have set it correctly, my posts still do not show up in my Facebook: neither in Wall or News feed. What am I missing here?

  27. #27 • John said on March 11 2010:
     

    Dean – have you also added your Facebook profile ID number to the appropriate spot in the WPBook settings page (in WordPress)?

    Have you also published a new blog post, or unpublished and existing one and published it again?

    Stream.publish will only work for posts pubished *after* you’ve activated the checkbox in WPBook setings, filled in your user profile id in WPBook settings, and granted permission.

  28. #28 • John said on March 11 2010:
     

    Esp – I assume you have added your FB profile ID to the WPBook settings (in WordPress) and checked the “publish new posts to Facebook stream” box?

    Have you posted new blog posts since granting permission, checking the box, and adding your user profile to the WPBook settings?

    I hope to release this weekend a version which does a better job of exposing the error messages that come back from Facebook when stream.publish gets called – maybe a debug switch

  29. #29 • Dean said on March 12 2010:
     

    @John still no luck. I have entered the correct Facebook profile ID (a long string of numbers), and I have tried republishing old entries as well as adding new entries, none came up on the wall.

    It got me thinking: should I expect to see the “stream” in my News feed (main Facebook landing page), or my Profile page, or my application profile page, or the actual application page (apps.facebook.com/xxxx)?

  30. #30 • John Eckman said on March 12 2010:
     

    @Dean – your “stream” posts should appear in your profile page – as though you had posted them. They may also appear in your friends’ News Feeds.

    You should also seem the posts on the application page, but that is functionality core long before 1.5 – that’s how WPBook has always worked.

  31. #31 • Dean said on March 12 2010:
     

    And it appears on none of the pages you mentioned, except the actual “application” itself, which is at: http://apps.facebook.com/octobertwenty/

    My application profile is at http://www.facebook.com/apps/application.php?id=349845601889 (as you can see it is blan)

    My Facebook profile is at http://www.facebook.com/dean.loh.yen.yoon (welcome to add me as your friend, you’ll see it doesnt have any feed from my blog)

    Grr…. I feel stupid now…

  32. #32 • John said on March 12 2010:
     

    @Dean

    When you go to your WPBook settings inside WordPress, is the “Publish new posts to Facebook Stream” checkbox checked?

    When you go to the url linked from that spot in WPBook settings (“click here to grant WPBook the permission to publish to your stream”) what do you see on that page?

    Is that the profile ID you’ve entered into the profile ID box in WPBook?

    Did you click on the “Click here to trigger extended permissions dialog box” link, and did yu get a dialogue box from Facebook telling you an app was requesting permission to publish to your stream?

    (You can also check by going in Facebook to My Account->Application Settings and then clicking on “Edit Settings” for your app, and looking at the “Additional Permissions” tab of the resulting dialog box – it should have a checkmark next to both of these: “Access my data even when I’m not using the application” and “Publish to streams.” If this is not set then you have not yet granted permissions).

    Ignore the application profile for now. The application itself looks like it is working fine.

    If the above tests show that you *HAVE* successfully granted permission and your FB profile ID is correct, you’ll need to run a special debug build for me to see what error FB is returning.

  33. #33 • Dean said on March 12 2010:
     

    @John

    “Publish new posts to Facebook Stream” is checked all along.

    Have also clicked the link that goes to the grant permission page, copied and pasted the userID back to my WordPress settings.

    However, when I clicked on “Click here to trigger extended permission dialog box”, the dialog box did pop up, showing that it was loading, but before it finished loading, the entire page was refreshed into a blank page, displayed the same block of text as previous, that says “This page is just for the author of the blog to grant extended permissions.

    Your userid is XXXXXXX

    You will need to enter that number into WPBook’s settings page on your WordPress install…”

    I believe this is the part where things stopped working. I have tried using different browser to no avail. My default browser is Safari. Have tried Chrome.

  34. #34 • Dean said on March 12 2010:
     

    Further more, when I looked at application settings in my Facebook account, under Additional Permissions I can only see a checkbox with label: “Publish recent activity (one line stories) to my wall” which is checked. The other two settings were not there.

  35. #35 • John said on March 12 2010:
     

    So when the second, blank page comes up which contains the “trigger permissions dialog box” link on it, have you clicked that one?

    Can you try it in Firefox?

  36. #36 • John said on March 12 2010:
     

    Clearly what’s failed is granting stream.publish permission – until that permission is granted WPBook will not be able to publish to your stream.

  37. #37 • Dean said on March 12 2010:
     

    The mystery is solved!!

    Know what was the problem? It was the Connect URL that I’d missed! I entered the URL of my blog and viola! Everything is in order now!

    Thank you so much John, for helping with the troubleshooting. Hats off to your professional attitude! Tell me, how can I buy you a beer? You have a PayPal account?

  38. #38 • Guy said on March 12 2010:
     

    I automatically updated to 1.5.1, but activation failed. This is the error: Plugin could not be activated because it triggered a fatal error.

    Parse error: parse error, unexpected ‘{‘ in /home/sites/site134/html/blog/wp-content/plugins/wpbook/wpbook.php on line 842

    Ideas?

  39. #39 • John said on March 12 2010:
     

    Hmm. Might be some kind of file corruption while upgrading? Try removing all the plugin files (uninstall/remove) and re-installing?

    Did you ever run 1.5, or was it only 1.5.1 that had the error?

    Is your host running PHP 5?

  40. #40 • John said on March 12 2010:
     

    You mean the “Connect URL” setting in Facebook? (Facebook “developers” app, edit application settings, Facebook Connect section?)

    I did not even realize that was required – but that’s great to know.

    Thank you for continuing to try – hope it will help others.

  41. #41 • Esp said on March 12 2010:
     

    So I’m the only one who cannot establish WPBook properly. I did everything again today, checked 3 times and still no effect.

    connect URL is ok, Click here to grant WPBook permission to publish to your stream – done, proper ID pasted in box and still nothing. Should I wait for debug then?

  42. #42 • John said on March 12 2010:
     

    I wouldn’t say you’re the only one who can’t get it working, but I do know myself and others have gotten it working – so the issue is trying to narrow down what is different about your setup.

    I will push out a build with debug options this weekend, which should capture whatever error is preventing yours from working. (I’m assuming Facebook is returning some kind of error to the stream.publish call).

    Do the posts get published to your personal profile (seems the link you sent before was to a page)?

  43. #43 • Esp said on March 12 2010:
     

    No, they don’t. I granted permission to page and my profile and posts don’t show up at any of them.

  44. #44 • Esp said on March 13 2010:
     

    Shame on me, I found the answer: I put my page ID instead of mine ID at the WPBook. Everything is working now. Thanks for help John.

    I still have two questions:
    1. Should my page fans get info on their walls that there’s something new at my page? I’m a fan of my page and when I wrote new post it shows up at the fb page, but me as a fan didn’t get any info on my wall.
    2. Is it possoble that WPBook publish the miniature of photo or Youtube clip that I included in blog post?

  45. #45 • joshuatj said on March 14 2010:
     

    Hi JetaR, I’m also using WP FB Connect. However, I have no idea how to “replace the client library”, can you help me out here?

    Thanks.

  46. #46 • Rog said on March 15 2010:
     

    HI John,
    Great work on this plugin!

    I’m running 1.51

    I’m also having problems posing to my own facebook stream. I have the same problem described above by JetarR when I click the ‘grant wp permission’ link in the settings. It takes me to facebook but shows this error…

    Warning: Invalid argument supplied for foreach() in /home/rogerhow/public_html/wp-content/plugins/wpbook/theme/index.php on line 75

    despite this I can still click the ‘trigger extended permissions’ and it takes me back to the app page.

    Then when I post a new item on my wp page (afsradio.com) it IS published on my facebook, BUT if I log out of facebook then post on my wp I an error beginning…

    Fatal error: Uncaught exception ‘FacebookRestClientException’ with message ‘Session key invalid or no longer valid’ in /home/rogerhow/public_html/wp-content/plugins/wpbook/client/facebookapi_php5_restlib.php:3065 Stack trace: #0 /home/rogerhow/…

    Any idea what’s going on here?

    I am admin on the application page (http://www.facebook.com/apps/application.php?id=407482068168)

    Thanks for your help!

  47. #47 • Rog said on March 15 2010:
     

    Great work on this plugin!

    I’ve got a similar issue to Jetar, I get the same error on the ‘grant permissions’ page. Although I am admin on the app facebook page (http://www.facebook.com/apps/application.php?id=407482068168)

    weirdly my streaming to my facebook works when I’m logged into facebook but I get this errorwhen I post on WP and I’m not logged in to Facebook…

    Fatal error: Uncaught exception ‘FacebookRestClientException’ with message ‘Session key invalid or no longer valid’ in /home/rogerhow/public_html/wp-content/plugins/…….

    Any help much appreciated!

  48. #48 • John Eckman said on March 15 2010:
     

    Somehow it seems you have not granted the “offline updates” permission, perhaps for the page?

    Are you trying to get the updates to post into your *personal* Facebook profile, or the profile of a Fan Page?

    Have you added the profile box to your Facebook page? (Enable “show add to profile box” in the WPBook settings and then load your app and use the “add to profile” box).

    It may be that I’ve inadvertently skipped a step here – that adding the profile box grants a permission necessary for stream publishing.