This plugin hasn’t been tested with the latest 3 major releases of WordPress. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.

Facebook Fan Box Cache


** Facebook recently changed their fanbox markup. If you are having problems, please update to the latest version. **

This plugin was written to take care of a serious issue. We were getting horrible load times on any page that contained the Facebook Fan Box iframe code. Especially during the evenings when everyone else in the world AND their mother was on Facebook playing Farmville and asking ME to join them. I wanted nothing of it, and I didn’t want my website to suffer the consequences. So after some research, I wrote up this plugin.

Now, you have got to give credit where credit is due, so I must say that this plugin is a WordPress adaptation / implementation of code inspired from my reading of this post by Aaron Saray.. It isn’t cut and paste, but this code is based off of his code.

Check the post on this plugin over at our site, Electric Easel, for instructions, updates, and other news.

* Reduce page load time on pages that would normally contain your iframe or FBML code
* Shortcode for embedding into a page
* FB Cache Widget (Default 240px wide)
* Manual Cache Refresh

A few notes about this plugin:
* This does not cache images locally. It only caches the generated HTML of the initial frame cURL call. Images are still pulled from Facebook. (Fixed in v 1.4)
* This plugin requires PHP5 and cURL to be enabled on your server.

CSS Guide

If you opt to disable inline CSS, you can paste this into your themes style.css file, and it will give you the default look.

.widget_FBCache .fan_box {
    margin:10px auto;
.widget_FBCache .fan_box_head {
    border-bottom:1px solid #D8DFEA;
.widget_FBCache .connections .total {
.widget_FBCache .connections .grid a {
.widget_FBCache .connections .grid a img {
    padding:5px 5px 0 5px;
.widget_FBCache .connections .grid a span {
}<h3>To Do</h3>


  1. Utilize WP_Http instead of strictly cURL
  2. Themes (“Facebook Style”, “Clean & Crisp”, “Blank Slate”)
  3. Enable Post Streams
  4. Facebook IDFinder
  5. Translations


  1. Utilizing cSprites on cached images


  • The plugin's admin screen
  • Widget options
  • Using the shortcode


  1. Go to WordPress Dashboard
  2. Click “Plugins”
  3. Click “Add New”
  4. Type “Facebook Fan Box Cache” in the input box.
  5. Click “Search”
  6. Click “Install” on the plugin that is by Don Gilbert & ElectricEasel (if you want this one)


Does this plugin cost anything?

No. That’s why it’s hosted here. And because we’re awesome.

Where’s the CSS Guide?

On the Other Notes page.

What about foo bar?

What about it?

Contributors & Developers

“Facebook Fan Box Cache” is open source software. The following people have contributed to this plugin.




CSS template feature added. Might be buggy – loads CSS in the footer ATM


Not quite 2.0, but does include the CSS guide for those who have been asking for it. Updated for WP 3.1.1


Bugfix: Fixing image links for WP installs outside of the root of the site domain. Thanks @peteratomic


Enhancement: Elimination of all external HTTP requests by caching ALL images as well as HTML output to the local server in the cache/ folder within the plugin. Increases page load time by .5 sec in our tests.


Not released to public, preparation for v2.0.
Enhancement: Fan Image Caching!


Bugfix: Facebook updated the way the page is displayed, and people were experiencing a double up on the fans count text. i.e. “193 people like Electric Easel. people like Electric Easel.”
Enhancement: Added PHP version check on activation.


Enhancement: Added alt tag to facebook fan image.


Bugfix: Windows doesn’t have a /tmp/ directory, and would throw an error every time the fanpage was requested. Moved temporary cache file to dirname(__FILE__).'/cache/fanbox.tmp.html'. Thanks @Altino Gomes


Bugfix: Regex for finding page url wasn’t working on pages that didn’t contain /pages/ in the url. Updated the regex and now it works fine. Thanks @Aaron Prill


OUT OF BETA!!! (Thanks to those who commented, and suggested changes!)
Added manual cache refresh.
Optimized codebase and added faster expiration/error checking.


Added option to allow custom width (defaults to 240px)
Added “Disable inline CSS” to widget options
Added custom expiration / cache renewal times.


Patched security hole where web user could view contents of cache directory.
Files added: cache/index.php


Initial release. Please let me know if you find any issues.