WP Movie Ratings v1.5 released!

It’s been 1,5 years since the release of v1.4 of WP Movie Ratings plugin. Actually, there are not that many changes in version 1.5. Following the tradition, odd minor version numbers are more or less maintenance releases, witout any big features.

Here is the changelog:

  • added option to add movies without rating them (only through the administration panel) (to create a list of owned just not yet seen dvds, for example).
  • added option to select all ‘only_rated’ or ‘only_not_rated’ movies using the wp_movie_ratings_show() function call.
  • char_limit option can now be passed as a parameter to the wp_movie_ratings_show() function call.
  • fixed problems making the movie reviews pages non XHTML compliant.
  • fixed error which prevented certain users from activating the plugin (the database table was not created).
  • fixed XHTML validation error in the bookmarklet.

You will find the detailed list of changes in the changelog file. And here’s the direct download link. Enjoy!

Upgrading Ubuntu to 8.04 (Hardy Heron). Ugh.

Some minor problems:

  • /etc/default/locale has been deleted (wtf?). Needed to be recreated.
  • Both /etc/timezone and /etc/localtime have been deleted. Needed to recreate the links.
  • /etc/updatedb.conf has been deleted. Needed to be copied from another machine.

and one major one:

  • klogd now takes 5 minutes to start, which means I have to wait 5 minutes after each reboot to use the machine. Adding -x switch in the init.d script solved the problem. What was the root cause? No idea. There are only hints.

Apparently there is some reasoning behind not upgrading your linux policy.

On being tired

And deploying code which let anyone using any login and password (and by any I mean really any combination, even asdf/asdf worked) authenticate. And have access to the administration panel. No fun. At least at first, when I shook my head with disbelief over the deployed code. How could I not check it… How could I not write even the simplest unit test… Quick fix and few minutes later the site was fixed. After that I’ve simply burst in laughter over my stupidity.

Thankfully hardly anyone ever tries to login to this particular site (login page has both no-index and no-follow so it does not attract google scripters) so despite the fact that this bug has been live for a little over 12 hours no one broke in.

Rails helpers. Rediscovered

Normally, you’d use partials to manage some common functionality in a single file. For example like this:

Somewhere in your view:

<%= render :partial => 'ads/ad', :locals => {:placement => 'frontpage-banner1'} %>

It’s quite concise, but how about making it even less verbose? Helpers to the rescue:

module AdsHelper
  def ad(placement)
    render :partial => 'ads/ad', :locals => {:placement => placement}
  end
end

And now you can write this in your view:

<%= ad 'frontpage-banner1' %>

Nice! I believe it’s as short as it gets. Sure, if you render this partial only a few times it might not be worth it, but what if you render it 20 or 30 times?