Skip to content

V2.2.0

Latest

Choose a tag to compare

@daunampc daunampc released this 06 Aug 03:02

Timezone fixes for daily reporting
This release fixes incorrect chart data and conversion rates on sites running in a timezone other than UTC.

πŸ› Bug fixes
Visit data bucketed into the wrong day

The daily statistics query used DATE(FROM_UNIXTIME(time)), which resolves against the MySQL server timezone rather than the timezone configured in WordPress. On a site set to UTC-4, every pageview between 20:00 and 23:59 local time was assigned to the following day.

This caused:

Wrong columns in the Sales / Orders and Conversion Rate charts.
Records pushed outside the selected date range disappearing entirely from the charts.
Conversion rate pairing one day's visits with another day's orders β€” wrong on both the numerator and the denominator.
Day boundaries are now computed in PHP using DateTimeImmutable with wp_timezone(), then passed to SQL as Unix timestamps. The MySQL timezone no longer affects results.

"Last updated" displayed with an offset

The value was stored using current_time( 'timestamp' ) β€” which already includes the site offset β€” and then passed through wp_date(), applying the offset a second time. On a UTC-4 site this made the line disagree with "Next update" directly beside it by four hours. It now stores a true UTC timestamp via time().

Order creation dates

Day-key calculation for orders was rewritten to resolve explicitly through wp_timezone(), guaranteeing it matches the day keys generated for visit data. It also no longer mutates the order's WC_DateTime object.

✨ Improvements
Added a Timezone check diagnostic page to the plugin menu, comparing WordPress, PHP, and MySQL timezones and counting how many stored records are actually affected.
Added current_start_gmt, current_end_gmt, previous_start_gmt, and previous_end_gmt to the date range data.
⚠️ Upgrade notes
After updating, clear the dashboard cache so figures are recalculated:

Burst Funnel Stats β†’ Data status β†’ Update now
Recommended: in Settings β†’ General, select a named timezone (for example America/New_York) rather than a fixed UTC offset such as UTC-4. Fixed offsets do not follow daylight saving time, which shifts reports by an additional hour after each transition.

Add To Cart data recorded before this release keeps its original day keys and cannot be recalculated. Figures will be consistent from the point of upgrade onward.