hi I'm getting the following message when I try to load a table linked to Google Sheets
Error
cURL error 28: Operation timed out after 5001 milliseconds with 0 out of -1 bytes received
This didn't happen before I used the option of link google sheet API to my wpdatatable to google sheet. Back then I just published my google spreadsheet to get a link for wpdatatalbe. I like the API feature because it allows me to protect my google sheet data, but this seems to cause this problem.
I heard from someone that the curl time needs to be extended in the code. Is that something wpdatatable can do? thank you.
Can you check first do you have some errors in your Inspect element->Console of the browser? If you do please share with us.
Then how you create this table? Are you connect to Google Sheet API over Section account like is explained here?
if the answer is no, then you just create a table with old logic like is describe on this link.
Recently Googe changes the functionality of how you can access google sheet data so you also need to share that sheet with everyone to be accessible like is explained on this link.
That old logic has one timeout set here wp-content/plugins/wpdatatables/source/class.wdttools.php around line 198
you will find this
$timeout = 5;
and you can try to increase it to 50 and check again.
Also please send us that Google Spreadsheet link that you use for those tables so we can test it in our local environment.
hi Aleksandar, thanks for your kind reply. I was unable to reply until now. I hope you understand.
I tried increasing the timelimit to 50 in class.wdttools.php, but I still have the same problem. (what I find odd is that wpdatatables still says operation timed out after 5001 milliseconds, even though I changed 5 to 50. Shouldn't it say "50001" milliseconds? Could this be because it takes time for the changed php file to be reflected?)
By the way, yes I connected the wpdatatable to my google sheets via Google Sheet API.
Does Google require that my sheets be public to everyone in such a case? At the moment, I have made my sheets private only to me and wpdatatable. Should I make it public and send you the link?
After exploring this issue further, we found that the Google Sheets API has a quota limit. It's limited to 500 requests per 100 seconds per project, and 100 requests per 100 seconds per user.
That quota can be increased, but that requires an additional charge in Google (increasing the quota is not free). Another way would be to use the old method without the API.
Our developers are working on this, and we'll try to come up with a better solution for one of our updates, without the need to pay Google for increasing the quota.
I'm still struggling with this error and was wondering if you had any update on the efforts to increase the limit without additional pay to Google. Also would you be able to point me to some guide or instructions on the non-API "old method" that can prevent the timeout error? Thank you.
I just spoke with our lead developer, and unfortunately, there's no solution for this yet.
You would be able to use the old method, you'd simply need to click on "Remove account" in wpDataTables settings/Google Spreadsheet API settings, and that's it.
However, if this is a private spreadsheet (not published to the web), it will not work, and also you will face the same issues with the cache on Google's side - up to 15 minutes before the data is updated in wpDataTables.
As for the Stack Overflow thread - we're not using the client, but direct API links.
What we are doing is passing Google sheet API URL with parameters from your Google sheets URL in a format like https://sheets.googleapis.com/v4/spreadsheets/... to the WordPress built-in function
wp_remote_get
that performs an HTTP request using the GET method and returns its response.
Like I said in the previous post if you test your file (you can create the same sheet with dummy data) and test it on our sandbox link that is also provided in the previous post you will see that tables are created without any issues with or without new Google sheet API connection.
If you get this error because of the WordPress hook that we provide in some of the previous posts
__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 ...
hi I'm getting the following message when I try to load a table linked to Google Sheets
Error
cURL error 28: Operation timed out after 5001 milliseconds with 0 out of -1 bytes received
This didn't happen before I used the option of link google sheet API to my wpdatatable to google sheet. Back then I just published my google spreadsheet to get a link for wpdatatalbe. I like the API feature because it allows me to protect my google sheet data, but this seems to cause this problem.
I heard from someone that the curl time needs to be extended in the code. Is that something wpdatatable can do? thank you.
Hello IW
Can you check first do you have some errors in your Inspect element->Console of the browser? If you do please share with us.
Then how you create this table? Are you connect to Google Sheet API over Section account like is explained here?
if the answer is no, then you just create a table with old logic like is describe on this link.
Recently Googe changes the functionality of how you can access google sheet data so you also need to share that sheet with everyone to be accessible like is explained on this link.
That old logic has one timeout set here wp-content/plugins/wpdatatables/source/class.wdttools.php around line 198
you will find this
and you can try to increase it to 50 and check again.
Also please send us that Google Spreadsheet link that you use for those tables so we can test it in our local environment.
Kind Regards,
Aleksandar Vuković
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia 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
hi Aleksandar, thanks for your kind reply. I was unable to reply until now. I hope you understand.
I tried increasing the timelimit to 50 in class.wdttools.php, but I still have the same problem. (what I find odd is that wpdatatables still says operation timed out after 5001 milliseconds, even though I changed 5 to 50. Shouldn't it say "50001" milliseconds? Could this be because it takes time for the changed php file to be reflected?)
By the way, yes I connected the wpdatatable to my google sheets via Google Sheet API.
Does Google require that my sheets be public to everyone in such a case? At the moment, I have made my sheets private only to me and wpdatatable. Should I make it public and send you the link?
Thank you
Hello again IW
After exploring this issue further, we found that the Google Sheets API has a quota limit. It's limited to 500 requests per 100 seconds per project, and 100 requests per 100 seconds per user.
https://developers.google.com/sheets/api/limits
That quota can be increased, but that requires an additional charge in Google (increasing the quota is not free). Another way would be to use the old method without the API.
Our developers are working on this, and we'll try to come up with a better solution for one of our updates, without the need to pay Google for increasing the quota.
Kind Regards,
Aleksandar Vuković
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia 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
Hi, Aleksandar,
I'm still struggling with this error and was wondering if you had any update on the efforts to increase the limit without additional pay to Google. Also would you be able to point me to some guide or instructions on the non-API "old method" that can prevent the timeout error? Thank you.
Hi again, IW
I just spoke with our lead developer, and unfortunately, there's no solution for this yet.
You would be able to use the old method, you'd simply need to click on "Remove account" in wpDataTables settings/Google Spreadsheet API settings, and that's it.
However, if this is a private spreadsheet (not published to the web), it will not work, and also you will face the same issues with the cache on Google's side - up to 15 minutes before the data is updated in wpDataTables.
Kind Regards,
Aleksandar Vuković
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia 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
Is there some solution for the cURL time out after 5001 ms?
My quota at google is not exceeded at all and still getting this error from time to time same like IW posted previously.
It should be possible to increase the cURL time over PHP:
https://stackoverflow.com/questions/54998625/how-to-set-curl-timeout-in-google-api-php-client-version-2-2-2
Thanks for reply,
Miroslav
Hey Miroslav
1. This is when you're using the API method:
As for the Stack Overflow thread - we're not using the client, but direct API links.
What we are doing is passing Google sheet API URL with parameters from your Google sheets URL in a format like https://sheets.googleapis.com/v4/spreadsheets/... to the WordPress built-in function
that performs an HTTP request using the GET method and returns its response.
Like I said in the previous post if you test your file (you can create the same sheet with dummy data) and test it on our sandbox link that is also provided in the previous post you will see that tables are created without any issues with or without new Google sheet API connection.
If you get this error because of the WordPress hook that we provide in some of the previous posts
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 not using the API method, but the old method:
That old logic has one timeout set here wp-content/plugins/wpdatatables/source/class.wdttools.php around line 198
you will find this (if you have the latest version of wpDataTables (3.6))
and you can try to increase it to 100 and check again.
If you have the older version of wpDataTables, the timeout is set to "5", not "25".
Kind Regards,
Aleksandar Vuković
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia 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