WPBook 1.3 Released: Improved Admin, Bug Fixes – Last PHP4 release

Quick Update: I just (3/27) released 1.3.1, a quick bug fix update. Details in the readme. Recommended for all users – still supporting PHP4 in this bugfix release, as I haven’t started on 1.4 yet.

I’ve just checked the code for version 1.3 of the WPBook plugin into subversion, which means it should shortly be available for auto-update in your dashboard/plugins page, or for download here. (Remember that your dashboard/plugins page only checks once each 24 hours for new plugins, so you may not see it until tomorrow).

wpbook_logo

Changes in this release:

  1. Improved Admin UI – options sorted into categories, with help text
  2. More options: ability to include date with post title, option for custom header/footer including custom date/time formats, tags, categories, and author names
  3. Style cleanup on the “view post on original blog” link (now matches the share this post link)
  4. Bug Fix: No more duplicate blog name on the top of the “Invite Friends” page
  5. Bug Fix: When profile boxes are updated as a result of a new blog post, the permalinks were pointing to the blog outside Facebook, rather than the Facebook urls

I also cleaned up the installation instructions (included in the plugin as an html page and PDF document) to reflect the new options screen and some facebook side changes.

NOTE: This will be the last version of WPBook that will support PHP4.

The Facebook client is only officially available in PHP5, and I need to add some exception handling for cases where the Facebook client fails to update the users profile FBML. (Right now that case, when it occurs, throws a very dramatic if harmless “Uncaught Exception” error in the WordPress interface).

If someone wants to create an alternative version of WPBook for PHP4, they can do so using this release as the place from which to branch, but when WPBook 1.4 comes out, I will no longer include PHP4 support.

Apologies to those of you who rely on PHP4, but it’s time to find a host that can enable PHP5.

Special thanks in this release to Brandon Dukes, who wrote most of the updated code in it. Sorry it took me a week to get it tested, packaged, and released.

Here’s a screenshot showing some of the new customization options:

Options available within WPBook for customizing the user's experience
Options available within WPBook for customizing the user's experience

Here’s the “advanced” options screen:

Advanced Options screen - click for full size
Advanced Options screen - click for full size

Next version, 1.4, I hope will include the ability to post notices into the Facebook status feed and/or news feed when you publish a blog post and (potentially) when comments are published. Not sure what the timeline on that will be, however.

