You should not be putting the minified files in the exclude from processing, only the un-minifed files should be added to stop them being minified.
Thread Starter
avong
(@avong)
Disregard the minified and un-minified references.
The issue is related to the scripts being excluded are removing the version attribute as defined in “wp_register_script” or “wp_enqueue_script” and “wp_register_style” or “wp_enqueue_style” WP functions.
Example:
wp_enqueue_script( 'some_js', '/path/to/foo.js',array(), '1.0.0');
This should output the HTML (without WP-Optimize minify enabled)
<script type="text/javascript" src="https:/example.com/wp-content/themes/example-theme/js/foo.js?ver=1.0.0" id="some_js"></script>
But when ‘wp-content/themes/’ is set as one of exclusion paths under WP-Optimize Minify, the “?ver=1.0.0” at the end is removed:
<script type="text/javascript" src="https:/example.com/wp-content/themes/example-theme/js/foo.js" id="some_js"></script>
I have checked this on one of my sites, you only kept the version bit (?ver=1.0.0) on minified scripts
Thread Starter
avong
(@avong)
That’s right. The minified scripts and css is fine, but scripts and css files on WP Optimize Exclusion list isn’t.
So any JS and CSS on WP Optimize exclusion lists should be left as is and (?ver=1.0.0) should be kept as is and not being removed . This is very important and hope your developers can resolve this asap.
The files added to the exclusion list should not have the ver=1.0.0 on the end as they are not minifed (you only get this on files that have been minified)
If your file has this on the end, it has already been minified and thus there is no point in excluding it.
Thread Starter
avong
(@avong)
Sorry, I think you’re still not understanding the issue.
What I’m referring to is anything in the exclusion list should not be manipulated by WP Optimize. Therefore, when a theme or a plugin enqueue’s a JS or CSS file via standard WP function, the SRC (JS) or HREF (CSS) should not be modified in any form or any string being stripped out.
Can you please take a bit more time to understand the issue raised and perhaps refer this to someone more technical/senior in the team to understand/resolve the issue?
I will check with my colleague and get back to you
We have created an internal ticket to investigate this further
Thread Starter
avong
(@avong)
Any updates from internal ticket?
Hi,
I am afraid there is no update at the moment. It is in our to do list. My advice would be to check the change log when an update becomes available.