Steve's Ramblings

  • Home
  • About
  • LastFM Widgets
  • Post By Mail
  • Site Search
  • Wordbooker
Witterings from the Site owner

← Still Alive

Thoughts on Version 2

October 31st, 2010 by Steve and tagged Computing, facebook, php, programming, Wordbooker, wordpress


Its been quite some time since I started work developing Wordbooker after I forked it off Robert Tsai’s Wordbook plug-in.

It became obvious about 6 months ago that the current code base (version 1.x) was far from ideal and it was starting to confuse me, and when the only coder starts getting lost in his own code you really have to start getting worried.

So I decided that I’d start version 2. I’d take the basic process flow from 1.0 and I’d also re-use code where it made sense but I’d clean things up and change how I modularised the code. I also set up a Google Code page for the plug-in, not for sharing the code on but really to use it as a bug tracker where people could also request new features.

Wordbooker 1.x has two major failings :

  • Comment Handling
  • Resilience to Facebook failures

Plus several other less important issues like not being WPMU/WP Networked Blogs friendly (in that it creates multiple tables per blog) and of course forgetting everything when people de-activate it for WP upgrades or plug-in upgrades.

Comment handling was something that I sort of bolted on and its never really worked properly, and due to the fact that Facebook have imposed a maximum number of feed posts an application can do in a 24 hour window its not something I’ve ever really taken much interest in, but its something that a lot of the users of the application want and it didn’t work with pages so that was top of the “user wants” for version 2.

Being more resilient to Facebook failures is very important – these range from sessions expiring if the user changes their Facebook password, through users hitting the dreaded feed post limit, to the complete breakdown of the Facebook platform : something which is actually all too common.

I’d worked out in my head how I was going to do the first of the two and sitting in the car on the outskirts of Stroud armed with a pad of paper and a pen had given me time to actually turn those vague thoughts into something more concrete.

The second big issue was something that had got me really stumped – the Facebook API is far from stable, and far from reliable, and sometimes it is so slow everything just times out. I’d done some work in the status update code to mitigate against Facebook failing but I’d not really got any clear idea on how to extend the process out to the whole of the Wordbooker plug-in, but it had become obvious that code that expected Facebook to be there, and that had no fall back if it wasn’t, wasn’t really the way forward.

It was a chance request by someone who does a lot of posts at once but only wants them to “trickle” out to Facebook that got me thinking and then I realised that the way I was planning to handle comments could actually be extended to how I’d handle posts.

So I guess I need to explain how comment handling works in Version 1 and how its going to work in Version 2

In V1 comments are handled in two different ways: Comments coming from WordPress are pushed to Facebook immediately with no moderation (even if you’ve got WordPress set to moderate comments). Comments coming to WordPress are handled by a WP-Cron based job which runs once an hour – this basically goes through each of the WordPress posts that Wordbooker “knows” have been published to Facebook, finds the time stamp of the last recovered Facebook comment, then fetches (using Facebook’s own query language) any new comments from Facebook and posts them to the appropriate blog post. Of course there is a problem here in that Wordbooker has to be able to recognise if its pulling comments down from Facebook that its actually posted up in the first place.

Pushing comments from the blog to Facebook counts against the feed action limit so if you’ve done a blog post you are then limited to 25 other post transactions in the next 24 hours – so if you get 26 comments on your blog then that last comment will fail because the post limit has been reached.

So in version 2 when comments are posted on your blog they aren’t posted to Facebook. All Wordbooker does it make a record that a comment has been posted. Then in the background it will check if the comment has been approved and if it has it will push it up to Facebook. If the comment has been marked as spam or deleted then Wordbooker will remove it from its list of comments to be processed. When a comment is posted to Facebook it will record the unique Facebook ID for that comment

Comments coming from Facebook will be checked by Wordbooker to see if the FB ID exists in its comment table (i.e. it’s a comment that Wordbooker created) and if it is then it will quietly ignore it.

Using a process queue like this means that I can handle FB problems easily. If you max out your feed limit or FB isn’t responding properly. then Wordbooker will simply sit there in the background attempting to post and if it can’t then the comments will simply be processed at a later date.

