I just took a look and it seems that now for every page visit there is one new entry in the wp_top_ten table as opposed to be before there was 1 entry per post where the visits was the total count.
Plugin Author
Ajay
(@ajay)
What’s your site URL?
Also, what are you seeing the wp_top_ten table when there is a visit? This should record the post ID along with the hit and increment the count for the same post every time it is refreshed.
The site is internal so I can’t share the url but every time there is a visit, there is another entry added in the top_ten table with the same post id and a value of 1 for the count. For now as a workaround we added SUM() to the column name query in the plugin code so it sums up the entries but that’s a workaround we’d like to not use. I understand after looking at the code that on duplicate key it’s suppose to increment the count but it looks like it’s not seeing a duplicate key and just adding a new entry into the table.
Plugin Author
Ajay
(@ajay)
There might be something wrong with the install as the plugin only adds a new entry if a post ID isn’t already there.
You can use the Top 10 > Tools to recreate the tables.
Alternatively, if you’re okay to lose the data for now, I’d suggest uninstalling the plugin and also deleting the wp_top_ten and wp_top_ten daily tables.
Ok, we’ll take a look. We definitely can’t lose years of data but we’ll look to recreating the tables. Thank you.
Plugin Author
Ajay
(@ajay)
You can backup the counts from the Tools page before making any changes.
And, of course backup your wp_top_ten and wp_top_ten_daily tables directly before making any changes as an additional backup.
The recreating tables option in the settings page attempts to backup counts before making any changes, but as always I recommend backing up databases before any changes to them.