Plugin Directory

Changeset 3276172


Ignore:
Timestamp:
04/17/2025 07:47:23 PM (4 weeks ago)
Author:
coffee2code
Message:

Release v1.7:

  • Hardening: Escape filtered and translated data before output
  • Change: Discontinue unnecessary explicit loading of textdomain
  • Change: Build string via concatenation rather than using HEREDOC syntax
  • Change: Note compatibility through WP 6.8+
  • Change: Note compatibility through PHP 8.3+
  • Change: Update copyright date (2025)
  • Unit tests:
    • Change: Explicitly define return type for overridden method
    • Change: Use expectException() instead of @expectedException comment (for PHPUnit 9 support)
Location:
notifications-for-collapsed-admin-menu
Files:
6 edited
1 copied

Legend:

Unmodified
Added
Removed
  • notifications-for-collapsed-admin-menu/tags/1.7/CHANGELOG.md

    r3141889r3276172 
    11# 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)
    213
    314## 1.6.2 _(2024-08-21)_
  • notifications-for-collapsed-admin-menu/tags/1.7/notifications-for-collapsed-admin-menu.php

    r3141889r3276172 
    22/**
    33 * Plugin Name: Notifications for Collapsed Admin Menu
    4  * Version:     1.6.2
     4 * Version:     1.7
    55 * Plugin URI:  https://coffee2code.com/wp-plugins/notifications-for-collapsed-admin-menu/
    66 * Author:      Scott Reilly
     
    1111 * Description: Highlights the comments and plugins icons in the collapsed admin sidebar menu when notifications are pending.
    1212 *
    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+.
    1414 *
    1515 * =>> Read the accompanying readme.txt file for instructions and documentation.
     
    1919 * @package Notifications_for_Collapsed_Admin_Menu
    2020 * @author  Scott Reilly
    21  * @version 1.6.2
     21 * @version 1.7
    2222 */
    2323
    2424/*
    25     Copyright (c) 2010-2024 by Scott Reilly (aka coffee2code)
     25    Copyright (c) 2010-2025 by Scott Reilly (aka coffee2code)
    2626
    2727    This program is free software; you can redistribute it and/or
     
    6161    public function __wakeup() {
    6262        /* 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__ ) ) );
    6464    }
    6565
     
    7070     */
    7171    public static function version() {
    72         return '1.6.2';
     72        return '1.7';
    7373    }
    7474
     
    7777     */
    7878    public static function init() {
    79         if ( is_admin() ) {
    80             // Load textdomain.
    81             load_plugin_textdomain( 'notifications-for-collapsed-admin-menu' );
    82         }
    83 
    8479        // Register hooks.
    8580        add_action( 'admin_enqueue_scripts', array( __CLASS__, 'add_css' ) );
     
    128123     */
    129124    public static function add_css() {
    130         $color = self::get_bg_color();
     125        $color = wp_strip_all_tags( self::get_bg_color() );
    131126
    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";
    140134
    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        );
    142142    }
    143143
  • notifications-for-collapsed-admin-menu/tags/1.7/readme.txt

    r3141889r3276172 
    66License URI: https://www.gnu.org/licenses/gpl-2.0.html
    77Requires at least: 4.6
    8 Tested up to: 6.6
    9 Stable tag: 1.6.2
     8Tested up to: 6.8
     9Stable tag: 1.7
    1010
    1111Highlights the comments and plugins icons in the collapsed admin sidebar menu when notifications are pending.
     
    5959`
    6060
    61 = Does this plugin include unit tests? =
     61= Does this plugin have unit tests? =
    6262
    6363Yes. 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/).
     
    7070
    7171== 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)
    7283
    7384= 1.6.2 (2024-08-21) =
     
    90101    * Change: Prevent PHP warnings due to missing core-related generated files
    91102
    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 indicator
    100 * Fix: Change `__wakeup()` method visibility from `private` to `public` to avoid warnings under PHP8
    101 * Fix: Throw an error when attempting to unserialize an instance of the class to actually prevent it from happening
    102 * Change: Prevent potential JavaScript errors
    103 * 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 filter
    104 * Change: Tweak installation instruction
    105 * Change: Note compatibility through WP 5.8+
    106 * Change: Reduce the number of plugin tags in readme.txt
    107 * Change: Restructure unit test file structure
    108     * Change: Restructure unit test directories
    109         * Change: Move `phpunit/` into `tests/phpunit/`
    110         * Change: Move `phpunit/bin/` into `tests/`
    111     * Change: Remove 'test-' prefix from unit test file
    112     * Change: In bootstrap, store path to plugin file constant
    113     * Change: In bootstrap, add backcompat for PHPUnit pre-v6.0
    114 * New: Add a few more possible TODO items
    115 
    116103_Full changelog is available in [CHANGELOG.md](https://.com/coffee2code/notifications-for-collapsed-admin-menu/blob/master/CHANGELOG.md)._
    117104
    118105
    119106== Upgrade Notice ==
     107
     108= 1.7 =
     109Minor 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).
    120110
    121111= 1.6.2 =
  • notifications-for-collapsed-admin-menu/trunk/CHANGELOG.md

    r3141889r3276172 
    11# 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)
    213
    314## 1.6.2 _(2024-08-21)_
  • notifications-for-collapsed-admin-menu/trunk/notifications-for-collapsed-admin-menu.php

    r3141889r3276172 
    22/**
    33 * Plugin Name: Notifications for Collapsed Admin Menu
    4  * Version:     1.6.2
     4 * Version:     1.7
    55 * Plugin URI:  https://coffee2code.com/wp-plugins/notifications-for-collapsed-admin-menu/
    66 * Author:      Scott Reilly
     
    1111 * Description: Highlights the comments and plugins icons in the collapsed admin sidebar menu when notifications are pending.
    1212 *
    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+.
    1414 *
    1515 * =>> Read the accompanying readme.txt file for instructions and documentation.
     
    1919 * @package Notifications_for_Collapsed_Admin_Menu
    2020 * @author  Scott Reilly
    21  * @version 1.6.2
     21 * @version 1.7
    2222 */
    2323
    2424/*
    25     Copyright (c) 2010-2024 by Scott Reilly (aka coffee2code)
     25    Copyright (c) 2010-2025 by Scott Reilly (aka coffee2code)
    2626
    2727    This program is free software; you can redistribute it and/or
     
    6161    public function __wakeup() {
    6262        /* 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__ ) ) );
    6464    }
    6565
     
    7070     */
    7171    public static function version() {
    72         return '1.6.2';
     72        return '1.7';
    7373    }
    7474
     
    7777     */
    7878    public static function init() {
    79         if ( is_admin() ) {
    80             // Load textdomain.
    81             load_plugin_textdomain( 'notifications-for-collapsed-admin-menu' );
    82         }
    83 
    8479        // Register hooks.
    8580        add_action( 'admin_enqueue_scripts', array( __CLASS__, 'add_css' ) );
     
    128123     */
    129124    public static function add_css() {
    130         $color = self::get_bg_color();
     125        $color = wp_strip_all_tags( self::get_bg_color() );
    131126
    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";
    140134
    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        );
    142142    }
    143143
  • notifications-for-collapsed-admin-menu/trunk/readme.txt

    r3141889r3276172 
    66License URI: https://www.gnu.org/licenses/gpl-2.0.html
    77Requires at least: 4.6
    8 Tested up to: 6.6
    9 Stable tag: 1.6.2
     8Tested up to: 6.8
     9Stable tag: 1.7
    1010
    1111Highlights the comments and plugins icons in the collapsed admin sidebar menu when notifications are pending.
     
    5959`
    6060
    61 = Does this plugin include unit tests? =
     61= Does this plugin have unit tests? =
    6262
    6363Yes. 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/).
     
    7070
    7171== 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)
    7283
    7384= 1.6.2 (2024-08-21) =
     
    90101    * Change: Prevent PHP warnings due to missing core-related generated files
    91102
    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 indicator
    100 * Fix: Change `__wakeup()` method visibility from `private` to `public` to avoid warnings under PHP8
    101 * Fix: Throw an error when attempting to unserialize an instance of the class to actually prevent it from happening
    102 * Change: Prevent potential JavaScript errors
    103 * 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 filter
    104 * Change: Tweak installation instruction
    105 * Change: Note compatibility through WP 5.8+
    106 * Change: Reduce the number of plugin tags in readme.txt
    107 * Change: Restructure unit test file structure
    108     * Change: Restructure unit test directories
    109         * Change: Move `phpunit/` into `tests/phpunit/`
    110         * Change: Move `phpunit/bin/` into `tests/`
    111     * Change: Remove 'test-' prefix from unit test file
    112     * Change: In bootstrap, store path to plugin file constant
    113     * Change: In bootstrap, add backcompat for PHPUnit pre-v6.0
    114 * New: Add a few more possible TODO items
    115 
    116103_Full changelog is available in [CHANGELOG.md](https://.com/coffee2code/notifications-for-collapsed-admin-menu/blob/master/CHANGELOG.md)._
    117104
    118105
    119106== Upgrade Notice ==
     107
     108= 1.7 =
     109Minor 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).
    120110
    121111= 1.6.2 =
Note: See TracChangeset for help on using the changeset viewer.