wp-cli / profile-command

Quickly identify what's slow with WordPress
MIT License
271 stars 29 forks source link

Profile command returns homepage source code #153

Closed viktorix closed 4 years ago

viktorix commented 5 years ago

Any reason why "wp profile stages --all" would return source code of the homepage?

We got v2.1.0 with PHP 7.2.14.

Same thing happens with "doctor" command. Regular commands seem to work fine.

joseairosa commented 5 years ago

Got the same issue :(

BernardZijlstra commented 5 years ago

Reproduced this issue on Ubuntu 16.04, PHP FPM 7.0, WP-CLI 2.1.0, WordPress version 5.1.1, same command "wp profile stages" and variants result in HTML source download from the home page.

schlessera commented 5 years ago

Cannot immediately reproduce this on my local system. A first guess would be that there is a redirect being triggered. Are you able to check debug/trace whether such a redirect is happening?

joseairosa commented 5 years ago

I am using a plugin that enforces traffic to go through https. Could that be the redirect?

@BernardZijlstra do you have anything like this as well?

schlessera commented 5 years ago

@joseairosa Yes, that could be a likely culprit. Did you try to skip loading that plugin with --skip-plugins=<plugin> ?

joseairosa commented 5 years ago

@schlessera I will try tonight :)

viktorix commented 5 years ago

I haven't had the time to look into this more until now. It was a simple site with 3 plugins, setup over HTTPS without any plugins or redirects. After testing --skip-plugins, it turns out Thrive Visual Editor plugin is causing profile command to return homepage source code.

So if anyone else has that plugin, here's a command to test it: wp profile stage --all --skip-plugins=thrive-visual-editor --allow-root

BernardZijlstra commented 5 years ago

A quick update, I haven't found the why and where it breaks jet. We don't use redirect plugins at all. Yes we use redirects to https on proxy's and on Nginx webservers. I tested the profile package on a couple of these systems and with some it just works and some it doesn't. For me it now feels like code breaks the profile package and not redirections to https. For instance it also breaks on a test system which is http only. To be continued.

joseairosa commented 5 years ago

So in my case, looks like there was something with woocommerce-all-in-one-currency-converter. I'm still getting a full extract of the source code, however, I'm now getting the benchmark back.

treyrich commented 4 years ago

We have this same issue.

pcfreak30 commented 4 years ago

This appears to happen with https://codecanyon.net/item/testimonials-showcase-wordpress-plugin/6588139 too., though only partial HTML output. My assumption is some sort of crash?

nsgnc commented 4 years ago

We have same issue. How we can fix this?

oempire commented 4 years ago

im getting this issue for virtually all profile command calls. We dont have any redirection plugins installed

rockoo commented 4 years ago

Same here... outputs html of page only

viktorix commented 4 years ago

Since this is not an issue with the profile command but rather a plugin conflict and it can be any number of plugins, I'll close my issue.

For anyone trying to troubleshoot it, you need to figure out which plugin is causing this. You can simply run WP-CLI command to skip plugins based on the plugin's slug:

wp profile stage --all --skip-plugins=plugin-slug --allow-root

Once you're able to see correct output of the profile command, you know which plugin is causing the issue and should report it to the plugin's developer. In our case, we simply had an outdated plugin that had to be manually updated. Once updated, the profile command was working fine.