Home For Fiction – Blog

for thinking people

Patreon LogoPatreon

September 30, 2024

YouTube Facade: a WordPress Plugin

Programming

internet, programming

YouTube Facade is the name of this plugin I’m sharing with you, but it started – like most things I make – as something entirely for my own use, on Home for Fiction. A facade is an interface that “masks” another kind of content — in this case, an embedded YouTube video.

Why, you might ask.

Facades serve a dual role:

If you’d like to see how it works, check it out e.g. on this page. Everywhere on the blog (and the main Home for Fiction site) there’s a YouTube video, facades are displayed.

YouTube facade: screenshot
YouTube Facade can speed up page load while safeguarding privacy

YouTube Facade: The (Basic) Basics

The code is ridiculously simple. Feel free to examine it on its GitHub page, but basically it simply fetches the YouTube thumbnail, it replaces the WordPress embed code with a facade – a custom group of elements (the image, the text, the “play” button representation) – and assigns a click event so that, when the YouTube facade is clicked, the original YouTube embedded video appears.

As I said in the introduction, this protects users’ privacy and significantly speeds up page load.

Download and Use for Free

Simply download the .zip file and extract it into the appropriate location inside your WordPress site. That should be: [yoursite.com]/wp-content/plugins. Then, from your WordPress dashboard, activate it and you’re ready to go. No further adjustment is needed.

YouTube Facade: Premium Version

If you found this useful and would like to support it, there’s also a premium version on my Patreon shop, which also allows you to set custom colors. You can either get it for the price of a coffee, or you can become a patron and also get access to tons of other stuff.

YouTube facade premium: dashboard screenshot

(Yes, Mr Walrus is helping me again 😀 )