Changeset 3276172
- Timestamp:
- 04/17/2025 07:47:23 PM (4 weeks ago)
- Location:
- notifications-for-collapsed-admin-menu
- Files:
- 6 edited
- 1 copied
- tags/1.7 (copied) (copied from notifications-for-collapsed-admin-menu/trunk)
- tags/1.7/CHANGELOG.md (modified) (1 diff)
- tags/1.7/notifications-for-collapsed-admin-menu.php (modified) (7 diffs)
- tags/1.7/readme.txt (modified) (4 diffs)
- trunk/CHANGELOG.md (modified) (1 diff)
- trunk/notifications-for-collapsed-admin-menu.php (modified) (7 diffs)
- trunk/readme.txt (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
notifications-for-collapsed-admin-menu/tags/1.7/CHANGELOG.md
r3141889 r3276172 1 1 # Changelog 2 3 ## 1.7 _(2025-04-17)_ 4 * Hardening: Escape filtered and translated data before output 5 * Change: Discontinue unnecessary explicit loading of textdomain 6 * Change: Build string via concatenation rather than using HEREDOC syntax 7 * Change: Note compatibility through WP 6.8+ 8 * Change: Note compatibility through PHP 8.3+ 9 * Change: Update copyright date (2025) 10 * Unit tests: 11 * Change: Explicitly define return type for overridden method 12 * Change: Use `expectException()` instead of `@expectedException` comment (for PHPUnit 9 support) 2 13 3 14 ## 1.6.2 _(2024-08-21)_ notifications-for-collapsed-admin-menu/tags/1.7/notifications-for-collapsed-admin-menu.php
r3141889 r3276172 2 2 /** 3 3 * Plugin Name: Notifications for Collapsed Admin Menu 4 * Version: 1. 6.24 * Version: 1.7 5 5 * Plugin URI: https://coffee2code.com/wp-plugins/notifications-for-collapsed-admin-menu/ 6 6 * Author: Scott Reilly … … 11 11 * Description: Highlights the comments and plugins icons in the collapsed admin sidebar menu when notifications are pending. 12 12 * 13 * Compatible with WordPress 4.6 through 6. 6+.13 * Compatible with WordPress 4.6 through 6.8+, and PHP through at least 8.3+. 14 14 * 15 15 * =>> Read the accompanying readme.txt file for instructions and documentation. … … 19 19 * @package Notifications_for_Collapsed_Admin_Menu 20 20 * @author Scott Reilly 21 * @version 1. 6.221 * @version 1.7 22 22 */ 23 23 24 24 /* 25 Copyright (c) 2010-202 4by Scott Reilly (aka coffee2code)25 Copyright (c) 2010-2025 by Scott Reilly (aka coffee2code) 26 26 27 27 This program is free software; you can redistribute it and/or … … 61 61 public function __wakeup() { 62 62 /* translators: %s: Name of plugin class. */ 63 throw new Error( sprintf( __( '%s cannot be unserialized.', 'notifications-for-collapsed-admin-menu' ), __CLASS__) );63 throw new Error( esc_html( sprintf( __( '%s cannot be unserialized.', 'notifications-for-collapsed-admin-menu' ), __CLASS__ ) ) ); 64 64 } 65 65 … … 70 70 */ 71 71 public static function version() { 72 return '1. 6.2';72 return '1.7'; 73 73 } 74 74 … … 77 77 */ 78 78 public static function init() { 79 if ( is_admin() ) {80 // Load textdomain.81 load_plugin_textdomain( 'notifications-for-collapsed-admin-menu' );82 }83 84 79 // Register hooks. 85 80 add_action( 'admin_enqueue_scripts', array( __CLASS__, 'add_css' ) ); … … 128 123 */ 129 124 public static function add_css() { 130 $color = self::get_bg_color();125 $color = wp_strip_all_tags( self::get_bg_color() ); 131 126 132 echo <<<HTML 133 <style> 134 .folded #adminmenu li.collapsed-with-pending { 135 background-color:$color; 136 border-left-color:$color; 137 border-right-color:$color; 138 } 139 </style> 127 $output = '<style> 128 .folded #adminmenu li.collapsed-with-pending { 129 background-color:%s; 130 border-left-color:%s; 131 border-right-color:%s; 132 } 133 </style>' . "\n"; 140 134 141 HTML; 135 printf( 136 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Output is known to contain hardcoded HTML. 137 $output, 138 esc_html( $color ), 139 esc_html( $color ), 140 esc_html( $color ) 141 ); 142 142 } 143 143 notifications-for-collapsed-admin-menu/tags/1.7/readme.txt
r3141889 r3276172 6 6 License URI: https://www.gnu.org/licenses/gpl-2.0.html 7 7 Requires at least: 4.6 8 Tested up to: 6. 69 Stable tag: 1. 6.28 Tested up to: 6.8 9 Stable tag: 1.7 10 10 11 11 Highlights the comments and plugins icons in the collapsed admin sidebar menu when notifications are pending. … … 59 59 ` 60 60 61 = Does this plugin include unit tests? =61 = Does this plugin have unit tests? = 62 62 63 63 Yes. The tests are not packaged in the release .zip file or included in plugins.svn.wordpress.org, but can be found in the [plugin's repository](https://.com/coffee2code/notifications-for-collapsed-admin-menu/). … … 70 70 71 71 == Changelog == 72 73 = 1.7 (2025-04-17) = 74 * Hardening: Escape filtered and translated data before output 75 * Change: Discontinue unnecessary explicit loading of textdomain 76 * Change: Build string via concatenation rather than using HEREDOC syntax 77 * Change: Note compatibility through WP 6.8+ 78 * Change: Note compatibility through PHP 8.3+ 79 * Change: Update copyright date (2025) 80 * Unit tests: 81 * Change: Explicitly define return type for overridden method 82 * Change: Use `expectException()` instead of `@expectedException` comment (for PHPUnit 9 support) 72 83 73 84 = 1.6.2 (2024-08-21) = … … 90 101 * Change: Prevent PHP warnings due to missing core-related generated files 91 102 92 = 1.6 (2021-10-22) =93 Highlights:94 95 This minor release adds support for other menu items that may have a count indicator, prevents potential JS errors, notes compatibility through WP 5.8+, and minor reorganization and tweaks to unit tests.96 97 Details:98 99 * New: Add support for other menu items that borrow the plugin count indicator markup for their own count indicator100 * Fix: Change `__wakeup()` method visibility from `private` to `public` to avoid warnings under PHP8101 * Fix: Throw an error when attempting to unserialize an instance of the class to actually prevent it from happening102 * Change: Prevent potential JavaScript errors103 * Change: Amend FAQ to also suggest and explain use of Add Admin CSS plugin to customize highlight color as an alternative to setting color via filter104 * Change: Tweak installation instruction105 * Change: Note compatibility through WP 5.8+106 * Change: Reduce the number of plugin tags in readme.txt107 * Change: Restructure unit test file structure108 * Change: Restructure unit test directories109 * Change: Move `phpunit/` into `tests/phpunit/`110 * Change: Move `phpunit/bin/` into `tests/`111 * Change: Remove 'test-' prefix from unit test file112 * Change: In bootstrap, store path to plugin file constant113 * Change: In bootstrap, add backcompat for PHPUnit pre-v6.0114 * New: Add a few more possible TODO items115 116 103 _Full changelog is available in [CHANGELOG.md](https://.com/coffee2code/notifications-for-collapsed-admin-menu/blob/master/CHANGELOG.md)._ 117 104 118 105 119 106 == Upgrade Notice == 107 108 = 1.7 = 109 Minor update: ensured translated strings don't contain unintended markup, discontinued explicit loading of textdomain, noted compatibility through WP 6.8+ and PHP 8.3+, and updated copyright date (2025). 120 110 121 111 = 1.6.2 = notifications-for-collapsed-admin-menu/trunk/CHANGELOG.md
r3141889 r3276172 1 1 # Changelog 2 3 ## 1.7 _(2025-04-17)_ 4 * Hardening: Escape filtered and translated data before output 5 * Change: Discontinue unnecessary explicit loading of textdomain 6 * Change: Build string via concatenation rather than using HEREDOC syntax 7 * Change: Note compatibility through WP 6.8+ 8 * Change: Note compatibility through PHP 8.3+ 9 * Change: Update copyright date (2025) 10 * Unit tests: 11 * Change: Explicitly define return type for overridden method 12 * Change: Use `expectException()` instead of `@expectedException` comment (for PHPUnit 9 support) 2 13 3 14 ## 1.6.2 _(2024-08-21)_ notifications-for-collapsed-admin-menu/trunk/notifications-for-collapsed-admin-menu.php
r3141889 r3276172 2 2 /** 3 3 * Plugin Name: Notifications for Collapsed Admin Menu 4 * Version: 1. 6.24 * Version: 1.7 5 5 * Plugin URI: https://coffee2code.com/wp-plugins/notifications-for-collapsed-admin-menu/ 6 6 * Author: Scott Reilly … … 11 11 * Description: Highlights the comments and plugins icons in the collapsed admin sidebar menu when notifications are pending. 12 12 * 13 * Compatible with WordPress 4.6 through 6. 6+.13 * Compatible with WordPress 4.6 through 6.8+, and PHP through at least 8.3+. 14 14 * 15 15 * =>> Read the accompanying readme.txt file for instructions and documentation. … … 19 19 * @package Notifications_for_Collapsed_Admin_Menu 20 20 * @author Scott Reilly 21 * @version 1. 6.221 * @version 1.7 22 22 */ 23 23 24 24 /* 25 Copyright (c) 2010-202 4by Scott Reilly (aka coffee2code)25 Copyright (c) 2010-2025 by Scott Reilly (aka coffee2code) 26 26 27 27 This program is free software; you can redistribute it and/or … … 61 61 public function __wakeup() { 62 62 /* translators: %s: Name of plugin class. */ 63 throw new Error( sprintf( __( '%s cannot be unserialized.', 'notifications-for-collapsed-admin-menu' ), __CLASS__) );63 throw new Error( esc_html( sprintf( __( '%s cannot be unserialized.', 'notifications-for-collapsed-admin-menu' ), __CLASS__ ) ) ); 64 64 } 65 65 … … 70 70 */ 71 71 public static function version() { 72 return '1. 6.2';72 return '1.7'; 73 73 } 74 74 … … 77 77 */ 78 78 public static function init() { 79 if ( is_admin() ) {80 // Load textdomain.81 load_plugin_textdomain( 'notifications-for-collapsed-admin-menu' );82 }83 84 79 // Register hooks. 85 80 add_action( 'admin_enqueue_scripts', array( __CLASS__, 'add_css' ) ); … … 128 123 */ 129 124 public static function add_css() { 130 $color = self::get_bg_color();125 $color = wp_strip_all_tags( self::get_bg_color() ); 131 126 132 echo <<<HTML 133 <style> 134 .folded #adminmenu li.collapsed-with-pending { 135 background-color:$color; 136 border-left-color:$color; 137 border-right-color:$color; 138 } 139 </style> 127 $output = '<style> 128 .folded #adminmenu li.collapsed-with-pending { 129 background-color:%s; 130 border-left-color:%s; 131 border-right-color:%s; 132 } 133 </style>' . "\n"; 140 134 141 HTML; 135 printf( 136 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Output is known to contain hardcoded HTML. 137 $output, 138 esc_html( $color ), 139 esc_html( $color ), 140 esc_html( $color ) 141 ); 142 142 } 143 143 notifications-for-collapsed-admin-menu/trunk/readme.txt
r3141889 r3276172 6 6 License URI: https://www.gnu.org/licenses/gpl-2.0.html 7 7 Requires at least: 4.6 8 Tested up to: 6. 69 Stable tag: 1. 6.28 Tested up to: 6.8 9 Stable tag: 1.7 10 10 11 11 Highlights the comments and plugins icons in the collapsed admin sidebar menu when notifications are pending. … … 59 59 ` 60 60 61 = Does this plugin include unit tests? =61 = Does this plugin have unit tests? = 62 62 63 63 Yes. The tests are not packaged in the release .zip file or included in plugins.svn.wordpress.org, but can be found in the [plugin's repository](https://.com/coffee2code/notifications-for-collapsed-admin-menu/). … … 70 70 71 71 == Changelog == 72 73 = 1.7 (2025-04-17) = 74 * Hardening: Escape filtered and translated data before output 75 * Change: Discontinue unnecessary explicit loading of textdomain 76 * Change: Build string via concatenation rather than using HEREDOC syntax 77 * Change: Note compatibility through WP 6.8+ 78 * Change: Note compatibility through PHP 8.3+ 79 * Change: Update copyright date (2025) 80 * Unit tests: 81 * Change: Explicitly define return type for overridden method 82 * Change: Use `expectException()` instead of `@expectedException` comment (for PHPUnit 9 support) 72 83 73 84 = 1.6.2 (2024-08-21) = … … 90 101 * Change: Prevent PHP warnings due to missing core-related generated files 91 102 92 = 1.6 (2021-10-22) =93 Highlights:94 95 This minor release adds support for other menu items that may have a count indicator, prevents potential JS errors, notes compatibility through WP 5.8+, and minor reorganization and tweaks to unit tests.96 97 Details:98 99 * New: Add support for other menu items that borrow the plugin count indicator markup for their own count indicator100 * Fix: Change `__wakeup()` method visibility from `private` to `public` to avoid warnings under PHP8101 * Fix: Throw an error when attempting to unserialize an instance of the class to actually prevent it from happening102 * Change: Prevent potential JavaScript errors103 * Change: Amend FAQ to also suggest and explain use of Add Admin CSS plugin to customize highlight color as an alternative to setting color via filter104 * Change: Tweak installation instruction105 * Change: Note compatibility through WP 5.8+106 * Change: Reduce the number of plugin tags in readme.txt107 * Change: Restructure unit test file structure108 * Change: Restructure unit test directories109 * Change: Move `phpunit/` into `tests/phpunit/`110 * Change: Move `phpunit/bin/` into `tests/`111 * Change: Remove 'test-' prefix from unit test file112 * Change: In bootstrap, store path to plugin file constant113 * Change: In bootstrap, add backcompat for PHPUnit pre-v6.0114 * New: Add a few more possible TODO items115 116 103 _Full changelog is available in [CHANGELOG.md](https://.com/coffee2code/notifications-for-collapsed-admin-menu/blob/master/CHANGELOG.md)._ 117 104 118 105 119 106 == Upgrade Notice == 107 108 = 1.7 = 109 Minor update: ensured translated strings don't contain unintended markup, discontinued explicit loading of textdomain, noted compatibility through WP 6.8+ and PHP 8.3+, and updated copyright date (2025). 120 110 121 111 = 1.6.2 =
Note: See TracChangeset for help on using the changeset viewer.