wp-media / wp-rocket

Performance optimization plugin for WordPress
https://wp-rocket.me
GNU General Public License v2.0
700 stars 218 forks source link

PHP Notice: Undefined index: host when exclude Defer JS domain name while Minify JS is enabled #4466

Closed Mai-Saad closed 3 years ago

Mai-Saad commented 3 years ago

Before submitting an issue please check that you’ve completed the following steps:

Describe the bug PHP Notice is added in debug.log when excluding domain name or file name from Defer JS while Minify JS is enabled

To Reproduce Steps to reproduce the behavior: 1.Add the following script in footer <script type='text/javascript' src='widget.trustpilot.com/bootstrap/v5/tp.widget.bootstrap.min.js?ver=5'></script>

  1. Enable Minify JS and Defer JS
  2. Exclude from Defer JS widget.trustpilot.com
  3. Clear cache
  4. Open the page containing this script
  5. Check debug.log PHP Notice: Undefined index: host in /var/www/new.rocketlabsqa.ovh/htdocs/wp-content/plugins/wp-rocket/inc/Engine/Optimization/AssetsLocalCache.php on line 112

Expected behavior No notice is added to debug.log

Backlog Grooming (for WP Media dev team use only)

remyperona commented 3 years ago

I was able to reproduce the issue with just minify JS enabled