Changeset 3194310
- Timestamp:
- 11/21/2024 03:59:45 PM (14 months ago)
- Location:
- simpleanalytics
- Files:
-
- 2 added
- 8 edited
- 1 copied
-
tags/1.28 (copied) (copied from simpleanalytics/trunk)
-
tags/1.28/.prettierrc.json (added)
-
tags/1.28/readme.txt (modified) (2 diffs)
-
tags/1.28/src/Plugin.php (modified) (1 diff)
-
tags/1.28/src/Setting.php (modified) (1 diff)
-
tags/1.28/src/Settings/Blocks/Fields/Checkbox.php (modified) (3 diffs)
-
trunk/.prettierrc.json (added)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/src/Plugin.php (modified) (1 diff)
-
trunk/src/Setting.php (modified) (1 diff)
-
trunk/src/Settings/Blocks/Fields/Checkbox.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
simpleanalytics/tags/1.28/readme.txt
r3190991 r3194310 5 5 Tags: privacy-first, privacy-friendly, free analytics, website analytics, simple analytics, analytics, statistics 6 6 Requires at least: 5.2 7 Tested up to: 6.7 7 Tested up to: 6.7.1 8 8 Requires PHP: 7.2.0 9 Stable tag: 1.2 79 Stable tag: 1.28 10 10 License: GPLv2 or later 11 11 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 75 75 == Changelog == 76 76 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 77 94 = 1.27 = 78 95 * 2024-11-18 -
simpleanalytics/tags/1.28/src/Plugin.php
r3151347 r3194310 102 102 103 103 $tab->checkbox(SettingName::ENABLED, 'Enabled') 104 ->default(true) 104 105 ->description('Enable or disable Simple Analytics on your website.'); 105 106 }) -
simpleanalytics/tags/1.28/src/Setting.php
r3190991 r3194310 21 21 public static function boolean(string $key, ?bool $default = null): ?bool 22 22 { 23 $value = get_option($key );23 $value = get_option($key, null); 24 24 25 25 if ($value === null || $value === '') { -
simpleanalytics/tags/1.28/src/Settings/Blocks/Fields/Checkbox.php
r3151347 r3194310 11 11 use HasDocs; 12 12 13 /** 14 * @var bool 15 */ 16 protected $default = false; 17 13 18 public function getValueSanitizer(): callable 14 19 { … … 19 24 { 20 25 return 'integer'; 26 } 27 28 public function default(bool $value): self 29 { 30 $this->default = $value; 31 32 return $this; 21 33 } 22 34 … … 37 49 class="h-4 w-4 rounded border-gray-300 text-primary focus:ring-primary" 38 50 <?php 39 if (Setting:: get($this->getKey())) echo 'checked';51 if (Setting::boolean($this->getKey(), $this->default) === true) echo 'checked'; 40 52 ?> 41 53 > -
simpleanalytics/trunk/readme.txt
r3190991 r3194310 5 5 Tags: privacy-first, privacy-friendly, free analytics, website analytics, simple analytics, analytics, statistics 6 6 Requires at least: 5.2 7 Tested up to: 6.7 7 Tested up to: 6.7.1 8 8 Requires PHP: 7.2.0 9 Stable tag: 1.2 79 Stable tag: 1.28 10 10 License: GPLv2 or later 11 11 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 75 75 == Changelog == 76 76 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 77 94 = 1.27 = 78 95 * 2024-11-18 -
simpleanalytics/trunk/src/Plugin.php
r3151347 r3194310 102 102 103 103 $tab->checkbox(SettingName::ENABLED, 'Enabled') 104 ->default(true) 104 105 ->description('Enable or disable Simple Analytics on your website.'); 105 106 }) -
simpleanalytics/trunk/src/Setting.php
r3190991 r3194310 21 21 public static function boolean(string $key, ?bool $default = null): ?bool 22 22 { 23 $value = get_option($key );23 $value = get_option($key, null); 24 24 25 25 if ($value === null || $value === '') { -
simpleanalytics/trunk/src/Settings/Blocks/Fields/Checkbox.php
r3151347 r3194310 11 11 use HasDocs; 12 12 13 /** 14 * @var bool 15 */ 16 protected $default = false; 17 13 18 public function getValueSanitizer(): callable 14 19 { … … 19 24 { 20 25 return 'integer'; 26 } 27 28 public function default(bool $value): self 29 { 30 $this->default = $value; 31 32 return $this; 21 33 } 22 34 … … 37 49 class="h-4 w-4 rounded border-gray-300 text-primary focus:ring-primary" 38 50 <?php 39 if (Setting:: get($this->getKey())) echo 'checked';51 if (Setting::boolean($this->getKey(), $this->default) === true) echo 'checked'; 40 52 ?> 41 53 >
Note: See TracChangeset
for help on using the changeset viewer.