sayontan / suffusion

The Suffusion Theme for WordPress
GNU General Public License v3.0
28 stars 18 forks source link

PHP Warning: count() #90

Closed Ciprian-Dracea closed 6 days ago

Ciprian-Dracea commented 3 weeks ago

Hi Marc,

First of all, thank you for keeping Suffusion up and running. I didn't had time to write here, but I was very happy seeing you updating and fixing bugs of the theme. Thank you.

Now, an annoying thing. On one of the sites which still use Suffusion, the server drop in error.log at every minute this line: PHP Warning: count(): Parameter must be an array or an object that implements Countable in /home/........./public_html/wp-content/themes/suffusion/widgets/suffusion-query-posts.php on line 113

In few months error.log become huge and the hosting company ask for more money for allowing more space.

I replaced the line 113 from if (count($solo_tags) > 0) { to if (!is_null($solo_tags)) {

and the site stop filling "error.log".

If the change is ok, please add it in the future updates of the theme or maybe you come with a better solution.

Thank you very much, Drake

marcissimus commented 3 weeks ago

Hi Drake,

you're very welcome. Taking over maintenance only works if the code has few bugs which is the case in this plugin. :-)

That doesn't mean there aren't any bugs, so thanks for reporting this one!

The fix is different than you suggested since you should be able to mention several tags separated by a comma (same as for post ids). Could you please test https://github.com/sayontan/suffusion/pull/91?

Cheers, Marc

mbrsolution commented 1 week ago

Hi all, out of curiosity how is this bug reproduce? I checked my log files and I don't see any PHP warning counts like the one mentioned by Drake above.

Kind regards, Manuel

mbtools commented 1 week ago

It should occur if you use a tag or tags in the widget

mbrsolution commented 1 week ago

Well, I tried everything I could think of and could not get a tag to appear in a widget. Maybe I need to go back to WordPress school :)

Kind regards, Manuel

mbtools commented 6 days ago

There's a tag field in the "post search" widget.

Here it is in German:

image