• Resolved llmarlou

    (@llmarlou)


    Hi,

    There seems to be an issue with the realtime stats in the Dashboard widget not automatically updating.
    This occurs on all our sites (single sites, multisites). One of them is still running v1.6.5 so it doesn’t seem to be related to the v1.7.x update.

    In the widget it says there have been 0 views (with 0 in the last hour).
    Once you go to the statistics page (/wp-admin/index.php?page=koko-analytics) and then go back to the Dashboard, the stats in the widget will be updated to the correct amount of views.
    But the issue persists because during the day as the stats won’t update automatically. They will only update after visiting the statistics page (/wp-admin/index.php?page=koko-analytics).
    So every new day it starts with 0 views (with 0 in the last hour). 

    In one of the sites, we’re also using the get_most_viewed_posts function for a custom ‘most read’ articles widget. That used to work fine. Not sure if it’s related, but the client is now reporting that the articles in that widget won’t update as well.
    The client also sends out a newsletter with these ‘most read’ articles, so it’s important that this data is regularly updated.

    Is this a bug in the plugin or possibly something else? What can we check? Is there a specific cronjob that should be running?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Danny van Kooten

    (@dvankooten)

    Hi @llmarlou ,

    Interesting, that sounds weird indeed. Do you happen to know if the server that site is running on is using a persistent object cache of any kind (ie: memcached, redis, something else).

    Thread Starter llmarlou

    (@llmarlou)

    @dvankooten
    On some sites we use Redis cache, but this also affects sites without Redis active (the example I mentioned doesn’t have Redis active).

    Other cache we use is OPcache which get flushed after every deploy.

    Plugin Author Danny van Kooten

    (@dvankooten)

    Hello @llmarlou,

    It sounds like your WP Cron system is somehow no longer running or something is blocking all other scheduled actions from running.

    This WP Cron event also runs whenever you visit the dashboard page, which is why you’re seeing the statistics update after visiting the dashboard. But if you’re not visiting the dashboard, the scheduled action named koko_analytics_aggregate_stats should take care of periodically updating your statistics.

    You can use a plugin like Advanced Cron Manager or WP Crontrol to debug your WP Cron and see if there’s anything blocking it:

    Once installed, go to Tools > Scheduled Actions (or Crontrol) and search for the koko_analytics_aggregate_stats and when it is due to run. What does it say there? And what is the next scheduled action (at the top of the list)?

    Best,
    Danny

    Thread Starter llmarlou

    (@llmarlou)

    Hi @dvankooten
    Thanks for your suggestions!

    I already checked and the cron was running, however, I overlooked an error in our logs regarding the ‘buffer’ files. For example:

    E_WARNING: rename(/www/wp-content/uploads/sites/3/koko-analytics/buffer-123456.csv,/www/wp-content/uploads/sites/3/koko-analytics/buffer-123456.csv.busy): Permission denied

    We fixed it by tweaking the permissions for that folder

    • This reply was modified 5 days, 19 hours ago by llmarlou.
    Plugin Author Danny van Kooten

    (@dvankooten)

    @llmarlou Nice find! What’s weird is that the error apparently did not happen when the process was triggered by you visiting the dashboard (because that worked, right?), but that could be explained by the WP Cron thing running as a different user than your HTTP web server…

    Anyway, something for me to remember in case others run into a similar issue. Glad it’s sorted for you now!

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.