Remove duplicate wpa_superstar_minify_css function from main plugin file

This commit is contained in:
Marcus Quinn
2025-03-14 02:24:28 +00:00
parent 4df4e66f89
commit 1098b3cd14

View File

@ -1,4 +1,3 @@
<?php <?php
/** /**
* Plugin Name: WP ALLSTARS Superstar Plugin * Plugin Name: WP ALLSTARS Superstar Plugin
@ -88,19 +87,3 @@ function wpa_superstar_lazy_load_assets() {
} }
// Hook the function to appropriate WordPress action // Hook the function to appropriate WordPress action
add_action( 'wp_enqueue_scripts', 'wpa_superstar_lazy_load_assets' ); add_action( 'wp_enqueue_scripts', 'wpa_superstar_lazy_load_assets' );
/**
* Minify CSS content to reduce file size
*
* @param string $css The CSS content to minify
* @return string Minified CSS
*/
function wpa_superstar_minify_css($css) {
// Remove comments
$css = preg_replace('!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $css);
// Remove space after colons
$css = str_replace(': ', ':', $css);
// Remove whitespace
$css = str_replace(["\r\n", "\r", "\n", "\t", ' ', ' ', ' '], '', $css);
return $css;
}