Title: Plugin is triggering PHP warnings
Last modified: July 30, 2019

---

# Plugin is triggering PHP warnings

 *  Resolved [zhigad](https://wordpress.org/support/users/zhigad/)
 * (@zhigad)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/plugin-is-triggering-php-warnings/)
 * My PHP error logs gets filled with errors, when I am using latest version of 
   plugin (2.3.15). This site is running WP 4.9.9 on PHP7.2.
 * Sample of an error:
    `count(): Parameter must be an array or an object that implements
   Countable`
 * Location, where warning is being triggered:
    `svg-support/functions/thumbnail-
   display.php:18`
 * The problem lies in following code:
    `$ob_levels = count( ob_get_level() );` `
   ob_get_level()` already returns number, so there is not point in counting it.
 * This probably isn’t triggered in PHP versions bellow 7.2.
    -  This topic was modified 6 years, 9 months ago by [zhigad](https://wordpress.org/support/users/zhigad/).

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Plugin Author [Benbodhi](https://wordpress.org/support/users/benbodhi/)
 * (@benbodhi)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/plugin-is-triggering-php-warnings/#post-11784125)
 * Interesting. Any reason why you’re using an older version of WordPress?
    I’ll
   have to look into this in PHP 7.2, I haven’t noticed it myself yet and have testing
   environments using 7.2.
 *  Thread Starter [zhigad](https://wordpress.org/support/users/zhigad/)
 * (@zhigad)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/plugin-is-triggering-php-warnings/#post-11784393)
 * Yes, there is a reason, not a good one, but reason nevertheless. WP is using 
   a lot of older plugins and currently the team can’t afford any potential downtime…
   It’s even worse than it sounds 😉
 * It’s not really and error, but a warning. You can read more about it here:
    [https://www.php.net/manual/en/migration72.incompatible.php#migration72.incompatible.warn-on-non-countable-types](https://www.php.net/manual/en/migration72.incompatible.php#migration72.incompatible.warn-on-non-countable-types)
 *  Plugin Author [Benbodhi](https://wordpress.org/support/users/benbodhi/)
 * (@benbodhi)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/plugin-is-triggering-php-warnings/#post-11784433)
 * I know where you’re coming from.
 * Thanks for pointing this out. I’m still not sure why I haven’t noticed it since
   I have all the logs printing warnings. But I will look at the code and see about
   changing it to avoid these warnings 🙂
 *  Plugin Author [Benbodhi](https://wordpress.org/support/users/benbodhi/)
 * (@benbodhi)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/plugin-is-triggering-php-warnings/#post-11784520)
 * After looking at my plugin, I don’t see that code. Unless the way I have used
   ob_start is triggering it somehow… but that’s not quite on the same line (18).
 * It must be that though. I’m not very experienced with output buffering, so it’s
   a strong possibility that the way I have used it needs some tweaking now. That’s
   some of the oldest code in my plugin from memory.
 *  Thread Starter [zhigad](https://wordpress.org/support/users/zhigad/)
 * (@zhigad)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/plugin-is-triggering-php-warnings/#post-11784557)
 * Sorry, there was a mix-up. I had Sentry reports coming in from 2 different hosts.
   The error was triggered by 2.3 version. Version 2.3.15 uses different `thumbnail-
   display.php` file.
 *  Plugin Author [Benbodhi](https://wordpress.org/support/users/benbodhi/)
 * (@benbodhi)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/plugin-is-triggering-php-warnings/#post-11784578)
 * Oh nice, I must have dealt with that back then. I was sure it worked fine with
   PHP 7.2 🙂

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Plugin is triggering PHP warnings’ is closed to new replies.

 * ![](https://ps.w.org/svg-support/assets/icon.svg?rev=1417738)
 * [SVG Support](https://wordpress.org/plugins/svg-support/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/svg-support/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/svg-support/)
 * [Active Topics](https://wordpress.org/support/plugin/svg-support/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/svg-support/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/svg-support/reviews/)

## Tags

 * [PHP7](https://wordpress.org/support/topic-tag/php7/)

 * 6 replies
 * 2 participants
 * Last reply from: [Benbodhi](https://wordpress.org/support/users/benbodhi/)
 * Last activity: [6 years, 9 months ago](https://wordpress.org/support/topic/plugin-is-triggering-php-warnings/#post-11784578)
 * Status: resolved