New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

count(): Parameter must be an array or an object that implements Countable #210

Open
ahmed-sigmalux opened this Issue Jan 16, 2018 · 12 comments

Comments

@ahmed-sigmalux

ahmed-sigmalux commented Jan 16, 2018

After upgrading to PHP 7.2, I'm seeing this repeatedly in my debug.log:

PHP Warning: count(): Parameter must be an array or an object that implements Countable in /var/www/wordpress/plugins/cloudflare/src/WordPress/Hooks.php on line 133

@ahmed-sigmalux

This comment has been minimized.

ahmed-sigmalux commented Feb 9, 2018

Has anyone at Cloudflare seen this bug?

@piscis

This comment has been minimized.

piscis commented Mar 6, 2018

This is what we get since the upgrade from php 7.0 to 7.2:

PHP Warning: count(): Parameter must be an array or an object that 
implements Countable in .... 
/plugins/cloudflare/src/WordPress/Hooks.php on line 133
@michalhalas

This comment has been minimized.

michalhalas commented Mar 6, 2018

Can confirm I've been receiving same error with newest available version of plugin 3.3.2 and php version 7.0.25
Warning: count(): Parameter must be an array or an object that implements Countable in /var/www/html/wp-content/plugins/cloudflare/src/WordPress/Hooks.php on line 133

@DerMauch

This comment has been minimized.

DerMauch commented Apr 26, 2018

Can confirm this issue for PHP 7.2. Occurs when trying to publish or preview a new post in a site on a network. PHP 7.1 works fine.

Warning: count(): Parameter must be an array or an object that implements Countable in /#####/wp-content/plugins/cloudflare/src/WordPress/Hooks.php on line 133

Warning: Cannot modify header information - headers already sent by (output started at /#####/wp-content/plugins/cloudflare/src/WordPress/Hooks.php:133) in /#####/wp-includes/pluggable.php on line 1216

@janvitos

This comment has been minimized.

janvitos commented May 11, 2018

Same thing here. I noticed the issue in the NGINX error log after upgrading to PHP 7.2.

It happens on post publish:

[error] 1140#1140: *369161 FastCGI sent in stderr: "PHP message: PHP Warning: count(): Parameter must be an array or an object that implements Countable in /wordpress/wp-content/plugins/cloudflare/src/WordPress/Hooks.php on line 133" while reading response header from upstream, client: xxx.xxx.xxx.xxx, server: www.com, request: "POST /wordpress/wp-admin/admin-ajax.php HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm/php-fpm.sock:", host: "www.com", referrer: "https://www.com/wordpress/wp-admin/post-new.php"

And it also happens on post edit:

[error] 1140#1140: *369445 FastCGI sent in stderr: "PHP message: PHP Warning: count(): Parameter must be an array or an object that implements Countable in /wordpress/wp-content/plugins/cloudflare/src/WordPress/Hooks.php on line 133" while reading response header from upstream, client: xxx.xxx.xxx.xxx, server: www.com, request: "POST /wordpress/wp-admin/post.php HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm/php-fpm.sock:", host: "www.com", referrer: "https://www.com/wordpress/wp-admin/post.php?post=103538&action=edit"

@ron2122

This comment has been minimized.

ron2122 commented Jun 13, 2018

same error here

Warning: count(): Parameter must be an array or an object that implements Countable in /home/blocktoken/public_html/wp-content/plugins/cloudflare/src/WordPress/Hooks.php on line 133

Warning: Cannot modify header information - headers already sent by (output started at /home/blocktoken/public_html/wp-content/plugins/cloudflare/src/WordPress/Hooks.php:133) in /home/blocktoken/public_html/wp-includes/pluggable.php on line 1216

@conorbarclay

This comment has been minimized.

conorbarclay commented Jul 5, 2018

Still getting count() errors on PHP 7.2 here. Latest version of plugin.

@ProggerPete

This comment has been minimized.

ProggerPete commented Jul 18, 2018

This issue makes the plugin a no go.

@stanwmusic

This comment has been minimized.

stanwmusic commented Jul 26, 2018

Can confirm this issue for PHP 7.2

@awbauer

This comment has been minimized.

awbauer commented Sep 7, 2018

This also breaks Gutenberg for end users, showing "Updating failed" due to the broken JSON response. Deactivating the plugin until a patch is pushed.

screenshot 2018-09-07 17 25 13

@thinknirmal

This comment has been minimized.

thinknirmal commented Sep 24, 2018

Been nine months and no fix? At least please merge the patch someone submitted #220

@iandunn

This comment has been minimized.

iandunn commented Sep 24, 2018

It looks like there's actually 4 PRs:

@firefallpro firefallpro referenced a pull request that will close this issue Oct 30, 2018

Open

Added type checking to Hooks.php #227

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment