New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"This feature is not available" in WordPress plugin when checking isPageSpeedEnabled() #20134
Comments
@mattmary It might be enough to not perform the check if the Installation plugin is not enabled. Feel free to test that and provide a PR for that. |
Hello @sgiehl Sorry, my sentence was not really accurate: by disabled, I meant that all these requests will fail (but the plugin is not disabled): some of the natives actions lead to an exception: So I was wondering if we could use a constant to bypass this test? For example, testing if MATOMO_DISABLE_PAGE_TESTSPEED and define it in the WordPress plugin? Otherwise, we could also disable this plugin when creating the WordPress plugin release and test like you said if the plugin is enabled? Maybe this second solution is more elegant and would also manage the case that this plugin would have been disabled in Matomo on premise. Please share your thoughts Matthieu |
@mattmary You can easily disable certain diagnostic checks using DI by adding something like below to a return [
'diagnostics.disabled' => \DI\add([
\DI\get(\Piwik\Plugins\Diagnostics\Diagnostic\PageSpeedCheck::class),
]),
]; |
Thank you, @sgiehl ! |
Yes, you can disable it there as well. Either same way as @sgiehl mentioned or similarly to the existing logic. |
In the WordPress plugin, some of our users have in their log files something like:
Expected Behavior
Do not have any error.
Current Behavior
Error in the webserver log file.
Possible Solution
This call is made here:
matomo/plugins/Diagnostics/Diagnostic/PageSpeedCheck.php
Lines 54 to 87 in 7020188
Unfortunately, the Installation plugin is disabled in the WordPress plugin: all Installation plugin requests throw an exception: https://github.com/matomo-org/matomo-for-wordpress/blob/03db1ea2f16073c0d6a2c09b17a3953985a39b57/plugins/WordPress/WordPress.php#L337-L341
So this isPageSpeedEnabled will always fail in an error.
Can you add in the check a constant verification to check if we can process this check? We could then disable it in the plugin and avoid this error.
Steps to Reproduce (for Bugs)
Context
Your Environment
The text was updated successfully, but these errors were encountered: