@robert, I created a test site and installed all my plugins with wpforo. No problems, pagination works well. So, the problem with my production site. Is there any debug options to detect the problem?
Update.
Something wrong with sql. If I open forum as user the select query is
SELECT COUNT(*) FROM wpforo_topics WHERE forumid = 14
It gives 17.
If I open forum as guest the select query is
SELECT COUNT(*) FROM wpforo_topics WHERE forumid = 14 AND private = 0 AND status = 0
It gives 0.
I have tried to run this query via phpMyAdmin and it returns also 0.
If I delete 'private' or 'status' the select returns 17.
Any ideas?
Please select all topics of forumid = 14 and check the private and status fields. Are they all 0?
I have just tried select:
SELECT * FROM wpforo_topics WHERE forumid = 14
It returned 17.
The I input select:
SELECT * FROM wpforo_topics WHERE forumid = 14 AND status = 0 AND private = 0
It returned 17.
Then I input
SELECT COUNT(*) FROM wpforo_topics WHERE forumid = 14 AND status = 0 AND private = 0
And it also returned 17. Now pagination works for guests. I don't understand anything...
Thank you for help @robert.
Ok, then this is a MySQL cache issue, you should add a multiple index to reset this cache and make it work faster. Please navigate to this table Structure Tab, select forumid. private, status fields and make those one index.
Or just execute this SQL, make sure the wp_ database table prefix is correct:
ALTER TABLE `wp_wpforo_topics` ADD INDEX( `forumid`, `private`, `status`);