This plugin hasn’t been updated in over 2 years. 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

Description

** 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.

Features:
* 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;
    width:240px;
}
.widget_FBCache .fan_box_head {
    border-bottom:1px solid #D8DFEA;
    padding-bottom:5px;
}
.widget_FBCache .connections .total {
    font-size:12px;
}
.widget_FBCache .connections .grid a {
    float:left;
    text-align:center;
    text-decoration:none;
}
.widget_FBCache .connections .grid a img {
    margin:0;
    padding:5px 5px 0 5px;
}
.widget_FBCache .connections .grid a span {
    color:#808080;
    font-size:10px;
}<h3>To Do</h3>

Easy

  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

Considering

  1. Utilizing cSprites on cached images

Screenshots

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

FAQ

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?

Changelog

2.0

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

1.5

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

1.4.1

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

1.4

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.

1.3.2

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

1.3.1

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.

1.3

Enhancement: Added alt tag to facebook fan image.

1.2

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

1.1

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

1.0

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

0.3b

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

0.2b

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

0.1b

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

Contributors & Developers

This is open source software. The following people have contributed to this plugin.

Contributors

Browse the code