Title: csstidy warning
Last modified: June 5, 2024

---

# csstidy warning

 *  Resolved [nikkers](https://wordpress.org/support/users/nikkers/)
 * (@nikkers)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/csstidy-warning/)
 * Great plugin! Any suggestion on how address this?
 * Warning: Trying to access array offset on value of type int in /www/wp-content/
   plugins/bm-custom-login/csstidy/class.csstidy_optimise.php on line 599
 * Version 2.3.2 on WordPress 6.5.3 (yes ahead of **Compatible up to:** 6.5.0)
    -  This topic was modified 2 years, 4 months ago by [nikkers](https://wordpress.org/support/users/nikkers/).
      Reason: more complete info

Viewing 5 replies - 1 through 5 (of 5 total)

 *  [zecompadre](https://wordpress.org/support/users/zecompadre/)
 * (@zecompadre)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/csstidy-warning/#post-17958115)
 * Trying to access array offset on value of type int
   /wp-content/plugins/bm-custom-
   login/csstidy/class.csstidy_optimise.php — line 599/wp-content/plugins/bm-custom-
   login/csstidy/class.csstidy_optimise.php — line 88/wp-content/plugins/bm-custom-
   login/csstidy/class.csstidy.php — line 934/wp-content/plugins/bm-custom-login/
   bm-custom-login.php — line 241/wp-content/plugins/bm-custom-login/bm-custom-login.
   php — line 208/wp-includes/class-wp-hook.php — line 324/wp-includes/class-wp-
   hook.php — line 348/wp-includes/plugin.php — line 517/wp-login.php — line 127/
   wp-login.php — line 1482
    -  This reply was modified 2 years, 1 month ago by [zecompadre](https://wordpress.org/support/users/zecompadre/).
 *  [zecompadre](https://wordpress.org/support/users/zecompadre/)
 * (@zecompadre)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/csstidy-warning/#post-17958117)
 * Trying to access array offset on value of type int
   /wp-content/plugins/bm-custom-
   login/csstidy/class.csstidy_optimise.php — line 599/wp-content/plugins/bm-custom-
   login/csstidy/class.csstidy_optimise.php — line 88/wp-content/plugins/bm-custom-
   login/csstidy/class.csstidy.php — line 934/wp-content/plugins/bm-custom-login/
   bm-custom-login.php — line 241/wp-content/plugins/bm-custom-login/bm-custom-login.
   php — line 208/wp-includes/class-wp-hook.php — line 324/wp-includes/class-wp-
   hook.php — line 348/wp-includes/plugin.php — line 517/wp-login.php — line 127/
   wp-login.php — line 1482
 *  Thread Starter [nikkers](https://wordpress.org/support/users/nikkers/)
 * (@nikkers)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/csstidy-warning/#post-17973762)
 * PHP error in the `csstidy` library, which is used by the `BM Custom Login` plugin
   to parse and optimize CSS code. The error occurs on line 599 of the `class.csstidy_optimise.
   php` file, where the code is trying to access an array offset on a value of type`
   int`. 
   I am NOT a developer but used AI to update the `merge_4value_shorthands`
   function and so far the errors are gone.
 *  [zecompadre](https://wordpress.org/support/users/zecompadre/)
 * (@zecompadre)
 * [2 years ago](https://wordpress.org/support/topic/csstidy-warning/#post-18056894)
 * FIX:
 *     ```wp-block-code
       static function merge_4value_shorthands($array) {    $return = $array;    $shorthands = &$GLOBALS['csstidy']['shorthands'];    foreach ($shorthands as $key => $value) {        // Check if $value is an array and has at least 4 elements        if (is_array($value) && count($value) >= 4) {            if (isset($array[$value[0]]) && isset($array[$value[1]]) &&                 isset($array[$value[2]]) && isset($array[$value[3]]) && $value !== 0) {                                $return[$key] = '';                $important = '';                for ($i = 0; $i < 4; $i++) {                    $val = $array[$value[$i]];                    if (csstidy::is_important($val)) {                        $important = '!important';                        $return[$key] .= csstidy::gvw_important($val) . ' ';                    } else {                        $return[$key] .= $val . ' ';                    }                    unset($return[$value[$i]]);                }                $return[$key] = csstidy_optimise::shorthand(trim($return[$key] . $important));            }        }    }    return $return;}
       ```
   
 *  Plugin Author [Teydea Studio](https://wordpress.org/support/users/teydeastudio/)
 * (@teydeastudio)
 * [1 year, 12 months ago](https://wordpress.org/support/topic/csstidy-warning/#post-18077731)
 * Hi [@nikkers](https://wordpress.org/support/users/nikkers/) and [@zecompadre](https://wordpress.org/support/users/zecompadre/),
 * thank you for reporting the issue. We just released the new version of this plugin,
   where CSSTidy library is entirely removed – please update the plugin to version
   2.4.0 to get rid of these PHP warnings.
 * Details: instead of CSSTidy library, we used the same CSS sanitization approach
   as WordPress core uses for CSS defined in customizer or theme.json – that means,
   it’s up to the user to provide valid CSS, and it’s up to us to ensure its stored
   and rendered securely. With this context, we decided that CSSTidy library is 
   a bit too heavy for this simple use case, hence the removal.
 * Hope that makes sense!
    -  This reply was modified 1 year, 12 months ago by [Teydea Studio](https://wordpress.org/support/users/teydeastudio/).

Viewing 5 replies - 1 through 5 (of 5 total)

 The topic ‘csstidy warning’ is closed to new replies.

 * ![](https://ps.w.org/bm-custom-login/assets/icon.svg?rev=3669568)
 * [Teydea Login Customizer - Custom Login Page, Branding & Styling](https://wordpress.org/plugins/bm-custom-login/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/bm-custom-login/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/bm-custom-login/)
 * [Active Topics](https://wordpress.org/support/plugin/bm-custom-login/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/bm-custom-login/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/bm-custom-login/reviews/)

 * 5 replies
 * 3 participants
 * Last reply from: [Teydea Studio](https://wordpress.org/support/users/teydeastudio/)
 * Last activity: [1 year, 12 months ago](https://wordpress.org/support/topic/csstidy-warning/#post-18077731)
 * Status: resolved