- Lester Chan's WordPress Plugins - https://lesterchan.net/wordpress -

JavaScript In My Plugins

Only 5 of my plugins (WP-Polls, WP-PostRatings, WP-Email, WP-ServerInfo and WP-UserOnline) use JavaScript. The JavaScripts are packed using Dean Edward’s Packer [1] and the only framework use just for AJAX is TW-Sack or Simple AJAX Code-Kit (SACK) [2]. TW-Sack is extremely lightweight and easy to use but unfortunately, it can be used only for AJAX purposes. The reason I used TW-Sack instead of jQuery is simple, at the time I created my plugin, jQuery does not exists yet and when jQuery becomes popular the reason why I didn’t upgrade it was because I was lazy. As the saying goes, “If it ain’t broke, don’t fix it”. Recently there is some buzz within the WordPress Development Team regarding WordPress’s JavaScript Usage. Andrew Ozz has written two articles on it in the WordPress Development Updates [3] blog entitled Optimizing script loading [4], Optimizing script loading part 2 [5] and Optimizing script loading, implementation [6]. With the upcoming WordPress 2.8 will feature some heavy JavaScript changes, I told myself to make use of this chance to totally revamped the JavaScripts in my plugins. Here are the changes that will be made:

I have already done it for WP-PostRatings and it is now running live on this site. Next, I will be doing WP-UserOnline, followed by WP-Email and lastly WP-Polls as it is more complex.