fbpx
Want To Add Extra Images Per Product Variation For Free? Download Now

Dashicons used whereas it’s only for admin

Tobias Purro

Hi,

Why do you use dashicons for frontend ? It’s a library made only for backoffice in wordpress, which is really heavy in term of size

I have to load it only for your plugin (whereas i have 70 plugins installed)

As you can see, without the library your plugin is not working at all : https://www.gladiatorfit.fr/produit/veste-gilet-leste-tactique-avec-plaques/

Can you explain me why ? And which css code should i load independently to make your plugin work. I win 1.5 seconds on page speed without dashicons, so as you understand i don’t want to load it and stay like this

Thanks for your help

Hakik Zaman

Hi Tobias,

Thanks for reaching out to us. At the time we released this plugin, there was no font that met the WordPress plugin repo rules. Only GPL-compatible fonts were allowed. So we couldn’t use the FontAwesome or other fonts.

Recently FontAwesome made the font compatible with the GPL License.

I can forward your message to our development team.

You can also send this request here: https://storepress.fider.io/

I hope this explanation will help.

Thank You

Tobias Purro

Hi,

Yes please because it’s not normal to use Dashicons for that … it’s made for admin interface and it’s a really huge css file

In the meantime can you tell me which is the css part of dash icon used to make it work ?

i will only use the necessary code on a separate file

many thanks

Hakik Zaman

Hi Tobias,

Our fronted.min.css has a dependency on dashicons. Please check the following line and you will find the dashicons inside the array:

// Stylesheet
wp_enqueue_style( 'woo-variation-gallery', esc_url( woo_variation_gallery()->assets_url( "/css/frontend{$suffix}.css" ) ), array( 'dashicons' ), woo_variation_gallery()->assets_version( "/css/frontend{$suffix}.css" ) );

So, the plugin CSS(fronted.min.css) will not load till your site loads dashicons on the front end.

Thank You

Tobias Purro

Hi,

many thanks !

is it possible to modify this with functions.php ?  To load frontend without dashicons ?

many thanks

Hakik Zaman

Hi Tobias,

You can reinitialize the Gallery CSS using the following snippet:
add_action('wp_enqueue_scripts', function(){
$suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
if( is_woocommerce() ){
wp_deregister_style( 'woo-variation-gallery' );
wp_enqueue_style( 'woo-variation-gallery', esc_url( woo_variation_gallery()->assets_url( "/css/frontend{$suffix}.css" ) ), array( ), woo_variation_gallery()->assets_version( "/css/frontend{$suffix}.css" ) );
}
});

Note: I will recommend using the Code Snippets plugin rather than the theme’s functions.php.

Please let me know if it helps.
Thank You

Tobias Purro

Hi !

THanks for the snippet !

I added it to my functions.php (from the child theme, so no loss possible), but it does not work, the css styles are still not loaded

Hakik Zaman

Hi Tobias,

Where did you dequeue the dashicon?

Can you please give us temporary admin access to your site? We’ll try to investigate the issue for you.

You can add new users by going to Users > Add New set the user and password for us, set the role to admin, and set the info here.

Add your site URL, login username, and password in the site login area. Follow this guideline: https://www.useloom.com/share/27c1f2ac633c4060b2da883d946107d7

Hope to hear from you soon!