Become Facebook-fan through cached Facebook-widget

I’ve been using the official fan box widget for a while on my blog and wanted to replace it with a cached version of the widget which loads much fewer content.

The widget (for WordPress) works pretty well (http://www.electriceasel.com/plugins/plugin-facebook-fan-box-cache) however one thing bugs me.

Read More

The “I like”-button just links to the Facebook-fanpage so the user would’ve to click again on “become a fan” which makes no sense since the user would expect to already be a fan after the first click.

What I’m looking for are solutions for either of these two problems:

1.) Find a way for users to become a fan with the cached plugin-version directly

2.) Reduce all the crap Facebook loads for the widget. It adds two seconds to my pages loadtime which isn’t acceptable.

Related posts

Leave a Reply

2 comments

  1. As the author of the plugin, I need to say, this is probably the MOST requested feature. I’m working on a solution to this, but I also must note that the purpose of the plugin was to remove all external JS files to speed up loading. I’m looking into a very small JS script that I could utilize to get this working as requested, but haven’t been able to to this point. Reference the blog post you linked to for further updates.

  2. you probably don’t want to cache the facebook code as you’d have no way to know when it was changed/updated. This code will load the script without blocking the page. It may take 2 seconds for your like buttons to show up but it will prevent the slow loading you describe.

      <div id="fb-root"></div>
      <script>
      (function() {
        var e = document.createElement('script'); e.async = true;
        e.src = document.location.protocol +
          '//connect.facebook.net/en_US/all.js#xfbml=1';
        document.getElementById('fb-root').appendChild(e);
      }());
    </script>