Feature for the next release : code emancipation !

Yes, that’s the word : emancipation !

As a (humble) plugin developer and based on some of the work I’ve done to help friends get started in the affiliation business, I’ve got to say, the default affiliate searchbox is outdated in many aspects.

The code

Once you’ve looked at it, I think one of the worst part is the code. Not that it is poorly coded, but it is simply poorly documented and beyond everything else, it has not been updated in 5+ years. The result ? When you load the default searchbox on your site, on an average, you add a whooping 1309 lines of code to your page. This includes about 200 lines of HTML, about 100 lines of CSS and about 1000 lines of javascript. With the current state of this plugin, I’ve only managed to reduce the code by about 10%. That’s still wayyy too much for what it does. For those of you that are curious, you can check the code here.

As several plugin users commented over the last few months, there is an SEO cost to having such a poor code on your site. Page weight and page load time could  be also mentionned but only in a marginal manner.

With today practices, moving the old HTML / CSS into HTML5 would save a couple of lines, for sure. However the saving wouldn’t be major. Now if you look at the javascript code that runs the date calculation and the calendar rendering, there’s a great opportunity for something more impactful.

The user experience

Here I’m not going to talk about color scheme, gradients or anything about how the searchbox LOOKS. day_then_the_restI’ll save that for another day. As a visitor of your own site, did you ever find relevant to start selecting a DAY (a number actually) from a dropdown and then proceed with month and year ?

Another fun one is the calendar. old_calendarNot only the random popup location has certainly driven a few of you nuts (I’m with you on that one) but simple things like previewing 2 months instead of one have become a standard practice. I mean it is certainly a nicer option than having to key in manually your checkin / checkout dates with the dropdown seen above… but really, there’s room for improvement.

Lastly, once you’ve selected your dates in & out, what shows up in the searchbox ? Parameters ! Gone are the actual days in plain language (if your language is covered), you’re back with a first dropdown that shows you checkin day, and another that shows the month and year. People like words better than numbers.

What day am I leaving again ?

Done with the bitching ? What’s the point ?

Here comes the fun. By bringing in some industry standard into the picture, I’ve been able to elegantly get rid off the default scripting for the searchbox. What that means is instead of these ~1000 lines of old school JS code, you’ll be down to about 50 lines enabling a lot of customization… and with that customization comes a series of great user experience improvements !


  1. Look at the date display ! It’s finally only one box and it speaks in your language. You’re no longer leaving on the 27th of July 2013 : You are now leaving on Saturday, 27th of July 2013. Feels reassuring for the vast majority of your users.
  2. Only one box means it’ll take less space on the screen while maximizing the info displayed. I’ve also included the calendar icon into the field to (1) free up some space (2) make it easier for you to change the background colors without thinking about color-matching the calendar icon.
  3. Ultimately the bigger improvement resides in the calendar itself. While this example isn’t styled yet, I wanted to share that you can now display 2 months in one click -which is great for your users- and the calendar will now ALWAYS show up where it’s meant to show up. No more fancy behaviour.

At this stage, this is a very much working example but I’ve not integrated it into the DEV version of the plugin yet. I’ve got some freetime on my hands this weekend and I should be able to make some good progress.

Also, I still have a number of things to improve, like the actual LOOK of the widget, for instance. It’s a much smaller / simpler thing to do, the backend rewrite remains the priority now. After this update, the next one will most probably feature a role restriction option so ONLY the site admins can access the admni panel for this plugin.

– To stay on top of what’s coming next and the future release dates, subscribe to the newsletter here.
– You have more ideas around what could be the next big thing to be added, let me know.




4 thoughts on “Feature for the next release : code emancipation !

    • Hello

      I’m still polishing the WP integration for jQuery. It’s all working as it should be the code isn’t (yet) using the right coding practices… which also means it could break for some not-so-standard / outdated WP install. I’m moving house in a couple of weeks so that has been slowing me down a little.
      I’ve also received great user feedback to correct some random errors for those who run an older version of PHP. It takes all kinds to make a world !

      What I’ll do shortly is deploy the plugin on this site so people can see how much better it works and once I’m finally done with the polishing, I’ll push it live through the repository.

      Thanks for asking.

Leave a Reply

Your email address will not be published. Required fields are marked *