Plugin Directory

Changeset 3414766


Ignore:
Timestamp:
12/08/2025 10:40:07 PM (4 months ago)
Author:
coffee2code
Message:

Release v2.5.1:

Highlights:

A bugfix release to address the overzealous encoding of some valid CSS characters introduced in v2.5.

Details:

  • Fix: Escape only the minimum of characters so that valid CSS characters don't get escaped. Props kevinvanrijn.
  • Change: Note compatibility through WP 6.9+
Location:
add-admin-css
Files:
6 edited
1 copied

Legend:

Unmodified
Added
Removed
  • add-admin-css/tags/2.5.1/CHANGELOG.md

    r3284556 r3414766  
    11# Changelog
     2
     3## 2.5.1 _(2025-12-02)_
     4
     5### Highlights:
     6
     7A bugfix release to address the overzealous encoding of some valid CSS characters introduced in v2.5.
     8
     9### Details:
     10
     11* Fix: Escape only the minimum of characters so that valid CSS characters don't get escaped. Props kevinvanrijn.
     12* New: Add `.gitattributes` file to exclude files from Github packaging. Props kevinvanrijn.
     13* Change: Note compatibility through WP 6.9+
    214
    315## 2.5 _(2025-03-29)_
  • add-admin-css/tags/2.5.1/add-admin-css.php

    r3284556 r3414766  
    22/**
    33 * Plugin Name: Add Admin CSS
    4  * Version:     2.5
     4 * Version:     2.5.1
    55 * Plugin URI:  https://coffee2code.com/wp-plugins/add-admin-css/
    66 * Author:      Scott Reilly
     
    1111 * Description: Easily define additional CSS (inline and/or by URL) to be added to all administration pages.
    1212 *
    13  * Compatible with WordPress 5.5+ through 6.8+, and PHP through at least 8.3+.
     13 * Compatible with WordPress 5.5+ through 6.9+, and PHP through at least 8.3+.
    1414 *
    1515 * =>> Read the accompanying readme.txt file for instructions and documentation.
     
    1919 * @package Add_Admin_CSS
    2020 * @author  Scott Reilly
    21  * @version 2.5
     21 * @version 2.5.1
    2222 **/
    2323
     
    104104     */
    105105    protected function __construct() {
    106         parent::__construct( '2.5', 'add-admin-css', 'c2c', __FILE__, array( 'settings_page' => 'themes' ) );
     106        parent::__construct( '2.5.1', 'add-admin-css', 'c2c', __FILE__, array( 'settings_page' => 'themes' ) );
    107107        register_activation_hook( __FILE__, array( __CLASS__, 'activation' ) );
    108108
     
    619619         * @since 1.0
    620620         *
    621          * @param string $files CSS code (without `<style>` tag).
     621         * @param string $files CSS styles (without `<style>` tag).
    622622         */
    623623        $css = trim( apply_filters( 'c2c_add_admin_css', $css ) );
    624624
    625         if ( $css ) {
     625        if ( $css && is_string( $css ) ) {
     626            // Encode '<' to prevent tag injection.
     627            $sanitized_css = str_replace( '<', '&lt;', wp_check_invalid_utf8( $css ) );
     628            // Allow use of '<' in comparators.
     629            $sanitized_css = str_replace( '&lt; ', '< ', $sanitized_css );
     630            $sanitized_css = str_replace( '&lt;= ', '<= ', $sanitized_css );
     631
    626632            echo "<style>\n";
    627             echo esc_html( $css ) . "\n";
     633            // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Sanitized above.
     634            echo $sanitized_css . "\n";
    628635            echo "</style>\n";
    629636        }
  • add-admin-css/tags/2.5.1/readme.txt

    r3284556 r3414766  
    66License URI: https://www.gnu.org/licenses/gpl-2.0.html
    77Requires at least: 5.5
    8 Tested up to: 6.8
    9 Stable tag: 2.5
     8Tested up to: 6.9
     9Stable tag: 2.5.1
    1010
    1111Easily define additional CSS (inline and/or by URL) to be added to all administration pages.
     
    9494
    9595== Changelog ==
     96
     97= 2.5.1 (2025-12-02) =
     98Highlights:
     99
     100A bugfix release to address the overzealous encoding of some valid CSS characters introduced in v2.5.
     101
     102Details:
     103
     104* Fix: Escape only the minimum of characters so that valid CSS characters don't get escaped. Props kevinvanrijn.
     105* Change: Note compatibility through WP 6.9+
    96106
    97107= 2.5 (2025-03-29) =
     
    186196* New: Add new string (from plugin framework) for translation
    187197
    188 = 2.0 (2021-05-12) =
    189 
    190 Highlights:
    191 
    192 This recommended minor release updates the plugin framework, restructures unit test files, notes compatibility through 5.7+, and incorporates numerous minor behind-the-scenes tweaks.
    193 
    194 Details:
    195 
    196 * Change: Outright support HTML5 rather than check for theme support of HTML5, since that isn't relevant to admin
    197 * Change: Update plugin framework to 062
    198     * 062:
    199     * Change: Update `is_plugin_admin_page()` to use `get_current_screen()` when available
    200     * Change: Actually prevent object cloning and unserialization by throwing an error
    201     * Change: Check that there is a current screen before attempting to access its property
    202     * Change: Remove 'type' attribute from `style` tag
    203     * Change: Incorporate commonly defined styling for inline_textarea
    204     * 061:
    205     * Fix bug preventing settings from getting saved
    206     * 060:
    207     * Rename class from `c2c_{PluginName}_Plugin_051` to `c2c_Plugin_060`
    208     * Move string translation handling into inheriting class making the plugin framework code plugin-agnostic
    209         * Add abstract function `get_c2c_string()` as a getter for translated strings
    210         * Replace all existing string usage with calls to `get_c2c_string()`
    211     * Handle WordPress's deprecation of the use of the term "whitelist"
    212         * Change: Rename `whitelist_options()` to `allowed_options()`
    213         * Change: Use `add_allowed_options()` instead of deprecated `add_option_whitelist()` for WP 5.5+
    214         * Change: Hook `allowed_options` filter instead of deprecated `whitelist_options` for WP 5.5+
    215     * New: Add initial unit tests (currently just covering `is_wp_version_cmp()` and `get_c2c_string()`)
    216     * Add `is_wp_version_cmp()` as a utility to compare current WP version against a given WP version
    217     * Refactor `contextual_help()` to be easier to read, and correct function docblocks
    218     * Don't translate urlencoded donation email body text
    219     * Add inline comments for translators to clarify purpose of placeholders
    220     * Change PHP package name (make it singular)
    221     * Tweak inline function description
    222     * Note compatibility through WP 5.7+
    223     * Update copyright date (2021)
    224     * 051:
    225     * Allow setting integer input value to include commas
    226     * Use `number_format_i18n()` to format integer value within input field
    227     * Update link to coffee2code.com to be HTTPS
    228     * Update `readme_url()` to refer to plugin's readme.txt on plugins.svn.wordpress.org
    229     * Remove defunct line of code
    230 * Change: Use plugin framework's `is_plugin_admin_page()` instead of reinventing it
    231 * New: Add a recommendation for Add Admin JavaScript plugin to settings page
    232 * Change: Output the multiple tips on the settings page as a list instead of multiple paragraphs
    233 * Change: Prevent appending newline to value of setting passed to filter unless an actual value was configured
    234 * Change: Move translation of all parent class strings into main plugin file
    235 * Change: Tweak conditional checks to be more succinct
    236 * Change: Ensure there's a current screen before attempting to get one of its properties
    237 * Change: Omit inline styles for settings now that plugin framework defines them
    238 * Change: Output newlines after paragraph tags in settings page
    239 * Change: Note compatibility through WP 5.7+
    240 * Change: Update copyright date (2021)
    241 * Change: Change plugin's short description
    242 * Change: Tweak some readme.txt documentation
    243 * Change: Tweak some inline function and parameter documentation
    244 * Unit tests:
    245     * New: Add tests for JS files getting registered and enqueued
    246     * New: Add tests for `add_codemirror()`
    247     * New: Add help function `get_css_files()`
    248     * Change: Restructure unit test directories and files into `tests/` top-level directory
    249     * Change: Remove 'test-' prefix from unit test files
    250     * Change: In bootstrap, store path to plugin file constant so its value can be used within that file and in test file
    251 
    252198_Full changelog is available in [CHANGELOG.md](https://github.com/coffee2code/add-admin-css/blob/master/CHANGELOG.md)._
    253199
    254200
    255201== Upgrade Notice ==
     202
     203= 2.5.1 =
     204Recommended bugfix update: Addressed the overzealous encoding of some valid CSS characters introduced in v2.5 and noted compatibility through WP 6.9+.
    256205
    257206= 2.5 =
  • add-admin-css/trunk/CHANGELOG.md

    r3284556 r3414766  
    11# Changelog
     2
     3## 2.5.1 _(2025-12-02)_
     4
     5### Highlights:
     6
     7A bugfix release to address the overzealous encoding of some valid CSS characters introduced in v2.5.
     8
     9### Details:
     10
     11* Fix: Escape only the minimum of characters so that valid CSS characters don't get escaped. Props kevinvanrijn.
     12* New: Add `.gitattributes` file to exclude files from Github packaging. Props kevinvanrijn.
     13* Change: Note compatibility through WP 6.9+
    214
    315## 2.5 _(2025-03-29)_
  • add-admin-css/trunk/add-admin-css.php

    r3284556 r3414766  
    22/**
    33 * Plugin Name: Add Admin CSS
    4  * Version:     2.5
     4 * Version:     2.5.1
    55 * Plugin URI:  https://coffee2code.com/wp-plugins/add-admin-css/
    66 * Author:      Scott Reilly
     
    1111 * Description: Easily define additional CSS (inline and/or by URL) to be added to all administration pages.
    1212 *
    13  * Compatible with WordPress 5.5+ through 6.8+, and PHP through at least 8.3+.
     13 * Compatible with WordPress 5.5+ through 6.9+, and PHP through at least 8.3+.
    1414 *
    1515 * =>> Read the accompanying readme.txt file for instructions and documentation.
     
    1919 * @package Add_Admin_CSS
    2020 * @author  Scott Reilly
    21  * @version 2.5
     21 * @version 2.5.1
    2222 **/
    2323
     
    104104     */
    105105    protected function __construct() {
    106         parent::__construct( '2.5', 'add-admin-css', 'c2c', __FILE__, array( 'settings_page' => 'themes' ) );
     106        parent::__construct( '2.5.1', 'add-admin-css', 'c2c', __FILE__, array( 'settings_page' => 'themes' ) );
    107107        register_activation_hook( __FILE__, array( __CLASS__, 'activation' ) );
    108108
     
    619619         * @since 1.0
    620620         *
    621          * @param string $files CSS code (without `<style>` tag).
     621         * @param string $files CSS styles (without `<style>` tag).
    622622         */
    623623        $css = trim( apply_filters( 'c2c_add_admin_css', $css ) );
    624624
    625         if ( $css ) {
     625        if ( $css && is_string( $css ) ) {
     626            // Encode '<' to prevent tag injection.
     627            $sanitized_css = str_replace( '<', '&lt;', wp_check_invalid_utf8( $css ) );
     628            // Allow use of '<' in comparators.
     629            $sanitized_css = str_replace( '&lt; ', '< ', $sanitized_css );
     630            $sanitized_css = str_replace( '&lt;= ', '<= ', $sanitized_css );
     631
    626632            echo "<style>\n";
    627             echo esc_html( $css ) . "\n";
     633            // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Sanitized above.
     634            echo $sanitized_css . "\n";
    628635            echo "</style>\n";
    629636        }
  • add-admin-css/trunk/readme.txt

    r3284556 r3414766  
    66License URI: https://www.gnu.org/licenses/gpl-2.0.html
    77Requires at least: 5.5
    8 Tested up to: 6.8
    9 Stable tag: 2.5
     8Tested up to: 6.9
     9Stable tag: 2.5.1
    1010
    1111Easily define additional CSS (inline and/or by URL) to be added to all administration pages.
     
    9494
    9595== Changelog ==
     96
     97= 2.5.1 (2025-12-02) =
     98Highlights:
     99
     100A bugfix release to address the overzealous encoding of some valid CSS characters introduced in v2.5.
     101
     102Details:
     103
     104* Fix: Escape only the minimum of characters so that valid CSS characters don't get escaped. Props kevinvanrijn.
     105* Change: Note compatibility through WP 6.9+
    96106
    97107= 2.5 (2025-03-29) =
     
    186196* New: Add new string (from plugin framework) for translation
    187197
    188 = 2.0 (2021-05-12) =
    189 
    190 Highlights:
    191 
    192 This recommended minor release updates the plugin framework, restructures unit test files, notes compatibility through 5.7+, and incorporates numerous minor behind-the-scenes tweaks.
    193 
    194 Details:
    195 
    196 * Change: Outright support HTML5 rather than check for theme support of HTML5, since that isn't relevant to admin
    197 * Change: Update plugin framework to 062
    198     * 062:
    199     * Change: Update `is_plugin_admin_page()` to use `get_current_screen()` when available
    200     * Change: Actually prevent object cloning and unserialization by throwing an error
    201     * Change: Check that there is a current screen before attempting to access its property
    202     * Change: Remove 'type' attribute from `style` tag
    203     * Change: Incorporate commonly defined styling for inline_textarea
    204     * 061:
    205     * Fix bug preventing settings from getting saved
    206     * 060:
    207     * Rename class from `c2c_{PluginName}_Plugin_051` to `c2c_Plugin_060`
    208     * Move string translation handling into inheriting class making the plugin framework code plugin-agnostic
    209         * Add abstract function `get_c2c_string()` as a getter for translated strings
    210         * Replace all existing string usage with calls to `get_c2c_string()`
    211     * Handle WordPress's deprecation of the use of the term "whitelist"
    212         * Change: Rename `whitelist_options()` to `allowed_options()`
    213         * Change: Use `add_allowed_options()` instead of deprecated `add_option_whitelist()` for WP 5.5+
    214         * Change: Hook `allowed_options` filter instead of deprecated `whitelist_options` for WP 5.5+
    215     * New: Add initial unit tests (currently just covering `is_wp_version_cmp()` and `get_c2c_string()`)
    216     * Add `is_wp_version_cmp()` as a utility to compare current WP version against a given WP version
    217     * Refactor `contextual_help()` to be easier to read, and correct function docblocks
    218     * Don't translate urlencoded donation email body text
    219     * Add inline comments for translators to clarify purpose of placeholders
    220     * Change PHP package name (make it singular)
    221     * Tweak inline function description
    222     * Note compatibility through WP 5.7+
    223     * Update copyright date (2021)
    224     * 051:
    225     * Allow setting integer input value to include commas
    226     * Use `number_format_i18n()` to format integer value within input field
    227     * Update link to coffee2code.com to be HTTPS
    228     * Update `readme_url()` to refer to plugin's readme.txt on plugins.svn.wordpress.org
    229     * Remove defunct line of code
    230 * Change: Use plugin framework's `is_plugin_admin_page()` instead of reinventing it
    231 * New: Add a recommendation for Add Admin JavaScript plugin to settings page
    232 * Change: Output the multiple tips on the settings page as a list instead of multiple paragraphs
    233 * Change: Prevent appending newline to value of setting passed to filter unless an actual value was configured
    234 * Change: Move translation of all parent class strings into main plugin file
    235 * Change: Tweak conditional checks to be more succinct
    236 * Change: Ensure there's a current screen before attempting to get one of its properties
    237 * Change: Omit inline styles for settings now that plugin framework defines them
    238 * Change: Output newlines after paragraph tags in settings page
    239 * Change: Note compatibility through WP 5.7+
    240 * Change: Update copyright date (2021)
    241 * Change: Change plugin's short description
    242 * Change: Tweak some readme.txt documentation
    243 * Change: Tweak some inline function and parameter documentation
    244 * Unit tests:
    245     * New: Add tests for JS files getting registered and enqueued
    246     * New: Add tests for `add_codemirror()`
    247     * New: Add help function `get_css_files()`
    248     * Change: Restructure unit test directories and files into `tests/` top-level directory
    249     * Change: Remove 'test-' prefix from unit test files
    250     * Change: In bootstrap, store path to plugin file constant so its value can be used within that file and in test file
    251 
    252198_Full changelog is available in [CHANGELOG.md](https://github.com/coffee2code/add-admin-css/blob/master/CHANGELOG.md)._
    253199
    254200
    255201== Upgrade Notice ==
     202
     203= 2.5.1 =
     204Recommended bugfix update: Addressed the overzealous encoding of some valid CSS characters introduced in v2.5 and noted compatibility through WP 6.9+.
    256205
    257206= 2.5 =
Note: See TracChangeset for help on using the changeset viewer.