Title: WP-CLI: Fatal error: Uncaught TypeError
Last modified: July 25, 2025

---

# WP-CLI: Fatal error: Uncaught TypeError

 *  Resolved [omegarobot](https://wordpress.org/support/users/omegarobot/)
 * (@omegarobot)
 * [10 months, 2 weeks ago](https://wordpress.org/support/topic/wp-cli-fatal-error-uncaught-typeerror/)
 * Hi,
 * I update sites using WP-CLI `wp plugin update --all` and they’re failing with
   the following error message:
 *     ```wp-block-code
       PHP Fatal error:  Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in /var/www/htdocs/wp-content/plugins/stopbadbots/functions/functions.php:3990
       Stack trace:
       #0 /var/www/htdocs/wp-content/plugins/stopbadbots/stopbadbots.php(1131): stopbadbots_block_httptools()
       ```
   
 * Tested on version 11.45 and 11.54.
 * Thanks

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

 *  Plugin Author [sminozzi](https://wordpress.org/support/users/sminozzi/)
 * (@sminozzi)
 * [10 months, 2 weeks ago](https://wordpress.org/support/topic/wp-cli-fatal-error-uncaught-typeerror/#post-18571204)
 * Hello,
 * You are welcome.
   Line 3990 of the file functions.php is:
 * **$table_name = $wpdb->prefix . ‘sbb_badips’; **
 * and does not include the word **count().**
 * Please double-check the plugins dashboard to confirm if your version is 11.54.
 * If so, you need to reinstall the plugin because the files are damaged.
 * I should add that the plugin update process is entirely handled by WordPress,
   and we don’t play any role in that activity.
   Regards,
 * Bill
 *  Thread Starter [omegarobot](https://wordpress.org/support/users/omegarobot/)
 * (@omegarobot)
 * [10 months, 2 weeks ago](https://wordpress.org/support/topic/wp-cli-fatal-error-uncaught-typeerror/#post-18571322)
 * Hi Bill,
 * Sorry for the confusion. I’m not entirely sure, but the Line 3990 error might
   be from version 11.45.
   I updated the plugin to version 11.54 in WP Dashboard,
   then run the `wp plugin update --all` command again in Terminal — the error caught
   is now in Line 4253:
 *     ```wp-block-code
       PHP Fatal error:  Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in /var/www/htdocs/wp-content/plugins/stopbadbots/functions/functions.php:4253
       Stack trace:
       #0 /var/www/htdocs/wp-content/plugins/stopbadbots/stopbadbots.php(1134): stopbadbots_block_httptools()
       ```
   
 * I checked the mentioned line in functions.php and found the following:
 *     ```wp-block-code
           if (count($astopbadbots_http_tools) < 1) {
               return '';
           }
       ```
   
 * From what I understand, **$astopbadbots_http_tools** might be **_null_** and **
   count()** doesn’t like it, like mentioned in this example: [https://www.php.net/manual/en/function.count.php#count.example.badexample](https://www.php.net/manual/en/function.count.php#count.example.badexample)
 * Hope that helps.
 *  Plugin Author [sminozzi](https://wordpress.org/support/users/sminozzi/)
 * (@sminozzi)
 * [10 months, 2 weeks ago](https://wordpress.org/support/topic/wp-cli-fatal-error-uncaught-typeerror/#post-18571371)
 * Thank you!
   I just uploaded the version 11.55Please, let me know if it works fine
   on your server.
 *  Thread Starter [omegarobot](https://wordpress.org/support/users/omegarobot/)
 * (@omegarobot)
 * [10 months, 2 weeks ago](https://wordpress.org/support/topic/wp-cli-fatal-error-uncaught-typeerror/#post-18571747)
 * That worked! Thanks, Bill.

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

The topic ‘WP-CLI: Fatal error: Uncaught TypeError’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/stopbadbots_f0f0f0.svg)
 * [Block Bad Bots and Stop Bad Bots Crawlers and Spiders and Anti Spam Protection](https://wordpress.org/plugins/stopbadbots/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/stopbadbots/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/stopbadbots/)
 * [Active Topics](https://wordpress.org/support/plugin/stopbadbots/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/stopbadbots/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/stopbadbots/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [omegarobot](https://wordpress.org/support/users/omegarobot/)
 * Last activity: [10 months, 2 weeks ago](https://wordpress.org/support/topic/wp-cli-fatal-error-uncaught-typeerror/#post-18571747)
 * Status: resolved