Updating My WordPress Plugin

My last post was about creating a plugin to show the hidden extra info attached to WooCommerce orders by the Stripe Payment Gateway. It’s been almost 2 years since then and it’s time to update a few things.

Turns out that the Stripe Payment Gateway has been updated and changes the order meta name from Stripe Fee and Net Revenue From Stripe to (a much more WP friendly) _stripe_fee and _stripe_net. It also adds another meta field called _stripe_currency that I haven’t investigated yet. I’m really glad to hear this and the latest version also adds the new fields to the individual order view.

However, all of the legacy orders are left invisible and there’s still no way to view the fees or net totals on the Order listing pages. So my little plugin is still of some use. It just needed a bit of work to list both the old and new meta fields as required.

Show Net Revenue from WooCommerce Stripe Gateway v1.1 is now available! Woo!

There is one issue that I’ll have to revisit when I have time: ordering by the Fee or Net column. WP_Query won’t allow ordering by 2 meta keys at the same time - or none that I could find at least. The best fix for now is to just orderby the Order’s total (what the customer paid) to get everything in the roughly the right place.

Finally, I had forgotten quite how much SVN is a git to use. LOL

EDIT: I’ve just discovered a companion plugin to this. WooCommerce Stripe fee in Report might be useful to anyone interested in charting the Stripe fees.

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.

Read More

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.

Read More

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.

Read More

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.

Read More

What the hell is a Glaikit?

Back when I was first starting out on my own as a freelancer, I needed a name. Especially as a Circus performer; people kind of expect a fancy show name. “Matt’s Circus” wasn’t quite right, so I went about looking for a better name. Preferably a name that no one had the domain for.

My mum likes to say that I look gormless when I’m performing (thanks mum) and my Scottish granny uses an old Scottish word - she calls me “Glaikit looking”

Yes - Glaikit means foolish. What a perfect name for a self-employed clown.

I looked for glaikitcircus.co.uk and was amazed that it wasn’t taken. Even more amazing was that glaikit.co.uk wasn’t taken, perfect for use when I wanted to move away from the circus stuff.

The name just kind of stuck after that.

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.

Read More

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.

Read More

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:

Read More