Geekery Marathon

I’m in the process of this very boring, very tedious, very important project at work.   I need to build about 100 test scripts that exercise an API and can be tested by automation against a known response set.   The requests and responses are both in JSON notation, which is very precise in its use of syntax and very dense with arrays nested in hashes nested in arrays nested in hashes ad nauseam, and the responses are pages long.   The cut\paste and general detail of the work in painful.

So i’ve been easily distracted by the blog as a flightly little pleasure toy.   I wanted to add some more functional plugins to the site that would show latest comments and latest posts on my blogroll.   This always involves fiddling with a few sample plugins, tweaks, and spelunking through code from developers around the world.   A few hours of effort led me to Get Recent Comments for the comments list now on the sidebar. Its got a very easy interface for formatting which allows you to use preloaded macros and combine them with freehand html.

After 2 hrs I was kinda rolling, so moved onto a recent-post streamer for my blogroll. This took a lot of fiddling to get what I wanted and in the format I wanted it, and after another 2 hours I was still evaluating and prototyping. I was liking one plugin called Feed Reading Blogroll but it required the use of widgets in your sidebar and the use of WordPress 2.7.1.   I’ve stayed away from widgets since they overwrite a lot of manual plugin code I’d built into the sidebar where I could control the formatting, and under WordPress 2.5 widgets seemed a little flaky.   You can only resist progress for so long, and I was a year behind on my version of WordPress, hanging doggedly on v2.5 since it was good enough.   Sooooooo…

I got sidetracked into upgrading.   This first required a full dl of all my code and a diff against the 2.5 default code to track all my edits.   Then a lot of fumbling about with my ftp client since it kept locking the connections to my ISP every 50 or so file uploads, was choking on recursive deletes, and I forgot to disable all my plugins when I started the upgrade process so the new version of WordPress blew up initially.   This meant falling back to the old version, more flumbling with the locking connections, until I found a management page in my website’s admin suite that let me kick ftp connections.   So I basically camped out on the page kicking connections as fast as I could while the ftp client kept establishing fresh ones, and eventually got the 1,000   v2.7.1 files uploaded.   Modify the DB to support the new version, edit the sidebar.php where it choked on deactivated plugins not wrapped in if statements, reactivate the plugins, and then begin the process of comparing all my v 2.5 tweaks to the v 2.7.1 code to see which ones I had to re-add.

It was about 5pm when I went to work on putting back my smileys, again.     WordPress once again redid its implementation of tinyMCE, and the code looked like it was written in linux so appeared as one ginormous line instead of formatted.   This was a search\replace\reverse-engineering PITA.   My emotions plugin code from v 2.5 was solid, but I had to figure out how to get it initialized by the new implementation of tinyMCE, and how to load its buttons into the WYSIWYG editor.   So I picked one plugin with a small code block (fullscreen) and manually formatted 4k of javascript code to confirm it was comparable to my emotions javascript, which it was.   Then I searched the whole WordPress install for the term “fullscreen” and figure out where I had to add my plugin name “emotions” to get it initialized.   Next I hacked through the whole code base to find its button.   After striking out on the buttons, and whittling down the list of places where “fullscreen” was called to relevant hunks of code, I realized that the buttons were picked from one large image, and that tinyMCE already had the smileys “button” in its library.   It was ready to be called by my changes above.   The files I modded were /wp-admin/ includes/post.php and/wp-admin/gears-manfiest.php.   It was now close to 8pm.

Back to the widgets to get my site widgetized and see how it looked.   I mostly got it to look right, figured out some code pieces I could pull outside the widgetizing block in sidebar.php to not be overwritten, screwed around with putting them in elements to get them correctly formatted in their new div, etc etc for a couple more hours.   And tumbled to a bug in the Recent Comments code where the title got fubarred due to any change in the widgets panel.   This took about an hour of trying to fix it on my own, until I finally figured out a workaround (resave your options for the plugin after every save to the widgets panel) and left a comment on the developer’s blog in hopes that they might fix it.   Paying back the community, as it were.

It was probably 9:30-10ish at least when I dialed in completely on the blogroll features.   It was a nice plugin, but I did not like the format.   The code was very dense and used the <abbr> html tag a lot which I did not know how to use.   The embedded php was also super-thick, and I struggled mightily to figure out where the inline styles were used vs. the optional css file.   About 3-4 more hours went by where I fiddled with it, tried and rejected a few other plugins, blew off taking out Kila, blew off working out,   and got it kinda sorta good enough when I left a comment on the developer’s site.   He was in Germany, and it was now daytime over there, and his reply helped me see the simple thing I’d missed – what I thought was a link from which I could not remove the underline was actually a bottom border.   Mixing that with some inline styles that I’d sorted out,   i quit about 2am.

My giant pile of work is still there waiting for me.

1 Comment

Leave a Reply