• Resolved Ervin Domonkos

    (@arachnoidea)


    Hi Creators,

    I’ve recently switched to PHP 8.1 (as 8.0’s official support ends this month).

    After the switch I found that there are several PHP warnings printed to my debug.log – they most often come out when I refresh the WP-Admin ? Plugins screen.

    One type of warning is:

    PHP Warning: Undefined property: stdClass::$renewalUrl in wp-content/plugins/wordpress-seo/inc/class-addon-manager.php on line 827

    There are several similar warnings, too – for other properties of this stdClass.

    Another type of warning is this one:

    PHP Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in wp-content/plugins/wordpress-seo/inc/class-addon-manager.php on line 552
    PHP Deprecated: version_compare(): Passing null to parameter #2 ($version2) of type string is deprecated in wp-content/plugins/wordpress-seo/inc/class-addon-manager.php on line 346

    So it looks like the Addon Manager class is generating most of them.

    While I know these are not real errors, it would be a good idea to eliminate these warnings. E.g. now if I want to debug anything else, I have to browse through hundreds of warnings generated by Yoast SEO to find the other warning.

    Thanks,
    Ervin

    • This topic was modified 1 year ago by Ervin Domonkos. Reason: edited path for privacy reasons
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support devnihil

    (@devnihil)

    @arachnoidea Thanks for reaching out!
    ?
    PHP warnings and notices are nothing to worry about (Some of these can even be generated because the developer has to keep compatibility with older versions of WordPress as well as older PHP versions). You’re probably seeing that because of default WordPress behavior, but the good news is that it shouldn’t impact the functionality of your site. So you can simply disable it.
    ?
    Please follow the instructions below.
    ?
    1) Log into the Host Control Panel (Cpanel). Go to File Manager (or you can connect to FTP).
    2) Get to the root directory of the website, open wp-config.php file.
    3) In this file, you should search for:
    ?
    define(‘WP_DEBUG’, false);
    ?
    4) And insert this piece of code below:
    ?
    ini_set(‘display_errors’,’Off’);
    ini_set(‘error_reporting’, E_ALL );
    define(‘WP_DEBUG’, false);
    define(‘WP_DEBUG_DISPLAY’, false);

    ?
    5) Save the file.

    Thread Starter Ervin Domonkos

    (@arachnoidea)

    Thanks for the instructions, @devnihil.

    Actually I don’t want to turn logs off as I am actively developing sites/plugins where I need to see the logs during the process.

    I am usually aiming for zero warnings in them, but I know it’s not always possible…

    I know most of them are not harmful at all, but it would be nice if the amount of them could be reduced, so that it would be easier to debug other components.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Lots of warnings under PHP 8.1’ is closed to new replies.