• Resolved plumski

    (@plumski)


    Hi

    I’m running Version 3.7.7 on WP 4.6.1

    The WP Engine compatibility checker is throwing up this error:

    ———-

    FILE: /nas/content/live/blogdecortiles/wp-content/plugins/social-networks-auto-poster-facebook-twitter-g/inc/nxs_snap_class.php
    ——————————————————————————————————————————-
    FOUND 1 ERROR AFFECTING 1 LINE
    ——————————————————————————————————————————-
    238 | ERROR | Using ‘break’ outside of a loop or switch structure is invalid and will throw a fatal error since PHP 7.0
    ——————————————————————————————————————————-

    ———-

    All advice appreciated.

    Chris

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author NextScripts

    (@nextscripts)

    SNAP is 100% PHP 7 compatible.

    That checker is not so good. It can’t properly analyze the code and generates a lot of false positives.

    Line 238:

    foreach ($nxs_snapAvNts as $avNt) 
      if (count($options[$avNt['lcode']])>0) 
        {
          $isNoNts = false; 
          break;
        } 

    So as you can see “break” is properly used INSIDE the “foreach” loop. Your tool just misdiagnosed it because of the “if” statement that it can’t understand.

    • This reply was modified 8 years, 3 months ago by NextScripts.
    Thread Starter plumski

    (@plumski)

    Thank you, I appreciate the feedback and confirmation that all is well.

    Thanks for posting this. I came searching for the same information. This might be worth pinning or announcing in case others use that same plugin to check for PHP7 compatibility?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘PHP7 Compatibility’ is closed to new replies.