[wp-meta] [Making WordPress.org] #551: Voting for Code Reference Examples
Making WordPress.org
noreply at wordpress.org
Thu Oct 23 08:10:57 UTC 2014
#551: Voting for Code Reference Examples
--------------------------+-------------------------------------
Reporter: siobhan | Owner: coffee2code
Type: enhancement | Status: closed
Priority: normal | Component: developer.wordpress.org
Resolution: fixed | Keywords:
--------------------------+-------------------------------------
Comment (by coffee2code):
Overview of voting for user contributed notes:
* Any logged in user can vote on any approved note.
* UI highly influenced by the voting on php.net.
* Voting submits an AJAX request to record the vote. The UI is updated via
JS. Works without JS as well.
* Votes are stored as separate lists of user ids (one for up votes, one
for down votes) in comment meta
* User can change their votes
* Upon voting: the vote number changes and the chosen vote indicator
changes color (green for up, red for down) and ceases to be a link.
* The number shown is the cumulative result of votes ($upvotes -
$downvotes). If you hover over the number, what I call the like percentage
is shown: the percentage of total votes that are up votes. (Consistent
with php.net.) [[br]]E.g. 6 people up voted, 2 people down voted =
Score:4, Like:75% [[br]]E.g. 4 people up voted, 0 people down voted =
Score:4, Like:100%
Future consideration:
* Votes are saved in comment_meta, so we can’t efficiently obtain a list
of what a given user voted on. I didn’t feel this was necessary to do.
Votes really only matter in the context of the comment/note. If we wanted
it, we could also store the list of up and down voted note ids as user
meta. (Or a dedicated table.)
* No special sorting for the notes listings are performed yet. We’d have
to decide what factor(s) we’d like to use for sorting before doing so.
* Applying color or other style changes to voted notes. php.net doesn’t do
this, but we could decide on criteria for “good” and “bad” notes and
emphasize/deemphasize accordingly. Sorting may be sufficient, though.
* Alert admins to “bad” notes. Yes, notes are initially moderated, but in
the event of moderator oversight or (more likely) that a note becomes
stale or wrong over time, do we want down votes to trigger an alert? Or
perhaps have an admin view where the most downvoted notes can be listed.
Bear in mind votes aren’t timestamped so we can’t gauge the number of down
votes over a given period of time.
In rereading the initial proposal, I realize I need to change it so for a
logged out visitor, trying to vote redirects them to log in and, upon
doing so, proceeds to register their vote. Currently the vote arrow aren't
clickable for logged out visitors and have hover text indicating they need
to log in before they can vote.
--
Ticket URL: <https://meta.trac.wordpress.org/ticket/551#comment:4>
Making WordPress.org <https://meta.trac.wordpress.org/>
Making WordPress.org
More information about the wp-meta
mailing list