Author: gazchap Page 1 of 11

Couch Potato to Half Marathon: Torture Isn’t Always Bad

It would be fair to say that, for most of my life, I’ve lived a somewhat sedentary lifestyle.

As a kid, physical activity was anathema to the enjoyment of my school days. I used to try every trick in the book to get out of PE lessons. Partly because I was so unfit that I just didn’t enjoy them, but mainly because I used to get mercilessly bullied by the ‘cool kids’ (and, in secondary school, one of the teachers) as a result of that poor fitness.

Eventually, I found a way to get out of PE lessons permanently. I (along with some friends) built a website for my secondary school — the first school website in the region, no less — and my IT teachers wanted us to update it, maintain it and look after it on the regular, and PE lessons provided a good time to do this. I think the PE teacher was secretly happy that I wasn’t dragging down his average times any more.

The years that have passed since leaving school have seen various aborted attempts to take up running and other sports. Apart from Taekwon-do, which I started in 2016 and am still doing, nothing stuck.

All of which is to explain why, if you’d said to me just over a year ago that I would be training to run a half-marathon in August 2024, I would have spat my drink right in your face and then laughed heartily. And yet, it’s true.

So how did this come about?

Gaming, and those things that stay with you

As people that know me will already know, I’m a gamer. These days, it has to be said, probably more of a ‘casual’ gamer than the hardcore staying-up-until-3am gamer. Age, and indeed, life, catches up with us all eventually.

As you might expect for nearly 35 years of playing video games, there have been some memories that have really impacted me in one way or another, whether it be for comedy value, poignancy, sheer terror or simply just raw enjoyment. So I thought I’d write about a few of them before April 2024 expires and I fail at my not-so-strict-goal of writing at least one post on here every month.

Grief

First of all, let me start this post by saying that I promise that not all of my posts from now on are going to be depressing!

Earlier this week, the 18th of March, was the one year anniversary of my Dad’s death. Rather like his death itself, it didn’t come completely out of nowhere, so it wasn’t a shock to the system as such. Combined with my ongoing separation from my partner of nearly ten years, however, it did get me thinking about grief, and specifically how I deal with it. I’m certainly no stranger to death or loss, but I do think that I’ve been ‘luckier’ than some in this regard.

The biggest life change of all

Well, except death I suppose.

So, this isn’t quite how I imagined my “February 2024” post to be, in the non-existent grand plan of “posts that I can write to meet my self-imposed one per month quota.”

Last Thursday, February the 8th 2024, my wife Jem and I made the decision to separate and, ultimately, divorce.

We’ve had something of a rollercoaster of a relationship in the last couple of years particularly, which has essentially magnified incompatibilities that were, strictly speaking, always present.

We both tried hard to make things work, and we’ve both done things that we shouldn’t have. I’ve learned that I have a lot of stuff stored up in my subconscious, difficulties and traumas from past relationships and other aspects of my life that I really should have put more effort into trying to deal with long before now, so that’s something I’m going to be focusing on more in 2024 and beyond.

It’s the right decision at this point for us to separate. We’re still friends, and we’re hoping that this will continue (not least because we have a lot of shared friends that neither of us particularly want to lose) and we still have a love for each other… just not the same kind of love.

I don’t know what the future holds. This isn’t my first rodeo when it comes to divorce, but it is the first time that I’ve reached the mutual decision to separate with someone that I still like, love and respect. Maybe that will make the next few months easier, or maybe it won’t.

One thing I do know though is that, despite being someone that doesn’t really go in for the whole Valentine’s Day thing, having all of these feelings, and writing this post on today of all days is proving more troublesome than I expected.

It’s been too long…

I feel like this is a post that I could have written at so many different points over the lifetime of my online presence. I really am terrible at keeping this place up to date.

Well, I’m going to be making a concerted effort throughout The Year Of Our Lord Twenty Twenty Four to change this.

If I can manage at least one post per month, I’ll be a happy bunny. Anything has to be better than leaving it to languish for over four years, right? So, what has been going on in my life since my last post, which was (looks back) on the 4th October, 2019?

WordPress Plugin Security Alert

Earlier this week, a friend (who, for the purposes of this post is named Stephen) relayed a story to me of an email that one of his friends had received recently.

This friend – let’s call him John – runs a local business that requires advance bookings from customers. He runs his entire booking calendar through his website, and as well as customers being able to register an account and book through the website, he can also create bookings on behalf of customers from the administration panel.

It’s this latter scenario that gave rise to the situation I’m about to delve into. John had booked this customer in to his calendar through the admin panel of his WordPress-powered website, and the customer received a confirmation email containing a “Manage Account” link.

