• Resolved Lea

    (@leac)


    I ran a PHPCS compatibility check for PHP 7.4 and got the following errors:

    `FILE: /data/phpcs/staff-list/admin/autil.php
    ————————————————————————————————————
    FOUND 1 ERROR AFFECTING 1 LINE
    ————————————————————————————————————
    401 | ERROR | Extension ‘mysql_’ is deprecated since PHP 5.5 and removed since PHP 7.0; Use mysqli instead
    ————————————————————————————————————

    FILE: /data/phpcs/staff-list/admin/dba.php
    ————————————————————————————————————
    FOUND 2 ERRORS AFFECTING 2 LINES
    ————————————————————————————————————
    78 | ERROR | Extension ‘mysql_’ is deprecated since PHP 5.5 and removed since PHP 7.0; Use mysqli instead
    280 | ERROR | Extension ‘mysql_’ is deprecated since PHP 5.5 and removed since PHP 7.0; Use mysqli instead`

    Should they be fixed?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author abcfolio

    (@abcfolio)

    Thanks for getting in touch. The plugin is fully compatible with PHP 7 and above.
    The reason that you are seeing these errors from the compatibility checker is that the plugin is also backwards compatible with previous PHP versions.

    1. The function mysql_… is located inside conditional if else statement and doing exactly what is supposed to – runs only if the PHP version is lower than 5.5. Otherwise it will use mysqli_…

    2. It’s probably not used anyways since it’s executed only if SQL VERSION() check fails.

    3. This an example of belt and suspenders coding practice when dealing with different version of WordPress and PHP.

    4. The compatibility checker needs to be improved or person that runs it should look at the actual code to avoid reporting false positives.

    Thread Starter Lea

    (@leac)

    Thank you very much for the detailed answer!

    Point taken.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘PHP comaptibility error’ is closed to new replies.