• Resolved qph9697

    (@qph9697)


    Hi,

    I am having trouble downloading the fonts locally. I want to preload my all google fonts.

    Whenever I am clicking on “download”, this error pops up

    “cURL error 28: Resolving timed out after 5000 milliseconds”

    I am attaching a screenshot for your reference.

    Screenshot 1 – https://ibb.co/WHHppSz
    Screenshot 2 – https://ibb.co/WcJv7Kz

    This error also pops up when I am trying to go from the “Advanced Settings” tab to “Generate Stylesheet” tab.

    My Website is https://questionpapershub.com/home/

Viewing 15 replies - 1 through 15 (of 37 total)
  • Plugin Author DaanvandenBergh

    (@daanvandenbergh)

    The API might’ve been down temporarily. Are you still having this issue?

    Otherwise, do you have access to PHP error logs? Because this seems to be a server (maybe permissions?) related issue.

    Thread Starter qph9697

    (@qph9697)

    Hi thank you for your quick reply,

    Yes, I am still having this issue.

    I even tried increasing my “PHP maximum execution time (300sec)” & “the memory limit (512MB)”, but still there was this error.

    In my query monitor, I am getting this error,
    Page Generation Time
    1.1524
    No execution time limit. The max_execution_time PHP configuration directive is set to 0.

    From the server end, I tried increasing the time and memory limit, at admin end, I even disabled all my plugins, but still, there was this issue.

    I have the latest WP installed 5.4.1, PHP 7.4, and cURL version 7.62.0.

    Plugin Author DaanvandenBergh

    (@daanvandenbergh)

    I found this, might be some default behavior of wp_remote_get() that I overlooked: https://carlalberto.code.blog/2018/02/17/curl-error-28-resolving-timed-out-after-5000-milliseconds/

    I’ll test with this.

    Plugin Author DaanvandenBergh

    (@daanvandenbergh)

    This error also pops up when I am trying to go from the “Advanced Settings” tab to “Generate Stylesheet” tab.

    Just read this. cURL isn’t even used when switching between tabs. Could you check the PHP error logs when this occurs?

    Thread Starter qph9697

    (@qph9697)

    Hi thank you for the reply,

    I am not good at coding.

    I do use snippets plugin to load PHP functions.

    Do I have to add this into the snippets plugin?
    add_filter(‘http_request_args’, ‘fix_wp_curl_timeout’, 100, 1);
    function fix_wp_curl_timeout( $time )
    {
    $time[‘timeout’] = 10;
    return $time;
    }
    add_action(‘http_api_curl’, ‘adjust_wp_custom_timout’, 100, 1);
    function adjust_wp_cust_timout( $handle )
    {
    curl_setopt( $handle, CURLOPT_CONNECTTIMEOUT, 10 );
    curl_setopt( $handle, CURLOPT_TIMEOUT, 10 );
    }

    and if yes, then where do I have to change the timeout? and what number should I use?
    (If assuming the current number is 5000)

    • This reply was modified 4 years, 10 months ago by qph9697.
    Plugin Author DaanvandenBergh

    (@daanvandenbergh)

    No no, sorry. I just shared that with you, to let you know that it’s some sort of common problem in WordPress that I (possibly) missed.

    There’s nothing you have to do with this. ??

    Thread Starter qph9697

    (@qph9697)

    This error also pops up when I am trying to go from the “Advanced Settings” tab to “Generate Stylesheet” tab.

    After updating the plugin, the error for moving from advanced tabs to generate stylesheet tab is gone.
    (earlier is used to get a white screen, with {return ‘false’, Resolving timed out after 5000 milliseconds})
    Above is not exact, but this is the kind of error I got every time.

    But the error for downloading the fonts is still there.

    Plugin Author DaanvandenBergh

    (@daanvandenbergh)

    Are you using caching mechanisms such as Varnish and/or Redis, by any chance?

    Thread Starter qph9697

    (@qph9697)

    No no, sorry. I just shared that with you, to let you know that it’s some sort of common problem in WordPress that I (possibly) missed.

    Oh okay got it, it’s okay.

    So sir, can you please help me to resolve this issue.

    Because I love your OMGF plugin, and it greatly improves my site speed, too.
    But this issue started, from yesterday, when I wanted to preload my font styles.

    Thread Starter qph9697

    (@qph9697)

    Are you using caching mechanisms such as Varnish and/or Redis, by any chance?

    No, I am not using varnish or Redis caching.

    Just for info, i am using w3 total cache plugin.

    Plugin Author DaanvandenBergh

    (@daanvandenbergh)

    i am using w3 total cache plugin.

    I use W3TC, too. So, that shouldn’t be an issue.

    But this issue started, from yesterday, when I wanted to preload my font styles.

    Wait a minute, so you’re saying you want to preload ALL fonts? You shouldn’t do that. You should just preload the ones that are needed above the fold.

    Then still, how many fonts are you trying to download? Perhaps it’s simply more than your server can process within a usual timespan. But still, I could try to make some optimizations.

    Thread Starter qph9697

    (@qph9697)

    Wait a minute, so you’re saying you want to preload ALL fonts? You shouldn’t do that. You should just preload the ones that are needed above the fold.

    I didn’t knew about that, I was trying to preload all my fonts.

    Then still, how many fonts are you trying to download? Perhaps it’s simply more than your server can process within a usual timespan. But still, I could try to make some optimizations.

    I had 2 Subsets and 18 font styles & I was trying to preload all 18 font styles.
    Here is the screenshot,
    Screenshot 1 – https://ibb.co/WHHppSz
    Screenshot 2 – https://ibb.co/WcJv7Kz

    But I tried both ways, I unticked all, and tried to download all the fonts that were gathered using Autodetect.
    In both cases, it threw a cURL error.

    Plugin Author DaanvandenBergh

    (@daanvandenbergh)

    Ok, 18 fonts. It’s not that much. Thanks for letting me know.

    You could try setting this in your server’s PHP configuration: try setting default_socket_timeout to 10 seconds, for example.

    Thread Starter qph9697

    (@qph9697)

    Hi thank you for the reply,

    You could try setting this in your server’s PHP configuration: try setting default_socket_timeout to 10 seconds, for example.

    Where could I find this?

    I am using Cpanel.

    Plugin Author DaanvandenBergh

    (@daanvandenbergh)

Viewing 15 replies - 1 through 15 (of 37 total)
  • The topic ‘cURL error | Unable to download fonts’ is closed to new replies.