One part crazy, one part awesome.

RVL 1.5.x Released, and General Moaning

Go get it! In this release, I’ve deprecated the dependency on the Twig templating system. Don’t get me wrong – Twig is fantastic! However, I was only using the tiniest bit of its functionality, and it was really a heavy-handed approach to a simple problem. I refactored the code into a pure PHP alternative in maybe 10 minutes.

Having Twig exposed an issue with both WordPress and PHP (One I should have foreseen, actually). In WordPress, it can be a real challenge to have multiple copies of the same third-party library in the same install.  To wit, if two plugin authors both include the standard Twig package, the second authors plugin won’t activate because Twig is already instantiated. Sure you can check to see if Twig already is declared and simply use that instance, but there’s no guarantee that they’re using the same version.  If they’re using an older version and you try to use a feature included in the newer version, you’re out of luck.

Namespacing or class nesting could solve the problem.  However, PHP doesn’t implement those features well enough (or at all, in the case of class nesting) to solve the basic issue. It would be fantastic to be able to open a new PHP file, declare a namespace, and require Twig, then Twig would be sitting all pretty and ready to go under my own umbrella namespace. Class collisions would be near-impossible.

My opinion of PHP, in general, has changed since I wrote my little post about PHP being web legos. If wielded correctly, PHP can be a fantastic language to work with.  But occasionally you still get the feeling that OOP was sort of bolted on (and it was), and miss some of the things you get when a language is object oriented from day one.

jQuery.autoTarget for WordPress 1.0.0 Released

I’ve been threatening long enough – I finally wrapped my jQuery.autoTarget jQuery plugin into a WordPress plugin, making it super simple to make all your external links automagically open in a new tab/window.  Go grab jQuery.autoTarget for WordPress!

Oh, and in the spirit of Dogfooding, I also use this plugin on this site.

jQuery.autoTarget 1.1.0 Released

In preparing to roll out a WordPress plugin version of jQuery.autoTarget (currently under review for inclusion in the WordPress Codex), I discovered that I had a slight error in the regular expression I use to extract the domain from all the links on a page. It’s not hard to have an error in a regular expression, they are dark magic after all. It also occurred to me that I was overwriting any extant targets that may be set deliberately by the site owner/developer, so I added in code to prevent that clobbering from happening.

Go download jQuery.autoTarget v1.1.0!

(Update:  the WordPress plugin version of this is now up and ready for the masses!)

jQuery.autoTarget 1.0.0 released

I finally reached the point where I was tired of finding and copying over the same snippet of jQuery code to make external links automagically open in a new tab/window.  So I wrote my first jQuery plugin called jQuery.autoTarget.  Super simple to use.  Next up will be a WordPress plugin to so the same thing for any given WordPress installation.