Re: Rate anything: new plugin in development, soliciting architecture advice
@djpaul and @boonebgorges, I hear you about the caching. that is one big bonus. I can make big ugly queries and know that they’ll be cached. If I ‘roll by own’ then I’ll have to build caching myself (but it’s not that hard).
I looked at the meta_query functions, and they seem quite sufficient for most queries, they only thing they are missing are the powerful mysql abilities such as GROUP BY, COUNT, DISTINCT, and mysql’s cryptic but powerful date range functions. Much of this can be done in php with more flexibility, but sometimes it’s nice to do a single query and get exactly what you want.
The most common need for this plugin, is to display the combined vote/rating/likes of a content object. I can pretty easily figure out how to do that with MySQL, but how to do it quickly with custom post types/taxonomies?
For example, i’m looking at a list of images, and I want to see the ratings of each image. I can’t really store it in my new rating custom post type, do I store it in some site option? seems kinda odd, or do I create a new custom post type – one for each object type – seems kinda odd, or do I use taxonomies. Or do I store it in the meta table of that individual object such as post_meta, group_meta. etc. this will not scale well because some objects have no meta table (such as images).
any insights into these things would be greatly appreciated.