Title: HTML Dom Parser Error
Last modified: September 19, 2024

---

# HTML Dom Parser Error

 *  Resolved [Stefano](https://wordpress.org/support/users/stefacchio/)
 * (@stefacchio)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/html-dom-parser-error/)
 * Hi,
 * if I enable **Optimize HTML via Dom ParserImproves HTML minification efficiency**
   option I get this PHP error on frontend:
 * `**Fatal error**: Uncaught TypeError: Cannot assign null to property DOMElement::
   $id of type string in /var/www/vhosts/stefanofattori.it/httpdocs/wp-content/plugins/
   powered-cache/includes/classes/Dependencies/voku/helper/AbstractSimpleHtmlDom.
   php:174 Stack trace: #0 /var/www/vhosts/stefanofattori.it/httpdocs/wp-content/
   plugins/powered-cache/includes/classes/Dependencies/voku/helper/HtmlMinDomObserverOptimizeAttributes.
   php(146): PoweredCache\Dependencies\voku\helper\AbstractSimpleHtmlDom->__set()#
   1 /var/www/vhosts/stefanofattori.it/httpdocs/wp-content/plugins/powered-cache/
   includes/classes/Dependencies/voku/helper/HtmlMin.php(1688): PoweredCache\Dependencies\
   voku\helper\HtmlMinDomObserverOptimizeAttributes->domElementAfterMinification()#
   2 /var/www/vhosts/stefanofattori.it/httpdocs/wp-content/plugins/powered-cache/
   includes/classes/Dependencies/voku/helper/HtmlMin.php(1667): PoweredCache\Dependencies\
   voku\helper\HtmlMin->notifyObserversAboutDomElementAfterMinification() #3 /var/
   www/vhosts/stefanofattori.it/httpdocs/wp-content/plugins/powered-cache/includes/
   classes/Dependencies/voku/helper/HtmlMin.php(1370): PoweredCache\Dependencies\
   voku\helper\HtmlMin->minifyHtmlDom() #4 /var/www/vhosts/stefanofattori.it/httpdocs/
   wp-content/plugins/powered-cache/includes/classes/FileOptimizer.php(301): PoweredCache\
   Dependencies\voku\helper\HtmlMin->minify() #5 /var/www/vhosts/stefanofattori.
   it/httpdocs/wp-content/plugins/powered-cache/includes/classes/FileOptimizer.php(
   191): PoweredCache\FileOptimizer->maybe_minify_html() #6 [internal function]:
   PoweredCache\FileOptimizer->process_buffer() #7 /var/www/vhosts/stefanofattori.
   it/httpdocs/wp-includes/functions.php(5427): ob_end_flush() #8 /var/www/vhosts/
   stefanofattori.it/httpdocs/wp-includes/class-wp-hook.php(324): wp_ob_end_flush_all()#
   9 /var/www/vhosts/stefanofattori.it/httpdocs/wp-includes/class-wp-hook.php(348):
   WP_Hook->apply_filters() #10 /var/www/vhosts/stefanofattori.it/httpdocs/wp-includes/
   plugin.php(517): WP_Hook->do_action() #11 /var/www/vhosts/stefanofattori.it/httpdocs/
   wp-includes/load.php(1280): do_action() #12 [internal function]: shutdown_action_hook()#
   13 {main} thrown in`
 * I use a VPS with plesk, NGINX
 * Server webnginx/1.26.1
   PHP8.3.11 (supporta valori a 64bit)PHP SAPI fpm-fcgiVersione
   di cURL7.88.1 OpenSSL/3.0.14WordPress 6.6.2

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

 *  Plugin Author [Mustafa Uysal](https://wordpress.org/support/users/m_uysl/)
 * (@m_uysl)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/html-dom-parser-error/#post-18026218)
 * hi [@stefacchio](https://wordpress.org/support/users/stefacchio/),
 * Thanks for your report! It looks like there’s a compatibility issue with a package
   we’re using for HTML minification ([https://github.com/voku/HtmlMin/issues/93](https://github.com/voku/HtmlMin/issues/93)).
   As a temporary workaround, you can either downgrade your PHP version to 8.2 or
   disable the HTML minification feature for now.
 *  Thread Starter [Stefano](https://wordpress.org/support/users/stefacchio/)
 * (@stefacchio)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/html-dom-parser-error/#post-18026445)
 * Hi [@m_uysl](https://wordpress.org/support/users/m_uysl/) thank you for your 
   fast reply!
 * Ok for the moment I’ll disable the feature, do you know when will be an update
   for fix the issue?
   What exactly does disabling this option change?
 *  Plugin Author [Mustafa Uysal](https://wordpress.org/support/users/m_uysl/)
 * (@m_uysl)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/html-dom-parser-error/#post-18026457)
 * > Ok for the moment I’ll disable the feature, do you know when will be an update
   > for fix the issue?
 * I can’t give an ETA for now, but I will try to update the dependency once it 
   is fixed.
 * > What exactly does disabling this option change?
 * That option determines whether HtmlDomParser is being used for HTML minification
   or not.
 * Generally, if your server supports compression methods like gzip or Brotli, the
   impact of HTML minification on performance is minimal, you can completely turn
   of that feature.
    -  This reply was modified 1 year, 8 months ago by [Mustafa Uysal](https://wordpress.org/support/users/m_uysl/).
 *  Plugin Author [Mustafa Uysal](https://wordpress.org/support/users/m_uysl/)
 * (@m_uysl)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/html-dom-parser-error/#post-18047909)
 * hi [@stefacchio](https://wordpress.org/support/users/stefacchio/),
 * I’ve released a new update and I think this problem has been fixed with the new
   version. Could you give it a try?
 * (marking as resolved for now, feel free to update this thread)
 *  Thread Starter [Stefano](https://wordpress.org/support/users/stefacchio/)
 * (@stefacchio)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/html-dom-parser-error/#post-18049022)
 * Hi [@m_uysl](https://wordpress.org/support/users/m_uysl/) it seems to work perfectly!
   Thanks!
 * Can I ask a last question?
 * I found another problem… often when I click ‘UPDATE ALL SETTINGS AND CLEAR ALL
   CACHE’ the settings are saved but the cache is not emptied, I have to force the
   emptying of the cache in the top bar of wordpress. Also could you add all the
   cache emptying buttons that are in the WP bar also in a section of the plugin
   page? Not everyone has the WP bar.
   Thanks
 *  Plugin Author [Mustafa Uysal](https://wordpress.org/support/users/m_uysl/)
 * (@m_uysl)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/html-dom-parser-error/#post-18049042)
 * hey [@stefacchio](https://wordpress.org/support/users/stefacchio/),
 * > often when I click ‘UPDATE ALL SETTINGS AND CLEAR ALL CACHE’ the settings are
   > saved but the cache is not emptied
 * That button works similarly to the admin bar purge. If your website holds too
   many cached pages, it can take some time. If you have enabled async purging, 
   it can lead to a delay in purging operations.
 * Please check the size of cache folder before/after you click on the button.
 * > Also could you add all the cache emptying buttons that are in the WP bar also
   > in a section of the plugin page? Not everyone has the WP bar.
 * `Update settings and clear all cache` button is enough for that.
 *  Thread Starter [Stefano](https://wordpress.org/support/users/stefacchio/)
 * (@stefacchio)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/html-dom-parser-error/#post-18049093)
 * [@m_uysl](https://wordpress.org/support/users/m_uysl/) ok great! Thank you!

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

The topic ‘HTML Dom Parser Error’ is closed to new replies.

 * ![](https://ps.w.org/powered-cache/assets/icon.svg?rev=2796939)
 * [Powered Cache – Caching and Optimization for WordPress – Easily Improve PageSpeed & Web Vitals Score](https://wordpress.org/plugins/powered-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/powered-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/powered-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/powered-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/powered-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/powered-cache/reviews/)

## Tags

 * [php-error](https://wordpress.org/support/topic-tag/php-error/)

 * 7 replies
 * 2 participants
 * Last reply from: [Stefano](https://wordpress.org/support/users/stefacchio/)
 * Last activity: [1 year, 8 months ago](https://wordpress.org/support/topic/html-dom-parser-error/#post-18049093)
 * Status: resolved