Support » Plugin: Polylang » PHP Warning

  • Resolved Spiffy Plugins

    (@spiffyplugins)


    Thank you for this plugin. I am evaluating for potential use on a new website. I have found the following PHP error warning is generated:

    Declaration of PLL_Walker_List::walk($elements, $args = Array) should be compatible with Walker::walk($elements, $max_depth, …$args) wp-content/plugins/polylang/include/walker-list.php:65

    I am using version 2.6.6.

Viewing 15 replies - 16 through 30 (of 47 total)
  • Plugin Author Chouby

    (@chouby)

    I will try to reformulate.

    Avoiding this warning means that we have to drop the support of PHP 5.6 (as using a spread operator in older version would cause a parse error). We will do that but we want to do it cleanly, i.e. in the next major version, not in a minor version.

    We can’t take the decision to drop old versions of PHP lightly. Less than 50% of users are using WordPress 5.2 or higher. Still 13% of users are running PHP < 5.6. The fact, that developers would prefer to use PHP 7 or even higher doesn’t matter.

    The WordPress team decided to change the signature of a method that we are overriding. This was rather unexpected. But they did not take this decision lightly. They were perfectly aware that it would cause an issue in some plugins including Polylang. However, it has been very well done, in a backward compatible way. That means that nothing has broken. There is just a warning issued. This warning is to the intention of the developers.

    If you are developer and are seeing warnings on a test site, then it’s ok. That what warnings are intended for. But if you are seeing warnings on a production site, then there is something wrong.

    WP: 5.3
    PHP: 7.0
    Polylang: 2.6.6

    When I’m editing a page or post, I see the following error. Please advise.

    Warning: Declaration of PLL_Walker_Dropdown::walk($elements, $args = Array) should be compatible with Walker::walk($elements, $max_depth, …$args) in /home/—/public_html/sbhd/wp-content/plugins/polylang/include/walker-dropdown.php on line 0

    Hello,
    I started seeing this warning on my production homepage (ofp.pt) after I upgraded to WordPress 5.3 and Polylang 2.6.6.
    Warning: Declaration of PLL_Walker_List::walk($elements, $args = Array) should be compatible with Walker::walk($elements, $max_depth, …$args) in /hermes/bosnaweb18a/b2975/ipg.fabulasticbluecom/ofppt/wp-content/plugins/polylang/include/walker-list.php on line 65
    Please advise.
    Thanks,
    José

    • This reply was modified 2 months, 1 week ago by ferreirajp.

    hi where to add this? so confuse
    php_admin_value[display_errors] = off

    Hi,
    I don’t get it: I’m using PHP Version 7.2.24. Why do I get this warning who’s normally only displayed for version under 5.6?

    In case this can help, I made the warning disappear by adding this to my wp-config.php file (just turning the DEBUG to false didn’t work):

    ini_set('display_errors','Off');
    ini_set('error_reporting', E_ALL );
    define('WP_DEBUG', false);
    define('WP_DEBUG_DISPLAY', false);

    – I had to add @ini_set( ‘display_errors’, 0 ); to get rid of the error message.

    Where did you add that?

    @pierredv Hi Pierre, in which line you can add this ?

    @pierredv its ok i did it 🙂 thank you

    Just checked. Our server is running this version of PHP.
    Running PHP version: 7.0.2-pl0-gentoo
    I am seeing the error on our production site.
    Downgraded to Polylang version 2.6.5.
    Still seeing the error.
    Any ideas?

    @wdfee I totally agree that this cant be the solution for a warning.
    When you will fix the warning?
    I pay on many sites for this Plugin…

    @andra0412 To make a more complete answer:

    Simply replace the line of your wp-config.pho that says:

    define('WP_DEBUG', true);

    By this:

    ini_set('display_errors','Off');
    ini_set('error_reporting', E_ALL );
    define('WP_DEBUG', false);
    define('WP_DEBUG_DISPLAY', false);

    This did not work for me. It made it worse.
    Here is what I have on the config file.
    // Enable WP_DEBUG mode
    ini_set(‘display_errors’,’Off’);
    ini_set(‘error_reporting’, E_ALL );
    define(‘WP_DEBUG’, false);
    define(‘WP_DEBUG_DISPLAY’, false);

    There are errors showing all over my site.

    My site is seriously affected by this issue. I need a solution quickly.
    http://www.comibam.org
    Anyone from Polylang?

    @deciosdecarvalho

    I would think you should be using:

    ini_set(‘error_reporting’, 0 );

Viewing 15 replies - 16 through 30 (of 47 total)
  • You must be logged in to reply to this topic.