PluginProbe
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance / 4.7.0
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance v4.7.0
4.7.0 4.6.1 4.6.0 4.5.5 4.5.4 4.5.3 4.5.2 3.2.20 3.2.21 3.2.22 3.2.3 3.2.5 3.2.6 3.2.7 3.2.9 3.3.0 3.3.1 3.3.2 3.4.0 3.4.1 3.4.2 3.5.0 3.6.0 3.7.0 3.7.1 All 111 releases
← All changes | minify/class-wp-optimize-minify-front-end.php +13 -4 4.5.2 → 4.7.0 View file →
@@ -792,9 +792,9 @@
792 792 }
793 793 $inline_css_hash = md5(implode('', $inline_css_group));
794 794 $hash = hash('adler32', $handle_str . $inline_css_hash . $last_modified_str);
795 795 } else {
796 - $hash = $handle_str . $last_modified_str;
796 + $hash = sanitize_file_name($handle_str . $last_modified_str);
797 797 }
798 798
799 799 // static cache file info
800 800 $file_name = 'wpo-minify-header-'.$hash.($minify_css ? '.min' : '');
@@ -1068,9 +1068,9 @@
1068 1068 if ($merge_js) {
1069 1069 // Change the hash based on last modified timestamp
1070 1070 $hash = hash('adler32', $handles_str . $last_modified_str);
1071 1071 } else {
1072 - $hash = $handles_str . $last_modified_str;
1072 + $hash = sanitize_file_name($handles_str . $last_modified_str);
1073 1073 }
1074 1074
1075 1075 // static cache file info
1076 1076 $file_name = 'wpo-minify-footer-'.$hash.($minify_js ? '.min' : '');
@@ -1424,9 +1424,9 @@
1424 1424
1425 1425 if ($merge_js) {
1426 1426 $hash = hash('adler32', $handles_str . $last_modified_str);
1427 1427 } else {
1428 - $hash = $handles_str . $last_modified_str;
1428 + $hash = sanitize_file_name($handles_str . $last_modified_str);
1429 1429 }
1430 1430
1431 1431 // static cache file info
1432 1432 $file_name = 'wpo-minify-header-'.$hash.($minify_js ? '.min' : '');
@@ -1888,9 +1888,9 @@
1888 1888 }
1889 1889 $inline_css_hash = md5(implode('', $inline_css_group));
1890 1890 $hash = hash('adler32', $handles_str . $inline_css_hash . $last_modified_str);
1891 1891 } else {
1892 - $hash = $handles_str . $last_modified_str;
1892 + $hash = sanitize_file_name($handles_str . $last_modified_str);
1893 1893 }
1894 1894
1895 1895 // static cache file info
1896 1896 $file_name = 'wpo-minify-footer-'.$hash.($minify_css ? '.min' : '');
@@ -2066,8 +2066,17 @@
2066 2066 if ("module" !== $script['type']) continue;
2067 2067
2068 2068 $href = WP_Optimize_Minify_Functions::get_hurl($script['url']);
2069 2069 if (WP_Optimize_Minify_Functions::is_minified_css_js_filename($href)) continue;
2070 +
2071 + $asset_content = WP_Optimize_Minify_Functions::get_asset_content($href);
2072 + $code = $asset_content['content'];
2073 +
2074 +
2075 + if (WP_Optimize_Minify_Functions::has_js_import_statements($code)) {
2076 + // If the module script contains import statements, we cannot safely minify or cache it, so skip it.
2077 + continue;
2078 + }
2070 2079
2071 2080 $last_modified = WP_Optimize_Minify_Functions::get_modification_time($script['url']);
2072 2081 $handle = $script['handle'];
2073 2082 $version = $script['version'];