Example Custom REST API Endpoint
Registers a read-only endpoint at /wp-json/wpide/v1/latest that returns your latest posts in a compact format, as a starting point for your own API routes.
Snippet Library
Snippets for developers: debugging helpers, custom cron schedules, body classes, REST API tweaks and admin tools for checking hooks and queries. Building blocks for people who write code for WordPress every day.
Registers a read-only endpoint at /wp-json/wpide/v1/latest that returns your latest posts in a compact format, as a starting point for your own API routes.
Adds a "wp heaviest-posts" command listing the posts and pages with the largest stored content, revisions excluded, to track down pasted base64 images or page builder bloat slowing the editor.
Adds a "wp largest-meta" command listing the biggest post, user and term meta rows with their key and owner, the quickest way to find plugins bloating the database with huge serialized data.
Prints an HTML comment at the bottom of each page, visible to administrators, listing every script and stylesheet handle loaded and its source, to find what to optimize.
Registers a native JavaScript module with WordPress's Script Modules API and loads it only on pages that contain a chosen block, so modern ES module code needs no bundler and costs nothing elsewhere.
Enqueues a JavaScript or CSS file only on the pages you list, instead of on every page, to keep the rest of the site fast.
Writes a line to the PHP error log for every request that takes longer than a set number of seconds, with the URL, time, memory and query count.
Adds wpide_timer_start() and wpide_timer_stop() helpers that measure the time and memory a piece of code uses and write the result to the PHP error log, to find slow functions.
Shows administrators the object cache hit rate, hits and misses for the current page in the admin bar, to check whether Redis or Memcached is actually helping.
Adds an HTML comment at the bottom of front-end and admin pages with the number of database queries, generation time and peak memory. Visible to administrators only.
Stops chosen plugin or theme scripts and stylesheets from loading on the front end, optionally everywhere except the pages where they are needed.
Counts the external HTTP requests WordPress, plugins and themes make while building a page, and lists each URL, status and time in an admin bar menu for administrators.
Replaces the WordPress version in the bottom right of admin screens with the PHP version, peak memory use and database query count of the current page.
When SAVEQUERIES is enabled, lists the slowest database queries of the page with their duration and caller in an HTML comment visible to administrators.