User ratings lost while post visibility private
Case description: you create a post, publish it, users on site have the page loaded in their browsers and start rating the post, then you switch post visibility to hidden/private temporarily because you need some time to make edits.
Issue: if those who loaded the page while the post was still public rate the post a bit later after the post was made private, their ratings will be lost (the plugin can’t update wp_postmeta in the database, I suppose) and won’t be reflected in %RATINGS_AVERAGE% / %RATINGS_USERS% for this post.
BUT their ratings will be listed in the logs correcly, nothing is lost there (I have a section at the bottom of the page which gives a rundown of who rated the post and how) — so, the plugin updates the wp_ratings table correctly. So, from that moment on there’s a discrepancy in ratings as reported at the top of the post (%RATINGS_AVERAGE% / %RATINGS_USERS%) and at the bottom where I query the database and list all users who rated the post and their ratings. That discrepancy is pretty hard to fix unless you manually go to the database and edit the values in wp_postmeta for the post.
I realize the issue can be avoided by never switching the post visibility to private after publishing it, but perhaps there’s a more elegant way of dealing with it, like the plugin could have some sort of built-in protection for this scenario?
Sorry for the long post, didn’t quite know how to describe the problem in a more concise manner.
- The topic ‘User ratings lost while post visibility private’ is closed to new replies.