Plugin Directory

Changeset 3194310


Ignore:
Timestamp:
11/21/2024 03:59:45 PM (14 months ago)
Author:
simpleanalytics
Message:

Update to version 1.28 from GitHub

Location:
simpleanalytics
Files:
2 added
8 edited
1 copied

Legend:

Unmodified
Added
Removed
  • simpleanalytics/tags/1.28/readme.txt

    r3190991 r3194310  
    55Tags: privacy-first, privacy-friendly, free analytics, website analytics, simple analytics, analytics, statistics
    66Requires at least: 5.2
    7 Tested up to: 6.7
     7Tested up to: 6.7.1
    88Requires PHP: 7.2.0
    9 Stable tag: 1.27
     9Stable tag: 1.28
    1010License: GPLv2 or later
    1111License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    7575== Changelog ==
    7676
     77= 1.28 =
     78* 2024-11-21
     79* Tested up to WordPress 6.7.1
     80* Changes:
     81* Fix invalid changelog multiline format
     82* Fix invalid changelog format
     83* Run awk instead of sed to consistently run on mac and linux
     84* Run prettier to cleanup code
     85* Remove rebase in git pull
     86* Improve release.sh script and changelog
     87* Use changelog from release script
     88* Allow regualar commits
     89* Set the checkbox default in the UI when empty
     90* Fix boolean value default retrieval
     91* Update version to support WordPress 6.7
     92
     93
    7794= 1.27 =
    7895* 2024-11-18
  • simpleanalytics/tags/1.28/src/Plugin.php

    r3151347 r3194310  
    102102
    103103                $tab->checkbox(SettingName::ENABLED, 'Enabled')
     104                    ->default(true)
    104105                    ->description('Enable or disable Simple Analytics on your website.');
    105106            })
  • simpleanalytics/tags/1.28/src/Setting.php

    r3190991 r3194310  
    2121    public static function boolean(string $key, ?bool $default = null): ?bool
    2222    {
    23         $value = get_option($key);
     23        $value = get_option($key, null);
    2424
    2525        if ($value === null || $value === '') {
  • simpleanalytics/tags/1.28/src/Settings/Blocks/Fields/Checkbox.php

    r3151347 r3194310  
    1111    use HasDocs;
    1212
     13    /**
     14     * @var bool
     15     */
     16    protected $default = false;
     17
    1318    public function getValueSanitizer(): callable
    1419    {
     
    1924    {
    2025        return 'integer';
     26    }
     27
     28    public function default(bool $value): self
     29    {
     30        $this->default = $value;
     31
     32        return $this;
    2133    }
    2234
     
    3749                    class="h-4 w-4 rounded border-gray-300 text-primary focus:ring-primary"
    3850                    <?php
    39         if (Setting::get($this->getKey())) echo 'checked';
     51        if (Setting::boolean($this->getKey(), $this->default) === true) echo 'checked';
    4052        ?>
    4153                >
  • simpleanalytics/trunk/readme.txt

    r3190991 r3194310  
    55Tags: privacy-first, privacy-friendly, free analytics, website analytics, simple analytics, analytics, statistics
    66Requires at least: 5.2
    7 Tested up to: 6.7
     7Tested up to: 6.7.1
    88Requires PHP: 7.2.0
    9 Stable tag: 1.27
     9Stable tag: 1.28
    1010License: GPLv2 or later
    1111License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    7575== Changelog ==
    7676
     77= 1.28 =
     78* 2024-11-21
     79* Tested up to WordPress 6.7.1
     80* Changes:
     81* Fix invalid changelog multiline format
     82* Fix invalid changelog format
     83* Run awk instead of sed to consistently run on mac and linux
     84* Run prettier to cleanup code
     85* Remove rebase in git pull
     86* Improve release.sh script and changelog
     87* Use changelog from release script
     88* Allow regualar commits
     89* Set the checkbox default in the UI when empty
     90* Fix boolean value default retrieval
     91* Update version to support WordPress 6.7
     92
     93
    7794= 1.27 =
    7895* 2024-11-18
  • simpleanalytics/trunk/src/Plugin.php

    r3151347 r3194310  
    102102
    103103                $tab->checkbox(SettingName::ENABLED, 'Enabled')
     104                    ->default(true)
    104105                    ->description('Enable or disable Simple Analytics on your website.');
    105106            })
  • simpleanalytics/trunk/src/Setting.php

    r3190991 r3194310  
    2121    public static function boolean(string $key, ?bool $default = null): ?bool
    2222    {
    23         $value = get_option($key);
     23        $value = get_option($key, null);
    2424
    2525        if ($value === null || $value === '') {
  • simpleanalytics/trunk/src/Settings/Blocks/Fields/Checkbox.php

    r3151347 r3194310  
    1111    use HasDocs;
    1212
     13    /**
     14     * @var bool
     15     */
     16    protected $default = false;
     17
    1318    public function getValueSanitizer(): callable
    1419    {
     
    1924    {
    2025        return 'integer';
     26    }
     27
     28    public function default(bool $value): self
     29    {
     30        $this->default = $value;
     31
     32        return $this;
    2133    }
    2234
     
    3749                    class="h-4 w-4 rounded border-gray-300 text-primary focus:ring-primary"
    3850                    <?php
    39         if (Setting::get($this->getKey())) echo 'checked';
     51        if (Setting::boolean($this->getKey(), $this->default) === true) echo 'checked';
    4052        ?>
    4153                >
Note: See TracChangeset for help on using the changeset viewer.