AI Search
Classic Search
 Search Phrase:
 Search Type:
Advanced search options
 Search in Forums:
 Search in date period:

 Sort Search Results by:

AI Assistant
Notifications
Clear all

wpForo online status tracking causes DB slowdowns site-wide

1 Posts
1 Users
0 Reactions
4 Views
Posts: 97
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@deepline-digital)
Estimable Member
Joined: 6 years ago
[#73043]

Hi,

We noticed that the Members::update_online_time() function (in the classes/Members.php file) is hooked to WordPress's built-in set_current_user action. This action runs on every page load for logged-in users, not just on forum pages. This means that even in setups where wpForo is embedded on only 1-2 specific forum pages, an unconditional UPDATE wp_wpforo_profiles SET online_time = ... query is executed site-wide (shop pages, checkout, homepage, admin panel).

On our server, under high load, this situation appears in the MySQL slow query log with durations of 2-4.5 seconds due to profile table contention.

We checked the "Online Status Timeout" setting in the profile settings, but this only controls how long a user is displayed as online; it does not restrict the write frequency.

Would it be possible to introduce a setting that allows the update_online_time() function to write once every N minutes for each user (by checking the current value before writing), or a filter/hook that allows us to control this ourselves without patching the core plugin files?

We believe this would significantly reduce the database load on WooCommerce + wpForo installations where most of the traffic never touches the forum.

Best Regards,


Share: