{"id":419527,"date":"2023-02-06T18:41:45","date_gmt":"2023-02-06T17:41:45","guid":{"rendered":"https:\/\/remkusdevries.com\/?p=419527"},"modified":"2024-12-18T08:59:55","modified_gmt":"2024-12-18T07:59:55","slug":"wordpress-performance-debug-tools","status":"publish","type":"post","link":"https:\/\/remkusdevries.com\/wordpress-performance-debug-tools\/","title":{"rendered":"WordPress Performance Debug Tools"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Today I discovered a bug in a&nbsp;WordPress&nbsp;plugin update that had a tremendous negative performance impact:<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-rich is-provider-twitter wp-block-embed-twitter\"><div class=\"wp-block-embed__wrapper\">\nhttps:\/\/twitter.com\/remkusdevries\/status\/1622545110176083968\n<\/div><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Luckily the solution was an easy one to fix, but I&#8217;ve gotten some question about how I found out where the issue was, so I thought I take you along on some performance debugging steps I always take.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-staging-amp-local-development\">Staging &amp; Local Development<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">First off, I work with both local development sites as well as staging sites.&nbsp;For my local development environments I use <a href=\"https:\/\/localwp.com\/\">LocalWP<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This means I work with two other version of the site besides the production site itself. This is how I discovered the issue before the update was deployed to the live site.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-performance-debug-tools\">Performance Debug Tools<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">I&#8217;m using the same tools for all three environments.:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Two WP CLI extensions&nbsp;<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/developer.wordpress.org\/cli\/commands\/profile\/\">WP Profile<\/a> and <a href=\"https:\/\/github.com\/wp-cli\/doctor-command\">WP Doctor<\/a>. Both have different ways to inspect whatever needs inspecting. Learn about them, play with them and add them to your deployment flow. They&#8217;re indispensible in my dev environment just as much as my text editing tool.\u00a0<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">WP Debug<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Using WP Debug goes without saying, right? If you&#8217;ve never seen it, do check out the <a href=\"https:\/\/developer.wordpress.org\/reference\/functions\/wp_debug_mode\/#description\">related developer docs<\/a>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Query Monitor<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The WordPress plugin <a href=\"https:\/\/querymonitor.com\/\">Query Monitor<\/a>, together with <a href=\"https:\/\/github.com\/Rarst\/laps\">Laps<\/a>, are the two plugins I install on every single non-production site. They help to debug where issues lie, and where the fix most likely is to be found.&nbsp;<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Slow Queries<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Turn on (or have your hoster do it for you) your <a href=\"https:\/\/dev.mysql.com\/doc\/refman\/5.7\/en\/slow-query-log.html\">MySQL Slow Query log<\/a> and see what&#8217;s causing your WordPress site to slow down. And where. This is one you may want to have turned on production for short times as well.&nbsp;<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Debug Plugins and Themes<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Disable plugins one by one to identify the source of any performance issues. There are ways to automate this with WP CLI. I&#8217;ll cover this in my <a href=\"https:\/\/remkusdevries.com\/courses\/\">WP CLI course<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">And lastly:<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Chrome DevTools<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Use the Network tab first, then look at Performance insights, Performance and Lighthouse. There is more to use, but this is my base performance debugging stack.&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today I discovered a bug in a&nbsp;WordPress&nbsp;plugin update that had a tremendous negative performance impact: Luckily the solution was an easy one to fix, but I&#8217;ve gotten some question about how I found out where the issue was, so I thought I take you along on some performance debugging steps I always take. Staging &amp; [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":"","_links_to":"","_links_to_target":"","_wordproof_timestamp":false},"categories":[1215],"tags":[],"class_list":["post-419527","post","type-post","status-publish","format-standard","hentry","category-wordpress-tools"],"acf":[],"_links":{"self":[{"href":"https:\/\/remkusdevries.com\/wp-json\/wp\/v2\/posts\/419527","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/remkusdevries.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/remkusdevries.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/remkusdevries.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/remkusdevries.com\/wp-json\/wp\/v2\/comments?post=419527"}],"version-history":[{"count":1,"href":"https:\/\/remkusdevries.com\/wp-json\/wp\/v2\/posts\/419527\/revisions"}],"predecessor-version":[{"id":421051,"href":"https:\/\/remkusdevries.com\/wp-json\/wp\/v2\/posts\/419527\/revisions\/421051"}],"wp:attachment":[{"href":"https:\/\/remkusdevries.com\/wp-json\/wp\/v2\/media?parent=419527"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/remkusdevries.com\/wp-json\/wp\/v2\/categories?post=419527"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/remkusdevries.com\/wp-json\/wp\/v2\/tags?post=419527"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}