Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
= 5.4.3 - 2026-03-16 =

Fixed
- Fixed fatal error on servers without the PHP calendar extension ([PR #229](https://github.com/wp-slimstat/wp-slimstat/pull/229))
- Added defensive fallback for corrupted `start_of_week` option in calendar-related reports

Improved
- Moved day names array to a class constant in DataBuckets for better maintainability

= 5.4.2 - 2026-03-15 =

Fixed
Expand Down
4 changes: 2 additions & 2 deletions languages/wp-slimstat.pot
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
# This file is distributed under the GPL-2.0+.
msgid ""
msgstr ""
"Project-Id-Version: SlimStat Analytics 5.4.2\n"
"Project-Id-Version: SlimStat Analytics 5.4.3\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wp-slimstat\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2026-03-15T15:51:50+00:00\n"
"POT-Creation-Date: 2026-03-16T10:28:33+00:00\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"X-Generator: WP-CLI 2.12.0\n"
"X-Domain: wp-slimstat\n"
Expand Down
7 changes: 6 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Text Domain: wp-slimstat
Requires at least: 5.6
Requires PHP: 7.4
Tested up to: 6.9.4
Stable tag: 5.4.2
Stable tag: 5.4.3
License: GPL-2.0+
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -75,6 +75,11 @@ An extensive knowledge base is available on our [website](https://www.wp-slimsta
9. **Settings** - Plenty of options to customize the plugin's behavior

== Changelog ==
= 5.4.3 - 2026-03-16 =
- **Fix**: Fixed fatal error on servers without the PHP calendar extension ([PR #229](https://github.com/wp-slimstat/wp-slimstat/pull/229))
- **Fix**: Added defensive fallback for corrupted `start_of_week` option in calendar-related reports
- **Improved**: Moved day names array to a class constant in DataBuckets for better maintainability

= 5.4.2 - 2026-03-15 =
- **Fix**: Fixed tracking data not being recorded on some server configurations — REST API and admin-ajax endpoints now return responses correctly ([PR #218](https://github.com/wp-slimstat/wp-slimstat/pull/218))
- **Fix**: Fixed visitor locations showing a proxy server IP instead of the real visitor IP on Cloudflare-powered sites ([#150](https://github.com/wp-slimstat/wp-slimstat/issues/150))
Expand Down
6 changes: 4 additions & 2 deletions src/Helpers/DataBuckets.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

class DataBuckets
{
private const DAY_NAMES = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];

private $labels = [];

private $prev_labels = [];
Expand Down Expand Up @@ -104,7 +106,7 @@ private function initSeqWeek(): void
{
$start = (new \DateTime())->setTimestamp($this->start);
$end = (new \DateTime())->setTimestamp($this->end);
$startOfWeek = get_option('start_of_week', 1);
$startOfWeek = (int) get_option('start_of_week', 1);

// Adjust start to the first day of the week
$firstLabel = $start->format($this->labelFormat);
Expand All @@ -115,7 +117,7 @@ private function initSeqWeek(): void
}

// Move start to the next week if it is not the start of the week
$start->modify('next ' . jddayofweek($startOfWeek - 1, 1));
$start->modify('next ' . (self::DAY_NAMES[$startOfWeek] ?? 'Monday'));
if ($start->getTimestamp() <= $this->start) {
$start->modify('+1 week');
}
Expand Down
4 changes: 2 additions & 2 deletions wp-slimstat.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: SlimStat Analytics
* Plugin URI: https://wp-slimstat.com/
* Description: The leading web analytics plugin for WordPress
* Version: 5.4.2
* Version: 5.4.3
* Author: Jason Crouse, VeronaLabs
* Text Domain: wp-slimstat
* Domain Path: /languages
Expand All @@ -20,7 +20,7 @@
}

// Set the plugin version and directory
define('SLIMSTAT_ANALYTICS_VERSION', '5.4.2');
define('SLIMSTAT_ANALYTICS_VERSION', '5.4.3');
define('SLIMSTAT_FILE', __FILE__);
define('SLIMSTAT_DIR', __DIR__);
define('SLIMSTAT_URL', plugins_url('', __FILE__));
Expand Down