47 Comments

  1. I love this app! It’s a great bridge into Facebook. But I’m getting a 404 error when trying to submit a comment. I’m getting the error at:
    /wp-content/plugins/wpbook/theme/fb-comments-post.php?fb_sig_in_iframe

    Any thoughts? Do I have this set up wrong somewhere?

    Thanks again!
    Matt

  2. @matt – Not sure – can you post the link to the Facebook app corresponding to your blog so I can try it out?

    fb-comments-post.php is the file that is supposed to accept the comments submission form – do you have such a file in your /wpbook/theme/ directory?

    Is your blog installed in a subdirectory?

  3. Hi John,
    Thanks for getting back to me so quick.
    The Facebook app is at: http://apps.facebook.com/heyadeline/

    I checked the directory, and the fb-comments-post.php is definitely in there.

    I was wondering if directory thing is an issue. The blog was originally posted in a subdirectory:
    http://www.heyadeline.com/blog

    Over the weekend I changed the index, and updated the header include so it functions as the index of the site. The rest of the Facebook plugin works perfectly, just not the commenting.

    I have to admit, I was actually amazed your plugin carried the other plugins over to Facebook. I love this plugin, and will definitely keep it in place even if I can’t get the captioning to work.

    Thank you again for your help!
    Matt

  4. Matt – it’s certainly possible that this is the issue.

    The form action, to which the form will submit, is set to: http://www.heyadeline.com/wp-content/plugins/wpbook/theme/fb-comments-post.php?fb_sig_in_iframe

    That seems to be correct. When I submit the form, I don’t get a 404 error, but I get popped out of the FB frame – the redirect that is supposed to send the user, after submitting a comment, back to the front page of the app seems broken.

    Did you change something recently, or was this what was happening before?

  5. Hi John,
    I hadn’t changed anything inside the blog or the plugin. I’m going to really dig into this tonight and see if it is something related to the location of the blog. It might be that simple.
    Thanks again
    Matt

  6. Depends a bit on what you mean. There’s no reason it couldn’t be used on a blog with multiple authors, but it doesn’t currently treat those any differently.

    That is, it will pull all posts by all authors into the Facebook view.

    It wouldn’t be too difficult to edit the plugin so that it only pulled one author’s posts – but it would be quite difficult to manage different Facebook Applications for different authors or anything like that.

    If you mean WordPressMU, I don’t believe so – I know I have not tested it.

  7. I’m getting a weird error that just started today – I admit i’ve been fiddling…

    The Add to Profile button, when clicked, is returning:

    Assert failed: can’t find endpoint

    Break into debugger?

    i tried backing up to previous files that i hadn’t touched, so i’m wondering if you think maybe it has something to do with facebook?

    amazing plugin by the way, especially working in tandem with Facebook Connect…

  8. Actually I’m seeing it on my test blog as well, so something is up.

    Unfortunately, nothing’s really changed here – so I’m at a loss as to why it may have stopped working – must be a change on the Facebook side.

    I’ll see what I can find out in the FB forums

  9. I love the concept of this plugin. I see that it is working correctly in everyone but my case. The plugin installed correctly, I created an app on FB and it appears to have worked correctly because my blog apeears on FB, but all my recent posts links default to the list of recent posts links and whenever I click on a header link in the FB blog at http://apps.facebook.com/idawinston I am redirected to the recent posts listing which will not link to the individual posts. I am sure I have overlooked something simple, can anyone tell me what I am overlooking? Thank you!

  10. Grady – looking at it this am it looks as if you’ve uninstalled the plugin.

    It isn’t clear to me from just your description what might have been going on – most likely a misconfiguration, potentially a bug or some kind of theme conflict.

    Let me know if you want to explore further, but you’ll need to have the plugin installed and active for me to be able to see if I can figure out what’s up.

  11. John, Thank you for the rapid reply. I have created as series of images to help explain the problem I am experiencing and the process I went through to install the application that can be found at http://www.idawinston.org/wpbook. Each image is linked to a larger image that is easier to view in detail. My installation of the WPBook application on FB can be found at http://apps.facebook.com/idawinston/. If you do not see it then that is the first problem. Let me know what else you need from me. All seems to be installed correctly and all works except the links within the actual application at http://apps.facebook.com/idawinston/. Thank you, Grady

  12. Got it – thanks for the explanation.

    The issue is that the callback url for the Facebook application is: http://www.idawinston.com/blog/

    But the permalinks for individual posts are in this form: http://www.idawinston.com/2009/MM/DD/Title

    The problem is that wpbook expects the permalinks to be from the callback url on down, so essentially the facebook app looks for the individual posts at: http://www.idawinston.com/blog/2009/MM/DD/Title

    Not finding an individual post there, it just lists the recent posts as a fallback.

    This is basically caused by a mismatch between the way you have mapped urls and what wpbook expects.

    Only workaround I can see is to either change your permalinks to all have /blog/ at the beginning before the year. This would mean, for example, that this post:
    http://www.idawinston.org/2009/03/25/interstate-22-alliance-advertisement-appears-in-aama-directory.htm

    Would have this url:
    http://www.idawinston.org/blog/2009/03/25/interstate-22-alliance-advertisement-appears-in-aama-directory.htm

    Once the facebook app has a callback url, we can point to posts below that path but can’t go above it – hopefully that’s clear.

  13. Hi,

    Very keen on this application – it looks to be almost exactly what I’m looking for. I’ve just installed it on FB and on WP and it’s *almost* working perfectly, but for one problem.

    I’m getting the following error when trying to post a test reply to a blog post from inside Facebook.
    “Forbidden

    You don’t have permission to access /blog/wp-content/plugins/wpbook/theme/fb-comments-post.php on this server.”

    Which is odd, surely since I installed the plug in, it’s my website, I’m logged into FB under my own profile, etc.

    I tried changing the permissions of the fb-comments-post.php file on the server to full 777 access, but that didn’t make any difference. (I changed them back to the original setting afterwards!)

    Relevant details:
    WPBook v1.3.1
    MySQL v5.0.45
    PHP version 5 point something

    http://www.facebook.com/apps/application.php?id=61551374747
    http://apps.facebook.com/alextreacherblog/

    Settings:
    Allow comments inside Facebook: ON
    Require author’s e-mail: OFF

    Socialise and General options:
    All ON (for the purpose of testing, anyway)

    Custom Header/Footer
    DISABLED

    Any ideas what’s causing this, and what I could do to fix it?

    And an unrelated question…
    Will new posts imported to FB from WP show up in any way on the main feed, even as a single line? (By that I mean will the post have any presence outside the dedicated blog page/canvas to alert other people to their presence?)

    Thanks in advance,
    A

  14. Hi Alex – sorry to be slow in getting back to you.

    The problem you’re having is related to permissions on your /wp-content/plugins/wpbook/ directory – it’s also impacting the css.

    (Try to load http://www.outsider.org.uk/blog/wp-content/plugins/wpbook/theme/default/style.css and you get a 403 Forbidden message).

    I see you tried changing that file, but I believe you’ll need to change the enclosing folders – could be any of:

    /wp-content/plugins/
    /wp-content/plugins/wpbook/
    /wp-content/plugins/wpbook/theme/
    /wp-content/plugins/wpbook/theme/default/

    This doesn’t impact the normal index page because it is addressed directly by the browser but included from the wordpress side – the comments-submitting page needs to be directly addressable from the outside.

  15. Hi John,

    Thanks for this excellent plugin. I am having some problems making it work tho.

    Not surprisingly this plugin seems to be incompatible with the fbconnect one, throwing an exception
    Fatal error: Uncaught exception 'FacebookRestClientException' with message 'Incorrect signature' in /home/sustent/public_html/blog/wp-content/plugins/fbconnect/facebook-client/facebookapi_php5_restlib.php:2618 Stack trace: #0 /home/sustent/public_html/blog/wp-content/plugins/fbconnect/facebook-client/facebookapi_php5_restlib.php(282): FacebookRestClient->call_method('facebook.auth.g...', Array) #1 /home/sustent/public_html/blog/wp-content/plugins/fbconnect/facebook-client/facebook.php(205): FacebookRestClient->auth_getSession('b033c91096fcef3...', false) #2 /home/sustent/public_html/blog/wp-content/plugins/fbconnect/facebook-client/facebook.php(166): Facebook->do_get_session('b033c91096fcef3...') #3 /home/sustent/public_html/blog/wp-content/plugins/fbconnect/facebook-client/facebook.php(68): Facebook->validate_fb_params() #4 /home/sustent/public_html/blog/wp-content/plugins/wpbook/theme/config.php(40): Facebook->__construct('ddb7bc0d228d46a...', 'da73c9991531b5a...') #5 /home/sustent/public_html/blog/wp-content/plugins/wp in /home/sustent/public_html/blog/wp-content/plugins/fbconnect/facebook-client/facebookapi_php5_restlib.php on line 2618

    you can see it in http://apps.facebook.com/sustentator

    I know this is from no fault of your app, or fbconnect’s (maybe, had to tweak it some to get it to work as i wanted it to) … but you are far more experienced than me on this.

    Do you have any idea how I can get these two apps to work together ? maybe you both are including the same connection php file instead of just “include once” … ? or something …

    It would be really helpful if you could give me some ideas of things to test

    Thanks in advanced
    Alex

  16. Alex – which fbconnect plugin (there are at least two, maybe more) and version?

    I don’t even see a line 2618 in the fbconnect plugin I have, in that facebookapi_php5_restlib.php

    If you disable fbconnect does it work?

    There was an earlier problem with the Sociable.es Facebook Connect plugin, which I posted a fix to in another post – but your error seems related to something else.

    You might try updating the copy of the “facebook client” provided by fbconnect with the one from wpbook – but that might break fbconnect.

  17. John,

    heh, I completely left out which plugin I was using. It IS the Sociable.es one.

    Line 2618 is just an exception handler. The exception comes from

    /**
    * Returns the session information available after current user logs in.
    *
    * @param string $auth_token the token returned by
    * auth_createToken or passed back to
    * your callback_url.
    * @param bool $generate_session_secret whether the session returned should
    * include a session secret
    *
    * @return array An assoc array containing session_key, uid
    */
    public function auth_getSession($auth_token, $generate_session_secret=false) {
    //Check if we are in batch mode
    if($this->batch_queue === null) {
    $result = $this->call_method('facebook.auth.getSession',
    array('auth_token' => $auth_token,
    'generate_session_secret' => $generate_session_secret));
    $this->session_key = $result['session_key'];

    if (!empty($result['secret']) && !$generate_session_secret) {
    // desktop apps have a special secret
    $this->secret = $result['secret'];
    }
    return $result;
    }
    }

    This one is the culprit (line 281/282) but i dont understand why.
    array('auth_token' => $auth_token,
    'generate_session_secret' => $generate_session_secret));

    Which fbconnect are you using? it might be faster and less of a pain for me to switch to that one.

    I’ll test your “client” tonight and let you know.

    Thanks for your time.

  18. Hi. Have been battling with your plugin for a good part of the afternoon because I think it’s worth it. Thanks for all your replies to previous questions but I can’t seem to find the answer to mine.
    I’ve followed all the steps and now i’m at the last step where i’m supposed to be taken to a page which says thank you for adding the app. The only thing that shows up is the following error message:
    Warning: Cookie names can not contain any of the following ‘=,; \t\r\n1314’ in /home1/menopau2/public_html/wp-content/plugins/wpbook/client/facebook.php on line 330

    Warning: Cookie names can not contain any of the following ‘=,; \t\r\n1314’ in /home1/menopau2/public_html/wp-content/plugins/wpbook/client/facebook.php on line 330

    Warning: Cookie names can not contain any of the following ‘=,; \t\r\n1314’ in /home1/menopau2/public_html/wp-content/plugins/wpbook/client/facebook.php on line 330

    Warning: Cookie names can not contain any of the following ‘=,; \t\r\n1314’ in /home1/menopau2/public_html/wp-content/plugins/wpbook/client/facebook.php on line 334

    Fatal error: Uncaught exception ‘FacebookRestClientException’ with message ‘Invalid API key’ in /home1/menopau2/public_html/wp-content/plugins/wpbook/client/facebookapi_php5_restlib.php:2618 Stack trace: #0 /home1/menopau2/public_html/wp-content/plugins/wpbook/theme/config.php(62): FacebookRestClient->call_method(‘facebook.Fbml.s…’, Array) #1 /home1/menopau2/public_html/wp-content/plugins/wpbook/theme/index.php(3): include_once(‘/home1/menopau2…’) #2 /home1/menopau2/public_html/wp-includes/template-loader.php(61): include(‘/home1/menopau2…’) #3 /home1/menopau2/public_html/wp-blog-header.php(16): require_once(‘/home1/menopau2…’) #4 /home1/menopau2/public_html/index.php(17): require(‘/home1/menopau2…’) #5 {main} thrown in /home1/menopau2/public_html/wp-content/plugins/wpbook/client/facebookapi_php5_restlib.php on line 2618
    I just don’t know where to start. A little help would be much appreciated. WordPress 2.7 WPBook 1.3.1
    If i’ve done something daft, pls let me know.

  19. The “Fatal error:” line from what you provided above claims “Invalid API key”

    Have you checked (and double checked, and triple checked) that the “secret” and “API Key” are exactly as shown in Facebook and are in the right places?

  20. Thanks for the quick answer. Yes, I had already done that because i copy/pasted those figures just to make sure. I have doubled and triple checked even before posting……..
    Update: decided to reset my secret code. Did it and it worked. So far so good. Thanks for the inspiration.

  21. For some reason I can’t show any images from my post…

    “<a href=”/”><img src=”/images/logo.png”>”

    doesn’t work.

  22. Lynette – can you share an example of where you’re trying to use images?

    Are you saying the images work in the context of the blog post outside facebook but fail inside facebook?

    Also, can you share the url of your blog in and ouside of FB?

  23. Hello John,

    Your plugin would make an excellent addition to our little community website. I’m pretty sure I’ve followed the instructions faithfully but I’m not a programmer and don’t know what to do with these error messages I’m getting.

    Going to the canvas of my fb app here: http://apps.facebook.com/squidlog/ it looks ok, except that it doesn’t show the latest post. Instead, it shows the date of Feb. 4, 2009 and a blank post. Incidentally, Feb 4 was one of the few days that we didn’t publish any post at all. Strangely, the “blank post” has post footer data though.

    In the post footer of all posts the variable %permalink% doesn’t resolve.

    Now when I try to invite some people with the “Invite Friends” button I get a huge error list:
    ————————————————-

    Errors while loading page from application
    Parse errors:

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

    CSS Error (line 156 char 0): Error in parsing value for property.: ‘font’ Declaration dropped.

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

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

    FBML Error (line 318): illegal tag “noscript” under “fb:canvas”

    Runtime errors:

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

    (this last line is repeated about 25 times)
    ——————————————-

    Any idea if this is due to a mistake I made?

    Also, when I’m in the developer’s view of my app at the bottom of the menu is this option:

    ———————-
    Sample Code
    Get started quickly with some example code!
    ———————-

    Is that something I need to do? Or is that supposed to be done by the plugin?

    Thanks so much for any help!

  24. Anne: what are you putting as your callback url in your Facebook application settings?

    It might be related to some complexities of the Hybrid theme you’re using, and how you are handling the blog home page, categories, topics, etc.

    You don’t need to do anything with the Sample Code – that’s just offered by Facebook to help.

  25. John,

    Thanks for this great app!
    As for the comments not working, as you have predicted, it will not work if the blog is stored under a subdirectory. I have mine placed under the directory “blog” from the root directory.

    I did a quick ugly hack to solve this:
    in ./theme/comments.php

    Replace

    <form action="/wp-content/plugins/wpbook/theme/fb-comments-post.php?fb_sig_in_iframe"
    method="post" id="commentform">

    with


    <form action="/blog/wp-content/plugins/wpbook/theme/fb-comments-post.php?fb_sig_in_iframe"
    method="post" id="commentform">

    This would solve the comments issue as the link was not pointing to the right path for my blog.

  26. Please help me figure out below error. I recieve below error when i try to invite friends to it.

    Errors while loading page from application

    Received HTTP error code 404 while loading http://abhi.com.np/blog/category/funny-jokes-videos-pranks/index.php?is_invite=true&fb_force_mode=fbml

    There are still a few kinks Facebook and the makers of Funny Jokes Videos Pranks LOL 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!

  27. Please help me figure out below error. I recieve below error when i try to invite friends to it.

    Errors while loading page from application

    Received HTTP error code 404 while loading http://abhi.com.np/blog/category/funny-jokes-videos-pranks/index.php?is_invite=true&fb_force_mode=fbml

    There are still a few kinks Facebook and the makers of Funny Jokes Videos Pranks LOL 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!

  28. What is the url of your app in facebook?

    What is the url of the blog outside facebook?

    What have you set as the “callback” url inside Facebook?

    It looks as though for some reason the invite page is pointing to the wrong url – but I don’t know why from the outside.

  29. @WebSite Designer Nepal

    Basically I see folks have issues whenever their blog homepage is different than their callback url.

    This is because the “invite friends” link has to construct a link to itself, which it expects to be, based on the callback url:
    http://abhi.com.np/blog/index.php

    But instead the link seems to be pointing to:
    http://abhi.com.np/blog/category/funny-jokes-videos-pranks/index.php

    Are you trying to show only one *category* of posts? That is not currently supported.

  30. Hey, is there a way that when a new post is made it shows a notification in the notification pop-up thing beside the chat bar? Or even a way to add an admin page option to type in a new notification manually and hit Submit then it will show up…

  31. Not in the current release.

    I am working on a next version (1.4 most likely) which will publish to your wall (and maybe to subscribers – haven’t figured that one out yet) using the Facebook Publisher.

    Could be that notifications is a possibility

  32. Yes John you should do that, it surely will be a great feature to the website. Imagine I add it to my website and it directly goes to the facebook walls … AMAZING …

    Thanks,
    Website Design Hong Kong

  33. I have used your plugin here to get my blog on a Facebook application.

    However, there are a couple issues! (1)Recent Posts List is displaying correctly. However, when you click on any of the individual posts in the Recent Posts List, it just takes you to the Recent Posts List again. Doesn’t matter what topic you click on!

    See: http://www.facebook.com/profile.php?id=1149181756&ref=profile

    One the Left-hand side, find the “Sapphire Solutions, Ltd. – Blog” box & Click on any one of them.

  34. Generally when this happens the issue is a misconfiguration, in which the callback url doesn’t match, so wordpress doesn’t find any post matching that permalink.

    I can’t see your profile (to which you linked) as we’re not friends and your privacy settings prevent it.

    What’s the link to your Facebook application (should look something like http://apps.facebook.com/somethinghere/) and what is the link to your blog outside facebook?

  35. You’ll have to provide the url to your blog outside facebook and your app inside facebook for me to see if I can determine what is happening.

  36. @bamair : I had the same problem like you have in your website hence I know what exactly you are trying to say. Please answer John and I will also try to help you on this one. Also I guess you might be seeing an error while trying to invite friends to your application, right?

Comments are closed.