[Resolved] Fonts.gstatic.com – Warnings: Lighthouse was unable to automatically check the `

Home Forums Support [Resolved] Fonts.gstatic.com – Warnings: Lighthouse was unable to automatically check the `

Home Forums Support Fonts.gstatic.com – Warnings: Lighthouse was unable to automatically check the `

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1622490
    Hemant

    Hello Team,

    Hope you are doing great.

    Just wanted to see if we can do something for this warning from lighthouse.

    I ran a speed test on page: https://fatlossplanner.com/boiled-egg-diet/

    I get error saying :
    “Warnings: Lighthouse was unable to automatically check the font-display values for the origin https://fatlossplanner.com.”

    Is there a way to get rid of this?

    The guide here https://web.dev/font-display/?utm_source=lighthouse&utm_medium=unknown says we need to leverage css by using below script.

    @font-face {
      font-family: 'Pacifico';
      font-style: normal;
      font-weight: 400;
      src: local('Pacifico Regular'), local('Pacifico-Regular'), url(https://fonts.gstatic.com/s/pacifico/v12/FwZY7-Qmy14u9lezJ-6H6MmBp0u-.woff2) format('woff2');
      font-display: swap;
    }

    But I am not quite sure if this will work in my case as the font error looks like roboto font.

    Plkease help me with either css code or anything we can do at the php side.

    Any help is greatly appreciated.

    #1622827
    Elvin
    Staff
    Customer Support

    Hi there,

    You can add this PHP snippet:

    add_filter( 'generate_google_font_display', function() {
        return 'swap';
    } );

    This adds &display=swap to your google fonts loaded on the wp_head to address this issue.

    #1622845
    Hemant

    OK so I added this code via php snippets and still get the warning.. šŸ™

    Here’s the page: https://fatlossplanner.com/boiled-egg-diet/

    #1622946
    Elvin
    Staff
    Customer Support

    OK so I added this code via php snippets and still get the warning.. šŸ™

    Hereā€™s the page: https://fatlossplanner.com/boiled-egg-diet/

    Can you temporarily disable SG Optimizer? To check just incase it’s interfering w/ the script.

    Can you tell us how you’re adding the font? I’ve checked the page and it’s doesn’t seem to be adding the google fonts the default way the theme adds in google fonts from the customizer.

    Are you manually importing fonts? Let us know.

    #1622967
    Hemant

    So I added that code using Code Snippets – https://docs.generatepress.com/article/adding-php/

    I have disabled SG Optimizer and cleared the cache.

    Still the same..

    I am not adding any fonts.. it looks like it’s coming from Google Ads it seems… as I am using system font “Verdana” by default.

    #1622998
    Elvin
    Staff
    Customer Support

    I am not adding any fonts.. it looks like itā€™s coming from Google Ads it seemsā€¦ as I am using system font ā€œVerdanaā€ by default.

    Ah that’s actually true as shown here:
    https://share.getcloudapp.com/wbuKE2R9

    I’m afraid this is outside of our scope as we can’t control how ad scripts display their contents.

    You’ll have to ask the developer of the plugin or the script you’re using.

    #1623033
    Hemant

    Never mind… the problem is GTmetrix shows a score of 100 but page speed insight is getting difficult…

    Let me know if you have any suggestions…

    I will close this thread.. but it will be great if you can suggest something on that.. I tried adding `

    #1624265
    Elvin
    Staff
    Customer Support

    Let me know if you have any suggestionsā€¦

    As mentioned previously, you can try asking the developer of the plugin or script you’re using for the ads for any suggestions on how to tackle this issue. Perhaps they’ve already encountered this and already provided modifications.

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.