Fix parse error

This commit is contained in:
Marcus Quinn
2025-03-13 22:57:46 +00:00
parent be998146b7
commit 9e43175f96

View File

@ -1,3 +1,4 @@
<?php <?php
/** /**
* Plugin Name: WP ALLSTARS Superstar Plugin * Plugin Name: WP ALLSTARS Superstar Plugin
@ -51,7 +52,7 @@ function wpa_superstar_admin_assets() {
wp_enqueue_style( wp_enqueue_style(
'wpa-superstar-admin', 'wpa-superstar-admin',
plugins_url( 'admin/css/wpa-superstar-admin.css', __FILE__ ), plugins_url( 'admin/css/wpa-superstar-admin.css', __FILE__ ),
[], array(),
WPA_SUPERSTAR_VERSION WPA_SUPERSTAR_VERSION
); );
@ -59,20 +60,17 @@ function wpa_superstar_admin_assets() {
wp_enqueue_script( wp_enqueue_script(
'wpa-superstar-admin', 'wpa-superstar-admin',
plugins_url( 'admin/js/wpa-superstar-admin.js', __FILE__ ), plugins_url( 'admin/js/wpa-superstar-admin.js', __FILE__ ),
[ 'jquery' ], array('jquery'),
WPA_SUPERSTAR_VERSION, WPA_SUPERSTAR_VERSION,
true true
); );
// Localize script for AJAX // Localize script for AJAX
wp_localize_script( $ajax_data = array(
'wpa-superstar-admin',
'wpaSuperstar',
[
'ajaxurl' => admin_url( 'admin-ajax.php' ), 'ajaxurl' => admin_url( 'admin-ajax.php' ),
'nonce' => wp_create_nonce( 'wpa-superstar-nonce' ) 'nonce' => wp_create_nonce( 'wpa-superstar-nonce' )
]
); );
wp_localize_script( 'wpa-superstar-admin', 'wpaSuperstar', $ajax_data );
} }
add_action( 'admin_enqueue_scripts', 'wpa_superstar_admin_assets' ); add_action( 'admin_enqueue_scripts', 'wpa_superstar_admin_assets' );
@ -84,3 +82,14 @@ function lazyLoad_assets() {
[], [],
WPA_SUPERSTAR_VERSION WPA_SUPERSTAR_VERSION
); );
}
function minifyCSS($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;
}