Firefox Referral Plugin for WordPress

Google is now paying $1 per referral for every download and installation of Firefox.

Ruby was the first to bring this to my attention, and at first I thought that she locked her site off from all Internet Explorer users, but now I can see that for some reason, IE the Explorer Destroyer banner is mussing up her page layout.

lotusmedia.org with the Explorer Destroyer banner

At first I felt kind of bitchy and wanted to leave a comment that this could backfire and turn people off of Firefox (it’s about as annoying as the oldskool Browser Upgrade Required messages. But I didn’t, probably because on some level I liked the idea.

In any event, I looked at the Explorer Destroyer and Kill Bill’s Browser code and decided I wouldn’t mind adding a less obstrusive Firefox Referral Ad, but only if I could integrate it into my existing layout. Screw JavaScript, I’m going to implement this in PHP.

And since it’s so freaking easy, I made it into a plugin! So you can add it to your WordPress blog too.

Instructions

  1. Download and unzip wp-firefox-referral-1.0.zip (v1.0)
  2. Important! Open wp-firefox-referral.php in a text editor and replace the code marked with REPLACE THIS BLOCK OF SCRIPT WITH YOUR OWN FIREFOX REFERRAL BUTTON SCRIPT with your own Firefox referral script which you can get here: google.com/adsense
  3. Save wp-firefox-referral.php in /path/to/wordpress/wp-content/plugins/
  4. Activate wp-firefox-referral from the WordPress control panel
  5. Edit the theme template file index.php or sidebar.php in your theme’s directory:
    /path/to/wordpress/wp-content/themes/name-of-theme
  6. Add <?php wp_firefox_referral(); ?> where you want the referral ad to appear

Options

The wp_firefox_referral function can take two optional parameters in between the parentheses:

wp_firefox_referral(referral_header, referral_footer)
  1. referral_header is a string that is printed out before the referral ad in Internet Explorer only
  2. referral_footer is a string that is printed out after the referral ad in Internet Explorer only

Screenshot

Here’s how it looks on my blog (at the top of the sidebar on the right) in Internet Explorer:
Screenshot of wp-firefox-referral plugin for WordPress

As always, if you have any questions, problems, or suggestions for improvement please feel free to leave a comment.