WordPress and Facebook Integration
I’d been using the Wordbook app for quite a bit but I’d always found that it lacked some features that I liked. I’ve now added these functions and got it doing things how I’d like.
So rather than keep cluttering up the original wordbook application page I’ve forked by code off totally.
I created a new Facebook application called Wordbooker and then created a new plugin called Wordbooker in the WordPress Extensions site.
Upgrading from the Forked Version.
As this is basically a new application its a bit messy as doing a normal removal of the old forked version will remove any record of posts/comments made with the forked version.
If you wish to retain that history then you need to back up the existing wordbook_postcomments table BEFORE you remove the forked version of wordbook.
Go into the options page for Wordbook and reset the configuration for wordbook
From the plugins page de-activate the wordbook plugin.
Delete the wordbook directory from wp-content/plugins
Upload the wordbooker directory into the wp-content/plugins directory
Go into the Plugins page and enable Wordbooker.
Go to the options page for Wordbooker and it will ask you to get a login key from Facebook and then ask you to grant two extra permissions needed by Wordbooker – these allow Wordbooker to publish to your wall and also to fetch comments from it.
Click on the Save Configuration button.
You can then set up the various options on the option screen:
** Multiple Facebook account / WordPress account support **
If you as the blog owner only want it so that WP posts go to your FB account then go into the Options screen and set the default account to be yours, and that should be it, any person using a different WP account to post to your blog will publish those stories to your FB account.
But what if you’ve got a Family WB where different people would like to post to WP and to their OWN FB accounts. Simply get each of them to login to WP as themselves and configure WB as if they were the only user. Then when all of them have done this go back in as yourself and set the Default account to be you.
On the Edit Post page there is a WordBook Options block which includes a drop down list of the blog you wish to post to, if you want to post to your default blog then you don’t need to touch this but if someone wants to post that post to their FB account all they need to do is pick their name from the drop down list before they post.
** Length of Extract **
This allows you to change the length of the extract posted to Facebook. The minimum value is 200 and the maximum is 400 (at the moment) with the default being 256 characters. The extract will be trimmed to the nearest full word BELOW this value.
** Default Publish Post to Facebook **
This allows you to choose if posts should automatically be posted to Facebook. This option can be overridden from the Edit Post page
** Post Attribute **
This allows you to change the attribute line when posts are sent to Facebook. By default this is set to “Posted a new post on their blog”. This option can be overridden from the Edit Post page.
** Republish Post if edited more than x days ago **
This allows you to control how long it should be before Wordbook considers an edited post to be a “new” post and re-publishes it to Facebook.
** Override Re-Publication window **
This allows to to force all edits to be reposted to Facebook ignoring the republish window. This option can be overridden from the Edit Post page.
** Update Facebook Status **
If this option is checked then the title of your blog post and its permalink will be posted to your status, along with the text specified here. This can be overridden from the Edit Post page. NOTE: If this option is Selected then your status is ALWAYS updated, even if you choose NOT to publish your post to Facebook.
** Import Comments from Facebook for Wordbook Posts **
This version of Wordbook supports the importing of comments made on Facebook back into your WordPress blog. This allows you to set the default behaviour. This option can be overridden from the Edit Post page
** Auto Approve imported comments **
If you trust your friends on Facebook then you’re probably quite happy for their comments to automatically get posted as comments on your WordPress blog. If this option is not set then any imported comments are held in the moderation queue.
Once you’ve got the options set how you want then save them.
If you exported the wordbook_postcomments table before upgrading then you can now import it back into the database.
There may be times when you you are posting a blog entry and you’d like to do something differently, like NOT publish a post, or change your choice on what you do with comment. So on the Add New and Edit posts page you should now find a Wordbooker Options Override block where you can override several defaults:
If you are the administrator of a Facebook Fan page then you’ll also be given the option of posting to that page instead of posting to your own wall. At the moment there is a bug in the API which means that posts made to Fan Pages are shown as YOU posting on the Fan Page wall – rather than it looking like the Fan Page has posted the post directly.
PROBLEMS
If you’ve got problems its probably best to post them on the Wordbooker Page on Facebook where people can create new threads for each bug/problem and people can easily see if any fixes have been made


