• Resolved model13

    (@model13)


    Hi, we’re preparing to update to PHP 7, and I’m running preliminary checks of our code using the PHP Compatibility Checker plugin. wpDirAuth is throwing one warning when tested with PHP 7.2. The details are below:

    FILE: [path redacted]/wp-content/plugins/wpdirauth/wpDirAuth.php
    ———————————————————————–
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    ———————————————————————–
    2190 | WARNING | Function create_function() is deprecated since PHP 7.2; Use an anonymous function instead
    ———————————————————————–

    • This topic was modified 6 years, 7 months ago by model13.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Paul Gilzow

    (@gilzow)

    I use it on PHP7 currently. What’s being flagged is the bit I added for compatibility with older PHP versions (since WordPress refuses to update their min requirements for PHP).

             * Added this back in to support older versions of PHP (*cough*5.2.X*cough*)
             * @todo remove completely once we hit v2.X.X
             */
            if(version_compare( PHP_VERSION, '5.3', '<' )){
                add_action('lostpassword_form',create_function('','echo get_site_option("dirAuthChangePassMsg");'));
            } else {
                add_action('lostpassword_form',function ()
                {
                    echo get_site_option('dirAuthChangePassMsg');
                });
            }

    There shouldn’t be any issues with running on PHP7.2.

    Thread Starter model13

    (@model13)

    Thank you! I appreciate the info. I’ve encountered this with a couple of other plugins as well. As much as I’d like to dissect them all myself, we’re running too many installations (including several multisites) to cover all the bases at short notice.

    Plugin Author Paul Gilzow

    (@gilzow)

    no worries. I’d really like to drop support for old versions as it is becoming increasingly difficult to support both 5.2 AND 7.2. ??

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