So that’s how comments are going to be handled, well roughly how I plan to do it – no doubt I’ll refine it and change it when I really start working through it all. Now that I’ve explained comment handling I can now explain how post handling will be done.

At the moment when you publish a post to your blog Wordbooker posts it immediately to Facebook – so if you’ve made a glaring mistake in the first part of your post its now sitting there on your FB wall for all your friends to see. The work round for this is to leave the Wordbooker Default Post option turned off and then once you’re happy with the post go in and edit it and force its publication on Facebook.

In version 2 you’ll have the following options when it comes to publishing a post:

  • Publish Immediately
  • Batch for automatic publication
  • Leave on queue

The first option “Publish Immediately” will behave in exactly the same way as publishing does in version 1 – and will be there for those people who are totally confident that their post is correct, and also for posts that have been scheduled for publication at a future date.

“Batch for automatic publication” will flag that the post should be pushed to Facebook at a later date – I’m still working on how the user will control when posts get pushed but it will allow users to basically change the order posts are pushed to FB.

“Leave on Queue” will do just that – the post will not get pushed to Facebook at all and you can edit/change the post to you hearts content and publish it later.

Of course this means that the options page will have to feature a “Queue Manager” which will allow users to manipulate their queued posts – so they can force a post to be published, or add it to, or remove it from, the batch list, or change the order in which posts should be sent to Facebook.

So by basically queueing all posts to Facebook (yes – even immediate post requests will be put onto the queue) it means that if the push to Facebook fails for any reason then the post isn’t lost, and Wordbooker will simply retry at a later date.

There will also be a “Queue process history” (but not with such a clumsy name) where you’ll be able to see the outcome of recent post activities – so rather than just getting a general “feed transaction limit reached” message you’ll be able to see which post failed and what Wordbooker has done since then.

I know that I’ve been telling people that the Options page was getting too complicated and scary, and this is just going to make it much worse. Well I’ve got a solution…the Wordbooker Options page will be divided into several sections. I did look at making it several tabs but it didn’t feel right – so instead I’m using collapsible sections like the ones on the WordPress admin menus.

Right – I think I’ve probably bored you all enough by now so I’ll stop here.

  • Share this:
  • Digg
  • Reddit
  • Print
  • StumbleUpon
  • Press This
  • Email

Category Computing, Witterings, Wordbooker |



