Plugin Directory

Changeset 3485123


Ignore:
Timestamp:
03/17/2026 09:27:33 PM (11 days ago)
Author:
mostafa.s1990
Message:

Update to version 5.4.4 from GitHub

Location:
wp-slimstat
Files:
10 edited
1 copied

Legend:

Unmodified
Added
Removed
  • wp-slimstat/tags/5.4.4/admin/config/index.php

    r3483202 r3485123  
    592592                'title'       => __('Content Types', 'wp-slimstat'),
    593593                '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'),
    595595            ],
    596596            'wildcards_description' => ['Wildcards',
  • wp-slimstat/tags/5.4.4/languages/wp-slimstat.pot

    r3483763 r3485123  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: SlimStat Analytics 5.4.3\n"
     5"Project-Id-Version: SlimStat Analytics 5.4.4\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wp-slimstat\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2026-03-16T10:28:33+00:00\n"
     12"POT-Creation-Date: 2026-03-17T21:13:27+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1414"X-Generator: WP-CLI 2.12.0\n"
     
    778778
    779779#: 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."
     780msgid "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."
    781781msgstr ""
    782782
  • wp-slimstat/tags/5.4.4/readme.txt

    r3483763 r3485123  
    66Requires PHP: 7.4
    77Tested up to: 6.9.4
    8 Stable tag: 5.4.3
     8Stable tag: 5.4.4
    99License: GPL-2.0+
    1010License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    7676
    7777== 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
    7883= 5.4.3 - 2026-03-16 =
    7984- **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  
    196196            }
    197197        } 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
    199206            if ($offset < 0) {
    200207                $offset = -1;
     
    207214
    208215        // Ensure offset is within bounds
    209         if ($offset <= $this->points) {
     216        if ($offset >= 0 && $offset < $this->points) {
    210217            $target = 'current' === $period ? 'datasets' : 'datasetsPrev';
    211218            if (!isset($this->{$target}['v1'][$offset])) {
     
    230237            return date($params['data_points_label'], $timestamp);
    231238        }, $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)));
    232251    }
    233252
     
    271290            'datasets'      => $this->datasets,
    272291            '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()),
    274293            'granularity'   => $this->gran,
    275294        ];
  • wp-slimstat/tags/5.4.4/wp-slimstat.php

    r3483763 r3485123  
    44 * Plugin URI: https://wp-slimstat.com/
    55 * Description: The leading web analytics plugin for WordPress
    6  * Version: 5.4.3
     6 * Version: 5.4.4
    77 * Author: Jason Crouse, VeronaLabs
    88 * Text Domain: wp-slimstat
     
    2121
    2222// Set the plugin version and directory
    23 define('SLIMSTAT_ANALYTICS_VERSION', '5.4.3');
     23define('SLIMSTAT_ANALYTICS_VERSION', '5.4.4');
    2424define('SLIMSTAT_FILE', __FILE__);
    2525define('SLIMSTAT_DIR', __DIR__);
  • wp-slimstat/trunk/admin/config/index.php

    r3483202 r3485123  
    592592                'title'       => __('Content Types', 'wp-slimstat'),
    593593                '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'),
    595595            ],
    596596            'wildcards_description' => ['Wildcards',
  • wp-slimstat/trunk/languages/wp-slimstat.pot

    r3483763 r3485123  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: SlimStat Analytics 5.4.3\n"
     5"Project-Id-Version: SlimStat Analytics 5.4.4\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wp-slimstat\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2026-03-16T10:28:33+00:00\n"
     12"POT-Creation-Date: 2026-03-17T21:13:27+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1414"X-Generator: WP-CLI 2.12.0\n"
     
    778778
    779779#: 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."
     780msgid "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."
    781781msgstr ""
    782782
  • wp-slimstat/trunk/readme.txt

    r3483763 r3485123  
    66Requires PHP: 7.4
    77Tested up to: 6.9.4
    8 Stable tag: 5.4.3
     8Stable tag: 5.4.4
    99License: GPL-2.0+
    1010License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    7676
    7777== 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
    7883= 5.4.3 - 2026-03-16 =
    7984- **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  
    196196            }
    197197        } 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
    199206            if ($offset < 0) {
    200207                $offset = -1;
     
    207214
    208215        // Ensure offset is within bounds
    209         if ($offset <= $this->points) {
     216        if ($offset >= 0 && $offset < $this->points) {
    210217            $target = 'current' === $period ? 'datasets' : 'datasetsPrev';
    211218            if (!isset($this->{$target}['v1'][$offset])) {
     
    230237            return date($params['data_points_label'], $timestamp);
    231238        }, $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)));
    232251    }
    233252
     
    271290            'datasets'      => $this->datasets,
    272291            '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()),
    274293            'granularity'   => $this->gran,
    275294        ];
  • wp-slimstat/trunk/wp-slimstat.php

    r3483763 r3485123  
    44 * Plugin URI: https://wp-slimstat.com/
    55 * Description: The leading web analytics plugin for WordPress
    6  * Version: 5.4.3
     6 * Version: 5.4.4
    77 * Author: Jason Crouse, VeronaLabs
    88 * Text Domain: wp-slimstat
     
    2121
    2222// Set the plugin version and directory
    23 define('SLIMSTAT_ANALYTICS_VERSION', '5.4.3');
     23define('SLIMSTAT_ANALYTICS_VERSION', '5.4.4');
    2424define('SLIMSTAT_FILE', __FILE__);
    2525define('SLIMSTAT_DIR', __DIR__);
Note: See TracChangeset for help on using the changeset viewer.