Title: Why saving Points in usermeta
Last modified: August 30, 2016

---

# Why saving Points in usermeta

 *  Resolved [MathiasP](https://wordpress.org/support/users/mathiasp/)
 * (@mathiasp)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/why-saving-points-in-usermeta/)
 * Hey J.D.
 * I am wondering why the points are beeing saved in usermeta table?
    I want to 
   group all user points by Year / Month in the wp admin can I just select the points
   from the logs table or is there maybe a difference between the usermeta?
 * Greez!!
 * [https://wordpress.org/plugins/wordpoints/](https://wordpress.org/plugins/wordpoints/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [J.D. Grimes](https://wordpress.org/support/users/jdgrimes/)
 * (@jdgrimes)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/why-saving-points-in-usermeta/#post-6368880)
 * The points stored in the usermeta table is the actual number of points that each
   user has for each points type. (Note that it is possible that this will be [stored in its own table in the future](https://github.com/WordPoints/wordpoints/issues/90).)
 * WordPoints does not calculate the number of points that a user has based on the
   points logs. That would make the plugin do a lot of work each time it wanted 
   to know how many points a user has. It would make it very difficult to show a
   list of the users with the most points, for example. That is why the number of
   points each user has is stored in the usermeta table.
 * The number in the usermeta table is the one that WordPoints uses. The number 
   of points is never calculated from the logs. In fact, it is possible that the
   number in usermeta would be a different amount from what you could calculate 
   from the logs. This is because it is possible to modify a user’s points without
   logging the transaction, or delete a log without modifying the points. The plugin
   does not do either of these things, but they are possible.
 * So, there is a difference between the number in usermeta and the total you would
   calculate from the logs. Usually they will be same, but it is possible that sometimes
   they could be different.
 * My recommendation is this:
    1. You should do whatever you want to with the number from the logs.
    2. Your code should not break if there is a discrepancy between the logs and the
       users points.
    3. When there is a discrepancy, your code should just assume that it is intended.
       Just assume that something modified one of the values on purpose.
 * I hope that answers your question.
 *  Thread Starter [MathiasP](https://wordpress.org/support/users/mathiasp/)
 * (@mathiasp)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/why-saving-points-in-usermeta/#post-6368889)
 * Totally, thank you!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Why saving Points in usermeta’ is closed to new replies.

 * ![](https://ps.w.org/wordpoints/assets/icon.svg?rev=1662380)
 * [WordPoints](https://wordpress.org/plugins/wordpoints/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordpoints/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordpoints/)
 * [Active Topics](https://wordpress.org/support/plugin/wordpoints/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordpoints/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordpoints/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [MathiasP](https://wordpress.org/support/users/mathiasp/)
 * Last activity: [11 years, 1 month ago](https://wordpress.org/support/topic/why-saving-points-in-usermeta/#post-6368889)
 * Status: resolved