wpengine / phpcompat

WordPress Plugin: PHP Compatibility Checker

Home Page:https://wordpress.org/plugins/php-compatibility-checker/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

False Positive

hheckner opened this issue · comments

WP-Matomo Integration Version 1.0.26
Wordpress 5.8.1
PHP 7.3
PHP Checker: 1.5.2

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

Feedback from Matomo Integation:

<style> </style>
  Lukas Winkler Lukas Matomo Team Member September 29

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.

github.com

braekling/WP-Matomo/blob/573d653aea3e99eee1a8516db20a9bfeca1da55f/classes/WP_Piwik.php#L380-L384

    
lang=EN style='background:#F9F9F9;mso-ansi-language:EN'><o:p> </o:p>
      <o:p></o:p>
<o:p> </o:p>
<o:p> </o:p>
          <o:p></o:p>
<![if !supportLists]>380. <![endif]>                                      foreach ($userRoles as $userRole)<o:p></o:p>
<![if !supportLists]>381. <![endif]><o:p> </o:p>
<![if !supportLists]>382. <![endif]><o:p> </o:p>
<o:p> </o:p>
<o:p> </o:p>
          <o:p></o:p>
<![if !supportLists]>383. <![endif]>                                              if (isset( $allowed[$userRole] ) && $allowed[$userRole]) {<o:p></o:p>
<![if !supportLists]>384. <![endif]><o:p> </o:p>
<![if !supportLists]>385. <![endif]><o:p> </o:p>
<o:p> </o:p>
<o:p> </o:p>
          <o:p></o:p>
<![if !supportLists]>386. <![endif]>                                                      $cap = 'read';<o:p></o:p>
<![if !supportLists]>387. <![endif]><o:p> </o:p>
<![if !supportLists]>388. <![endif]><o:p> </o:p>
<o:p> </o:p>
<o:p> </o:p>
          <o:p></o:p>
<![if !supportLists]>389. <![endif]>                                                      break;<o:p></o:p>
<![if !supportLists]>390. <![endif]><o:p> </o:p>
<![if !supportLists]>391. <![endif]><o:p> </o:p>
<o:p> </o:p>
<o:p> </o:p>
          <o:p></o:p>
<![if !supportLists]>392. <![endif]>                                              }<o:p></o:p>
<![if !supportLists]>393. <![endif]><o:p> </o:p>
<![if !supportLists]>394. <![endif]><o:p> </o:p>
<o:p> </o:p>
<o:p> </o:p>
      <o:p></o:p>
<o:p> </o:p>
<o:p> </o:p>
    <o:p></o:p>
<o:p> </o:p>
  <o:p></o:p>

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.


Rufe das Thema auf oder antworte auf diese E-Mail, um zu antworten.

Um diese E-Mails abzubestellen, klicke hier.

                                                           

The foreach is missing curly braces, which is the cause for the false positive.

@jrfnl can you please try to directly communicate with Matomo Development Team (here is the link to the ticket on their platform) https://forum.matomo.org/t/php-compatibility-checker-shows-critical-errors-for-wp-matomo-integration/43318/2
I'll forward your reply to them, though :-)

@jrfnl can you please try to directly communicate with Matomo Development Team (here is the link to the ticket on their platform) https://forum.matomo.org/t/php-compatibility-checker-shows-critical-errors-for-wp-matomo-integration/43318/2 I'll forward your reply to them, though :-)

You what ? No.

@hheckner Do I really have to explain the basic principles of open source to you ?

  • Nobody in open source owes you anything.
  • If anyone responds to whatever issue or pull request you open, it is from the kindness of their hearts, so be grateful and thank them.
  • Unless you pay people, don't ask them to do (your) work.

Also see: https://twitter.com/jrf_nl/status/1443183793293168646

I don't want to sound impolite. It was just the fact that I was forwarding the answers from both sides. But hey that's no problem I do this no problem (as I mentioned) above.
Thank you very much!

In case you need more details about the false positive issues you can get the status here: https://forum.matomo.org/t/php-compatibility-checker-shows-critical-errors-for-wp-matomo-integration/43318/3

I don't want to sound impolite. It was just the fact that I was forwarding the answers from both sides.

You did and that's not my problem. You asked a question and I gave an answer. Don't ask me to do your work for you or to move to another platform in which I have no interest whatsoever, nor ever will.