Uncategorized

  • Heartbeat is polling admin-ajax every fifteen seconds

    The Heartbeat API keeps post locks and autosave working by posting to admin-ajax.php on a timer — every fifteen seconds in the editor, every sixty elsewhere in the…

  • Laravel 5.2 middleware groups replaced the kernel list

    Before 5.2 the HTTP kernel had one global middleware stack, so anything needed by web routes also ran for API routes — sessions, CSRF verification and cookie encryption…

  • Xdebug and a sampling profiler measure different things

    Xdebug instruments every function call, so it sees everything and multiplies the runtime by three to five. A sampling profiler interrupts periodically and records the stack, so it…

  • A deployment pipeline that runs the tests first

    Deploying by rsync on a Friday afternoon, and what replaced it: lint, test, build, stage, promote — with a rollback that is the same mechanism rather than a…

  • preg_replace_callback_array for several patterns at once

    Applying several regular expressions with different callbacks meant chaining preg_replace_callback() calls, each re-scanning the whole subject — three patterns, three passes. Patterns are applied in the order given…

  • fastcgi_finish_request for work the visitor should not wait for

    Sending a webhook or writing an analytics row after the page has rendered still holds the connection open, because PHP does not close it until the script ends.…

  • WooCommerce sessions are not PHP sessions

    WooCommerce maintains its own session handler backed by a database table and a cookie, entirely separate from $_SESSION. Code that starts a PHP session to store something cart-related…

  • The critical rendering path decides your first paint

    A stylesheet in the head blocks rendering until it has loaded, and a script without defer blocks parsing until it has executed. Both are correct behaviour and both…

  • admin-ajax versus a rewrite endpoint

    Every request to admin-ajax.php loads the full admin bootstrap before reaching your handler — a measurable amount of work for an endpoint that returns three fields, and it…

  • class in JavaScript is prototypes with better syntax

    class introduced no new object model. It is syntax over the prototype chain, which explains most of the behaviour that surprises people coming from other languages. Methods are…