Recent Mood Issues

It has come to my attention that there is an issue with the Cricket Moods WordPress plugin. The issue appears to be that when you edit your personal list of moods you receive something similar to the following error:

Warning: ksort() expects parameter 1 to be array, string given in
/wp-content/plugins/cricket-moods.php on line 615

Warning: Invalid argument supplied for foreach() in
/wp-content/plugins/cricket-moods.php on line 616

I have received about five or six e-mails from individuals having this issue, and I can only assume it’s related to some change I overlooked in the relatively recent 2.0.5 release of WordPress. I apologize if you haven’t heard a response from me about the plugin. Rest assured, I’m not ignoring you! I have recently just moved and am now on vacation out-of-state. I will be back to my workstation in a week or two and will be able to dedicate some time to this issue then.

Keep in mind that the plugin is Open Source Software. If anyone feels like investigating this on their own, I’d be more than happy to accept your patch and release a new version immediately giving you full credit. :)

6 Responses to “Recent Mood Issues”

  1. !!blue Says:

    I look forward to a fix for this issue. :) I don’t receive the error above, what happens to me is that the default and newly added fields disappear and I get 5 blank fields starting with ID #21.

  2. Les Says:

    This error just bit me this morning. Hope a fix can be sorted out soon :)

  3. Les Says:

    OK – a quick work around. Take life in hands, make sure you have a backup, etc, etc.

    Using phpMyAdmin or your personal choice of database editing too, go into the wp_usermeta table. Delete the two fields relating to Cricket Moods for each affected user. (I have one user, so this was easy)

    Removing the fields resets the user to the default moods. My added mood is present and correct, and the nasty error is gone. Hope this helps someone :)

  4. kccricket Says:


    Yep, that will definately fix the error. However, keep in mind that moods used in posts by the user may not match up with the default list of moods.

    With the rudimentary testing I’ve been able to do over dial-up on my POS laptop, it appears that the WP get_usermeta function is not un-serializing the serialized user-mood array in the database. I should be able to give this more attention on Monday evening.

    It appears that I don’t need to be serializing and escaping the array before passing it to update_usermeta.

  5. kccricket Says:


    The same error is actually occurring for you, the error just isn’t showing up. I experienced the same behavior testing with a WP 2.1 alpha.

  6. Cricket Moods version 3.2 : Losing it[1] Says:

    [...] I had a quick look at those lines in the plugin and was immediately reminded that I am not a coder. Obviously something was broken, but I had no idea what. After some random searching, I eventually found this post on the author’s site, in which he noted that he was aware that there was a problem, and that he’d fix it as soon as he could. OK, I was relieved that it wasn’t just my site being broken, but I really wanted to make the error go away. [...]