As previously announced via banners and our newsletters, support is no longer available through this platform.

For easier navigation, you can still click on "Submit a Ticket" here, choose the appropriate category, and you'll be redirected to the correct support channel for your plugin.

You can still access your previous tickets and browse public tickets, but please note that responding to tickets is no longer possible.

Paid customers: Please log in to your store account for support.

Pre-purchase questions: Use the support widget in the bottom-right corner of our websites:
https://wpamelia.com
https://wpdatatables.com
https://wpreportbuilder.com

Okay
  Public Ticket #3069833
WP Datatables cURL Error 28 most of my tables after update!!!
Closed

Comments

  •  1
    Mee started the conversation

    Hi, I am having massive issues with my tables at after updating the plugin. How can I roll back to the previous release? 

    It seems to be an issue with all my tables that are set to fill the width of the screen. As soon as I change them or look at the old ones there is a cURL 28 error.

  •  2,576
    Aleksandar replied

    Hello Mee, thank you for reaching out to us.

    1. If you're using the API method:

    This error is returned by the function wp_remote_get which uses cURL in the background. The client's server doesn't have time to manage the data from Google's API in 5 seconds (which is the default setting in WordPress).

    That limit can be increased using a hook https://wordpress.stackexchange.com/questions/341357/wp-remote-get-curl-error-28-only-on-same-domain. Instead of "15" set it to "100", just in case.

    If you get this error because of the WordPress hook extend_http_request_timeout, you need to remove it from your functions.php file and then checkout solutions for the first initial error for curl error 28 - Operation timed out ...

    https://www.wpbeginner.com/wp-tutorials/how-to-fix-curl-error-28-connection-timed-out-after-x-milliseconds/

    2. If you're using the old method (without Google's API credentials) the timeout limit is set to 25 in file wp-content/plugins/wpdatatables/source/class.wdttools.php on line 198.

    This can be overwritten with the hook wpdatatables_curl_get_data. For example:

    function filterCURLOptions($data, $ch, $url){
       $new_ch = curl_init();
       $timeout = 1000;
       $agent = 'Mozilla/5.0 (Windows NT 6.2; WOW64; rv:17.0) Gecko/20100101 Firefox/17.0';
            curl_setopt($new_ch, CURLOPT_URL, $url);
            curl_setopt($new_ch, CURLOPT_RETURNTRANSFER, 1);
            curl_setopt($new_ch, CURLOPT_CONNECTTIMEOUT, $timeout);
            curl_setopt($new_ch, CURLOPT_USERAGENT, $agent);
            curl_setopt($new_ch, CURLOPT_REFERER, site_url());
            curl_setopt($new_ch, CURLOPT_FOLLOWLOCATION, true);
            $data = curl_exec($new_ch);
                if (curl_error($new_ch)) {
                    $error = curl_error($new_ch);
                    curl_close($new_ch);
                    throw new Exception($error);
                }
                if (strpos($data, '<title>Moved Temporarily</title>')) {
                    throw new Exception(__('wpDataTables was unable to read your Google Spreadsheet, probably it is not published correctly. <br> You can publish it by going to <b>File -> Publish to the web</b> ', 'wpdatatables'));
                }
                $info = curl_getinfo($new_ch);
                curl_close($new_ch);
                if ($info['http_code'] === 404) {
                    return NULL;
                }
       
        return $data;
    }
    add_filter('wpdatatables_curl_get_data','filterCURLOptions', 10, 3);
    

    This needs to go to the functions.php file of your theme or the child theme (depending on what you're using).

    Kind Regards, 

    Aleksandar Vuković
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables