PHP Compatibility Checker shows critical errors for WP Matomo Integration

I use WP Matomo Integration 1.0.26 and PHP Compatibility Checker 1.5.2
The site runs on PHP 7.3. Wordpress 5.8.1
After scanning the site I get the following critical errors:
Before you say please first upgrade to PHP 7.4. I read this tutorial: https://wordpress.org/support/update-php/ which indicates that before upgrading PHP one should fix all compatibility issues found by PHP Compatibility Checker :slight_smile:

FILE: /var/www/wordpress/wp-content/plugins/wp-piwik/classes/WP_Piwik.php

FOUND 1 ERROR AFFECTING 1 LINE

383 | ERROR | Using ‘break’ outside of a loop or switch structure is invalid and will throw a fatal error since PHP 7.0

FILE: /var/www/wordpress/wp-content/plugins/wp-piwik/proxy/proxy.php

FOUND 1 ERROR AFFECTING 1 LINE

106 | ERROR | INI directive ‘magic_quotes_runtime’ is deprecated since PHP 5.3 and removed since PHP 5.4

Hi,

Could it be that the tool is giving a false alert, as unless I am missing something obvious here, the break is inside a loop.

But guessing by the fact that a lot of people (including me) are running the plugin on PHP 7 without issues for a long time now, I guess it isn’t an important issue that should stop you from upgrading.

PHP Compatibility Check (Juliet) answered: The foreach is missing curly braces, which is the cause for the false positive. In case you want to get more details about the false positive in PHP Compatibility Checker https://github.com/wpengine/phpcompat/issues/297

1 Like