← All recipes

Debug Slow Plugins

Attempts to locate a plugin causing a significant slow down.

function debug_slow_plugin {
  printf "All Plugins: "
  echo $(wp plugin list --debug 2>&1) | perl -n -e '/Debug \(bootstrap\): Running command: .+\((.+)\)/&& print $1';
  active_plugins=$(wp plugin list --field=name --status=active)
  for plugin in $active_plugins; do
    echo ""
    printf "Skipping plugin $plugin: "
    echo $(wp plugin list --debug --skip-plugins=$plugin 2>&1) | perl -n -e '/Debug \(bootstrap\): Running command: .+\((.+)\)/&& print $1'
  done
  echo ""
}
debug_slow_plugin
Run it across a fleet

Open the console in CaptainCore Manager, pick the target sites, choose this recipe from the Cookbook picker and press run. The CLI streams each site's output back to the dock.

About the console →