TechEarl
Topic · PHP

PHP

PHP that ages well: WordPress, frameworks, and the production patterns that outlived the criticism.

41 articlesWritten by Ishan Karunaratne
PHP development guides on WordPress, frameworks, and production patterns that age well.
More in PHP
How to disable jQuery Migrate in WordPress: a wp_default_scripts snippet that removes the jquery-migrate dependency on the front end while keeping it in the admin, with the JQMIGRATE console-warning test that confirms it is safe.

Disable jQuery Migrate in WordPress

How to disable jQuery Migrate in WordPress: remove the jquery-migrate dependency on the front end so the compatibility shim stops loading, plus the testing step that tells you whether it is safe.

How to catch and route your own 404s in WordPress: hook template_redirect, check is_404(), parse the requested path, then resolve to content with status_header(200), 301-redirect with wp_safe_redirect(), or let it fall through to the real 404.

Catch and Route Your Own 404s in WordPress

Intercept requests that would 404 in WordPress on template_redirect, then resolve them to real content with status_header(200), 301 to the right URL with wp_safe_redirect(), or let them fall through. A fallback router for dynamic and legacy slugs you cannot enumerate.

How to install the Gearman PHP extension on Ubuntu 22.04 and 24.04 LTS for PHP 8.2, 8.3, and 8.4. Two install paths (apt and PECL), php.ini wiring, gearmand service setup, a working client/worker test, and when Gearman still makes sense vs Redis, RabbitMQ, and SQS.

Install Gearman PHP Module on Ubuntu (PHP 8.x)

How to install the Gearman PHP extension on Ubuntu 22.04 and 24.04 LTS for PHP 8.2, 8.3, and 8.4. Two install paths (apt and PECL), php.ini wiring, gearmand service setup, a working client/worker test, and when Gearman still makes sense vs Redis, RabbitMQ, and SQS.

Remove empty, null, false, or empty-string values from a PHP array. Covers array_filter, the '0 gets removed' gotcha, array_values re-indexing, multidimensional cleanup, and a performance comparison.

How to Remove Empty Values from an Array in PHP

Drop empty, null, or false values from a PHP array with array_filter and the right callback. Includes the '0 gets removed' gotcha, the array_values re-index pattern, multidimensional cleanup, and a performance comparison.