Terence Eden. He has a beard and is smiling.

Terence Eden’s Blog

Theme Switcher:

A small accessibility improvement to WordPress

· 6 comments · 300 words


An upload screen - there's a large text box for the image description.

My mate, the accessibility specialist Léonie Watson, has this to say about how we improve the world, piece-by-piece: Accessibility doesn't have to be perfect, it just has to be a little bit better than yesterday. Source: Twitter Damn straight! One of the best ways we can make tomorrow slightly better than today is by making small changes which make it easier for people to do the right thing. …

Strategies for linking to obsolete websites

· 7 comments · 400 words · Viewed ~245 times


Plugin offering to fix a broken link by replacing it with an archive link.

I've been blogging for a long time. Over the years, I've linked to tens of thousands of websites. Inevitably, some of those sites have gone. Even when sites still exist, webmasters seem to have forgotten that Cool URls Don't Change. I use the WordPress Broken Link Checker plugin. It periodically monitors the links on my site and lets me know which ones are dead. It also offers to link to…

HOWTO: Regenerate Gravatars in WordPress

· 300 words


The Logo for WordPress.

A troublesome plugin recently corrupted some of the avatars on my blog's comments. This is a quick HOWTO for regenerating them. Gravatars are based on the MD5 hash of a user's email. For some reason, the plugin had overwritten the avatar field with the text http://identicon This MySQL query finds all the comment IDs which have that dodgy text: SELECT comment_id FROM `wp_commentmeta` …

Using the WordPress mShots Screenshot API

· 7 comments · 300 words · Viewed ~4,171 times


The Logo for WordPress.

A few years ago, I wrote about Google's secret screenshot API - a slightly cumbersome way to take website screenshots for free. There's another service which you may find simpler to use - mShots from WordPress. Here's how it works: Take any website link: https://twitter.com/JennyVass/status/1067855777040338944 URL Encode it: …

Import Images From A Migrated WordPress

· 2 comments · 550 words · Viewed ~531 times


The Logo for WordPress.

Here's how to solve a common WordPress problem. I want to re-import all my blog's images into the media library. I've moved my blog to a new host - but kept the same domain name. I started with a new WordPress install, the uploads folder still has all my images, but WordPress can't see them. None of the plugins I found worked with huge amounts of images spread across multiple directories. One …

An "on this day" plugin for WordPress

· 500 words · Viewed ~233 times


Just me scratching my own itch. I want to create an RSS feed of all the blog posts which I'd published on this day in the past. For example, if today is 21st of November 2016 then this plugin will show blog posts written on 2015-11-21 2014-11-21 2013-11-21 And so on. You can view a demo at https://shkspr.mobi/blog/on-this-day/ Code The code is pretty simple. The WordPress API is fairly …

Google's AMP is a gilded cage

· 47 comments · 450 words · Viewed ~74,683 times


AMP is Google's attempt to re-fight the transcoding wars of the early 2000s. It is actively dangerous to the web ecosystem, helps disseminate propaganda, and is disliked by many users. If, like me, you made the mistake of trying out AMP on your website - you're in a tricky position if you try to remove it. Google doesn't like anything leaving its clutches. After a few weeks of AMP, I decided …

Don't use negative numbers for error codes

· 9 comments · 250 words · Viewed ~2,185 times


A warning to programmers - try to understand how people will use your error codes. This morning, I was confronted with a rather bemusing error message on my WordPress blog: Ok, so this should "never happen" and yet somehow it has. I wonder what on earth the error code means? I selected the error code and Googled it! I just copied and pasted the error message into Google and got back a set …

Displaying WordPress Posts' JetPack Statistics Using stats_get_csv()

· 550 words · Viewed ~895 times


Bar chart showing how many times a blog has been red over a year.

Here's a quick way to display how many times a WordPress post has been read. For this, you will need: A blog running WordPress. The JetPack plugin installed. The ability to edit your themes. Here's the snippet of code I'm using to add "This post has been read 12,345 times". I'll explain how it works in a bit more detail. if( function_exists( 'stats_get_csv' ) ) { …

How To Style WordPress's Audio Player?

· 1 comment · 250 words · Viewed ~2,243 times


The Logo for WordPress.

WordPress has a built in media player. Chuck in an .MP3 or other sound file, and it will play directly in the browser. Nifty! The only problem is that is looks a bit... dull. 🔊 Celeste🎤 Alex Fitch 💾 Download this audio file. (From Alex Fitch's Eola) It works, but it's not exactly what you'd call gorgeous, is it? Wouldn't it be nice if we could have something like this? Well, the…

WordPress Archive Calendar Widget

· 2 comments · 400 words · Viewed ~965 times


One of the most addicting aspects of Open Source software is the ability to scratch one's own itches. I've been blogging since 2004 - and while I'd never mistake longevity for expertise - I do take a certain pride in letting my readers know that I've spent over a decade bashing out words. So, I decided to build a simple widget which would display my posting history in a calendar style. And…

The Unsecured State Part 3 - 2,000+ NHS Security Vulnerabilities (Disclosed)

· 7 comments · 1,900 words · Viewed ~11,228 times


This is part 3 of a series of blog posts looking at the security of the UK Government's web infrastructure. Britain's National Health Service is riddled with old and insecure WordPress-based websites. Many of these sites have severe flaws including being vulnerable to XSS attacks. There is absolutely no suggestion that patient data or confidentiality has been put at risk. These flaws were …