Skip navigation

Snippets Snippets

  • WebAware
  • Shop
  • Snippets
  • Search

Search

  • Home
  • About
  • Privacy Policy
  • Mastodon
  • GitHub
  • WordPress
  • RSS
  • Contact Us

Yet another programmer blogging about code

Bulk redirection with nginx maps

8 November 2025

Using the map module in nginx to redirect many incoming requests with minimal code.

Tags: nginx
Posted in How-to | No comments

Read more »

Redirect to add a trailing slash for WordPress

8 November 2025

WordPress websites really like having a trailing slash on permalinks. A redirect from Apache’s .htaccess file quickly fixes that.

Tags: apache, htaccess, wordpress
Posted in How-to | No comments

Read more »

Not gone, just busy

8 November 2025

So I haven't posted anything here since January 2023. Oops. Somehow, two and a half years has just whipped on past.

Posted in Administrivia | No comments

Read more »

Caching oembed with nginx

14 January 2023

When we post a blog link on Mastodon, caching pages might not be enough, thanks to oembed requests — so cache those too with nginx fastcgi cache.

Tags: caching, nginx, wordpress
Posted in Snippets | No comments

Read more »

Purging the nginx cache when users differ

10 January 2023

Purge the whole nginx fastcgi cache from WordPress when nginx and PHP run as different users.

Tags: caching, nginx, wordpress
Posted in Snippets | No comments

Read more »

Hide fields under review in Gravity Forms

14 December 2022

Hiding a page or section of a form in Gravity Forms, without having to remove it from the form.

Tags: gravity forms
Posted in How-to | No comments

Read more »

Test for blocks within reusable blocks

9 December 2022

WordPress has a handy function called has_block() that tests whether your page or post uses a particular block type.

Tags: wordpress, wp-blocks
Posted in Snippets | No comments

Read more »

Gravity Forms countries restricted by WooCommerce countries

3 December 2022

If WooCommerce is restricting which countries it sells to, then Gravity Forms should probably restrict its addresses to match.

Tags: gravity forms, woocommerce
Posted in Snippets | No comments

Read more »

WordPress video in the block editor

29 November 2022

The WordPress block editor comes with a simple video block that doesn't support MP4 and WebM for one video. But the old video shortcode can.

Tags: wordpress
Posted in How-to | No comments

Read more »

Safari-compatible SVG with dark mode support

14 June 2022

SVG images can support light and dark mode in CSS. But Safari browser has a problem.

Tags: css, svg
Posted in Snippets | No comments

Read more »

Turn on debug logging for WordPress tests

1 January 2022

Automatically turn on the debug log when running unit tests for WordPress plugins.

Tags: php, testing, wordpress
Posted in How-to | No comments

Read more »

Unit testing WordPress plugins with PHP8+

7 December 2021

Run your WordPress plugin tests on PHP 8.0 and later. With thanks to Juliette Reinders Folmer and Yoast!

Tags: php, testing, wordpress
Posted in How-to | No comments

Read more »

  • 1
  • 2
  • 3
  • 4
  • …
  • 11
  • 12
  • >

© 2025 WebAware Pty Ltd | ABN 56 079 079 593

  • Mastodon
  • GitHub
  • WordPress
  • RSS
  • Contact Us