PHP7 Support for WPMU Dev Dashboard

Just ran a PHP7 compatibility check and there were some issues with the WPMU DEV Dashboard plugin. My host is moving to PHP7 soon and I would love it if all of my plugins were future-proof! Thanks guys :slight_smile:

Using: https://wordpress.org/plugins/php-compatibility-checker/

FILE: .../wp-content/plugins/wpmudev-updates/template/support-system.php
----------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 4 WARNINGS AFFECTING 5 LINES
----------------------------------------------------------------------------------------------------------------------------------------------------
77 | ERROR | Extension 'mysql_' is deprecated since PHP 5.5 and removed since PHP 7.0 - use mysqli instead.
313 | WARNING | Function name "__render_list" is discouraged; PHP has reserved all method names with a double underscore prefix for future use
334 | WARNING | Function name "__error_reporting" is discouraged; PHP has reserved all method names with a double underscore prefix for future use
376 | WARNING | Function name "__value_format" is discouraged; PHP has reserved all method names with a double underscore prefix for future use
390 | WARNING | Function name "__const_format" is discouraged; PHP has reserved all method names with a double underscore prefix for future use
----------------------------------------------------------------------------------------------------------------------------------------------------

  • Vaughan

    Hi Will,

    Hope you're well?

    I expect it will be updated soon, I have passed this along to the developer though, so hopefully we can get this done quickly.

    The main issues we face is that not everybody is using PHP 7, and we have to still support those people who are still using PHP 5.2 (I know it's old & end of life, but unfortunately we have to support the minimum version of PHP that wordpress officially supports (which currently is 5.2.4)

    So in some cases, fixing issues for PHP 7, might break those versions which means extra work and wasted energy for developers because they have to write functions that are compatible with both versions, some are simple fixes though and don't take much, but there are some that cause problems and hair pulling to make backward compatibility.

    I have just been informed whilst writing this, that these issues are actually addressed and fixed in the current version 4.1.2 release, and that using those checkers isn't always reliable because as I mentioned above, sometimes we have to also add backward compatibility, so those functions will not be called on PHP 7, but will still be used by older versions.

    Hope this helps

  • Darius Suryadi

    I get the following:

    FILE: .../wp-content/plugins/wpmudev-updates/template/part-system-info.php
    ----------------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AND 4 WARNINGS AFFECTING 5 LINES
    ----------------------------------------------------------------------------------------------------------------------------------------------------
      77 | ERROR   | Extension 'mysql_' is deprecated since PHP 5.5 and removed since PHP 7.0; Use mysqli instead
     304 | WARNING | Function name "__render_list" is discouraged; PHP has reserved all method names with a double underscore prefix for future use
     325 | WARNING | Function name "__error_reporting" is discouraged; PHP has reserved all method names with a double underscore prefix for future use
     367 | WARNING | Function name "__value_format" is discouraged; PHP has reserved all method names with a double underscore prefix for future use
     381 | WARNING | Function name "__const_format" is discouraged; PHP has reserved all method names with a double underscore prefix for future use
    ----------------------------------------------------------------------------------------------------------------------------------------------------
    
    FILE: .../wp-content/plugins/wpmudev-updates/includes/class-wpmudev-dashboard-api.php
    ------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    ------------------------------------------------------------------------------------------------------------
     1623 | WARNING | Function create_function() is deprecated since PHP 7.2; Use an anonymous function instead
    ------------------------------------------------------------------------------------------------------------
    
    FILE: .../wp-content/plugins/wpmudev-updates/lib/PHPSecLib/Crypt/Random.php
    -------------------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 5 ERRORS AFFECTING 2 LINES
    -------------------------------------------------------------------------------------------------------------------------------------------------------
      75 | ERROR | Extension 'mcrypt' is deprecated since PHP 7.1 and removed since PHP 7.2; Use openssl (preferred) or pecl/mcrypt once available instead
      75 | ERROR | Function mcrypt_create_iv() is deprecated since PHP 7.1 and removed since PHP 7.2; Use random_bytes() or OpenSSL instead
     114 | ERROR | Extension 'mcrypt' is deprecated since PHP 7.1 and removed since PHP 7.2; Use openssl (preferred) or pecl/mcrypt once available instead
     114 | ERROR | Function mcrypt_create_iv() is deprecated since PHP 7.1 and removed since PHP 7.2; Use random_bytes() or OpenSSL instead
     114 | ERROR | The constant "MCRYPT_DEV_URANDOM" is deprecated since PHP 7.1 and removed since PHP 7.2
    -------------------------------------------------------------------------------------------------------------------------------------------------------

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.