• Resolved nick6352683

    (@nick6352683)


    I love this plugin, but it generates a warning on the front end when used with php 7.2:

    Warning: count(): Parameter must be an array or an object that implements Countable in C:\xampp\htdocs\testing\wp-includes\post-template.php on line 284

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Guido

    (@guido07111975)

    Hi Nick,

    Although my plugin uses the PHP count() function, it’s only used in the backend.. couting number of characters. Are you certain it’s caused by my plugin? Currently I don’t have an active install running on PHP 7.2 ??

    Update: I just read about this warning in 7.2 > will try to fix it asap. Thanks for letting me know.

    Guido

    • This reply was modified 6 years, 6 months ago by Guido. Reason: updated response
    Plugin Author Guido

    (@guido07111975)

    Hi again,

    I’ve made a mistake: I’m not using count() in my plugin. So it must be something else?

    I do use strlen() to count the characters.. this is not the best way to do this, so I’m gonna update plugin.

    Guido

    Thread Starter nick6352683

    (@nick6352683)

    Hi Guido,

    The warning message is only there when your plugin is activated, so I have to conclude that the plugin is causing this…

    Plugin Author Guido

    (@guido07111975)

    Hi Nick,

    That’s very strange. Right no I’m not able to link this to my plugin.

    It’s caused by the PHP count() function which is located at line 284 of file wp-includes\post-template.php.

    So I have Googled the warning and found this thread (and more).

    Are you willing to check and try the fixed there?

    Meanwhile I’m gonna update the PHP version of my (test) server so I can check for myself.

    Guido

    Plugin Author Guido

    (@guido07111975)

    Right no I’m not able to link this to my plugin.

    Just updated PHP version as well and you’re right, somehow my plugin triggers this warning. But right now I have no clue.

    As mentioned before, my plugin does not use this count() function and the warning is not linked to my plugin directly, but to a core file.

    I will keep you informed.

    Guido

    Plugin Author Guido

    (@guido07111975)

    Hi Nick,

    Found it. I call the excerpt and this triggers a warning in case excerpt is empty.
    So I will update plugin asap with an extra check for this.
    More info here.

    Guido

    Thread Starter nick6352683

    (@nick6352683)

    Thanks a million Guido, I wish all developers were awesome like you !!!

    I will check out the update tonight and report if not fixed, but I’m sure this issue is now resolved by you…

    Nick.

    Plugin Author Guido

    (@guido07111975)

    Hi Nick,

    Thank you ??

    Because I’m (almost) certain it’s fixed now, I will mark this topic as resolved.

    Guido

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Not Compatible with Php 7.2’ is closed to new replies.