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.

New Plugin, “Rate”

Update: It broke! Update to 0.1.1 please!

Disclaimer #1: Beta Release, it might break

Disclaimer #2: I am not a maniac, the only reason I am writing so many plugins right now is because I have a lot of freelance projects, little time to fuck around, and a desire to save my solutions for future use

I am well-aware that there are 5 million Ratings plugins for WordPress, and (from what I can tell) most of them suck. The amount of bad inline JavaScript and disgusting HTML that most of them produce is just sad. Ratings are a little wee feature of a site, not a monstrous piece of architecture that need to jam itself into every corner of your  code base.

That’s why I wrote “Rate.” In sticking with my verb naming scheme see (Tumble and Shuffle), I have tried to make ratings as painless and clean as possible.

There are 2 functions that display ratings:

the_rating()

and

the_comment_rating()

Your users rate your Page / Post / Product whatever in the comments section, and the average rating from all of the Page / Post / Whatever’s ratings is accessible with the_rating(). Rate makes use of the oft-overlooked and under-utilized comment_karma field in the wp_comments table.

The functions don’t install themselves automatically, you must insert them into your Theme in the appropriate places. The ratings styles are loaded by default from within the plugin directory. If you want to override with your own styles, drop a rate.css file in your theme’s directory and the rate plugin CSS won’t load, yours will!

I really thought I could download a plugin from the WordPress Plugin Directory that would suit my needs. I installed PollDaddy the minute I realized that it supported ratings. PollDaddy’s implementation is disgraceful and completely un-override-able. Aside from having inline event handlers (which is ghetto), the styles are written dynamically with JavaScript which makes them virtually impossible to override in CSS. The presentation options/settings are pretty limiting as well.

Hopefully Rate will grow and mature into the cleanest and best ratings plugin for WordPress.

“Movies” plugin now supports WebM

I just checked in version 0.3 of “Movies,” my HTML5 Video plugin for WordPress. When used with Shuffle, you can now associate an Ogg Theora file, a WebM file, and an image with an MP4 (H.264) file to load into an HTML5 Video player (built on top of VideoJS) that will play native Video in browsers that support it (most of them that aren’t IE, and IE9) and use the MP4 and Flash for browsers that don’t (old versions of good browsers and all versions of IE, minus IE9).

I spent half of the day trying to install ffmpeg on the command line to encode videos into WebM, but I failed miserably/then realized you can encode WebM files with Firefogg, the same tool that is used to encode Ogg Theora files: just select “vp8” instead of “theora” in the video codec dropdown. Easy!

Go here to see what’s supported where: http://diveintohtml5.org/video.html#what-works

My previous post on Movies: http://scotty-t.com/2010/11/24/new-plugin-movies/

New Plugin, “Tumble”

I launched Shuffle 2 days ago, and it is has already been downloaded over 200 times. Drunk with this knowledge, I cranked out a 2nd plugin: “Tumble.”

Tumble is an API helper for, you guessed it, Tumblr. What does that mean? Well, your WordPress Media Library and Post history are great resources. They are content repositories waiting to be unleashed unto the world. By default, you share them using your WordPress blog/website, but why not use the same content on other services when appropriate?

Let’s say you want to start a Tumblr but you don’t want to take the time to fill it up with new posts. Maybe you want your website to have galleries of images, but there’s one photo in particular that you think would be great as a Tumblr “Photo” post. Tumblr might be a niche audience that likes your content, but only in bite-sized pieces. This is where Tumble comes in.

Tumble inserts it self in your Post history as a one-click action, right alongside “Edit,” “Quick Edit,” and the like. Click “Post to Tumblr” for a post in your list of Posts, and voila! you have added a new post to your Tumblog.

In your Media Library, I have added a column that inserts Tumblr Post links for each item. Click the link for an item, and the plugin is smart enough to know what time of content you are dealing with and will format the API call to Tumblr appropriately. Currently this works for Photos, Audio, and Video. There is a 10MB limit for photos/audio and a 50MB limit for video. The plugin will tell you right away if the item is too big to transfer.

I like the idea that your Media Library is just a content repository, so why not use it to share to other destinations on the web. Just another reason that WordPress is the Swiss Army knife of development frameworks!

http://wordpress.org/extend/plugins/tumble/