'remove_dashicons', 'title' => 'Remove dashicons on frontend', 'desc' => 'Stop loading the Dashicons stylesheet for logged-out visitors', 'icon' => 'layout', 'risk' => 'safe', 'level' => 'beginner', 'audience' => 'everyone', 'priority' => 2, 'benefit' => 'Dashicons is the WordPress admin icon font. If your theme or a plugin loads it on public pages, this saves each visitor a download of about 58 KB (about 35 KB compressed). Logged-in users still get it, because the admin bar needs it.', 'help' => 'WordPress loads dashicons.min.css on the front end for logged-in users (for the admin bar), and for visitors only when a theme or plugin asks for it. The icon font is embedded inside that file. This feature removes it for logged-out visitors. If a theme or plugin stylesheet lists Dashicons as a requirement, that stylesheet will not load for visitors either, so check your site after turning this on.', 'before' => 'dashicons.min.css (about 58 KB) loaded for visitors when a theme or plugin requests it', 'after' => 'Only loaded for logged-in users.', 'detect' => function () { return array( 'detected' => true, 'message' => 'Dashicons CSS loaded on the front end', 'safe' => true, 'savings' => '~35KB gzipped', ); }, 'callback' => function () { add_action( 'wp_enqueue_scripts', function () { if ( ! is_user_logged_in() ) { wp_deregister_style( 'dashicons' ); } }, 100 ); }, );