- This topic has 27 replies, 2 voices, and was last updated 3 years, 8 months ago by Tom.
-
AuthorPosts
-
June 19, 2020 at 9:27 pm #1334921JERRY
InMotion Hosting tells me the solution as follows:
[Jacob M.] I see. So in regards to the curl error, that is likely because the plugin is not using a user agent to connect to the server.
A user agent is required to make these connections to the server. Unfortunately, this is not something that we can adjust for you.
As the plugin developer will need to correct their code to be able to implement this. Unfortunately, that is the only way of correcting this issue, as there is no other workaround, as you are on a shared server, and it is not possible to remove that limitation.
This may be the case for many GeneratePress clients that have exhausted all possible remedies, and no solution has helped.
Generate Press can this be a possibility to help us out?
June 20, 2020 at 9:40 am #1335556TomLead DeveloperLead DeveloperThanks for that – I’ll do some digging.
While this error does come up sometimes, hundreds of license keys are being activated/deactivated every day with no issues, so it’s likely something they could adjust on their end (since many other hosts don’t have an issue with it). However, this really helps – I’ll see if it’s something we can do ๐
* Edit *
Just looked into the code. We use
wp_remote_post()
to make the request: https://developer.wordpress.org/reference/functions/wp_remote_post/While we don’t specify a
user-agent
, the function uses these default args: https://developer.wordpress.org/reference/classes/WP_Http/request/They can see that there is a default
user-agent
which is sent with the request:WordPress/' . get_bloginfo( 'version' ) . '; ' . get_bloginfo( 'url' )
June 20, 2020 at 11:55 am #1335643TomLead DeveloperLead DeveloperAnother update here. We can test their idea by adding a different user-agent:
add_filter( 'http_headers_useragent', function( $user_agent, $url ) { if ( 'https://generatepress.com' === $url ) { $user_agent = $_SERVER['HTTP_USER_AGENT']; // Or whatever they require. } return $user_agent; }, 10, 2 );
June 20, 2020 at 9:59 pm #1335928JERRYOk, so what do I have to do to try to implement this?
Also, did you want me to ask them what user agent it needs to be? I am not a coder, so I am not sure what you require from them to code successfully.
June 21, 2020 at 10:40 am #1336518TomLead DeveloperLead DeveloperYou can try adding the code I provided above to your website: https://generatepress.com/forums/topic/curl-error-28-connection-timed-out-after-10000-milliseconds-2/page/2/#post-1335643
Adding PHP: https://docs.generatepress.com/article/adding-php/
If it doesn’t work, you can ask them what the user-agent should be, as the code already sends a user-agent by default, and the above will send the user-agent associated with your browser.
June 21, 2020 at 11:45 pm #1336930JERRYOk, it did not work. I posted the code snippet via the Code Snippets plugin. I am now going to reach back out to InMotion Hosting to find out what user-agent I need to have.
June 25, 2020 at 11:16 pm #1342203JERRY(This is a reply from my hosting provider)
This message regards some trouble updating the GeneratePress plugin.
I do apologize for this issue! I’ve fully checked.
First, I fully updated the site to use PHP 7.3, and maxed the PHP settings. This is in case the problem is caused by something else.
Then, I got logged in and tested the plugin. The error displayed:
“cURL error 28: Connection timed out after 10000 milliseconds”
Now that the user agent is fixed, this issue can only be due to latency in the request being answered by the GeneratePress servers.
I do see they are aware of the slowness because they provide an alternative method for updating the plugin, mentioned here:
https://docs.generatepress.com/article/updating-gp-premium/When a curl request is made, it’s the same as requesting a webpage. The request must be answered by the resource being called within an amount of time.
The curl timeout setting can be modified on Reseller VPS.
In addition the actions mentioned above, I also employed standard WordPress troubleshooting. I deactivated all plugins, and was still able to recreate the problem. I also optimized the WordPress database.
Sorry again for this issue. More recent plugins use the WordPress Requests library, and not curl directly. Here’s an article about it:
https://deliciousbrains.com/php-curl-how-wordpress-makes-http-requests/
June 26, 2020 at 9:19 am #1342875TomLead DeveloperLead DeveloperHmm, well I don’t believe it’s the load time of the request, as we successfully process hundreds of license keys every day.
Some hosts just seem to have an issue with it, and their support teams aren’t able to find the issue. We’ll look into cURL alternatives, but I do believe it’s the standard when it comes to WordPress.
July 2, 2020 at 7:56 pm #1350056JERRYOk, thank you, will you be looking for Curl alternatives? I bet this will help those clients in the middle like me. Thank you for all of your help.
July 3, 2020 at 9:32 am #1350837TomLead DeveloperLead DeveloperI’ll definitely look into it, although I fear that if servers are preventing cURL from working, it will likely be the same with other methods.
July 19, 2020 at 8:11 am #1368765JERRYOk, thank you. Please let me know if you have found another method, then I can dismiss their theory, and put the ball back into their court, if it does not work.
August 11, 2020 at 5:18 pm #1397984JERRYHey Tom,
what did you do? I logged into one of my Word Press sites and it say that Generate Press needed an update, and I was apprehensive. But, I tried to update, and IT WORKED!
What did you do to fix this, I am on cloud nine. Now people in the forum with this issue is probably fixed, now, Awesome!
Question not related, but are you all going all in on Gutenberg Blocks? that is truly the WordPress of the future, and I think it makes making Word Press sites easier.
Thanks, Tom and Generate Team!
August 12, 2020 at 8:52 am #1399188TomLead DeveloperLead DeveloperHi there,
We haven’t done anything on this front, but glad to hear it’s working now! I assume something changed with your hosting/server to allow the communication.
Yes, we’re very excited and serious about our GenerateBlocks plugin: https://generateblocks.com
Lots of cool things on the way! ๐
-
AuthorPosts
- You must be logged in to reply to this topic.