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.

relatedposts

16 comments

name
blog (optional)
comment

It’s not Explorer Destroyer that breaks my layout, it’s Internet Explorer! (You just don’t see the switch thing unless you’re using IE.) Hence my support for Firefox…

Ah gotcha! Correction made.

I could fix it, but wouldn’t it be easier if everyone just switched to Firefox? ;-)

BTW, I’ve been thinking someone should make some alternative graphics for the Google/Firefox download button. The current one is not very appealing and therefore not one that I get very excited about adding to my web site.

There’s a whole bunch of cool buttons at the Spread Firefox site.

Hey, I really like your site, and I’ve gotten a lot of inspiration from it for mine that I’m building up.
I can’t remember how I stumbled upon here this weekend, maybe some word press plugin, but this is one of the nicest original personal blogs I’ve seen. Personal, yet VERY interesting.

Anyways, I was just going to comment that the icon of get Firefox is not showing on my IE (I just tried it out, I use Firefox already), it’s just showing a white box. Refreshed a couple of times, it works now. You should implement it on your pages posts too though, make some bucks ya know.

On another note, I really like the monthchunks plug-in (I’ve been looking for something like it forever, since I don’t like the calendar thing that many have at all) and many other things that you have implemented in your site.

You even got me reading into CC. I’m still finishing some touches on my design, and my site should be up soon hopefully.

I’m from Venezuela btw, I’m going to school in NC though… I’ve added you to my RSS feed now… sorry for the long comment…

Albert, thanks for the kind comments. I’m not sure if you figured this out from my blog, but I used to live in Chapel Hill, NC, where I went to UNC for 6 years.

Good luck with the plugins, let me know if you have any problems or suggestions.

Got a Google AdSense account? Got a blog? Get a buck per Firefox download using Firefox Referral Plugin for Wordpress.

If you run a Wordpress powered blog, you may want to take a look at this handy Firefox Referral Plugin for Wordpress.

hi justin,

I tried out your plugin. But i still get the blank white rectangle. I tried putting in a header and footer and they appear alright.

any advice?

ka edong

Ka, for some reason my IE won’t even load your site, so I’m unable to take a look.

If you check out http://justinsomnia.org/ in IE, you’ll see the Try Firefox sidebar in the upper right hand side.

If not, perhaps there’s something nonstandard about the User-Agent string your IE is sending the webserver. Or perhaps your webserver is doing something to the User-Agent string before it gets to PHP?

Possibly it could be that you’ve got IE configured not to run any Javascript? Hope this helps.

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

yes, I myself would really appreciate better looking ‘use firefox’ buttons, but google would have to do it, because it is against their TOS to use our own buttons :-( I guess so we don’t just have random pics tricking people

Hey, just wanted to say this is a great way to get people to use the best broswer there is! Also the built in pop up blocker is amazing

[…] Speaking of useragent checking, I was looking into the Explorer Destroyer the other day and there seems to be quite a debate over weather this is the “right” approach to getting new firefox converts. I’m definately not going to use it for my site but I will be putting up a Google firefox referal button on this site. I’ll probably try the Firefox Referral Plugin for Wordpress. I’ve been wanting to see how adSense works so this is a good opportunity. I’ve opened an account already. […]

This is a lifesaver! :D a bit of editing and I was able to override all that stupid IE stuff :D.

Does this plugin still work since it’s made in 2005? Is there a better version or better plugin for this year 2008?