Your changes have been saved.

Easy Fonts Options

To confirm and obtain the list of fonts that are loading on your website click here

If enabled, the plugin will download Google Fonts from <link> and host them locally.

Process @import inline style

If enabled, the plugin will process @import rules from inline <style> tags.

Process @font-face statement

If enabled, the plugin will process @font-face statement from inline <style> tags.

Remove Resource Hints

If enabled, the plugin will remove resource hints (such as preconnect, prefetch, etc) from the website.

If enabled, the plugin will remove google fonts loading from webfont.js loader inline script tags.

The fonts have been removed.

get_session_tokens(); // Add the cookies and headers to the request $options = array( 'cookies' => $cookies, 'headers' => array( 'User-Agent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3', ), ); // Append a query string to the homepage URL to visit it as an admin $home_url = home_url() . '?easyfonts_preload=1'; // Visit the homepage as admin to preload the fonts wp_remote_get($home_url, $options); } } function easyfonts_preload() { $current_user = wp_get_current_user(); // Check if the user is an admin if (user_can($current_user, 'manage_options')) { // Get the cookies for the current user $cookies = wp_get_current_user()->get_session_tokens(); // Add the cookies and headers to the request $options = array( 'cookies' => $cookies, 'headers' => array( 'User-Agent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3', ), ); // Append a query string to the homepage URL to visit it as an admin $home_url = home_url() . '?easyfonts_preload=1'; // Visit the homepage as admin to preload the fonts wp_remote_get($home_url, $options); } // Display a success message ?>

The fonts have been preloaded.

isFile()) continue; if($file->getExtension() == 'css'){ $css_files[] = $file->getFilename(); } } if(!empty($css_files)){ echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; foreach($css_files as $file_name) { $file_url = wp_upload_dir()['baseurl'].'/easyfonts/'.$file_name; $file_path = $easyfonts_dir.$file_name; $file_content = file_get_contents($file_path); $font_family = array(); $variant = array(); $variant_italic = array(); $variant_normal = array(); preg_match_all("/@font-face\s*{[^}]+}/", $file_content, $matches); if (count($matches[0]) > 0) { foreach ($matches[0] as $font_face) { if (preg_match("/font-family:([^;]+);/", $font_face, $font_family_match)) { $font_family[] = trim($font_family_match[1]); } if (preg_match("/font-style:([^;]+);/", $font_face, $variant_match)) { $style = trim($variant_match[1]); if($style == 'italic'){ if (preg_match("/font-weight:([^;]+);/", $font_face, $variant_match)) { $variant = trim($variant_match[1]); if (!in_array($variant, $variant_italic)) { $variant_italic[] = $variant; } } }elseif($style == 'normal'){ if (preg_match("/font-weight:([^;]+);/", $font_face, $variant_match)) { $variant = trim($variant_match[1]); if (!in_array($variant, $variant_normal)) { $variant_normal[] = $variant; } } } } } } $font_family = array_unique($font_family); $style_data[] = array( 'file_url' => $file_url, 'font_families' => $font_family, 'variant' => 'italic '.implode(',', $variant_italic) . ' | normal '.implode(',', $variant_normal) ); } if(!empty($style_data)){ foreach($style_data as $style){ echo ''; echo ''; echo ''; echo ''; echo ''; } } echo ''; echo '
Hosted Fonts CSS URLFont FamiliesVariants
'. esc_url($style['file_url']) .''. esc_attr(implode(',', $style['font_families'])) .''. esc_html($style['variant']) .'
'; }else{ if (get_option('easyfonts_host_google_fonts_locally_link', false) || get_option('easyfonts_host_google_fonts_locally_import', false)) { echo 'fonts styles are not found. Preload Font first or visit the homepage.'; } } } catch (Exception $e) { echo 'Error: ' . $e->getMessage(); } }