Link Leaderboard – WordPress Plugin (Version 0.1 Alpha)

5 Jul

This is a post dedicated to the WordPress Link Leaderboard plugin that I wrote, Version 0.1 (Alpha)

This is the first WordPress plugin that I’ve written so expect many bugs and errors and plenty of room for improvement. The basic idea was a London 2012 Olympics style promotional campaign where our company would email current clients a unique link each. They would then be encouraged to distribute this link via social networks to drive traffic to our website. For every one that visited, we would score one to the original user and display this on a leaderboard, assuming of course that the person followed the link with the unique code in the query string.

A cookie is placed on the users computer so that they can’t easily register the unique link again and the users IP address is also checked so that each IP address can only enter once. Not a fully fail-safe solution but half decent.

To use this plugin you obviously need to download and install it. You then need to populate the ll_codes table with the following information:

  • id : Nothing, this is auto generated
  • name : This is the name that will be displayed in the leaderboard table
  • code : This is the unique code that they will use in their link, it must be unique of course (i.e tzxq)

The shortcode to display the leaderboard is:

[linkleaderboard]

The top 3 places are gold, silver and bronze, this can all be changed in the style sheet if required.

The unique URL will be along the lines of:

http://www.mydomain.com?code=unique_code_here

I plan to make an options page to make it more customisable and I would also like to add an easier way of importing the values into the ll_codes table. I probably should add I18N support and a heap of other stuff, I’m still learning.

For reference, this is how I emailed out the social links with the unique code mail merged into them:

  • Twitter: http://twitter.com/home/?status=TEXT HERE
  • Facebook: http://www.facebook.com/sharer.php?u=URL HEREt=TEXT HERE
  • LinkedIn: http://www.linkedin.com/shareArticle?mini=true&url=URL HERE&title=TITLE HERE&summary=SUMMARY HERE&LINK HERE
  • Email: mailto:?subject=SUBJECT HERE&body=BODY OF EMAIL AND LINK ETC HERE

Other than that, it’s good to go, please let me know your thoughts.

Downloads

Version 0.1 (05/07/2012)