Plugin Directory

Changeset 3661867


Ignore:
Timestamp:
08/23/2026 01:06:00 PM (2 months ago)
Author:
saigamo
Message:

Version 1.2.1: fix digit padding so counts beyond display width are not truncated

Location:
astrowave-simple-visit-counter/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • astrowave-simple-visit-counter/trunk/astrowave-simple-visit-counter.php

    r3661854 r3661867  
    44 * Plugin URI: https://wordpress.org/plugins/astrowave-simple-visit-counter/
    55 * Description: Ultra-lightweight visitor counter. No DB, cookie dedupe, bot filter, midnight reset by WP timezone. / 超軽量アクセスカウンター。DB不要・Cookie二重カウント防止・Bot排除・夜中0時リセット(WPタイムゾーン準拠)。
    6  * Version: 1.2.0
     6 * Version: 1.2.1
    77 * Author: Saigamo
    88 * Author URI: https://astrowave.jp/
    … …  
    1717
    1818// 定数の定義
    19 define('ASTROWAVE_SIMPLE_VISIT_COUNTER_VERSION', '1.2.0');
     19define('ASTROWAVE_SIMPLE_VISIT_COUNTER_VERSION', '1.2.1');
    2020define('ASTROWAVE_SIMPLE_VISIT_COUNTER_DIR', plugin_dir_path(__FILE__));
    2121define('ASTROWAVE_SIMPLE_VISIT_COUNTER_URL', plugin_dir_url(__FILE__));
  • astrowave-simple-visit-counter/trunk/js/counter-ajax.js

    r3661854 r3661867  
    2424                    var showDaily = counter.getAttribute('data-show-daily') === '1';
    2525                   
    26                     // ゼロ埋め関数
     26                    // ゼロ埋め(桁未満のみ。桁を超えたら省略せずそのまま表示)
    2727                    function pad(num, size) {
    28                         var s = "0000000000" + num;
    29                         return s.substr(s.length - size);
     28                        var s = String(Math.abs(parseInt(num, 10) || 0));
     29                        while (s.length < size) {
     30                            s = '0' + s;
     31                        }
     32                        return s;
    3033                    }
    3134
  • astrowave-simple-visit-counter/trunk/readme.txt

    r3661854 r3661867  
    55Tested up to: 7.1
    66Requires PHP: 7.4
    7 Stable tag: 1.2.0
     7Stable tag: 1.2.1
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
    … …  
    138138== Changelog ==
    139139
     140= 1.2.1 =
     141* Fix: when yesterday/today (or total) exceeds the display digit width, show the full number instead of truncating.
     142* 修正: 昨日/今日(および合計)が表示桁を超えたとき、末尾だけ残さず全桁を表示するようにしました。
     143
    140144= 1.2.0 =
    141145* Added optional milestone popup (default OFF): celebrate when the total hits your number, with image save.
Note: See TracChangeset for help on using the changeset viewer.