Skip to content

Instantly share code, notes, and snippets.

@vpnwall-services
Last active December 25, 2020 17:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vpnwall-services/d7b240084a5717ea3fc0a3bcbcc66423 to your computer and use it in GitHub Desktop.
Save vpnwall-services/d7b240084a5717ea3fc0a3bcbcc66423 to your computer and use it in GitHub Desktop.
[Find Wordpress Performances Issues] FInd Wordpress performances issues #bash #wpcli #wp-cli #performances #issues

WP PERF 101

Install module wp package install wp-cli/profile-command

Run module wp profile stage

Run module on specific part wp profile stage bootstrap

Run module and show hooks for each stage wp profile stage --all --orderby=time

Run module and show hooks for each stage and filter out zero-like values wp profile stage --all --spotlight --orderby=time

Dig into the wp hook wp profile hook wp

Dig into all hooks with spotlighs wp profile hook --all --spotlight

Simulate loading of specific URL wp profile hook --all --spotlight --url=https://mywordpress.local --orderby=time

If problematic callbacks, extract them grep -ril generate_add_navigation_after_header wp-content/themes

If multiple results grep -ril gettext wp-content/plugins/ | awk -F / '{ print $3}' | sort -u

Output filename, line number and before/after characters grep -rHin generate_add_navigation_after_header wp-content/themes

Deactivate plugin wp plugin deactivate plugin-name

Simulate plugin deactivation wp profile hook --all --spotlight --skip-plugins=plugin-name

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment