• Resolved Pete

    (@pete1874)


    I’ve used OMGF in the past without any issues, but when I added it to a new site today I’m seeing some stuff that might be weird (I never had to look into any of this because it always worked fine)…

    1) With the plugin added and Google Fonts disabled, it’s making 8 calls to fonts.gstatic (I recall in the past it removed all those calls)
    2) When I look in the download folder, all the fonts are there at 0 bytes in file size
    3) The fonts stylesheet is pointing at the Google addresses, instead of pulling things in from the font folder (I assume because the file sizes are empty)

    Hoping I’m just missing something and this is a super easy fix!

    • This topic was modified 5 years, 4 months ago by Pete.
    • This topic was modified 5 years, 4 months ago by Pete.
Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author DaanvandenBergh

    (@daanvandenbergh)

    Hi @pete1874,

    Perhaps something went wrong during download? Have you tried again?

    Try the following:
    – Click ’empty download folder’,
    – Press F12, which will open the console,
    – Follow the steps to download the fonts and generate the stylesheet.

    Did you see any errors in your console? If not, do you have access to PHP error logs?

    Was your previous site on a different host, or was it hosted on the same server as your new site?

    Thread Starter Pete

    (@pete1874)

    Hey Daan,

    I’ve completely uninstalled and reinstalled, and deleted and re-downloaded the fonts several times, plus changed the webfont folder – still all 0 filesize ??

    No errors in the console when I followed your instruction above

    Not sure I have access to PHP logs – any idea where I’d find that on a cPanel account?

    (The last site I used it where it worked was on the same server BTW)

    Cheers!

    Plugin Author DaanvandenBergh

    (@daanvandenbergh)

    Could you check your PHP configuration if the allow_url_fopen setting is enabled?

    Thread Starter Pete

    (@pete1874)

    Hey Dan,

    It was disabled, so I enabled it and ran through the process again – same result though ??

    Perhaps worth adding in here that the CSS file has an appropriate size (11,708 bytes) and has content – it’s just the font files that are pulling down at 0 size

    • This reply was modified 5 years, 4 months ago by Pete.
    Plugin Author DaanvandenBergh

    (@daanvandenbergh)

    @pete1874,

    I’ll have to check the code to see if I can come up with something that might be causing this.

    I’ll get back to you!

    Plugin Author DaanvandenBergh

    (@daanvandenbergh)

    Hi @pete1874,

    I might’ve found something. I found out that sometimes 0 byte files are returned if the filename contains illegal characters (defined by the server).

    Which fonts are you using?

    Thread Starter Pete

    (@pete1874)

    Hey Daan,

    It’s Poppins Latin Regular (300, 400, 500, 600, 700, 800, 900) and Montserrat Latin Regular (300, 400, 500, 600, 700, 800, 900)

    Cheers!

    *Note to self: delete some bloody font weights lol*

    Plugin Author DaanvandenBergh

    (@daanvandenbergh)

    Hi @pete1874,

    On my testing environment I have no issue with downloading these fonts.

    I’ve just released v2.0.2 which adds better error handling to the scripts which downloads the fonts. Would you mind starting again from scratch (make sure to ‘Clear the cache folder’ from OMGF’s settings!) and see if you’re getting any errors? This’ll help me pinpoint the issue.

    Looking forward to hearing from you!

    Thread Starter Pete

    (@pete1874)

    Hey Daan

    Now I’m getting the following error:

    Error: 403 – File (https://fonts.gstatic.com/s/poppins/v9/pxiByp8kv8JHgFVrLDz8Z1xlEA.ttf) could not be written. Do you have permission to write to /home/***/public_html/***/***.com/wp-content/cache/omgf-webfonts?

    Permissions are okay, as the fonts.css file is being written to the directory no problem

    • This reply was modified 5 years, 4 months ago by Pete.
    Plugin Author DaanvandenBergh

    (@daanvandenbergh)

    Ok, this error is thrown if the downloaded file returns empty. Which means that file_get_contents isn’t working properly on your server. Does your server allow downloading external URLs using file_get_contents()?

    Plugin Author DaanvandenBergh

    (@daanvandenbergh)

    @pete1874,

    I found this post on Stack Overflow: https://stackoverflow.com/questions/4172860/file-get-contents-returns-empty-string

    Try to debug the issue using the answers, especially the one marked as solution.

    Hope it helps!

    Plugin Author DaanvandenBergh

    (@daanvandenbergh)

    Hi @pete1874,

    I think I found it!

    I implemented a new way to download the files in the latest version. This resolved the 0 byte filesize in CAOS for a few users, so I hope it does the same in OMGF!

    Let me know if it works now?

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘0 Byte Font File Sizes After Download’ is closed to new replies.