PHIL KURTH

Email

October 2019

How to clear lockouts from the awesome Limit Login Attempts plugin via SQL

Ever used the Limit Login Attempts plugin to help safeguard against attacks? I usually find this installed on managed hosts like Pressidium and Flywheel and it’s a very nice plugin and does a solid job. Unfortunately, I get blocked by it now and then which is, admittedly, my own fault as I’m either logging in […]

October 2019

Use generic views with data arrays for a flexible, context-independent UI system

When you start digging into WordPress partials, things really open up on the theme side. Being able to reuse templates is a nice feature and can help keep your code nice and tidy but if your templates are using WordPress’ template tags, you can easily find yourself in situations where you need the markup from […]

October 2019

A PHP class for dumping data to a separate log file

Debugging can be a lot simpler with a nice set of tools. Ideally, breakpoints and stepping through code is the way to go but sometimes it is nice and easy just to dump stuff somewhere. Dumping to the DOM is usually fine but can obviously cause problems on the page render and it can be […]

October 2019

Use curl on the command line for some quick information on a URL

One neat trick I use a fair bit is hitting URLs on the command line using curl. The most common use case I have for it is checking redirects but if you start using the command you’ll see there’s actually a fair bit of information handed back to you when you type the following in […]

October 2019

Simplify WordPress updates using these sequential WP CLI commands

Updating WordPress can really start to grind on me. Everyone is constantly releasing updates for their plugins and the core team are pushing to release more and more core updates all the time. Seeing the update notification can be a real bummer. So, to keep it easy, I just bang through all updates using a […]

October 2019

How to set defer or async attributes on enqueued script tags in WordPress

If you get down to business with performance optimisation, you could find yourself looking at ways to defer your scripts or even load them asynchronously. As far as I’m aware, WordPress’ built-in functions wp_register_script() and wp_enqueue_script() don’t currently take arguments for defining these attributes. But, with WordPress being WordPress, there is usually a way and […]

October 2019

Working with empty jQuery objects to build dynamic selectors

This is one of those techniques that you don’t really think you need until you find yourself in a situation where you do. This definitely isn’t a hammer and more often than not, you can select what you need in a single selector via jQuery or through the use of the built-in .filter() method but […]

October 2019

How to customize the colour palette for WordPress’ Gutenberg block editor

Building on yesterday’s tip, I’m putting this up to show how easy it is to register a custom colour palette for WordPress’ block editor; AKA Gutenberg. It’s actually something we can register as a theme feature so it’s all doable on the PHP side and is very straight-forward. Here’s the code you need;