Changeset 3485123
- Timestamp:
- 03/17/2026 09:27:33 PM (11 days ago)
- Location:
- wp-slimstat
- Files:
-
- 10 edited
- 1 copied
-
tags/5.4.4 (copied) (copied from wp-slimstat/trunk)
-
tags/5.4.4/admin/config/index.php (modified) (1 diff)
-
tags/5.4.4/languages/wp-slimstat.pot (modified) (3 diffs)
-
tags/5.4.4/readme.txt (modified) (2 diffs)
-
tags/5.4.4/src/Helpers/DataBuckets.php (modified) (4 diffs)
-
tags/5.4.4/wp-slimstat.php (modified) (2 diffs)
-
trunk/admin/config/index.php (modified) (1 diff)
-
trunk/languages/wp-slimstat.pot (modified) (3 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/src/Helpers/DataBuckets.php (modified) (4 diffs)
-
trunk/wp-slimstat.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-slimstat/tags/5.4.4/admin/config/index.php
r3483202 r3485123 592 592 'title' => __('Content Types', 'wp-slimstat'), 593 593 'type' => 'textarea', 594 'description' => __('Enter a list of Slimstat content types that should not be tracked: <code>post, page, attachment, tag, 404, taxonomy, author, archive, search, feed, login</code>, etc. See note at the bottom of this page for more information on how to use wildcards. String should be entered in lowercase.', 'wp-slimstat'),594 'description' => __('Enter a list of Slimstat content types that should not be tracked: <code>post, page, attachment, tag, 404, taxonomy, author, archive, search, feed, login</code>, etc. For custom post types, use the <code>cpt:</code> prefix (e.g., <code>cpt:product</code>, <code>cpt:portfolio</code>). See note at the bottom of this page for more information on how to use wildcards. Strings are case-insensitive.', 'wp-slimstat'), 595 595 ], 596 596 'wildcards_description' => ['Wildcards', -
wp-slimstat/tags/5.4.4/languages/wp-slimstat.pot
r3483763 r3485123 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: SlimStat Analytics 5.4. 3\n"5 "Project-Id-Version: SlimStat Analytics 5.4.4\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wp-slimstat\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 2026-03-1 6T10:28:33+00:00\n"12 "POT-Creation-Date: 2026-03-17T21:13:27+00:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 14 "X-Generator: WP-CLI 2.12.0\n" … … 778 778 779 779 #: admin/config/index.php:594 780 msgid "Enter a list of Slimstat content types that should not be tracked: <code>post, page, attachment, tag, 404, taxonomy, author, archive, search, feed, login</code>, etc. See note at the bottom of this page for more information on how to use wildcards. String should be entered in lowercase."780 msgid "Enter a list of Slimstat content types that should not be tracked: <code>post, page, attachment, tag, 404, taxonomy, author, archive, search, feed, login</code>, etc. For custom post types, use the <code>cpt:</code> prefix (e.g., <code>cpt:product</code>, <code>cpt:portfolio</code>). See note at the bottom of this page for more information on how to use wildcards. Strings are case-insensitive." 781 781 msgstr "" 782 782 -
wp-slimstat/tags/5.4.4/readme.txt
r3483763 r3485123 6 6 Requires PHP: 7.4 7 7 Tested up to: 6.9.4 8 Stable tag: 5.4. 38 Stable tag: 5.4.4 9 9 License: GPL-2.0+ 10 10 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 76 76 77 77 == Changelog == 78 = 5.4.4 - 2026-03-17 = 79 - **Fix**: Chart data not showing due to incorrect bounds check ([PR #232](https://github.com/wp-slimstat/wp-slimstat/pull/232)) 80 - **Fix**: Weekly chart not showing today's data and not respecting start_of_week setting ([PR #235](https://github.com/wp-slimstat/wp-slimstat/pull/235)) 81 - **Improved**: Added `cpt:` prefix guidance to content type exclusion setting 82 78 83 = 5.4.3 - 2026-03-16 = 79 84 - **Fix**: Fixed fatal error on servers without the PHP calendar extension ([PR #229](https://github.com/wp-slimstat/wp-slimstat/pull/229)) -
wp-slimstat/tags/5.4.4/src/Helpers/DataBuckets.php
r3483763 r3485123 196 196 } 197 197 } elseif ('WEEK' === $this->gran) { 198 $offset = date('W', $dt) - date('W', $base) + (date('Y', $dt) - date('Y', $base)) * 52; 198 // Calculate the start-of-week date for both base and dt 199 // This respects WordPress start_of_week setting instead of using ISO weeks 200 $baseWeekStart = $this->getWeekStartTimestamp($base); 201 $dtWeekStart = $this->getWeekStartTimestamp($dt); 202 203 // Calculate weeks between the two week start dates 204 $offset = (int) round(($dtWeekStart - $baseWeekStart) / (7 * 86400)); 205 199 206 if ($offset < 0) { 200 207 $offset = -1; … … 207 214 208 215 // Ensure offset is within bounds 209 if ($offset <=$this->points) {216 if ($offset >= 0 && $offset < $this->points) { 210 217 $target = 'current' === $period ? 'datasets' : 'datasetsPrev'; 211 218 if (!isset($this->{$target}['v1'][$offset])) { … … 230 237 return date($params['data_points_label'], $timestamp); 231 238 }, $labels, array_keys($labels)); 239 } 240 241 /** 242 * Get the start-of-week timestamp for a given timestamp. 243 * Respects WordPress start_of_week setting. 244 */ 245 private function getWeekStartTimestamp(int $timestamp): int 246 { 247 $startOfWeek = (int) get_option('start_of_week', 1); 248 $dayOfWeek = (int) date('w', $timestamp); // 0=Sun, 6=Sat 249 $diff = ($dayOfWeek - $startOfWeek + 7) % 7; 250 return strtotime(date('Y-m-d', strtotime("-{$diff} days", $timestamp))); 232 251 } 233 252 … … 271 290 'datasets' => $this->datasets, 272 291 'datasets_prev' => $this->datasetsPrev, 273 'today' => 'WEEK' === $this->gran && wp_date('YW', $this->end, wp_timezone()) === wp_date('YW', time(), wp_timezone()) ? str_replace("'", '', $this->labels[count($this->labels) - 1]) : wp_date($this->labelFormat, time(), wp_timezone()),292 'today' => 'WEEK' === $this->gran && $this->getWeekStartTimestamp($this->end) === $this->getWeekStartTimestamp(time()) ? str_replace("'", '', $this->labels[count($this->labels) - 1]) : wp_date($this->labelFormat, time(), wp_timezone()), 274 293 'granularity' => $this->gran, 275 294 ]; -
wp-slimstat/tags/5.4.4/wp-slimstat.php
r3483763 r3485123 4 4 * Plugin URI: https://wp-slimstat.com/ 5 5 * Description: The leading web analytics plugin for WordPress 6 * Version: 5.4. 36 * Version: 5.4.4 7 7 * Author: Jason Crouse, VeronaLabs 8 8 * Text Domain: wp-slimstat … … 21 21 22 22 // Set the plugin version and directory 23 define('SLIMSTAT_ANALYTICS_VERSION', '5.4. 3');23 define('SLIMSTAT_ANALYTICS_VERSION', '5.4.4'); 24 24 define('SLIMSTAT_FILE', __FILE__); 25 25 define('SLIMSTAT_DIR', __DIR__); -
wp-slimstat/trunk/admin/config/index.php
r3483202 r3485123 592 592 'title' => __('Content Types', 'wp-slimstat'), 593 593 'type' => 'textarea', 594 'description' => __('Enter a list of Slimstat content types that should not be tracked: <code>post, page, attachment, tag, 404, taxonomy, author, archive, search, feed, login</code>, etc. See note at the bottom of this page for more information on how to use wildcards. String should be entered in lowercase.', 'wp-slimstat'),594 'description' => __('Enter a list of Slimstat content types that should not be tracked: <code>post, page, attachment, tag, 404, taxonomy, author, archive, search, feed, login</code>, etc. For custom post types, use the <code>cpt:</code> prefix (e.g., <code>cpt:product</code>, <code>cpt:portfolio</code>). See note at the bottom of this page for more information on how to use wildcards. Strings are case-insensitive.', 'wp-slimstat'), 595 595 ], 596 596 'wildcards_description' => ['Wildcards', -
wp-slimstat/trunk/languages/wp-slimstat.pot
r3483763 r3485123 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: SlimStat Analytics 5.4. 3\n"5 "Project-Id-Version: SlimStat Analytics 5.4.4\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wp-slimstat\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 2026-03-1 6T10:28:33+00:00\n"12 "POT-Creation-Date: 2026-03-17T21:13:27+00:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 14 "X-Generator: WP-CLI 2.12.0\n" … … 778 778 779 779 #: admin/config/index.php:594 780 msgid "Enter a list of Slimstat content types that should not be tracked: <code>post, page, attachment, tag, 404, taxonomy, author, archive, search, feed, login</code>, etc. See note at the bottom of this page for more information on how to use wildcards. String should be entered in lowercase."780 msgid "Enter a list of Slimstat content types that should not be tracked: <code>post, page, attachment, tag, 404, taxonomy, author, archive, search, feed, login</code>, etc. For custom post types, use the <code>cpt:</code> prefix (e.g., <code>cpt:product</code>, <code>cpt:portfolio</code>). See note at the bottom of this page for more information on how to use wildcards. Strings are case-insensitive." 781 781 msgstr "" 782 782 -
wp-slimstat/trunk/readme.txt
r3483763 r3485123 6 6 Requires PHP: 7.4 7 7 Tested up to: 6.9.4 8 Stable tag: 5.4. 38 Stable tag: 5.4.4 9 9 License: GPL-2.0+ 10 10 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 76 76 77 77 == Changelog == 78 = 5.4.4 - 2026-03-17 = 79 - **Fix**: Chart data not showing due to incorrect bounds check ([PR #232](https://github.com/wp-slimstat/wp-slimstat/pull/232)) 80 - **Fix**: Weekly chart not showing today's data and not respecting start_of_week setting ([PR #235](https://github.com/wp-slimstat/wp-slimstat/pull/235)) 81 - **Improved**: Added `cpt:` prefix guidance to content type exclusion setting 82 78 83 = 5.4.3 - 2026-03-16 = 79 84 - **Fix**: Fixed fatal error on servers without the PHP calendar extension ([PR #229](https://github.com/wp-slimstat/wp-slimstat/pull/229)) -
wp-slimstat/trunk/src/Helpers/DataBuckets.php
r3483763 r3485123 196 196 } 197 197 } elseif ('WEEK' === $this->gran) { 198 $offset = date('W', $dt) - date('W', $base) + (date('Y', $dt) - date('Y', $base)) * 52; 198 // Calculate the start-of-week date for both base and dt 199 // This respects WordPress start_of_week setting instead of using ISO weeks 200 $baseWeekStart = $this->getWeekStartTimestamp($base); 201 $dtWeekStart = $this->getWeekStartTimestamp($dt); 202 203 // Calculate weeks between the two week start dates 204 $offset = (int) round(($dtWeekStart - $baseWeekStart) / (7 * 86400)); 205 199 206 if ($offset < 0) { 200 207 $offset = -1; … … 207 214 208 215 // Ensure offset is within bounds 209 if ($offset <=$this->points) {216 if ($offset >= 0 && $offset < $this->points) { 210 217 $target = 'current' === $period ? 'datasets' : 'datasetsPrev'; 211 218 if (!isset($this->{$target}['v1'][$offset])) { … … 230 237 return date($params['data_points_label'], $timestamp); 231 238 }, $labels, array_keys($labels)); 239 } 240 241 /** 242 * Get the start-of-week timestamp for a given timestamp. 243 * Respects WordPress start_of_week setting. 244 */ 245 private function getWeekStartTimestamp(int $timestamp): int 246 { 247 $startOfWeek = (int) get_option('start_of_week', 1); 248 $dayOfWeek = (int) date('w', $timestamp); // 0=Sun, 6=Sat 249 $diff = ($dayOfWeek - $startOfWeek + 7) % 7; 250 return strtotime(date('Y-m-d', strtotime("-{$diff} days", $timestamp))); 232 251 } 233 252 … … 271 290 'datasets' => $this->datasets, 272 291 'datasets_prev' => $this->datasetsPrev, 273 'today' => 'WEEK' === $this->gran && wp_date('YW', $this->end, wp_timezone()) === wp_date('YW', time(), wp_timezone()) ? str_replace("'", '', $this->labels[count($this->labels) - 1]) : wp_date($this->labelFormat, time(), wp_timezone()),292 'today' => 'WEEK' === $this->gran && $this->getWeekStartTimestamp($this->end) === $this->getWeekStartTimestamp(time()) ? str_replace("'", '', $this->labels[count($this->labels) - 1]) : wp_date($this->labelFormat, time(), wp_timezone()), 274 293 'granularity' => $this->gran, 275 294 ]; -
wp-slimstat/trunk/wp-slimstat.php
r3483763 r3485123 4 4 * Plugin URI: https://wp-slimstat.com/ 5 5 * Description: The leading web analytics plugin for WordPress 6 * Version: 5.4. 36 * Version: 5.4.4 7 7 * Author: Jason Crouse, VeronaLabs 8 8 * Text Domain: wp-slimstat … … 21 21 22 22 // Set the plugin version and directory 23 define('SLIMSTAT_ANALYTICS_VERSION', '5.4. 3');23 define('SLIMSTAT_ANALYTICS_VERSION', '5.4.4'); 24 24 define('SLIMSTAT_FILE', __FILE__); 25 25 define('SLIMSTAT_DIR', __DIR__);
Note: See TracChangeset
for help on using the changeset viewer.