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-functions.php +11 -0 4.5.2 → 4.7.0 View file →
@@ -355,8 +355,19 @@
355 355 return self::minify_js_string($js, true);
356 356 }
357 357
358 358 /**
359 + * Check if the JS code contains import statements
360 + *
361 + * @param string $js
362 + * @return boolean
363 + */
364 + public static function has_js_import_statements($js) {
365 + $js = preg_replace('/\/\/.*|\/\*[\s\S]*?\*\//', '', $js); // Remove comments to avoid false positives
366 + return 1 === preg_match('/\bimport\b/', $js);
367 + }
368 +
369 + /**
359 370 * Functions, minify html
360 371 *
361 372 * @param string $html
362 373 * @return string