Rate v0.2 is pretty good, doesn’t break

I have received a lot of feedback from the WordPress community about my ratings plugin, Rate. I squashed some bugs and added some features and can now take this thing out of what I like to call “Beta.” If this thing breaks when you install, I am now officially an asshole.

You still need to insert the_rating() and the_comment_rating() into your theme – see screenshots on the plugin page – but I wrote some filters using the Plugin API that will insert the ratings widget into the comment form, so you can rate a post/page/product/thing while commenting, instead of after commenting. I probably should have started with this functionality, but it took a while to figure out the best way to do it.

Even though comment_karma is a field in the $wpdb->comments table, the comment_karma field will not be saved with the other comment fields if that field is Post’d along with the other values, so I actually have run a second database query after the comment has been inserted to save the rating (comment_karma) along with the comment data.

Weird and annoying.

Anyways, this thing should work like a champ now. I also fixed the_rating() to display a more accurate average of the ratings. Instead of just doing SELECT AVG(comment_karma), I added this logic: WHERE comment_karma > 0. Once again, duh, but at least it’s fixed NOW.