• Resolved b2bcherry

    (@b2bcherry)


    Hi,

    I am working on the migration of my website to php 7. In order to analyse my site, I ran a test on all plugins and themes installed using “PHP Compatibility Checker” plugin.
    The test revealed a few of issues with WP Super Cache that I wanted to share with you. This is the report on your plugin :

    FILE: /…/wp-content/plugins/wp-super-cache/rest/class.wp-super-cache-rest-update-settings.php
    ———————————————————————————————————————–
    FOUND 1 ERROR AFFECTING 1 LINE
    ———————————————————————————————————————–
    652 | ERROR | Global with variable variables is not allowed since PHP 7.0
    ———————————————————————————————————————–

    FILE: /…/wp-content/plugins/wp-super-cache/wp-cache.php
    ——————————————————————————————————
    FOUND 2 ERRORS AND 3 WARNINGS AFFECTING 4 LINES
    ——————————————————————————————————
    235 | WARNING | INI directive ‘safe_mode’ is deprecated since PHP 5.3 and removed since PHP 5.4
    235 | WARNING | INI directive ‘safe_mode’ is deprecated since PHP 5.3 and removed since PHP 5.4
    240 | WARNING | INI directive ‘safe_mode_gid’ is deprecated since PHP 5.3 and removed since PHP 5.4
    4008 | ERROR | Global with variable variables is not allowed since PHP 7.0
    4025 | ERROR | Global with variable variables is not allowed since PHP 7.0
    ——————————————————————————————————

    Do you think your can update the code in the next version ?

    Thank you,

    Valéry

Viewing 2 replies - 1 through 2 (of 2 total)
  • Sa?a

    (@stodorovic)

    Hi @b2bcherry,

    There are many similar posts where you can find more info. These “ERRORS” aren’t fatal errors, so WPSC works on PHP 7.0. Anyway PR #429 fixes them and it’s part of Pre-1.5.8 Development Version. Version 1.5.8 will be released in next days.

    Related to WARNINGS – INI directive ‘safe_mode’ is deprecated since PHP 5.3 and removed since PHP 5.4, we need to keep this code for backward compatibility with PHP 5.2. You can see these lines (wp-cache.php):

    if ( version_compare( PHP_VERSION, '5.3.0', '<' ) && ( 1 == ini_get( 'safe_mode' ) || "on" == strtolower( ini_get( 'safe_mode' ) ) ) ) {
        echo '<div class="notice notice-error"><h3>' . __( 'Warning! PHP Safe Mode Enabled!', 'wp-super-cache' ) . '</h3><p>' .
            __( 'You may experience problems running this plugin because SAFE MODE is enabled.', 'wp-super-cache' ) . '<br />';
    
        if( !ini_get( 'safe_mode_gid' ) ) {
    

    This code works only when PHP_VERSION is 5.2.x. PHP compatibility checker is static checker and current version doesn’t check usage of PHP_VERSION in conditions. Related issue – https://github.com/wpengine/phpcompat/issues/161.

    I hope that helps.

    Regards,
    Sasa

    Thread Starter b2bcherry

    (@b2bcherry)

    Thank you for this explanation Sasa

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