Skip to content
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

False Positive #297

Open
hheckner opened this issue Sep 29, 2021 · 8 comments
Open

False Positive #297

hheckner opened this issue Sep 29, 2021 · 8 comments

Comments

@hheckner
Copy link

hheckner commented Sep 29, 2021

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.

                                                           

@jrfnl
Copy link

jrfnl commented Sep 29, 2021

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

@hheckner
Copy link
Author

@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
Copy link

jrfnl commented Sep 29, 2021

@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
Copy link
Author

?

@jrfnl
Copy link

jrfnl commented Sep 29, 2021

@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

@hheckner
Copy link
Author

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!

@hheckner
Copy link
Author

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

@jrfnl
Copy link

jrfnl commented Sep 29, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants