Category: WordPress

  • Quick Tip: Script Debugging in WordPress

    Quick Tip: Script Debugging in WordPress

    When debugging core WordPress scripts, dealing with cached copies like in `script-loader.php` can be tricky. You can apply a unique `ver` argument to core scripts on each refresh using a filter. This ensures you get the most recent version from page and browser cache. Remember to enable `SCRIPT_DEBUG` when debugging core scripts.

  • Quick Tip: Disable WordPress Block Editor Fullscreen Mode

    Quick Tip: Disable WordPress Block Editor Fullscreen Mode

    Editing posts in WordPress can be frustrating when the block editor keeps defaulting to fullscreen mode. Utilize this PHP code snippet to disable the fullscreen mode by default for a smoother editing experience. Credits to Jean-Baptiste Audras for sharing this helpful solution.

  • Getting WordPress Database Size via WP-CLI

    Getting WordPress Database Size via WP-CLI

    A WordPress WP-CLI command `db-size` allows fetching database tables, their data, and index size in various formats. The command offers sorting options like total, table, data size, and index size. Use `–format` to adjust the output format (`table`, `csv`, `json`, `count`, `yaml`), and `–raw` for full byte size.

  • Quick Tip: Export WordPress SQL output via WP-CLI

    Quick Tip: Export WordPress SQL output via WP-CLI

    Learn how to run custom SQL queries on your WordPress database using a small WP-CLI command. The command supports different output formats like table, CSV, JSON, and more. Plus, it includes a dry run option for safety. No need to rely on `wp db query` anymore!

  • Half-Baked Plugins: Embeds for Twitch and Gutenberg

    Half-Baked Plugins: Embeds for Twitch and Gutenberg

    Learn about Embeds for Twitch and Gutenberg, a WordPress plugin for embedding Twitch channels, videos, and clips as Gutenberg blocks. No plans for release, just for learning. Note: Clip functionality may be faulty. Explore Half-Baked Plugins for more experimental projects.

  • Deleting Old Post Revisions in WordPress with WP-CLI

    Deleting Old Post Revisions in WordPress with WP-CLI

    Working with a client’s large database, I crafted a custom WP-CLI command to purge post revisions based on specific criteria, saving backups of those deleted. This script efficiently prunes revisions older than a year and prior to post publication, reducing the overall database size prior to a site migration.

  • Wisps, a WordPress Plugin

    Wisps, a WordPress Plugin

    With Wisps, you can have code snippets similar to Gist, Pastebin, or similar code sharing sites. Using the built-in WordPress code editor, you can write snippets to post and share.

  • Debugging WordPress Hooks: Speed

    Debugging WordPress Hooks: Speed

    Learn how to measure the execution time of WordPress hooks with precision by capturing individual callback durations. Find out how to set up a timeline for targeted hooks and track start and stop times for each. Be cautious of potential overhead and conflicts with plugins using hook priorities. Utilize the provided PHP code to implement…