• Hi,

    With debug enabled I am seeing the below PHP Warning
    [04-Aug-2020 10:00:54 UTC] PHP Warning: count(): Parameter must be an array or an object that implements Countable in path\wp-content\plugins\image-sizes\templates\settings\disable-sizes.php on line 5

    Please fix.

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Same Here:

    [07-Aug-2020 20:52:47 UTC] PHP Warning: count(): Parameter must be an array or an object that implements Countable in /home2/delaio86/public_html/loja.delaitec.com/site/wp-content/plugins/image-sizes/templates/settings/disable-sizes.php on line 5

    Hello.

    I found a possible solution on the internet and adapted it to our case.
    The errors disappeared.

    The explanation of the solution is in the link below:
    https://www.gigasystems.com.br/artigo/106/error-php-7-2-count-parameter-must-be-an-array-or-an-object-that-implements-countable

    The solution I did follows here:
    If you are receiving the error:

    PHP Warning: count (): Parameter must be an array or an object that implements Countable in … / wp-content / plugins / image-sizes / templates / settings / disable-sizes.php on line 5

    Access the file:

    /wp-content/plugins/image-sizes/templates/settings/disable-sizes.php

    Replace this code:
    count( get_option( '_image-sizes' ) )

    Per:
    $pkCount = ( is_array(get_option('_image-sizes')) ? count(get_option('_image-sizes')) : 0 ), $pkCount

    I don’t know yet if this could cause a problem in the future, because I just created the solution.

    The developer will be able to tell us better. let’s wait.

    • This reply was modified 4 years, 3 months ago by delaitec.
    • This reply was modified 4 years, 3 months ago by delaitec.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘PHP Warning: count()’ is closed to new replies.