It needs the 0, if not if you do a WP Query to get the most rated/posts, those without 0 will not show up.
If you dig into the WP code, it will not be added if the post already contains the post_meta. See https://codex.ww.wp.xz.cn/Function_Reference/add_post_meta
-
This reply was modified 8 years, 10 months ago by
Lester Chan.
I don’t think that topic is resolved.
1. even there are no duplicates, it creates 3 empty values for each posts. It increase db size and db query times, and page load times.
2. why you need posts without ratings to appear in most rated lists?
3. don’t be lazy to optimize/fix code.
Some statistics: wp-admin load time with fix above will load 25% faster. Tested on real site with many posts.
1, 2) I have requests for posts without ratings to appear many times.
3) See above. I am ok removing it and removing is so easy. But it will be a vicious circle as I will get support questions for posts not appearing in the list with 0 votes.
As of now, I will make the decision to include those fields, if my plugins don’t fit your needs, feel free to fork it and remove those 3 fields for your needs.