9 Responses to “ Thoughts on Version 2 ”

  1.    Fredelig Says:
    October 31st, 2010 at 9:29 am

    Thanks for explaining thoroughly. :)

    I’m sure version 2 will be great. I’m specially looking forward to the “queue process history”.

  2.    Diaan Says:
    October 31st, 2010 at 2:14 pm

    Hi Steve. Just thought I’d say thanks for the work on Wordbooker. It’s one of my favourite WP plugins, and certainly one of the most useful too.

  3.    Paul Says:
    October 31st, 2010 at 2:15 pm

    Not bored at all, and I’m glad you explained it so well. The work you’ve done on v1 is awesome, and I’m looking forward to v2!

  4.    Daniel Says:
    November 5th, 2010 at 1:11 am

    Thank you for such a great core dump of where you are at and where you are going with this. After reading it, I am excited.

    I’m really looking forward to the comments working. When a comment comes in from FB, will it be automatically approved in WP, or will it go into Pending? Or will that be an option?

    Daniel

  5.    Tim Says:
    November 11th, 2010 at 1:46 am

    Definitely looking forward to it! Wordbooker is great, just waiting for that comment feature to function :)

  6.    Chet Says:
    November 11th, 2010 at 3:59 pm

    Steve

    I’ve installed Wordbooker on my WordPress (version 2.8.4) blog and linked it to my Facebook account. I posted a new blog entry after the linking, but the entry did not appear on my FB account. A few hours later, I was unable to access my FB account. I get this error page:

    “Account Temporarily Unavailable.

    Your account is currently unavailable due to a site issue. We expect this to be resolved shortly. Please try again in a few minutes.”

    I have been trying for the last couple of hours.

    I asked a friend to check my FB page and she said she got the message “Profile unavailable”. I can’t access anything on the FB site, and have asked the same friend to email their Help team to check my account.

    The only thing I can think of is maybe the Wordbooker plugin has something to do with it. I can’t access the Wordbooker discussion forum on FB to see if anyone else experienced something similar before. I couldn’t find your contact info to email you, which is why I’m posting a comment here.

    Have you heard from other Wordbookers users if they’ve experienced this, too?

    Thanks.

    •    Steve Says:
      November 11th, 2010 at 4:03 pm

      Its nothing to do with Wordbooker – its FB’s account servers – which is exactly what their message is telling you.

  7.    Chet Says:
    November 11th, 2010 at 4:16 pm

    Thanks for your quick reply, Steve.

    But nobody else is having the problem?

    •    Steve Says:
      November 11th, 2010 at 7:44 pm

      I’ve had it in the past and there do seem to be some very odd things being reported by developers.

  • Facebook Status


     FB photo for Stephen Atty


    Stephen Atty : OK - where's the Lamba key on my keyboard....
    (Sat Jan 21, 4:49 pm).

  •  

  • The Old Stuff

    • October 2010
    • July 2010
    • May 2010
    • April 2010
    • February 2010
    • January 2010
    • December 2009
    • November 2009
    • October 2009
    • September 2009
    • August 2009
    • July 2009
    • June 2009
    • May 2009
    • April 2009
    • March 2009
    • February 2009
    • January 2009
    • December 2008
    • November 2008
    • October 2008
    • September 2008
    • August 2008
    • July 2008
    • June 2008
    • May 2008
    • April 2008
    • March 2008
    • February 2008
    • January 2008
    • December 2007
    • November 2007
    • October 2007
    • September 2007
    • August 2007
    • July 2007
    • June 2007
    • May 2007
    • April 2007
    • March 2007
    • February 2007
    • December 2006
    • October 2006
    • September 2006
    • August 2006
    • July 2006
    • December 2005
    • November 2005
    • August 2005
    • February 2005
    • January 2005
    • December 2004
  • Site Wide Tags


    3G 93 95 accident accounts Add new tag alcohol allergy advice alone alternator america android animal anniversary apache augusta autherley bank basketball beer Beeston benefits birmingham birthday blogging blogs boat boating Bob Geldof Boscastle boston brakes Braunston brewood BSS Bude builders C cable calendar camsigh canalplan canalplan AC car crash car park cars Cast List casualty Cats Challenger chavs cheese cheltenham Chester christian louboutin for sale christian louboutin on sale christian louboutin sale online Christmas cinco de mayo clearsilver coast code coding cold Computer Computing cooker CPRS crackers curry customer service dead depression diet diy dns Download dowód e-commerce easter eli stone elvis email enhancement extension facebook fashion jewelry favourites fish floods food forums Fraud fridge funding g1 gailey garage garden gas GCHQ General Options geospatial gloucester gnosall gold cup goldstone Goodies google Googlemaps granny buttons graph API grub street guinness hackers hallowell Heathrow holiday holidays home home mooring hoover hotel Importing integration intercontinental internet Internet Explorer irish Javascript jen jewellery Jill Joke json kathy kennebunk kestrel kitchen korea ladykat Last.FM latitude lawn LED bulb LED Point Light LED tube leeching lighthouses linux ll bean lonely longitude lunch maine malvern manage routes maps market drayton maths mexican microsoft midges mintball mobile mooring mortgage MOT moving mozart MP Music mystery na Nantwich national hunt netscape new domain new features new server nhs norbury npower ogunquit painting paprika party penkridge petition photos php phpbb pickle plugin Plugins poke in the eye police portland post by email Pożyczka

    Donate

    If you've found anything useful on here and want to say thanks then please feel free:



    WPMUDEV

    WordPress MU, WPMU and BuddyPress plugins, themes and support at WPMU DEV

    Snapshots

    Enhanced with Snapshots
  •  


© 2012 Steve's Ramblings using Dignity theme by themebox

RSS Entries and RSS Comments.

Provided by WPMU DEV -The WordPress Experts
Hosted by Canalplan Blogs


Server uptime: 81 day(s), 11 hour(s) and 09 minute(s) | Server Load: 0.00, 0.07, 0.08

Canalplan Interlinking provided by Canalplan AC Plugin

loading Cancel
Post was not sent - check your email addresses!
Email check failed, please try again
Sorry, your blog cannot share posts by email.