Hi spielo,
Thanks for raising this, and sorry for the repeated work.
You are right that there is no setting for it yet. The Online Visitors window is fixed at 5 minutes inside the plugin code, so the change you make by
hand is replaced every time the plugin updates. That will happen with any edit to plugin files.
We are going to fix this properly. First we will add a filter so you can set the value from a small snippet in your own theme or a helper plugin, which
survives updates. After that we plan to expose it as a normal setting in the admin.
In the meantime, could you tell us what value you change it to, and what works better about it for your site? That helps us choose a sensible range and
default.
Regards,
Thread Starter
spielo
(@spielo)
Hi,
Thanks for the replay, we use different timeframes by sites up to 240 minutes
Hi spielo,
Thanks, that helps. We have added a filter for exactly this, so you can set the window once and it will not be wiped by updates. It is in our development branch now and ships in the next release.
Put this in a small helper plugin, or in your theme functions file, and set the minutes to whatever suits each site. For 240 minutes:
add_filter( 'wp_statistics_online_visitors_timeframe', function () { return 240; } );
Once you are on the next release, that is all it takes, on every site, and updates leave it alone.
Best