• Resolved climatesaver

    (@climatesaver)


    There needs to be a way to prevent clients from hitting /wp-json/wp-statistics/v2/online every minute. I guess this is used to track online users, but I have disabled this functionality in the settings. Yet, when a user leaves open my website, I get a hit every single minute from that client. This floods my server logs, is usuless bandwidth and energy consumption for both my server and the client. I’m happy with a client hitting wp-statistics once when opening a page on a site, but I don’t want multiple hits over and over again (sometimes for hours) because users leave the page open in their browser.

    This is basically the same request as https://www.ads-software.com/support/topic/disable-wp-json-wp-statistics-v2-online/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Amir

    (@amirfallah)

    Hi @climatesaver

    Thank you for opening this thread.

    We will definitely add this feature in future updates so you can manage it through the settings.

    In the meantime, you can set the wp_statistics_js_check_time_interval to a very high number according to the guide in the link below to effectively prevent the requests:
    Customizing User Online Status Intervals

    function custom_js_check_time_interval($check_time) {
    // Set the check time interval to 1 day (86,400,000milliseconds)
    return 86400000;
    }
    add_filter('wp_statistics_js_check_time_interval', 'custom_js_check_time_interval');

    Thank you for your valuable feedback.
    Best regards,

    Plugin Author Mostafa Soufi

    (@mostafas1990)

    Hello,

    Thank you for reporting the issue. We have fixed it in the development version. The request to /wp-json/wp-statistics/v2/online will not be sent unless the “User Online” option is enabled in the settings page.

    We’ll try to release the new version at the beginning of the new week. Please let us know if you have any further questions.

    Best

    Thread Starter climatesaver

    (@climatesaver)

    Thanks. To give you an idea of the impact of this issue: 2,5 days ago I disabled wp-statistics completely on my site and flushed all WordPress caches. Now 2,5 days later, I’m still getting 20 hits (404 not found) per minute on /wp-json/wp-statistics/v2/online . This site has about 350 visits per day, according to awstats so it’s not really a very busy site. You might want to reconsider the defaults regarding to this option.

    Plugin Author Mostafa Soufi

    (@mostafas1990)

    Thank you for providing the data. It is absolutely helpful, and we are already working on this issue. It will be fixed in an upcoming minor version soon.

    Best

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Needs way to prevent minutely hits on /wp-json/wp-statistics/v2/online’ is closed to new replies.