wordpress

  • The site editor writes templates to the database

    A template edited in the site editor becomes a wp_template post, and from that moment the file on disk is ignored for that template. This is the single…

  • posts_per_page => -1 is a promise you cannot keep

    An unbounded query works on the development database with four hundred rows and takes the site down at forty thousand. fields => ‘ids’ is the other half and…

  • A block style variation instead of a whole block

    A block that differs from a core block only in appearance is a style variation, which is a class name and a stylesheet rule. The variation adds an…

  • Block deprecations exist because save() is a contract

    A static block’s save output is stored in the post, and changing it invalidates every existing instance unless the old shape is still declared. Without the deprecation the…

  • An InnerBlocks template with allowedBlocks

    A container block can specify what it starts with and what may be added, which is the difference between a layout and a suggestion. allowedBlocks restricts the inserter…

  • wp_options autoload, ranked by size

    The total autoloaded payload is a single number that predicts a large fraction of baseline request time, and almost nobody knows theirs. Tracking the figure over time is…

  • An autoloaded option that holds a cache

    Every autoloaded option is fetched on every request, and a plugin storing a cache in one turns a cache into a fixed cost. The total autoloaded size is…

  • A custom table when postmeta is the wrong shape

    Post meta is a key-value store with an index on the key, and querying it by value is a join per condition with no useful index. The string…

  • Image optimisation is a build step, not a plugin

    A 4.2 MB hero image, uploaded by somebody doing their job correctly. LCP at 6.1 seconds, and a plugin that only runs on upload.

  • Find the largest autoloaded options