Tagged: 

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #56837
    Bryson T
    Participant

    Hi. All daily stats track incorrectly as it’s on UTC, not my WordPress or server timezone (CST/CDT). I’ve tried this on Nginx and OpenLiteSpeed, as well as multiple hosts. Days on this plugin end at 7PM or 6PM, depending on the season. It’s always been like this. Thought I had made a request before but can’t find it if so. Really annoying. Makes any stats beyond individual posts useless, like the dashboard widget shown below.

    dashboard stats view

    #56846
    Bartosz
    Keymaster

    Hi Bryson,

    PVC stores the data in UTC in order for it it be as universal as possible. But it does display charts using your WordPress timezone.
    We have a task opened to adjust that – thing is it would be irreversible (once set, every change would result in a bias related to timezone).
    Would that be something you’d accept?

    #56859
    Bryson T
    Participant

    Sorry. Didn’t get notified of this response (yes, it was selected).

    Storing in UTC absolutely makes sense. All stats then need to be displayed based on the site’s chosen locale. There is no need to change that as it would create problems than it would solve. Getting the user locale to affect stats display, and function correctly, is all that is needed. It doesn’t. Never has in the years I’ve been using this plugin. Again, server and WordPress are set correctly (America/Chicago). Doesn’t work correctly on the dashboard widget or the reports page.

    #56860
    Bryson T
    Participant

    The only use of/reference to “timezone” I can find in the base plugin is line 324 in the Post_Views_Counter_Dashboard class.

    
    // get current date
    $current_date = date_create( 'now', wp_timezone() )->format('Y m W d t');
    $current_date_chunks = explode( ' ', $current_date );
    

    Neither of those variables are used anywhere else.

    Using wp_timezone() on my site outputs the correct date and time according to the timezone set in WP settings. So, if that code was used anywhere, it would produce an accurate time.

    Haven’t been through the JS yet.

    #56862
    Bartosz
    Keymaster

    We’re looking into this again. Quite possible that we’ll add an option for that in the upcoming Pro release. Just making sure we’re not missing something while adding an option for that.

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