Category: General

Integrating AbuseIPDB With the Nginx Ultimate Bad Bot Blocker Script

The Nginx Bad Bot Blocker script is fantastic and a no-brainer to install on any Nginx server hosting publicly accessible websites.

As great as it is though, I’ve recently noticed a significant increase in the number of attacks on the servers which I administer and websites in general. So I looked into into integrating the paid API from AbuseIPDB.

This is how I got it to work.

Continue reading “Integrating AbuseIPDB With the Nginx Ultimate Bad Bot Blocker Script” ››

Clear W3 Total Cache by URL From the Admin Bar or Dashboard

When recently working on a WordPress website that generated pages from an API that aren’t stored in the main site database, I discovered that the W3 Total Cache admin bar link to clear the current page’s cache didn’t work.

The ‘Purge Current Page’ link in the Performance menu item works by passing the current post ID to a function that clears the cache by an ID. Since this only works for single posts, it also doesn’t work on post archives and term listing pages.

So I wrote a small plugin to clear the current page’s cache by its URL.

Continue reading “Clear W3 Total Cache by URL From the Admin Bar or Dashboard” ››

Automatically Add Unique CSS Classes to Contact Form 7 Forms

When using certain CRMs and marketing automation tools, Contact Form 7 submissions can all look like they came from the same form.

This is especially noticeable in HubSpot which uses the class on the form tag to identify each form. Unless you specifically add a class to the shortcode then it will look like any submission came from a form named “.wpcf7-form, .init”

So I wrote a small plugin to automatically add the title slug as a form class for any forms that haven’t had one added manually.

Continue reading “Automatically Add Unique CSS Classes to Contact Form 7 Forms” ››

Forcing W3 Total Cache to Clear Parent Term Listing Pages on Post Save

In the page caching settings of W3 Total Cache there is an option to flush the ‘Post Terms Pages’ when saving or updating a post. This clears the listing pages for any terms that the post has been added to, but it doesn’t clear the listing pages of any parent terms that aren’t checked, even though the post can still show on those pages.

The following code uses WordPress filters to detect a change in a post and then invalidate the cache of any parent term listing pages whether they have been checked or not.

Continue reading “Forcing W3 Total Cache to Clear Parent Term Listing Pages on Post Save” ››

Mapping a Synology NAS Drive in Windows 11

How to map a Synology NAS with Windows 11 that you previously had connected with Windows 10

Continue reading "Mapping a Synology NAS Drive in Windows 11" ››

Prevent PDF Caching With Invoice Ninja 5 (Apache, .htaccess)

If you find that PDF files aren’t updating after changes, it could be that they are cached by the browser or a CDN such as Cloudflare.

Continue reading “Prevent PDF Caching With Invoice Ninja 5 (Apache, .htaccess)” ››

Customising the Client Portal Colour In Invoiceninja 5

Customizing the invoiceninja V5 client portal colour scheme.

Continue reading "Customising the Client Portal Colour In Invoiceninja 5" ››

Loading Disqus Comments On Demand Without jQuery or AJAX

Posted in General

There are many posts around the internet about loading Disqus comments on demand, however, I found many of them either rely on jQuery, try and load the embed.js file via ajax and run into CORS issues or just lack small bits of functionality. So I thought I would put everything together in one gist.

Continue reading “Loading Disqus Comments On Demand Without jQuery or AJAX” ››

How to get your Windows 10 Key

Posted in General

I recently bought a new pc, and was a bit quick to install Windows, create a backup drive and remove the disk to install the larger ssd from my previous computer.

The upshot of that was that, after installing the operating system on the new drive, it wouldn’t activate Windows as I didn’t fully activate it on the first install before making the recovery drive.

In the end, I got in contact with a Windows support person who recovered the activation key from the computer hardware. Which is pretty simple when you know the commands.

To get your key:

Right click on the start menu and select “Command prompt (admin)”

Type in:

wmic path SoftwareLicensingService get OA3xOriginalProductKey

You should then get your key in the console output.

Issues Assigning Nameservers to .de Domain Names

I recently ran into an issue whilst trying to change the nameservers for a German (.de) domain name. When I tried to point the domain to a whm/cpanel install I got the error ‘Failed to Modify Domain Nameservers: The domain DNS check has failed’.

The reason for this is specific to .de domains.

Continue reading “Issues Assigning Nameservers to .de Domain Names” ››