I have modified an old Stackoverflow inspired badge system script to work with the latest Wordpress version. You can view the code here (and please feel free to use it if you wish): http://pastebin.com/zA4zGnKZ
It has a condition system that detects
Post count and
Comment count. You can create custom badges and assign conditions to them. It works perfectly besides a very random bug that I cannot fix.
I setup a Wordpress test site and created 10 accounts. I played around with the users and the badges were awarded according to its conditions, so for instance, if a user posted 10 articles, they would be awarded the
Junior Publisher badge.
However, one user was instantly awarded all badges when the account was created. This user has no posts or comments. Even more strange, when I add a new badge, this user automatically gets awarded with it! There is no difference between this user and the other users. All have
Contributor privileges. The user ID number of this user is 5.
Can you please help me detect why the script is behaving like this? Obviously, I cannot add the script to a live site yet in scare of random users being awarded all badges like this user.