Pierre-Lannoy / wp-decalog

Capture and log events, metrics and traces on your site. Make WordPress observable - finally!
https://perfops.one/
GNU General Public License v3.0
64 stars 8 forks source link

[3.6.0] Call to undefined method WP_CLI::get_logger()“ at `./wp-content/plugins/decalog/includes/plugin/class-initializer.php:64`. #36

Closed JanThiel closed 1 year ago

JanThiel commented 1 year ago

Describe the bug

After updating our Test ENV to Decalog 3.6.0 we got tons of these in our logs:

Uncaught exception (Error): “Call to undefined method WP_CLI::get_logger()“ at ./wp-content/plugins/decalog/includes/plugin/class-initializer.php:64.

To Reproduce Steps to reproduce the behavior: Update to Decalog 3.6.0 and run code via WP-CLI

Environment (please complete the following information):

Pierre-Lannoy commented 1 year ago

Hi Jan! Sorry to hear that. I haven't seen this behavior in all my tests… Can you tell me what version of wp-cli you use?

JanThiel commented 1 year ago

WP-CLI 2.5.0

JanThiel commented 1 year ago

Nothing bad happened yet :-) That's what test envs are for.

Pierre-Lannoy commented 1 year ago

😅

Do you have the opportunity to update wp-cli? I must admit I made all my tests on the current version…

JanThiel commented 1 year ago

Sure, just updated it to WP-CLI 2.6.0. Seems to fix it.

But there might be outdated WP-CLI versions out there in the wild as well. It's not that WP-CLI is very pushy about letting you know there are updates available. Nor are there any real issues with running older versions. Until know ;-)

I will close this issue but think you should add a function_exists around this code path to prevent this on other systems.

Thanks for pointing me to the new WP-CLI update :-)

Pierre-Lannoy commented 1 year ago

Ahaha, I double agree:

you should add a function_exists around this code path to prevent this on other systems

Glad it's now ok for you. I will publish a new version (3.6.1) as soon as I collected and fixed all bugs of this new version. Thanks a lot ❤️