Re: User Total # Post & Starded Topics without plugin
The query is going to be run on each and every topic/reply. So a topic page with 20 authors showing would run this query 20 times on that page.
Multiply that by hundreds of concurrent users and you have a lot of queries to handle. That is why I brought up needing to cache the output.
I’m not saying that it is a bad query, actually I think that is exactly how to get it, just worried about performance for such little benefit is all.
I was actually contemplating a different approach:
1. run an initial query to count all users topics/replies and store that value in the usermeta table.
2. append the submit topic/reply form to add to the users topic count in the usermeta table.
3. simply call the value stored for the user and output that.
This means that bbpress never has to do the manual counts on page load, but just pulls the number just like any other data.
*would also need to modify system so if a topic/reply is deleted that the users count is also modified to lower their count.
good idea?