My WordPress Plugin

Well, it’s finally happened. I’ve actually written a plugin that might be useful to others and I’ve set it up as a public plugin on the WordPress repo.

I’ve just finished working on a site that used WooCommerce and the Stripe payment Gateway. I’d noticed during testing that orders were given a little meta data by the Stripe Gateway; what the fee was and the remaining net income.

I mentioned this to my client who said “Damn, that’s useful information. Can you make it so I can see that data?”. At first I thought there would be a setting in Woo or the Gateway pages, I couldn’t find anything. Seems that they’ve added the meta data (simply called “Stripe Fee” and “Net Revenue From Stripe”) but not really done anything with it.

This is WordPress we’re talking about here – someone will have made a plugin to show this info… Right???

Wrong! I haven’t found anything yet, Even searching for the meta names just returned the source code from Woo. No body had made something to do it.

Never one to back down from a challenge, I got to work. Continue reading “My WordPress Plugin”

Load-balanced WP installs: which server am I looking at?

Been working on a few WordPress installs on load-balanced servers recently. Load balancing is a great technology and has so many benefits to a site that gets overloaded a lot, but I had a few contributors and editors that were not seeing up-to-date images. The front end servers sync files between themselves, but it can take a moment or two – more than long enough for people to panic.

I tried a few different load balancing settings but some users were using one machine to edit posts and another to check it. So there was no way for them to see which server they were on.

During development, I had added the hostname to the <head> in a comment…

<!-- hostname: master.example.com -->

… but that was only really available to users who know their way around developer tools or HTML. I needed something else. Continue reading “Load-balanced WP installs: which server am I looking at?”

Getting rid of “Howdy”

If you’ve used WordPress before, you’ve probably noticed that the admin toolbar says “Howdy, Matt” in the top right. [other usernames are available]

Much as I enjoy a good “Howdy”, it doesn’t always seem very professional so I thought I would have a little go at removing it. Most snippets that I could find involved doing a search and replace for “Howdy, ” which kinda works but might have problems on non-English sites. Continue reading “Getting rid of “Howdy””

Little tip for updating Windows machines

Recently I have moved from Linux based machines to Windows 7. While I won’t go into which is the better operating system or why I’ve made the switch after many happy years of open source OSes – there was one major feature that Linux has by default that Windows lacks: apt-get.

For those who have no clue what an apt-get is, it is a package manager; a command line tool (in debian based linuxes) that will install, uninstall and update programs for you. Continue reading “Little tip for updating Windows machines”

WP plugin dev’s are the greatest

After buying the Premium version of the Relevanssi plugin for making WordPress search work better than normal. I realised that it didn’t do exactly what I (and the client) wanted.

My client wanted to be able to put a specific page/post at the top of results for certain search terms. Even to be able to specify the weight of the result – so that the page/post could be put anywhere in the results. Continue reading “WP plugin dev’s are the greatest”

Dynamic 3 column sitemap for WordPress

Recently had a job that the client wanted a WordPress sitmap page that was dynamic showing only the pages (no posts). Easy enough with the wp_list_pages() function in WordPress but the client also wanted this in 3 well spaced columns even when pages have different numbers of children. Also, the children of the top level page had to be grouped with the parent. This is where it gets harder for WP. Continue reading “Dynamic 3 column sitemap for WordPress”

Emails, Lies and Wedding rings.

Last September I proposed to my girlfriend.

“What does that have to do with emails?” – I hear you ask.

Well, I couldn’t just say “Let’s go to a nice hotel in Brighton for the weekend” and Liz (the girlfriend) not be suspicious. And that would spoil the fun. I decided to pretend to be on a gig that needed her with me.

Most of the time when I do have a real gig, I go with surprisingly little information other than where to park, at what time and who to ring when I get there. Liz however, needed much more information than this to be convinced and wanted all the emails that I got forwarded on to her. Not very easy when it was a fake gig. Time to fake some emails, and here’s how I did it: Continue reading “Emails, Lies and Wedding rings.”