Yet another programmer blogging about code

VBScript For Next and Continue

October 10, 2015

I still get the occasional Classic ASP VBScript maintenance job from time to time, and it reminds me of the language statements it just doesn’t have. Like “continue”, great for skipping a bunch of logic inside a For loop. Turns out, there is a nice simple way to get that functionality. (more…)

Comma-separated vulnerabilities

October 8, 2015

If you accept user input and then export it as CSV, please read this now! James Kettle very neatly explains how something as simple as a CSV export can be used to deliver exploits. I didn’t know about this before today; hat tip to Gravity Forms and, via them, Ninja Forms.

Load Gravity Forms stylesheets in page head

August 21, 2015

Gravity Forms normally loads its stylesheets in the page head, where they belong. It does that only on pages which have forms, which is nice. If you use a widget to host your form, however, it can’t detect that until it renders the widget… too late to load the stylesheets in the head. At that point, it just pulls them directly into the page body. (more…)

Disable scroll wheel on Events Manager location maps

August 15, 2015

Events Manager is a really nice, easy to customise plugin for showing events on WordPress websites. One gripe I always have with it is that the location maps zoom when you use the mouse scroll wheel, something I always turn off when I add a map to a page. Here’s how to fix it. (more…)

Hack a WordPress plugin AJAX action

July 13, 2015

Customising the AJAX output of WordPress plugins can often be a breeze, when the authors oblige other developers by peppering their code with action and filter hooks. But if they don’t, you can always fall back on hacking the plugin’s AJAX action. (more…)

Life seems but a quick succession of busy nothings

It’s not often that I quote Jane Austen, but she had it so right when she said, “Life seems but a quick succession of busy nothings.”

Moved to DigitalOcean

January 4, 2015

I’ve moved nearly all of WebAware’s websites to DigitalOcean, and stuck NginX in front of everything. (more…)

Fix broken tables in twentyfifteen WordPress theme

December 27, 2014

WordPress 4.1 brings with it the twentyfifteen theme, which I find to be a rather nice blog theme. Unfortunately, it adds a new wrinkle to any tables on your website — often breaking them! Here’s the simple fix. (more…)

Sort WooCommerce products first in search results

December 18, 2014

When shoppers search a WordPress website, you want them to find products first before listing any articles and pages. And it’s surprisingly easy to achieve, with a simple filter hook. (more…)

Use Autoptimize effectively

November 6, 2014

Keeping your WordPress website fast can become pretty tricky once you start installing plugins and off-the-shelf themes. Everything seems to want to load at least one CSS stylesheet, and sometimes a dozen or more JavaScript script files. Some also inject great chunks of CSS and JavaScript into every page. Luckily, there’s the handy Autoptimize plugin to help you sort all of that out. (more…)