=== Add Link to Facebook ===
Contributors: Marcel Bokhorst, M66B
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=AJSBB7DGNA3MJ&lc=US&item_name=Add%20Link%20to%20Facebook%20WordPress%20Plugin&item_number=Marcel%20Bokhorst&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donate_LG%2egif%3aNonHosted
Tags: post, posts, Facebook, social, link, links, permalink, wpmu, admin, comment, comments, shortcode, sidebar, widget, bbPress
Requires at least: 3.2
Tested up to: 3.6.1
Stable tag: 1.191

Automatically add links to published posts or pages to your Facebook wall, pages or groups and more

== Description ==

Automatically add links to posts or pages that are being published to your Facebook wall, pages or groups. Simple one time setup and forget. The way links appear on Facebook can be customized.

The link title will be the post title. The link description will be the excerpt, or part of the post text if there is none.
It is possible to configure a link image (WordPress icon, first image in the media library or in the text, featured image, avatar of the author or custom image) or you can let Facebook select one automatically.
It is possible to exclude individual post links from being added to your wall, pages or groups by ticking a check box just above the publish button.

**[Setup guide](http://wordpress.org/extend/plugins/add-link-to-facebook/other_notes/ "Setup guide")**

There is support for multi-user and network sites and shortcodes will be processed (option).
It works for remote publishing too, for example from [Android](http://android.wordpress.org/ "Android") or [iOS](http://ios.wordpress.org/ "iOS") (iPhone, iPad) powered devices
or using [Window Live Writer](http://explore.live.com/windows-live-writer "Window Live Writer")
or from Linux using [BloGTK](http://blogtk.jayreding.com/ "BloGTK") or [Blogilo](http://blogilo.gnufolks.org/ "Blogilo").

**Additional features:**

* Integrate Facebook comments and likes on added links into Wordpress
* Post WordPress comments back to Facebook
* Copy Facebook comments to the WordPress database (for archiving, editing, replying, moderation, etc)
* Show the standard Facebook
[Like](http://developers.facebook.com/docs/reference/plugins/like/) and
[Send](http://developers.facebook.com/docs/reference/plugins/send/) buttons
* Show the names of the people who liked your post on Facebook above/below the post/page text
* Sidebar widget, shortcodes and template tags for Facebook comments/messages, Like/send button,
[Like box](http://developers.facebook.com/docs/reference/plugins/like-box/ "Like box"),
[Comments box](http://developers.facebook.com/docs/reference/plugins/comments/ "Comments box"),
[Facepile](http://developers.facebook.com/docs/reference/plugins/facepile/ "Facepile"),
[Registration](http://developers.facebook.com/docs/plugins/registration/ "Registration")/login,
[Activity feed](http://developers.facebook.com/docs/reference/plugins/activity/ "Activity feed") and/or a link/icon to your Facebook profile
* [bbPress support](http://wordpress.org/support/topic/add-link-to-facebook-support-bbpress-now)
* And much more!

**Pro version:**

* Add links to more than one Facebook page/group/friend wall for one post simultaneously
* See [here](http://www.faircode.eu/al2fbpro/) for details

If you find this plugin useful, please rate it accordingly.
If you rate this plugin low, please let me know why.
Please report any issue you have with this plugin in the [support forum](http://forum.faircode.eu/), so I can at least try to fix it.
Solutions to common problems are described in [the FAQ](http://wordpress.org/extend/plugins/add-link-to-facebook/faq/ "FAQ").

Translations are welcome, see [the FAQ](http://wordpress.org/extend/plugins/add-link-to-facebook/faq/ "FAQ") for instructions.

* English (en\_US), built-in, corrections are welcome
* Dutch (nl\_NL) by [Marcel](http://blog.bokhorst.biz/about/ "Marcel Bokhorst") and [Satyamo](http://www.satyamo.nl/ "Satyamo"), thanks!
* Flemish (nl\_BE) by [Marcel](http://blog.bokhorst.biz/about/ "Marcel Bokhorst") and [Satyamo](http://www.satyamo.nl/ "Satyamo"), thanks!
* Norwegian (nb\_NO) by [Stein Ivar Johnsen](http://www.idyrøy.no/ "Stein Ivar Johnsen"), thanks!
* Afrikaans (afr\_AFR) by [Jeremy](http://www.primeimage.co.za/ "Jeremy"), thanks!
* Italian (it\_IT) by [Gianni](http://gidibao.net/ "Gianni"), thanks!
* Turkish (tr\_TR) by [laztrix](http://www.diviksfilm.com/blog "laztrix"), thanks!
* German (de\_DE) by [Dirk Exner](http://www.ping-pongline.de/ "Dirk Exner"), [Björn](http://cooleisbaer.co.funpic.de/ "Björn"), [Micha](http://www.styloweb.de/ "Micha"), [Till Grzegorczyk](http://www.formpix.com "Till Grzegorczyk") and [Wolfgang Tischer](http://www.literaturcafe.de "Wolfgang Tischer"), thanks!
* Polish (pl\_PL) by [tomi0011](http://blog.coszsieciami.cba.pl/ "tomi0011"), thanks!
* Hungarian (hu\_HU) by [Pitty](http://www.pittyphoto.hu/ "Pitty"), thanks!
* Russian (ru\_RU) by *Lurii* and [Pavel](http://jack.kiev.ua "Pavel"), thanks!
* French (fr\_FR) by [Alberto](http://www.wowbelgium.be/ "Alberto"), thanks!
* Vietnamese (vi\_VN) by [Crazywolfdl](http://mydalat.com "Crazywolfdl"), thanks!
* Swedish (sv\_SE) by *JornB*, thanks!
* Spanish (es\_ES) by [Marcelo Cannobbio Guillard](http://nubecolor.es "Marcelo Cannobbio Guillard"), thanks!
* Indonesian (id\_ID) by [Mokhamad Oky](http://rainerflame.com/ "Mokhamad Oky"), thanks!
* Latvian (lv) by [Edgars Bergs](http://www.yourwebagency.co.uk/ "Edgars Bergs"), thanks!
* Czech (cs\_CZ) by [Artemian](http://www.artemian.cz/ "Artemian"), thanks!
* Hebrew (he\_IL) by [Sagive](http://www.sagive.co.il/ "Sagive") and [Yossi Jana](http://www.webist.co.il "Yossi Jana"), thanks!
* Belorussian (be\_BY) by [Igor Dubilei](http://www.itransition.com/ "Igor Dubilei"), thanks!
* (Brazilian) Portuguese (pt\_BR/pt_PT) by [Bruno Cantuaria](http://cantuaria.net.br "Bruno Cantuaria") and [Claudio Lessa](http://www.claudiolessa.com/ "Claudio Lessa"), thanks!
* Slovak (sk\_SK) by [Viliam Brozman](http://www.brozman.sk/blog/ "Viliam Brozman"), thanks!
* Serbian (sr\_RS), thanks!
* Greek (el\_EL), thanks!
* Lithuanian (lt\_LT) by [Host1Free](http://www.host1free.com/ "Host1Free"), thanks!
* Danish (da\_DK) by [Mads Phikamphon](http://www.genvejen.dk/ "Mads Phikamphon"), thanks
* Ukrainian (ua\_UA), thanks

See [my other plugins](http://wordpress.org/extend/plugins/profile/m66b "Marcel Bokhorst").

== Installation ==

1. Login to your weblog
1. Go to Plugins
1. Select Add New
1. Search for *Add Link to Facebook*
1. Select Install
1. Select Install Now
1. Select Activate Plugin

Continue with the [Setup guide](http://wordpress.org/extend/plugins/add-link-to-facebook/other_notes/ "Setup guide").

== Frequently Asked Questions ==

**Warning: if you delete your Facebook application, you might also delete the links added through it!**

**--- Usability ---**

= U01 What is a caption, message, etc? =

Take a look at [the screen shot](http://wordpress.org/extend/plugins/add-link-to-facebook/screenshots/ "Screen shot") to get an idea of what is what.

The plugin will use the excerpt as description and when not available it will use part of the post text.
If you specify a *Text trailer* the text will be truncated and the text trailer (for example *Read more ...*)
will be used as last words (no link, Facebook does not allow this).
If you leave the text trailer blank, Facebook will show *See more* and if you click on it, you will see the whole post text on Facebook.
The options *Use site title as caption* and *Use excerpt as message* (tab *Appearance*) do what they say.
If you leave the excerpt blank, the site title will be used as message. This is to prevent grouping of links.
See question U37 for an alternative method.

= U02 Why is the option 'Featured post image' grayed out? =

Because your current WordPress theme doesn't support featured images.

= U03 How can I display featured images as Facebook link pictures? =

1. Configure the plugin to use featured images
1. Select a featured image in the WordPress post screen

A few notes:

* Not all Wordpress themes support featured images
* You have to select a featured image before published a post
* If there is no featured image set, the WordPress icon will be used

As an alternate to feature images, you can use the Add Link to Facebook post meta box (since version 0.23).
In this box you can select one of the images attached to the post.
Selecting an image this way takes precedence over the other settings.

= U04 To which wall will a link be added? =

Always to the wall of the post author, if configured.
Even if somebody else is editing the post.
You can add links to pages and groups too, see question U12 and U13.

= U05 Which link picture will Facebook select? =

Mostly the first picture in the post, but it depends on the theme and layout of your website.
You are adviced to let the plugin select an image (the default setting is to select the first image in the post).

= U06 Why doesn't Facebook display my link picture? =

Maybe because the image is too small or Facebook had trouble accessing the image.
Another cause could be that you disabled the Open Graph Protocol (a plugin option enabled be default).

= U07 I don't want a link picture =

Facebook doesn't support this as far as I know,
but you could let the custom link picture point to a valid but non existing address.

= U08 What happens when I update a post? =

If the link to the post was added already to your wall, page or group, nothing,
else a new link will be added. See also the next question.

= U09 How can I add a link to an existing post? =

Change the post status temporarily to draft, update the post and publish the post again.

= U10 Will links for future posts be added? =

Yes, when they are published automatically a link will be added to your wall, page or group too.

= U11 How about private / password protected posts? =

Don't worry, no links to private posts will be added.

= U12 I want to add links to my fan/community/business page =

This option is only available *after* you have authorized, since information from Facebook needs to be fetched.

Just go to the plugin settings through the WordPress *Tools* menu and
select the page you want the links to be added to using the option *Add to page* on the tab *Page/group*.
Note that pages and groups exclude each other (except in the [Pro version](http://www.faircode.eu/al2fbpro/)).

If the page/group you want to add links to doesn't appear,
make sure you have authorized the plugin with a personal Facebook account that has access to the page/group
and that you have allowed all the permissions the plugin asked for.
If you want to check the permissions, just press the authorize button on the plugin settings page again.
If you want to change the Facebook account you have authorized the plugin with, see question U47.

= U13 I want to add links to a group =

This option is only available *after* you have authorized, since information from Facebook needs to be fetched.

Just go to the plugin settings through the WordPress *Tools* menu and check *Use groups* on the tab *Page/group*.
You'll have to re-authorize one more time, because an extra Facebook permission is required for this.
Note that pages and groups exclude each other (except in the [Pro version](http://www.faircode.eu/al2fbpro/)).
Also note that it is only possible to add links using your personal account (a Facebook limitation).
However, you can add links to pages as page owner, so consider switching to pages.

If you want to add links to a group, the Facebook account you authorized with should have permission to that group.

= U14 How can I use hyperlinks on Facebook? =

Since Facebook doesn't accept HTML, all HTML is stripped from the post text and excerpt before adding a link to Facebook.
This means that hyperlinks are stripped too. The hyperlink texts are preserved, however.
If you want to keep hyperlinks, check the option *Keep hyperlinks*.
The consequence is that the hyperlink texts will be stripped.
So you have to choose if you want the hyperlink text (the default) or the hyperlink itself.

= U15 How can I use short URL's as Facebook link? =

* Install and configure an URL shortener plugin
* [URL Shortener](http://wordpress.org/extend/plugins/url-shortener/ "URL Shortener") is known to work
* Any short URL plugin that supports the filter *pre_get_shortlink* or *get_shortlink* will work
* Enable the option *Use short URL*
* You probably want to enable the option *Use site title as caption* too

= U16 Can I add links to pages? =

Yes, just check the option *Add links for new pages* (settings tab *Misc.*).

= U17 Why is the option "add 'Share' link" experimental? =

For two reasons:

1. The Facebook interface for this feature is undocumented
2. Sharing works, but Facebook doesn't handle it correctly ([discussion](http://forum.developers.facebook.net/viewtopic.php?id=50049), [bug report](http://bugs.developers.facebook.net/show_bug.cgi?id=9075))

= U18 How can I translate the plugin? =

You can use the [Dutch translation](http://plugins.svn.wordpress.org/add-link-to-facebook/trunk/language/add-link-to-facebook-nl_NL.po "Dutch") as a start.
After saving the file, you can translate it by using a text editor or [Poedit](http://www.poedit.net/ "Poedit").
[See here](http://drupal.org/node/17564 "Poedit plural forms") for details on plural forms.
Another way is to install and use the [Codestyling Localization](http://wordpress.org/extend/plugins/codestyling-localization/ "Codestyling Localization") plugin.
Please use [this contact form](http://forum.faircode.eu/contact/) to send me the new .po file.

= U20 How can I setup one wall for all users? =

An administrator can setup his wall (personal/page/group) for all users of one site by checking the option *Share with all users on this site*.
Other users cannot configure their own wall anymore, if this option is used.
Only the **same** administrator can undo this.

= U21 I don't see a link to my post on Facebook =

Assuming that you have configured and authorize the plugin, you can check this:

* Is the wall of the *post author* configured? See also question U4 and U20.
* Has the *post author* the configured minimum capability? (default *edit_posts*)
* Is *Do not add link to Facebook* un-checked?
* Is the post password protected? See also question U11.
* Was the post published before using the plugin? See also question U09.
* Was there already a link added? See also question U09.
* Are you logged into the correct Facebook account?
* Are you looking at the correct personal/page/group wall/profile?
* Do the privacy options allow viewing the link?
* Make sure sandbox mode is not enabled in the Facebook application (most common problem)

Note that each WordPress user (author) should authorize the plugin,
unless you check the option *Share with all users on this site* in the Easy setup section.

See also question U41.

= U22 Where are the settings of the plugin? =

In the WordPress menu *Tools*.
Note that if you checked the option *Share with all users on this site*, only the adminstrator that checked this option can access the settings.
If you cannot access the other administrator account for some reason,
add these lines of code to the end of the file *add-link-to-facebook-class.php* (before `?>`):

`if (is_multisite())
	delete_site_option(c_al2fb_option_app_share);
else
	delete_option(c_al2fb_option_app_share);`

This code resets the option *Share with all users on this site*.

To reset the option *Required capability to use plugin*, you can add this:

`update_option(c_al2fb_option_min_cap, 'edit_posts');`

= U23 How can I use the shortcodes? =

Example to show liker names:

* [al2fb_likers]
* [al2fb_likers post_id="123"]

All shortcodes:

* [al2fb_likers]
* [al2fb_anchor]
* [al2fb_like_count]
* [al2fb_like_button]
* [al2fb_like_box]
* [al2fb_send_button]
* [al2fb_comments_plugin]
* [al2fb_face_pile]
* [al2fb_profile_link]
* [al2fb_registration]
* [al2fb_login]
* [al2fb_activity_feed]

If you want to use shortcodes in a (text) widget, you should enable the option *Execute shortcodes in widgets*.

= U24 How can I use the template tags? =

Example:

* if (function_exists('al2fb_likers')) al2fb_likers();
* if (function_exists('al2fb_likers')) al2fb_likers(123);

= U25 Can I add links to multiple walls? =

This feature is only available in the [Pro version](http://www.faircode.eu/al2fbpro/) of the plugin.

= U26 Why doesn't the like button show all likes? Why are liker names not displayed? =

The option *Show likers below the post text* shows the names of the people that liked the *link* the plugin added on Facebook.
The like button on your website is a standard Facebook like button which is not connected to the link added by the plugin
(in fact there may not even have been added a link).
The like button is connected to the *post* (page) on which it is displayed.
Unfortunately there is no way to connect the likes of the *link* to the post and the likes of the *post*,
since Facebook consider these as different objects.

= U27 I want pink links! ;-) =

How, when and where links, comments, etc appear on your wall/page/group is entirely determined by Facebook.
Only a few link properties can be set by the plugin.
See [here](https://developers.facebook.com/docs/reference/api/link/) for the official documentation.

The social plugins, such as the like box, comments plugin and activity feed, seem to be part of your website,
but in reality these plugins run on Facebook. This means the appearance and behavior of these plugins can only be changed by Facebook.

= U28 Can I display the widget / social plugins on every page? =

Yes, enable the widget option *Show everywhere using my settings*

= U29 How can I use the Facebook registration form/login button? =

First read the previous question and [this documentation](http://developers.facebook.com/docs/user_registration/flows/ "User Registration Flows") for some background information.

* Create a page and add the shortcode *[al2fb_registration]* to it; this is the registration page
* Add a (text) widget to for example your side bar
* Add the shortcode *[al2fb_login post_id="xxx"]* to the widget; replace *xxx* by the page number of the registration page
* Let the plugin option *Login registration URL* point to your registration page
* Enable the plugin option *Execute shortcodes in widgets*
* Enable the WordPress option *General* > *Membership* > *Anyone can register*

Optionally create a landing page for logged in users and set the plugin option *Login redirect URL* to it.

Note that the registration form and login button are not shown when you are logged in.
The registration form is also not shown if users cannot register.

Advanced use: you can set what to display when a user has logged in using the option *Text or HTML when logged in* (default behavior is to display nothing).
It is possible to use shortcodes, for example defined using the [Shortcode Exec PHP](http://wordpress.org/extend/plugins/shortcode-exec-php/ "Shortcode Exec PHP") plugin.
[Stein Ivar Johnsen](http://www.idyrøy.no/ "Stein Ivar Johnsen") developed the following shortcode
to display a little welcome message along with the first name and avatar of the logged in user:

`global $current_user;
wp_get_current_user();
echo '<p>Welcome <br />' . $current_user->user_firstname . '<br />';
echo '<div id="avatar">' . get_avatar($current_user->user_email, 32) . '</div>';
echo '<a href="' . admin_url('profile.php') . '">Profile</a><br />';
echo '<a href="' . wp_logout_url(home_url()) . '">Logout</a></p>';`

Question E22 describes possible errors for the Facebook registration form / login button.

= U31 Can I change/remove 'xxx seconds ago via ...'? =

No, this can't be removed or changed for automatically added links, see also question U27.
The only thing that can be changed is the Facebook application name after 'via'.

= U32 Is video supported? =

From version 1.149.1 you can set a video URL in the post editor.
Please note that the URL must link *directly* to the video and not to a page that displays the video.

= U33 The like/send button doesn't look/behave as I want =

The plugin just adds the standard Facebook like/send button.
Facebook doesn't allow any change to the like/send button, except for a very few things.
The most important thing that can be controlled is the link the like button is associated with.
The default is the current post and page, which is almost always what you want.
Likes for this post or page are counted.

= U34 How do I prevent adding links for special post types? =

Some plugins use [custom post types](http://codex.wordpress.org/Post_Types) to store information,
for example some contact forms and twitter plugins.
For these custom post types a link will be added to Facebook too.
Sometimes this is desirable and sometimes not.
If this is not wanted, you will have to find out the name(s) of the custom post types
and to put them into the plugin option *Exclude these custom post types* (admin only).
The author of the plugin will probably know the name(s), else you will have to look into the source code or database.
The custom post types for the last 10 posts are visible in the debug information (see last question).

= U35 The link picture is wrong =

First check if the Open Graph Protocol is enabled (plugin settings tab *Common*).
Next check if the option *Link picture* (tab *Picture*) is set correctly.
The default *First image in the post* is mostly what you want.
If you want to use a featured image as link picture, see question U02 and U03.

= U36 The privacy option is not working =

You cannot add links with less privacy as specified in the Facebook application settings.
To change this: Privacy Settings (right top triangle) > Ads, Apps and Websites > Apps you use > Edit Settings (button) > Edit (link) > Posts on your behalf.
The privacy option doesn't work if you use the option *Use links API instead of feed API*.

= U37 I don't want my links grouped on the timeline =

Enabling the option *Use excerpt as message* will prevent grouping of links.
If you don't write an excerpt the site title will be used as message.
You can also enable the option *Use links API instead of feed API* (tab *Admin*).
The links API does not work for groups (a Facebook bug).
See the previous question for another limitation.

**Due to [a Facebook bug](https://developers.facebook.com/bugs/226481434092661?browse=search_4f0185df08d385a20237575) the links API will not work for groups**

= U38 I see HTML / shortcodes on Facebook =

Try disabling one of these options on the plugin settings tab *Admin*:

* *Do not execute shortcodes for texts*
* *Do not execute filters for texts*

but be sure to check if everything still looks and works as should,
because these options are known to be incompatible with some plugins.

= U39 Why are comments are not imported? =

First check if the setting *Integrate comments from Facebook* on the plugin settings tab *Comments* is enabled
(each author should enable this individually).
It could be that your theme is incompatible with this feature.
Switch back to the default theme (Twenty Ten/Eleven),
wait at least 10 minutes (because of caching) and then refresh the post page where you expect Facebook comments.
Please note that only comments on links added by the plugin are imported (the link is the anchor) and only as native comments.
Another potential problem are the privacy settings of the Facebook account that was used to comment on Facebook.
Try writing a comment with another Facebook account.

For posts with comments disabled or which are excluded based on the settings tab admin or in the post editor, no comments will be imported.
To prevent problems with Facebook, only comments for young posts are imported (less than a week old).

**Comments are not imported for the [Facebook comments plugin](https://developers.facebook.com/docs/reference/plugins/comments/)**

See also question U27.

= U40 I don't see pictures in the messages widget =

The messages widget only imports status updates, not links with pictures.
Consider using the activity feed instead.

= U41 Added links do not show up in the news feed =

Read [Your Average Facebook Post Only Reaches 12% Of Your Friends](http://techcrunch.com/2012/02/29/facebook-post-reach-16-friends/) to understand why.

Added links are often not visible on your own timeline too.

= U42 I want to edit/moderate imported Facebook comments =

Enable these options:

* *Integrate comments from Facebook* (plugin)
* *Copy comments from Facebook to WordPress* (plugin)
* *Do not execute filters for comments* (plugin)
* *An administrator must always approve the comment* (WordPress)

= U43 There is no share link (anymore) =

Thank Facebook for this.
You might be able to fix it by switching to the links API, but read about the limitations in question U37.

= U44 The option 'Picture size sent to Facebook' does not work =

Facebook only shows thumbnails for link pictures (see also question U27).
This option exists only to solve aspect ratio problems in some case.

= U45 I don't see the 'Create New App' button =

You are probably using a non-personal Facebook account type.
Try to login with a personal Facebook account that has access to the page you want to add links to.

= U46 My website gets slow =

If you enabled comment integration: try increasing the refresh/cache time (option *Refresh Facebook comments every*, settings tab *Admin*)
or try decreasing the number of posts to import comments for (option *Refresh Facebook comments for*)
or try enabling the option *Refresh Facebook comments in the background*.

This plugin does require some memory and processor cycles, maybe more than your hosting provider provides,
so consider contacting your hosting provider for an upgrade or switching to another hosting provider.

= U47 How can I authorize the plugin with another Facebook account? =

Just remove the Facebook App ID & Secret from the Easy setup section on the plugin settings page
and follow [the setup guide](wordpress.org/plugins/add-link-to-facebook/other_notes/) again.

**--- Security ---**

= X01 Which users can use this plugin? =

Users with the *edit_posts* capability: all user roles, except subscriber.
Since version 0.11 administrators can change this using the setting *Required capability to use plugin*.

**--- Compatibility ---**

= C01 Is this plugin compatible with my theme? =

Most likely yes, but featured images can only be used as link picture when your theme supports this.
See also the next question.

= C02 Is this plugin compatible with plugin xxx? =

The question is more: is plugin (or theme) xxx written in a compatible way.
I have looked dozens of times to other plugins (and themes), mostly with the conclusion that the plugin doesn't behave as it should.
For example by adding pictures or altering texts *after* a post have been published.
Because of this I don't give support on compatibility with other plugins and themes anymore.
You should contact the author of the other plugin or theme.
The author of the other plugin or theme is free to contact me if needed.

= C03 Are shortcodes being processed? =

This is an option, when enabled shortcodes will be processed.
This option is disabled by default, because not all plugins are compatible with it, especially forum software.

= C04 Are multi-user and network sites supported? =

Yes, each user can configure his/her own wall, page or group.
The same user can setup the plugin multiple times for multiple sites.

= C05 Is remote publishing supported? =

Yes, via both [XML-RPC](http://en.wikipedia.org/wiki/XML-RPC "XML-RPC") and the [Atom Publishing Protocol](http://en.wikipedia.org/wiki/Atom_%28standard%29 "Atom").
So you can use for example an [Android](http://android.wordpress.org/ "Android") or [iOS](http://ios.wordpress.org/ "iOS") powered device (XML-RPC)
or [Window Live Writer](http://explore.live.com/windows-live-writer "Window Live Writer") (Atom)
or [BloGTK](http://blogtk.jayreding.com/ "BloGTK") or [Blogilo](http://blogilo.gnufolks.org/ "Blogilo") for Linux
to publish posts and still have links added to your wall or page automatically.
Don't forget to enable remote publishing using the WordPress menu *Settings > Writing*.

= C06 Are custom post types supported? =

Yes, but the custom post type should support custom values for it to work.

= C07 How can I use an image of NextGEN Gallery as link picture? =

Assuming that you embed a NextGEN Gallery into a post, set the option *Link Picture* to *First image in the post*.
Disable the option *Do not execute filters for texts*, but take care to check if this doesn't result in compatibility problems with other plugins.
Also enable the option *Do not execute shortcodes for texts*.
Please note that changes in NextGEN may cause this not to work anymore, see also question C02.

**--- Error messages ---**

= E01 I get 'Error validating application' =

You have probably entered a wrong *App ID* or the Facebook application may be deleted.
If you didn't create a Facebook application yet, you should follow the instructions in the yellow box on the plugin page.

= E02 I get 'Error validating client secret' =

You have probably entered a wrong *App Secret*.

= E03 I get 'Invalid redirect_uri: Given URL is not allowed by the Application configuration' =

You have most probably skipped the settings part of step 2 of the
[Setup guide](http://wordpress.org/extend/plugins/add-link-to-facebook/other_notes/ "Setup guide").

= E04 I get 'The user hasn't authorized the application to perform this action' =

You have probably revoked one of the permissions of the Facebook application.
If you did this by accident, you can simply re-authorize the plugin.
If you did this deliberately, you should remove the *App ID* and *App Secret* from the plugin settings.
If you are the only user of the website, you can also disable the plugin.

= E05 I get 'Invalid access token signature' =

You have probably reset the *App Secret*. You should re-enter it.

= E06 I get 'Error validating verification code' =

Your WordPress installation is probably configured incorrectly.
In most cases there is a second colon in the site URL that shouldn't be there.
See [here](http://codex.wordpress.org/Changing_The_Site_URL) for how to change your WordPress configuration.

= E07 I get 'This API call requires a valid app_id' =

You could try to re-authorize to fix this, but it should not happen.

= E08 I get 'An active access token must be used to query information about the current user' =

Should not happen.

= E09 I get 'Invalid access token signature' =

You have probably entered an access token manually, but incomplete or with extra characters.

= E10 I get 'Your server may not allow external connections' =

This means the PHP setting [allow_url_fopen](http://www.php.net/manual/en/filesystem.configuration.php#ini.allow-url-fopen "allow_url_fopen") is disabled
and that [cURL](http://php.net/manual/en/book.curl.php "cURL") is not available too. You may have to ask your hosting provider to enable at least one of the two.

= E11 I get 'cURL error ...' =

cURL errors are almost always caused by internet connection problems.
For most cURL errors you need support from your hosting provider.

Recent versions of the plugin report cURL errors encountered while importing Facebook comments and likes too:
*Import comment: cURL error ...* and *Add comment: cURL error ...*
These error messages will be removed automatically after a next successful import for the same post/page.
If these errors appear now and then, don't worry about them.
This just means the internet connection from your hosting server isn't perfect.
If this happens frequently and Facebook comments and likes are not imported at all because of these errors,
it is time to contact your hosting provider.

cURL errors commonly reported:

* Error 0: cURL may not be installed or functioning correctly or there may be no internet connection
* Error 1: *The URL you passed to libcurl used a protocol that this libcurl does not support*: the hosting server may not support secure connections (https)
* Error 6: *Couldn’t resolve host*: the DNS of the hosting server may not work correct
* Error 7: *Failed to connect() to host or proxy*: the hosting server is probably not allowing connections to the internet
* Error 28: *Operation timeout*: hopefully temporarily no internet available on the hosting server, you can try to increase the setting *Facebook communication timeout*
* Error 47: *Maximum redirects followed*: update to version 1.149+
* Error 56: *Failure with receiving network data*: this error may be caused by using a CDN or caching solutions like CloudFare
* Error 60: *Peer certificate cannot be authenticated with known CA certificates*: the security certificates on the hosting server could be missing or outdated, try enabling the option *Use bundled CA certificates* or as a last resort *Do not verify the peer's certificate* (settings tab *Admin*), but be aware this is less secure
* Error 77: *Problem with reading the SSL CA cert*: the certificate files on the hosting server are not accessible or missing

You can find all cURL error codes on the [libcurl error page](http://curl.haxx.se/libcurl/c/libcurl-errors.html "libcurl-errors.3 -- man page").

= E12 I get 'HTTP 400 Bad Request' =

You are probably using Microsoft Internet Explorer.
This browser has the bad habit not to display the content
when there is an [HTTP](http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol "HTTP") error.
Actually you are most probably having one of the above errors, but you cannot see which one.
You could temporarily switch to [Chrome](http://www.google.com/chrome) or [Mozilla Firefox](http://www.mozilla.com/ "Mozilla Firefox").

= E14 I get '(#100) Invalid parameter' =

You may have deleted a link on Facebook that was added by the plugin and also tried to delete it using the plugin.
See question E19 for how to remove the error message and question U09 for how to add a link for an existing post.

You might need to manually remove the link information of the plugin.
On the post edit page click *Screen Options* (upper right) and tick *Custom fields*.
Scroll down to the meta box *Custom fields* and delete the value *al2fb_facebook_link_id*.

You can prevent this problem by deleting the link using the plugin.

= E15a I get 'Error validating access token' =

Most often this happen when you changed your Facebook password.
The access token the plugin acquired during the authorization process may be revoked by Facebook.
Maybe because there was a security problem with your Facebook application or account.
Re-authorizing will probably solve this problem.

= E15b I get 'Error invalidating access token' =

This problem is probably caused by Facebook and applies at least to multi-sites using the same application for each site.
A workaround might be to use a different application for each site.

See [here](http://forum.faircode.eu/forums/topic/multi-user-site-facebook-group-error/) for progress on this problem.

= E16 I get 'You failed to provide a valid list of administators' =

This message occurs when clicking on the like button.
The like button probably points to a page without Open Graph Protocol meta tags.
If you didn't enable the Open Graph Protocol try to enable it.
If you have set the option *Link to*, make sure this page has Open Graph Protocol meta tags.
If this option is not set (the default) the like button points to the post or page.
Note that the plugin cannot create the meta tags for pages with more than one post (for example the home page, categories and archives).
The plugin is only able to determine the correct Facebook application for posts and pages, because it needs to know an author for this.
You can use the [URL Linter](http://developers.facebook.com/tools/lint/ "URL Linter") to see if there are valid meta tags.

= E17 I get 'Error finding the requested story' =

The plugin tried to add a WordPress comment to an added link on Facebook, but the link does not exist anymore.
To prevent this message in the future, you should delete the link from WordPress too.
While deleting, you will probably get the error described in question E14 too.

= E18 I get 'Missing redirect_uri parameter' =

It could be that you have filled something wrong into the field App ID. This field should contain only digits.

= E19 How can I remove error messages? =

The first thing you should try is to simply update the post(s) using the WordPress update button.
The plugin will add a link to the post if it didn't already do that and remove the error message in the process.
You can also tick the checkbox *Clear error messages* in the post submit box, near the update button.
In this way you can clear the error message without adding a link to Facebook
(you'll probably want to check *Do not add link to Facebook* too in this case).
Since version 1.163 you can clear all errors for the current user using an option in the settings tab 'Misc'.

= E20 I get 'Error validating access token: The session has been invalidated because the user has changed the password' =

Authorizing the plugin again will most probably solve this problem.

= E21 I get 'failed to open stream: no suitable wrapper could be found' =

Your hosting server probably doesn't have the software installed or it isn't configured correctly to make a (secure) connection to the internet.
Ask your provider to install and configure [cURL](http://www.php.net/manual/en/curl.setup.php "cURL").

= E22 What errors can occur during Facebook registration and login? =

* **Facebook registration failed**: the data Facebook sent could not be decoded
* **User registration disabled**: WordPress option *General* > *Membership* > *Anyone can register* is disabled
* **Facebook e-mail address missing**: Facebook didn't sent an e-mail address while registering
* **E-mail address in use**: e-mail addresses must be unique for WordPress users
* **Facebook user ID missing**: Facebook didn't sent an user ID while logging in
* **User not found**: no WordPress user with the ID Facebook sent was found (user not registered?)
* **Could not verify Facebook login**: Facebook user profile could not be retrieved (could be transient, so try again)
* WordPress user registration errors, most notably **This username is already registered.**

= E23 I get 'The post's links must direct to the application's connect or canvas URL' =

You are probably using an existing Facebook application.
You can solve this problem by going into application settings and setting the Stream post URL security to disabled under advanced.
If you are adding links to a group, try disabling the option *Add 'Share' link*.

= E24 I get 'file_get_contents ... No such file or directory' =

Your hosting provider does not provide *cURL* and *file_get_contents* isn't working too.
So, the plugin isn't able to communicate to the internet.
You should ask your hosting provider to install and configure cURL.

= E25 I get 'This API call requires a valid app_id' =

Double check the App ID in the Easy setup section and try to authorize the plugin again.

= E26 I get 'Session has expired at unix time ...' =

The access token has expired for some reason.
This problem can probably be solved by authorizing the plugin again.

= E27 I get a blank settings page / authorizing the plugin =

It could be that your hosting server is blocking things (firewall, max. execution time, etc)
or that your local firewall is blocking things or that your browser is incompatible.

If you have access to your hosting server logs, check if there are error messages.

= E28 I get 'Requires extended permission: share_item' =

Authorizing the plugin again is reported to solve this problem.

= E29 I get 'Subject must be a page' =

This is probably because you are trying to add links to an application page.
Check the pages you are adding links to on the plugin settings tab Page/group.

= E30 I get 'The url you supplied is invalid' =

This is most probably caused by multiple plugins outputing the Open Graph Protocol meta tag *og:url*.
Make sure that other plugins don't output conflicting OGP tags.

= E31 I get 'Developer Alert: July 2013 Breaking Changes' =

Just enable the Facebook app advanced option 'July 2013 Breaking Changes'.

**--- Support ---**

= S01 Where can I ask questions, report bugs and request features? =

You can open a topic in the [support forum](http://forum.faircode.eu/).

= S02 How can I send the debug information? =

**Only send debug information when asked for and always include a valid support forum topic link**

Debug information not asked for or without valid support forum topic link will be ignored.

Go to the plugin page (via the *Tools* menu) and click on the link *Debug information* in the right yellow *Resources* panel.
Fill in your name, your e-mail address,
a link to the [support forum](http://forum.faircode.eu/) where you reported the problem before
and describe the problem as accurate as possible and press the *Send* button.

If your problem concerns a post, please include the title of the post in the message.
Please note that the debug information only contains information about the last 10 posts.

The debug information sometimes doesn't arrive,
therefore it isn't a bad idea to let me know on the forum you did send it.

== Screenshots ==

1. What is a caption, message, etc?
1. Where is Apps?
1. Where is Create New App?
1. Where is the Website URL?

== Changelog ==

= Development version =
* ...

Follow these steps to install the development version:

* Download the development version by clicking on [this link](http://downloads.wordpress.org/plugin/add-link-to-facebook.zip)
* Go to *Plugins* on your WordPress dashboard
* *Deactivate* Add Link to Facebook
* *Delete* Add Link to Facebook (*Yes, delete these files*)
* Click *Add New*
* Click *Upload* (a link at the top)
* Click *Choose file* and select the file you downloaded before
* Click *Install*, then *Activate Plugin*
* Please report any problem you encounter
* Reports that everything works are also appreciated :-)

= 1.191 =
* Improvement: fix PHP warning

= 1.189 =
* Improvement: allways show multi-site URL

= 1.188 =
* Improvement: consistently check Facebook responses

= Older versions =
* Deleted, because of maximum readme.txt size (thanks @wordpress.org)
* Newer versions should always be compatible with [older versions](http://wordpress.org/extend/plugins/add-link-to-facebook/download/ "Other Versions")

== Upgrade Notice ==

= 1.191 =
One improvement

== Setup guide ==

**If you have more than one Facebook account, either logout completely or login to the correct account before you start.**

**If you want to add links to a fan/community/business page, authorize the plugin with a personal account that owns to the page.**

**If you have a multi-site installation, create a separate Facebook application for each site.**

**Never delete an existing Facebook application, because you could delete the links added through it too.***

The setup of the plugin should be fairly self-explanatory.
Basically there are five steps to follow:

1. Click on the link *Click here to create* in the yellow box on the settings page
	* Or click [here](https://developers.facebook.com/) ;-)
	* Navigate to *Apps* (top menu)
	* Select *Create New App* (button at top)
	* See the [screenshots](http://wordpress.org/extend/plugins/add-link-to-facebook/screenshots/) if you cannot find it
2. Create the Facebook application:
	* Give it any name you like (will appear as *via* below the added links) and press *Continue*
	* Fill in the red URL which the plugin indicates into the field *Website with Facebook Login* (click the sentence) > *Site URL*
	* See the [screenshot](http://wordpress.org/extend/plugins/add-link-to-facebook/screenshots/) if you cannot find it
	* **Don't confuse this with the field *App Domain*, this field should be empty**
	* Press the *Save Changes* button
3. Copy the *App ID* and *App Secret* from Facebook to the appropriate fields in the plugin
4. Press the *Save* button to save the configuration
5. Press the *Authorize* button, login if needed and allow the plugin to add links to Facebook

Note that you don't have to submit the Facebook application to the *App Directory* to use it.

Some people need to verify their account before they can create an application.
If you want to use your mobile phone number, take care that the phone number is correct.
When it was wrong, you have to wait more than a week before you can try again.
If the standard procedure doesn't work, you can try [this page](https://register.facebook.com/confirmphone.php).

Setting up Facebook registration form / login button: see question U29 of [the FAQ](http://wordpress.org/extend/plugins/add-link-to-facebook/faq/ "FAQ")

If you are having a problem, you can probably find the solution in [the FAQ](http://wordpress.org/extend/plugins/add-link-to-facebook/faq/ "FAQ").
If you need help, you can leave a message on the [support forum](http://forum.faircode.eu/).

If you need to setup the plugin again for some reason,
just remove the Facebook App ID & Secret from the Easy setup section of the plugin settings page.

== User Guide ==

**Easy setup**

Everybody has to start here. Just follow the short instruction on the setup page or the setup guide above.
The first goal is the acquire the following two values from Facebook:

* App ID
* App Secret

After entering these values you should authorize the plugin.
The plugin will use the App ID and Secret to obtain an access token, which is required to access your Facebook wall.

Common problems:

* To create an application you have to verify your account
* Error *Given URL is not allowed by the Application configuration*: see question E03 of [the FAQ](http://wordpress.org/extend/plugins/add-link-to-facebook/faq/ "FAQ")
* cURL error: see question E11 of [the FAQ](http://wordpress.org/extend/plugins/add-link-to-facebook/faq/ "FAQ")

For administrators (capability *manage\_options*) there is one option in this section:

* Share with all users on this site

The default is that each user of your weblog has to setup/authorize the plugin.
If you check this option all users will use your access token.
After checking this option the setup page of the plugin will be accessible only to the administrator that enabled this option.
Note that all users will use your name. You may want to choose *Avatar of author* as link picture (see below).

**Additional settings**

*Link picture*

Links on Facebook can have a link picture, which is displayed between your Facebook profile picture and the link text(s).
The plugin offers several options to automatically select a picture:

* WordPress logo: the default, unless *Default picture URL* is filled in
* First attached image: the image which was first uploaded on the post page
* Featured post image: for themes that support a featured image only
* Let Facebook select: this often doesn't work as you want to, because Facebook can select for example a header image
* First image in the post: similar to first attached image, but the image doesn't have to be associated with the post
* Avatar of author
* Custom picture below: complete URL to a static picture of your choice

Most users probably want to use *First image in the post*.
This is also the best option for users that use remote publishing.

Note that the default picture is used if no link picture could be found,
for example if there was no featured post image selected or when there was no picture in the post.

No picture at all is not officially supported by Facebook, but you can try to use an invalid custom picture.

*Pages and groups*

The plugin can add a link to a page or group wall of your choice.
Just check what you want, page or group, press *Save* and select the page or group you want to add links to.
For pages it is possible to add links as page owner, instead of with your personal account.
For groups this is not possible, since Facebook doesn't support it.

*Link appearance*

Some visual aspects of added links can be controlled, but most of the layout is entirely determined by Facebook.
The plugin will strip all markup, since Facebook doesn't allow it.

To better understand some of the options take a look at [the screen shot](http://wordpress.org/extend/plugins/add-link-to-facebook/screenshots/ "Screen shot") to see what is what.

* Use site title as caption: replace the URL by your blog title (shown below the option)
* Use excerpt as message: by default there is no message, but if you like you can use the standard WordPress excerpt (if any)
* Text trailer: if you use this option, the text will be truncated (whole sentences) and the text trailer will be appended
* Keep hyperlinks: by default hyperlinks are stripped, leaving the title (if any), this options reverses that
* Add 'Share' link: this option is experimental, because it is not officially supported by Facebook (it is not documented)
* Use short URL: see question U15 of [the FAQ](http://wordpress.org/extend/plugins/add-link-to-facebook/faq/ "FAQ") for details
* Add links for new pages: by default only links will be added for new posts, check this option if you want the same for new pages

If you use a text trailer, you should know it is just a text and it is not clickable.
The text including the trailer will not be longer than 256 characters, this is what Facebook will display at maximum without truncating the text.
Note that the text could be shorter, because the plugin will truncate the text after periods only (sentences).
You can change the default maximum text length with trailer of 256 characters using a plugin option.
If you don't use a text trailer, the complete post/page text up to 10,000 characters will be sent to Facebook and
Facebook will truncate the text at 256 characters and display *Read more*, which when clicked will reveal the complete text.
You can change the default maximum text length of 10,000 characters using a plugin option,
but you shouldn't set it above 10,000 characters, since Facebook will report an error above this hard limit.

*Comments and likes*

**Please be aware that comment integration could harm the privacy of other Facebook users!**

* Integrate comments from Facebook: show Facebook comments in WordPress
* Post WordPress comments back to Facebook: show WordPress comments on Facebook
* Copy comments from Facebook to WordPress: store Facebook comments in the WordPress database, so you can for example edit them
* Integrate likes from Facebook: show Facebook links as WordPress pingbacks
* Show likers below the post text: show a comma separated list of Facebook liker names at the bottom of your post

Comments copied from Facebook to WordPress are subject to moderation and notification, depending on the WordPress discussion settings.

Link Facebook comment to:

* None: no link at all, good for privacy
* Profile author: default, link to the profile page of comment author
* Added link: link to the discussion on the added link

The Facebook author name is always shown.

The plugin only mirrors comments on links it added. In summary it works like this:

* The plugin adds a link to Facebook
* Somebody writes a comment on the link on Facebook, if enabled the plugin will mirror the comment to WordPress
* Somebody writes a comment on WordPress, if enabled the plugin will mirror the comment to Facebook, using your Facebook account

You can disable comment integration for individual posts/pages by selecting *Do not integrate comments* on the post page.

*Standard Facebook buttons*

The plugin can as an extra add a standard Facebook like button/box and/or send button to your post.
The layout is mostly determined by Facebook.
You can only control the general layout, if there will be faces, the width, the action (like or recommend), the font and color scheme.
See for details [the Facebook documentation](http://developers.facebook.com/docs/plugins/ "Social plugins").

By default the buttons will be shown below your post/page text, but you can change that by checking *Show at the top of the post*.
If you want more control over the location of the buttons, you can use a shortcode or template tag.
See question U23 of [the FAQ](http://wordpress.org/extend/plugins/add-link-to-facebook/faq/ "FAQ") for details.

There are options to suppress showing the like and send button on your home page, on individual posts or pages, in archives and in categories.
It is also possible to check *Do not add like button* on the post page to suppress showing the like/send button for individual posts.

By default the like button will link to the post or page where it is shown (recommended).
It is possible to change this to a static URL with the *Link to* option. Use with care.

If you use a Facebook like button, you should enable the [Open Graph protocol](http://developers.facebook.com/docs/opengraph/ "Open Graph protocol")
(unless you use another plugin for this purpose).
Most problems with the like button do find its cause in not using the Open Graph protocol.

*Other options*

If you explicitly want to select when to add, check the option *Do not add link by default*.
Alternatively you can select *Do not add link to Facebook* on the post page to prevent the plugin from adding a link.

If your post overview is already full of extra columns, you could check the option *Don't show a summary in the post list*.

I have never had a report about it, but if you have problems displaying the correct characters on Facebook, you could use the *Facebook character encoding* option to override the default character encoding (UTF-8).

When you don't want to use the plugin anymore, you can check *Clean on deactivate* before deactivating the plugin to erase all options. This doesn't erase the administrator option, however.

Checking the option *I have donated to this plugin* will remove all the donate buttons and links.
Developing this plugin took many hours. A small donation as a token of your appreciation is always welcome.

Please let me know if you think this plugin is good or bad by rating it.
Checking *I have rated this plugin* will remove the rating reminder message.
If you don't like the plugin, please [let me know why](http://forum.faircode.eu/).
If the plugin isn't working for you, [help is just one question away](http://forum.faircode.eu/).

*Administrator options*

The administrator options can only be changed by an administrator (obviously) and apply to all users.

The plugin needs to communicate with Facebook. The default timeout time is 30 seconds.
If your server has a slow connection, you may have to increase the timeout time to for example 60 seconds.

When you are running a multi-user weblog, you probably want to check *Do not display notices* to restrict the plugin notices, mostly error messages, to the plugin setting page only.
And maybe you don't want to allow usage of the plugin to all users. This is what the option *Required capability to use plugin* is for.

When comment integration is turned on, Facebook comments are fetched every 10 minutes by default.
You can use the option *Refresh Facebook comments every* to do this more or less often, maybe depending on the number of visitors of your weblog.

See link appearance section above for a description of the text length options.

The plugin supports custom post types if the custom post type support custom values.
Sometimes you don't want to add links for certain custom post types.
That is where the option *Exclude these custom post types* is for.
Enter the names, separated by comma's for which you don't want the plugin add links.

Speaking about excluding things, maybe you don't want to add links for certain categories.
You are in luck, because you can use the option *Exclude these categories* for this.
You should use catergory id's, not names.

If your server isn't setup completely right, there could be problems making a secure link to Facebook.
In case you get cURL error 60, you can try the option *Do not verify the peer's certificate* as a workaround.
Of course this is less secure ...

*Widget*

**Please be aware that showing Facebook comments and status messages in the widget could harm the privacy of other Facebook users!**

You can read [here](http://codex.wordpress.org/Widgets_SubPanel "Widgets") in the WordPress codex how widgets work.

The Add Link to Facebook widget can display:

* Facebook comments on added links
* Facebook status updates from your wall
* Facebook like button
* Facebook send button
* Facebook icon with a link to your Facebook profile

The widget is only shown on single posts or pages (not on the home page or elsewhere).
Facebook comments, status updates and the profile link are only shown if the post author has authorized the plugin
(or when the option *Share with all users on this site* is enabled).
The link to the author follow the comment integration settings (*None*, *Profile author* or *Added link*).
The styling (layout, colors, etc) of the widget depends on the styling of your theme.
You can add additional styling rules using a plugin option.

== Acknowledgements ==

This plugin uses:

* [jQuery](http://jquery.com/ "jQuery") licensed under MIT License or GNU General Public License (GPL) Version 2
* [jQuery Plug-In socialshareprivacy](http://www.heise.de/extras/socialshareprivacy/ "jQuery Plug-In socialshareprivacy") licensed under MIT License
* [Plugin Update Checker Library](http://w-shadow.com/ "Plugin Update Checker Library") licensed under GNU General Public License (GPL)