January 11th, 2010 at 4:11 am
Hey,
Just wondering if there’s a way to have the plugin post to a fan page feed? I set up a wordpress and bought a domain for my girlfriend for christmas and have been trying to figure out how to cross-pollinate her FB fan page for her blog with her wordpress. She doesn’t want it to post to her personal profile, and I feel like this is something obvious that I’m missing. Love the plugin!
January 11th, 2010 at 8:11 am
At the moment publishing to fan pages is broken because of a bug in the Facebook API which I’ve reported and I’m waiting on a fix.
Once that is fixed and posts to fan pages appear on the wall as being from the fan page itself I’ll change the options page so that publishing to a fan page becomes a properly selectable option.
January 11th, 2010 at 6:18 pm
That sounds great Steve, thanks so much for the swift response! I’m looking forward to the bug fix.
January 12th, 2010 at 2:09 am
Great plugin Steve it works like a dream. I second ngszehin’s request for the plugin to work with scheduled posts. If you could add it that would be great. Thank you.
January 12th, 2010 at 8:00 am
Thomas, scheduled post support is coming in 1.5 – just troubleshooting it as we speak!
January 14th, 2010 at 1:04 am
thanks for the upgrade. Installed already.
January 14th, 2010 at 4:16 am
Steve – thanks for the upgrade with scheduled post support. I hope to test it out tomorrow.
January 14th, 2010 at 3:34 pm
Just confirming that the scheduled post support worked like a charm. Thanks again.
January 15th, 2010 at 3:41 pm
Hi steven,
With this new update a couple of things have changed, 1 the excerpt stays at 300 characters no matter what the pull-down selection is. e.g. if set at 256 or 250 it jumps back to 300 when saved. 2. the picture from the blog is no longer showing on the post. did I miss a preference?
January 15th, 2010 at 3:59 pm
Changes in the FB API mean that only 1 photo is shown until you click on the MORE link.
The extract length is a bug introduced when I was moving code round. It will be fixed in the next release.
January 15th, 2010 at 4:08 pm
Hi,
there is only one photo on the blog page which used to be published (if I had two Wordbooker would randomly choose it seems. where is the ‘more’ link? is that set in the ‘settings’ with the pull-down? the link that shows up on FB is “read full article”
January 15th, 2010 at 4:28 pm
When you publish you should see your extract and underneath it there should be a “See More” tag:
http://www.tty.org.uk/see_more.png
If you click on that then the rest of the extract will appear along with more photos. Unless FB have changed their layout again.
January 15th, 2010 at 4:48 pm
Hi again,
I still don’t see the “more” I am using the plugin to pull the entire blog rather than an except.
here is an example of yesterday’s blog and today’s blog
http://www.blackshade.net/samples.html
January 19th, 2010 at 4:37 pm
Im trying to add wordbooker to my site and keep gettin the following error when attempting to activate the plug-in.
Parse error: syntax error, unexpected ‘{‘ in /home/imspos3/public_html/blog/wp-content/plugins/wordbooker/wordbooker.php on line 140
Any ideas?
Thanks
Alex
January 19th, 2010 at 4:40 pm
Are you on PHP5?
January 19th, 2010 at 6:38 pm
Getting the following error when I update a post: (I am using PHP5.)
Fatal error: Uncaught exception ‘FacebookRestClientException’ with message ‘Updating status requires the extended permission status_update’ in D:\home\counterpointonline.net\wwwroot\blog\wp-content\plugins\wordbooker\facebook-platform\php\facebookapi_php5_restlib.php:3112 Stack trace: #0 D:\home\counterpointonline.net\wwwroot\blog\wp-content\plugins\wordbooker\facebook-platform\php\facebookapi_php5_restlib.php(1860): FacebookRestClient->call_method(‘facebook.users….’, Array) #1 D:\home\counterpointonline.net\wwwroot\blog\wp-content\plugins\wordbooker\wordbooker.php(1376): FacebookRestClient->users_setStatus(‘Counterpoint Bl…’) #2 D:\home\counterpointonline.net\wwwroot\blog\wp-content\plugins\wordbooker\wordbooker.php(1396): wordbook_publish_action() #3 D:\home\counterpointonline.net\wwwroot\blog\wp-content\plugins\wordbooker\wordbooker.php(1463): wordbook_transition_post_status() #4 D:\home\counterpointonline.net\wwwroot\blog\wp-includes\plugin.php(339): wordbook_publish(Object(stdClass)) #5 D:\home\counterpointonline in D:\home\counterpointonline.net\wwwroot\blog\wp-content\plugins\wordbooker\facebook-platform\php\facebookapi_php5_restlib.php on line 3112
January 19th, 2010 at 7:54 pm
Try setting the permissions with this URL
http://www.facebook.com/authorize.php?v=1.0&api_key=0cbf13c858237f5d74ef0c32a4db11fd&ext_perm=status_update
It looks like Facebook sometimes doesn’t set the Status Update priv when it does the rest.
I’ll add it into the next release along with a check
January 19th, 2010 at 9:25 pm
Thanks. That corrected it.
Clarification: From reading it appears that you are waiting on a WP fix to enable posting to a FanPage. Is this correct?
Also, can ALL posts (from two different WP authors) be posted to two different FB accounts? If so, will the two-way Comments transactions function properly.
January 19th, 2010 at 9:28 pm
I am waiting for a bug fix for it to work properly.
at the moment one post can only go to one single FB account at a time. If you wanted to post article A to three different FB accounts you’d have to publish it to one and then do an update post and force republish – with a different user selected.. Comments from FB to WP would work but no the other way roumd.
January 23rd, 2010 at 3:49 pm
Hey:
Im having a problem with the plugin and im hoping you can help.
I installed the wordbooker plugin and went through set up and started getting errors all across my dashboard. So i decided to uninstall/reinstall but the dashboard wouldnt allow me. So I FTP’d over and removed the plugin. still having the same errors. I have restored my whole WP SQL database to a week ago and a complete Restore of the site…still having problem. I have re-installed the plug in several times…still having the problem… Im hoping you can help me resolve it or i will have to wipe the server and start the site from scratch..the dashboard is so messed up it wont even allow me to export all my data to a XML file.
When i log into my dashboard i get this…about 1000 times in every area except the stats
Warning: file(/home/deettekattel/atlantapropertypros.com/wp-content/home/deettekattel/atlantapropertypros.com/wp-content/themes/agentpress_1.02/sidebar.php) [function.file]: failed to open stream: No such file or directory in /home/deettekattel/atlantapropertypros.com/wp-content/themes/agentpress_1.02/tools/post_templates.php on line 23
Warning: implode() [function.implode]: Invalid arguments passed in /home/deettekattel/atlantapropertypros.com/wp-content/themes/agentpress_1.02/tools/post_templates.php on line 23
Warning: file(/home/deettekattel/atlantapropertypros.com/wp-content/home/deettekattel/atlantapropertypros.com/wp-content/themes/agentpress_1.02/search.php) [function.file]: failed to open stream: No such file or directory in /home/deettekattel/atlantapropertypros.com/wp-content/themes/agentpress_1.02/tools/post_templates.php on line 23
Warning: implode() [function.implode]: Invalid arguments passed in /home/deettekattel/atlantapropertypros.com/wp-content/themes/agentpress_1.02/tools/post_templates.php on line 23
Warning: file(/home/deettekattel/atlantapropertypros.com/wp-content/home/deettekattel/atlantapropertypros.com/wp-content/themes/agentpress_1.02/redirect.php) [function.file]: failed to open stream: No such file or directory in /home/deettekattel/atlantapropertypros.com/wp-content/themes/agentpress_1.02/tools/post_templates.php on line 23
Warning: implode() [function.implode]: Invalid arguments passed in /home/deettekattel/atlantapropertypros.com/wp-content/themes/agentpress_1.02/tools/post_templates.php on line 23
it goes on and on…referencing every file….it basically says that over and over on every page in the ADMIN area
thanks in advance for your help!
January 23rd, 2010 at 4:00 pm
If you’ve removed my plugin code from the directory and you’re still getting the problems then I hate to say it but its not my code. The plugin only hooks into about 4 wordpress hooks and makes no changes to any core files.
It adds a few tables into the database and a couple of options into the blog options table.
If you delete the wordbooker directory from the plugins directory, and the wordbook_ tables and the two configuration options that will completely remove the plugin.
Also those are just warnings. Its recommended on a live site that on screen warnings and errors are supressed and sent to an error log instead.
Looking at those warnings I’d say its a problem with agentpress.
January 29th, 2010 at 8:20 pm
Great plugin. Would there be a way to post to FB links that you add to your Blogroll, for example. I continually add links on my sustainabledelco site and it would be useful to post on FB too.
January 29th, 2010 at 8:26 pm
Its something I can look at – just don’t forget that the number of posts to the wall per day is limited by Facebook so each blogroll add would use up of one of those posts.
January 29th, 2010 at 9:41 pm
Maybe you could roll them up per day and post them at 5:00pm.
By the way, what is the max FB posts?
January 29th, 2010 at 10:03 pm
It depends, some people say 10 a day, some people say its 15-20 in a 48 hour rolling window. I think it depends on how “big” your application is. The bigger it gets the more capacity you get.
1.7 (or 1.8) will batch WP comments for uploading – just to make it more spam proof and more resilient to glitches in the API.
February 3rd, 2010 at 6:01 am
Hi there Steve.
Great plugin, but at the moment I have disabled it because I am struggling to get it to do exactly what I want.
I don’t want it sending a post to a ‘Personal Profile’ on facebook – I only want it sending to Fan Pages so the ‘And/Or’ option is baffling me.
The other thing that I don’t like is the way it pulls in status updates from my personal facebook page on the admin screen. I want to disable all links with my ‘personal’ profile altogether and focus entirely on sending blog posts to fan pages.
Cheers.
Martin
February 3rd, 2010 at 8:36 am
I can make displaying your status in the blog admin page an option. Some of the reason for that being there is to confirm that your facebook session is still valid and that your blog and facebook can talk to each other.
February 3rd, 2010 at 6:53 am
Hi Steve…
Thought I’d update after my earlier comment.
I seem to have now managed to get posts going to the Fan Page without sending a status update to my Personal Profile.
However. Posting after updating a post; The post is going onto the fan page twice.
And, is there any way of getting the link in FB to show one of the images from the gallery? Ok, that’s maybe pushing it a bit but I thought I’d ask.
All the best.
Martin
February 3rd, 2010 at 8:33 am
Just to confirm – if you go in and edit a post and have forced it to be republished it is actually republished twice to the wall?.
The layout of the wall post is controlled by Facebook. All we can provide is some text, an action link (or two) and upto 5 images.
1.6.1 doesn’t properly support images loaded into the post by some third party galley plug ins. However 1.7 does.
February 4th, 2010 at 9:15 am
Hi there! Thanks soooo much for this kick ass plug-in. This is the best thing since Pac Man.
I have a question and wondering if the creator or people around knows about – I’ve installed Disqus plugin on my WP, although my blog articles get automatically posted onto FB, the FB comments cannot be posted back.
I tried to import comments back into Disqus and it doesn’t work. I don’t mind it THAT much, but having FB comments posted back is still kick ass, if combined with Disqus it will be total pwnage!
Anyone have any ideas?
February 4th, 2010 at 1:34 pm
I’ve never used Disqus so don’t know anything about how it works. Wordbooker keeps tracks of its own posts and comments so I guess it would be possible to do some integration. I’ll be changing the way Wordbooker handles comments in 1.8 due to some of the limits imposed by Facebook on external apps such as Wordbooker – so I’d not suggest anyone looks at trying to link the two plugins right now.
February 6th, 2010 at 5:17 pm
hello,
i use your plugin but i have question for my website. I edit post with no-future plugin for my agenda of night party.
I want to publish the post on facebook before the date of the party in order to advice people 1 or 2 week before.
is it possible ?
thank you
February 6th, 2010 at 10:34 pm
Hello Steve,
I’ve been experimenting with this fine plugin but came across a little oddity. Whenever the title contains any umlaut, it’s skipped. It works all fine for the excerpt though.
I saw the section with all the encoding options, but since there’s no problem with the excerpt, I was wondering, if there’s just something missing? (Well, obviously I am missing somethin’ here…
Thanks,
Stefan
February 7th, 2010 at 2:17 pm
Stefan. I’d checked for umlauts, or thought I had. I’ll look into it and get it working for 1.7
February 7th, 2010 at 3:06 pm
Stefan, I just checked on my install and its all working. This might sound like a silly question but if you use something like phpMyadmin at the raw data for the blog post do you see the umlauts there or are they encoded in some way. In my DB the umlauts appear as umlauts. My Table character set is set to utf8_general_ci with all my character variables (character_set_client etc.) set to utf8, apart from character_set_filesystem which is set to binary.
February 7th, 2010 at 8:23 pm
Same here, they appear as the umlauts they are in the DB. The setting was utf8_unicode_ci but switching to utf8_general_ci didn’t change the outcome. The variables are all utf8, but I don’t see character_set_filesystem among them.
But don’t waste too much time on this, I’m only toying around with it and as I said, the excerpts are fine – that made me think it was probably a minor bug.
February 7th, 2010 at 8:46 pm
Well when 1.7 comes out if it still does it we can try tweaking a few things to see if we can find out what is going on.
February 8th, 2010 at 3:12 am
Hi,
We are using Wordbooker Version 1.6.1 plugin for talkigeducation.com.au and when I have post any news via wordpress then it has been post the link on facebook page. But in the facebook page I couldn’t find any settings or options for delete that post. Because when I update the post it will post twice in the facebook page.
So can please help me out how to delete that post from facebook..
Thanks & Regards,
Sanjay
February 8th, 2010 at 7:51 am
Sanjay, there is no way for my plugin to delete things from facebook (unless Facebook add that call to the API). So you’ll have to manually delete it.
February 8th, 2010 at 11:55 pm
I’ve installed the plugin and configured it and when i post I get this:
Fatal error: Call to undefined method FacebookRestClient::stream_publish() in /home/davecand/public_html/blog-testing/wp-content/plugins/wordbooker/wordbooker.php on line 194
The test post shows up when I visit the page.
Is it me, or what?
Wordbooker: 1.6.1
Facebook PHP API: PHP5
JSON library: PHP
SimpleXML library: PHP
WordPress: 2.9.1
PHP: 5.2.9
MySQL: 5.0.89
Server : Apache/2.2.11 (Unix) mod_ssl/2.2.11 OpenSSL/0.9.8e-fips-rhel5 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635
February 8th, 2010 at 11:58 pm
Hi Steve,
Thank you very much for your help…I have done delete manually from the facebook..
Thnaks,
Sanjay
February 9th, 2010 at 5:08 pm
Hi, Great plug-in and got it working with no issues.
One question though…
Is it possible to make it post to ONLY a fan page?
It posts to my personal profile and my website page both. I can, obviously, go in a delete from my profile, but would be nice to not have to do that.
Thanks,
Steven
February 9th, 2010 at 5:12 pm
Sure it can. There should be an And/Or option for fan page posting. So Set that to “Or” and select the fan page you want to post to and it should stop posting to your own wall. Versions prior to 1.6.1 had to cope with a problem in the API so things didn’t work too good
February 10th, 2010 at 7:23 pm
hello,
i can’t see my post on facebook on “news feed”. Is it normal ? is it a options to fix ?
post are post on facebook the day of the scheduler of wordpress or before ?
thank you
February 10th, 2010 at 7:40 pm
Well it should appear. Posts are only posted to FB when they get published to the blog – so if its scheduled for the future then it wont appear until then.
February 12th, 2010 at 9:30 am
If I posting to a fan page only using the “or” option and I also have the update Facebook status checkbox ticked then I get the status updated on my own page. That made me confused for a long time until I tried unchecking it. I think that might be what is making other people confused when they are trying to post to a fan page only.
Should that status update go to the fan page when using the “or” option in combination with update Facebook status maybe?
February 12th, 2010 at 11:00 am
Update status only posts to the user page and not to the fan page which is, as you’ve suggested wrong. I should be able to change that in 1.7 which is currently in beta
February 12th, 2010 at 11:48 am
Great, thanks a lot.
Very Good plug-in by the way. Forgot to say that in my previous post
I will definitely recommend it.
Thanks,
Johan
February 17th, 2010 at 11:31 pm
I just install Beta 5. Tried to generate a facebook code and got “Oops! We were unable to generate a code. Please try again later.”. Also facebook says you don’t have any discussions and I can’t post to your wall. Is something up?
February 28th, 2010 at 7:24 pm
Hi,
Great plug-in, but I had one issue : When activated, everything worked fine for me but all the users couldn’t log into my blog. They had this message : “Hey, you’re not allowed in here.” The only way to be back to normal is to disable Wordbooker.
Dis you saw that already ? Can I provide you more information to get rid of this issue ?
February 28th, 2010 at 7:32 pm
Its a bug in 1.6.1 which is fixed in 1.7
You can work round it by commenting out the following line:
if (!current_user_can(WORDBOOKER_MINIMUM_ADMIN_LEVEL)) { wp_die(“Hey, you’re not allowed in here.”); }
which is line 1158 in wordbooker.php
February 28th, 2010 at 7:46 pm
I just install 1.7b9, and it did the trick, very good job ! I will make a donation definitely with a such support
Thanx !
March 4th, 2010 at 11:09 am
what’s the problem that uploaded novelties in the FB fan page, oh well the FP profile loads the news. I use version 1,6,1 although a week ago everything worked well