Uncategorized

  • Rate limiting in nginx before it reaches PHP

    A rate limiter in the application still costs a PHP-FPM worker per request, which means a burst of login attempts occupies the pool whether or not it is…

  • Shared libraries between services recouple them

    A package holding the shared domain model removes duplication and reintroduces exactly the coupling the split was for: a change to it requires every consumer to upgrade, which…

  • wp-cli commands are classes, and yours can be too

    A maintenance task run through wp eval-file has no arguments, no help, no progress and no exit code worth checking. Registering it as a command costs about ten…

  • Query cache is gone in 8.0, and was already a mistake

    The query cache stores result sets keyed by the exact query text and invalidates every entry for a table whenever that table is written. On anything with writes,…

  • Route model binding with a custom key per route

    getRouteKeyName() changes the binding column for a model everywhere, which is wrong when the admin addresses an order by id and the customer addresses it by reference. An…

  • PHPStan levels are a ratchet, not a target

    The levels run 0 to 7 and the instinct is to aim for the top, which on an existing codebase produces thousands of errors and no way to…

  • The cron event that schedules itself twice

    wp_schedule_event() does not check whether the hook is already scheduled, so calling it on init — which is where it usually ends up — adds another entry on…

  • The each() deprecation is a whole class of loop

    each() is deprecated in 7.2 and the notice appears once per call, which on a loop means once per iteration and a log file measured in megabytes. The…

  • Grid and flexbox answer different questions

    Both arrived as “the new layout system” and they are not alternatives. Flexbox distributes space along one axis; grid places items on two at once. The rule of…

  • The 7.2 object type hint, and what it is not

    November’s release adds object as a type, which sounds like it should let a function accept “any class” and be checked. It does exactly that and nothing more.…