Title: Invalid css minification
Last modified: January 18, 2023

---

# Invalid css minification

 *  Resolved [Tofandel](https://wordpress.org/support/users/tofandel/)
 * (@tofandel)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/invalid-css-minification/)
 * The css minification doesn’t work correctly with special selectors
 *     ```wp-block-code
       input[type="radio"]:checked + img {
           border: 5px solid #0083ca;
       }
       ```
   
 * The previous code will minify to
 *     ```wp-block-code
       input[type="radio"]:checked img{
       border: 5px solid #0083ca
       }
       ```
   
 * As you can see the `+` has been dropped making this a completely different selector
   
   Obviously checking “Disable CSS Files Minification” is a way to avoid it, but
   then the plugin has little purpose

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

 *  Thread Starter [Tofandel](https://wordpress.org/support/users/tofandel/)
 * (@tofandel)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/invalid-css-minification/#post-16385026)
 * Also completely unrelated, I was reading the source to locate the error, and 
   there is an error in common.php
 *     ```wp-block-code
       $purge_savvii = new \Savvii\CacheFlusherPlugin();
       		if ( method_exists( $plugin, 'domainflush' ) ) {
       			$purge_savvii->domainflush();
       			return __( 'A cache purge request has been sent to <strong>Savvii</strong>', 'fast-velocity-minify' );
       		}
       ```
   
 * `$plugin` in method_exists should be `$purge_savvi`
 *  Thread Starter [Tofandel](https://wordpress.org/support/users/tofandel/)
 * (@tofandel)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/invalid-css-minification/#post-16385065)
 * And on line 1022 there is an undefined variable `$tvers`
   Line 1487 there is an
   undefined variable `$cache_method`
 *  Thread Starter [Tofandel](https://wordpress.org/support/users/tofandel/)
 * (@tofandel)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/invalid-css-minification/#post-16385234)
 * I have located the issue to the `fvm_ensure_utf8` function
   It’s an issue with
   php8.1+ only[https://onlinephp.io?s=ZZFvS8MwEMZfr9DvcHaDtTjZQISxWnznJ9BXIiVLrmuwTUr-DIf43b00rlMWEkjufnmey-XxaWiHNJkDKusNgmuZA-uMVAeQFrxrtrM0abziTmoFzbGvI1mHVL4gtICvNJktUHGooN_XAh1yRxjXgmRGZhUSnbSXsM2LFTjjsSjp9pGZWvh-yIPMGJEN5FGzqqBhncUi2MwMOm9UjJSwXgPXvhOgtINoDGcHor8BCYNJ64a0steX57ttFqs-y1F1XKsjmqu6f_EVxMqi40iiAKfHDl2c_mqG-yPPOoNMnCaUFs05vUF2tPn3ojShdJosuLXUzaVUg3dv7jRglRkmpM7ed7xF_kHmtyD7Q3AEGnttBJodPAyfYHUnBcw3m-09Z0FxWU6KVx9I4dBv5K2GcKD9Dw%2C%2C&v=8.2.1%2C8.1.14%2C8.0.27](https://onlinephp.io?s=ZZFvS8MwEMZfr9DvcHaDtTjZQISxWnznJ9BXIiVLrmuwTUr-DIf43b00rlMWEkjufnmey-XxaWiHNJkDKusNgmuZA-uMVAeQFrxrtrM0abziTmoFzbGvI1mHVL4gtICvNJktUHGooN_XAh1yRxjXgmRGZhUSnbSXsM2LFTjjsSjp9pGZWvh-yIPMGJEN5FGzqqBhncUi2MwMOm9UjJSwXgPXvhOgtINoDGcHor8BCYNJ64a0steX57ttFqs-y1F1XKsjmqu6f_EVxMqi40iiAKfHDl2c_mqG-yPPOoNMnCaUFs05vUF2tPn3ojShdJosuLXUzaVUg3dv7jRglRkmpM7ed7xF_kHmtyD7Q3AEGnttBJodPAyfYHUnBcw3m-09Z0FxWU6KVx9I4dBv5K2GcKD9Dw%2C%2C&v=8.2.1%2C8.1.14%2C8.0.27)
    -  This reply was modified 3 years, 2 months ago by [Tofandel](https://wordpress.org/support/users/tofandel/).
 *  Thread Starter [Tofandel](https://wordpress.org/support/users/tofandel/)
 * (@tofandel)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/invalid-css-minification/#post-16385341)
 * [https://github.com/php/php-src/issues/10192](https://github.com/php/php-src/issues/10192)
   
   Maybe we can remove UTF-7 from the mb_list_encodings() as a workaround
    -  This reply was modified 3 years, 2 months ago by [Tofandel](https://wordpress.org/support/users/tofandel/).
 *  Thread Starter [Tofandel](https://wordpress.org/support/users/tofandel/)
 * (@tofandel)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/invalid-css-minification/#post-16385437)
 * Like this:
   `$enc = mb_detect_encoding($str, array_filter(mb_list_encodings(),
   function($enc) { return strpos($enc, "UTF-7") !== 0; }), true);`Tested that it
   fixes the issue
 *  [davidtrebacz](https://wordpress.org/support/users/davidtrebacz/)
 * (@davidtrebacz)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/invalid-css-minification/#post-16387652)
 * I think I’m experiencing the same issues. On the front end font awesome icons
   are rendered as strange symbols. If I disable the plug in or “Disable CSS Files
   Minification _[ Will disable CSS Files minification for compatibility purposes]_”
   the icons render properly. I also running on php 8.1. Can you give me a little
   more context on what file and line to make the mb_detect_encoding change?
 *  [davidtrebacz](https://wordpress.org/support/users/davidtrebacz/)
 * (@davidtrebacz)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/invalid-css-minification/#post-16387662)
 * I can confirm moving back to php version 8.0.12. Eliminates the issue. Not a 
   good solution either.
 *  Plugin Author [Raul P.](https://wordpress.org/support/users/alignak/)
 * (@alignak)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/invalid-css-minification/#post-16395620)
 * Thank you very much for reporting, I will get them sorted asap for the next update.
 *  Plugin Author [Raul P.](https://wordpress.org/support/users/alignak/)
 * (@alignak)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/invalid-css-minification/#post-16395666)
 * please check 3.3.9, thanks
 *  [davidtrebacz](https://wordpress.org/support/users/davidtrebacz/)
 * (@davidtrebacz)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/invalid-css-minification/#post-16396096)
 * Working great on 3.3.9 with php 8.1.0. Thanks for the fix and quick turn around…
   Great plug in!
 *  [davidtrebacz](https://wordpress.org/support/users/davidtrebacz/)
 * (@davidtrebacz)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/invalid-css-minification/page/2/#post-16683678)
 * Seems to be “back” in version Version 3.4.0 with php 8.1.17. Checking “_disable
   CSS Files minification for compatibility purposes_” and clearing caches gets 
   this working again.

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

The topic ‘Invalid css minification’ is closed to new replies.

 * ![](https://ps.w.org/fast-velocity-minify/assets/icon-128x128.jpg?rev=1440946)
 * [Fast Velocity Minify](https://wordpress.org/plugins/fast-velocity-minify/)
 * [Support Threads](https://wordpress.org/support/plugin/fast-velocity-minify/)
 * [Active Topics](https://wordpress.org/support/plugin/fast-velocity-minify/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/fast-velocity-minify/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/fast-velocity-minify/reviews/)

 * 16 replies
 * 3 participants
 * Last reply from: [davidtrebacz](https://wordpress.org/support/users/davidtrebacz/)
 * Last activity: [2 years, 11 months ago](https://wordpress.org/support/topic/invalid-css-minification/page/2/#post-16683678)
 * Status: resolved