• Resolved atmoshost

    (@atmoshost)


    Hi! After last update my sites show the error bellow, can you help me?

    There was an error connecting to . Please try again later.
    1 Message:
    cURL error 28: Connection timed out after 10001 milliseconds

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Sayontan Sinha

    (@sayontan)

    I am not able to access your website at all – I tried from three separate computers (including switching to a VPN) and my phone, so I don’t know if there is an ISP level setting or if your site is down in general.

    Basically the message is self-explanatory – your site is unable to connect to the provider from which the photos are being pulled. Behind the scenes it connects via cURL (that part is handled by WordPress natively in most cases), and that connection is not working. This might be because your site is down, or some other reason, and your hosting provider can help you troubleshoot this.

    What shortcode do you have in place?

    Thread Starter atmoshost

    (@atmoshost)

    Hello the site was offline, now it’s ok!

    The shortcode is:
    [gallery type='flickr' view='photosets' photoset_id='72157701727376354' user_id='135263736@N02' sort='date-posted-desc' count='500' caption='none' media='photos' main_size='c' layout='masonry' tag_mode='any' thumb_size='t' collections_display='lazy' controls='show']

    Plugin Author Sayontan Sinha

    (@sayontan)

    Sorry, I am still unable to access the site, so there might be a problem with my ISP.

    Is the shortcode working OK for you now? Normally if you are getting an error with a cURL timeout, the best things to do are:

    1. Wait for a while and retry. Sometimes the server you are trying to connect to is busy and cannot respond to the connection request.
    2. If it doesn’t get resolved after some time, contact your hosting provider – they might have some checks or firewall settings that might be halting or slowing down cURL requests.

    I have not made any changes to the Flickr code as far as requests are made. Ever since 2011 or 2012 they have used wp_remote_request (a standard WP function), which uses cURL internally. I have explicit cURL requests only for Zenfolio and some parts of Google Photos (that is why I asked for your shortcode – to find out what provider you were pulling data from).

    Thread Starter atmoshost

    (@atmoshost)

    Hello, please try this site that also has the same problem:
    https://www.clickitatiba.com.br/portal/2018/10/16/sossega-madalena-13-10/

    Plugin Author Sayontan Sinha

    (@sayontan)

    OK – this one took time to load, but I see two things: first is a cURL error, and the second is the list photos from your album (so I am seeing the photos).

    Are both of these sites owned by you? Are they on the same hosting platform / shared hosting? If so, can you reach out to your host and see if they have some sort of filters on cURL requests that they implemented recently? The reason I ask is because connections to Flickr are very, very quick. I can basically make a call, process the results and display a photoset, all in less than 5 seconds, while in your case the call itself is taking more than 10 seconds.

    If your host is unable to help you, I can give you a workaround to increase the cURL timeout – it is not straightforward though. Basically if you have a child theme, you can add this to your functions.php:

    add_action('http_api_curl', 'photonic_http_api_curl', 100, 1);
    function photonic_http_api_curl($handle) {
    	curl_setopt( $handle, CURLOPT_CONNECTTIMEOUT, 90 );
    	curl_setopt( $handle, CURLOPT_TIMEOUT, 90 );
    }

    This will automatically set the cURL timeout to 90 seconds and will work for slow connections too. The downside is that the behaviour will still be slow – that can only be corrected if your host is able to tweak things at its end.

    Thread Starter atmoshost

    (@atmoshost)

    Thanks man! I’ll talk to the host staff.:-)

    Plugin Author Sayontan Sinha

    (@sayontan)

    FYI, in version 2.10 of Photonic I have added an option within the plugin to increase the cURL timeout, under Photonic → Settings → Generic Options → Advanced → Increase cURL timeout

    Thread Starter atmoshost

    (@atmoshost)

    WOW! Thanks ! 🙂

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘After last update… cURL Error’ is closed to new replies.