The customer clicked this link to view his booking details, and was surprised to find that he could see a lot more bookings than just his own! He, very responsibly, emailed John to let him know, who then in turn got in touch with Stephen (who had built the website) and Stephen then relayed this whole story to me.

Immediately my ears pricked up – that’s not a great situation for a customer to find, as it suggests deep-seated problems with the website’s security, so I volunteered to take a look. The following is what I found…

WooCommerce: getAddress.io Postcode Lookup

Update: Version 2.2 released on 10th February 2022, on the WordPress plugin repository.

This, my third WordPress plugin (and also my third WooCommerce plugin, apparently I really like doing stuff with WooCommerce!) adds a postcode lookup tool to the checkout in WooCommerce 3.x that lets your UK-based customers quickly fill in their billing/shipping addresses based on their postcode.

It utilises the great getAddress.io API for the postcode lookup, and as such requires an API key for their service. I’d always recommend the £10 per month pricing plan, simply because it offers the best value, but they have a number of others available.

WooCommerce: Purchase Order Payment Gateway

Update: Version 1.1.5 released on 4th May 2021, on the plugin repository.

A recent project required the ability for customers on a client’s WooCommerce website to be able to request an invoice for their order (and thus pay offline) – but with the added twist that it required a Purchase Order number. This twist meant that simply changing the name of WooCommerce’s built-in “Offline” gateway was not enough.

I had a quick look around and found an existing plugin for WooCommerce that added this functionality, but as seems to be common when I do this, the functionality left a little bit to be desired.

First of all, the plugin required the customer to enter a postal address for the invoice (and curiously, didn’t automatically pull through the customer’s billing address) – I only needed a Purchase Order number field.

Additionally, it wasn’t very well internationalised – some strings were set as translated, but others – particularly in the HTML output that the plugin generated on the front-end and the admin back-end, were not.

So, I’ve taken it upon myself to learn a bit more about WooCommerce’s Payment Gateway API, and have written my own – which you can download below.

How to enable checkbox lists for non-hierarchical taxonomies in WordPress

WordPress’ taxonomy features are one of the most powerful aspects of the platform, giving you the capabilities to group posts (including custom post types) in pretty much as many ways as you can think of.

There are two types of WordPress taxonomy – hierarchical and non-hierarchical. In case it’s not obvious from the name, a hierarchical taxonomy has a hierarchy – that is, you can create terms that are children of a parent term (and even children of those children) – standard post categories in WordPress are an “out of the box” example of a hierarchical taxonomy.

A non-hierarchical taxonomy has no parent/child structure, and is basically just a “flat” list of terms. Post tags are the “out of the box” example here.

When you’re developing a plugin for WordPress (or maybe even a theme) you may find that you have a need to create custom taxonomies – for example, if creating a plugin for a property/real estate website, you may have a custom taxonomy for “Property Type”, that contains terms like “House”, “Apartment” etc.

It’s at this point that you may run into a bit of an annoyance with the default WordPress user interface…

WooCommerce: Use Product Images as Category Images

Update: Version 1.3.1 released on the 25th August 2020.

So, earlier this morning I found myself wishing that WooCommerce had the capability to use a product thumbnail when displaying a category link in situations where the category doesn’t have its own thumbnail defined.

I went on a bit of a hunt and found a couple of small plugins. One didn’t work at all, which I attribute mainly to it having not been updated for two years and much changing in both WordPress and WooCommerce since then, and another one that I found didn’t work until I made a couple of code changes – and had a couple of noteworthy problems;

  • it would only fetch product thumbnails from that immediate category – not delving deeper down into the category tree and fetch product thumbnails from child categories, and
  • it did no filtering for products that had no thumbnails set, so would in some cases return products that had no thumbnail

So, I’ve made my own. A zip download can be found below, you just need to drop the folder inside it into your wp-content/plugins folder and then activate the “WooCommerce Category Product Thumbnails” plugin.

I’m using WordPress 4.9.4 and WooCommerce 3.3.0 – please let me know in the comments if it doesn’t work on other versions.

Update version 1.1 –  23rd March 2018: Add option (found under WooCommerce -> Settings -> Products -> Auto Category Thumbnails) to change the image size used for the automatic thumbnails. By default it remains as “shop_thumbnail”, but you may find that “shop_catalog” is a better choice.

Download

Download the plugin from the WordPress Plugin Repository

Source

This plugin is open-source – view the source code on the GitHub repository.

Page 1 of 11

Privacy Policy & Powered by WordPress & Theme by Anders Norén