That’s odd.
What connection settings do you have? It should be timing out faster than that – and should also be caching so that subsequent loads are very quick too.
Three options for the way forward:
- Set
define('WP_DEBUG', true);
in wp-config.php
. This gives a ton of diagnostics in HTML comments about how the plug-in is working.
- Try P3 to confirm that it really is Rotating Tweets that is delaying things.
- Change the connection settings to 24 hours, 1 second and yes. This should give you the fastest possible connection.
I’ll be interested to see what you get.
Thanks for the advice.
After enabling the debug mode, these are the only comments I got:
<!-- There are currently 1 identities cached -->
<!-- Using OAuth - version 1.1 of API - statuses/user_timeline -->
<!-- Verifying SSL peer -->
<!-- Setting timeout to 3 seconds -->
<!-- wp_remote_request() variables in lib/wp_twitteroauth.php:
$url = REMOVED TO HIDE THE CLIENT'S TWITTER KEYS
$args = Array
(
[method] => GET
[timeout] => 3
[sslverify] => 1
)
-->
<!-- wp_remote_request() in lib/wp_twitteroauth.php successfully completed -->
<!-- Successfully read data from Twitter --><!-- Rotating Tweets - got new data --><!-- Storing cache entry for tsocmusic11 in rotatingtweets-cache -->
I am currently scanning with P3 and will let you know what the results are.
Thanks again for your advice (and your plug-in!)
Also, I initially had the default connection settings.
Well, this isn’t good. According to P3, the Rotating Tweets plug-in has a 99.7% impact on the page load time. (It actually took 46 seconds to load during the Scan!)
Any idea what could be causing this?
What happens if you load twice in quick succession?
The second time should be caching – and should be dramatically faster.
If you want, I can add a timer to the comments – so that we can see where the delay is – although I’m guessing it’s fetching the Twitter feed – but if it keeps delaying, it might be something else.
Loading twice in quick succession didn’t change anything. In fact, I got this error (which seems to happen once every 10 visits or so)
WordPress error code: http_request_failed – The SSL certificate for the host could not be verified.
Is it my imagination or is it running faster now?
I’ve added some extra timing diagnostics to the development version.
Martin
It’s also possible (although – it would be odd) that another plug-in is using the http_request_timeout
filter to increase the time-out for wp_remote_request()
beyond 3 seconds. Which other plug-ins are you using?
BTW, I’ve removed the URL from the diagnostics report.
Martin
Another possible scenario triggered by the SSL certificate problem.
If RT doesn’t download valid data, it doesn’t reset the timer on the cache and keeps trying to download data every time you load the page.
If SSL is causing a problem, this will mean that it keeps trying to reload the data every time you load the site.
One way to stop this would be to switch ‘Verify SSL connection to Twitter’ to ‘No’ on the settings page.
The other way is to sort out the SSL certificate!
Martin
Thanks again.
Here is a list of the other plug-ins I am using:
– Advanced Custom Fields
– Contact Form 7
– Core Control
– Facebook Members
– Simple Share Buttons
– WordPress SEO
According to Core Control, my http_request_timeout is set to 5 (though it does mention that this can be affected by other plug-ins)
I’ll try disabling the ‘Verify SSL connection’ and see what that does.
How would I go about sorting out the SSL certificate?
Also, what is the significance of “tsocmusic11” in:
<!-- Storing cache entry for tsocmusic11 in rotatingtweets-cache -->
in the diagnostics message? Should that match with something, like a username or a database?
tsomusic11
is the name of the cache of Tweets from tsomusic’s timeline with the first ‘1
‘ meaning that retweets are included and the second ‘1
‘ meaning that replies are excluded.
I suspect sorting out the SSL certificate would require something to be done that’s specific to your server set-up. I’m afraid I can’t really help on that.
I’ll be interested to know if setting ‘Verify SSL connection’ to ‘no’ makes a difference. Incidentally, are you using the development version of the plug-in?
Thanks for explaining that, that makes a lot of sense.
Setting ‘Verify SSL connection’ to ‘no’ hasn’t made a difference.
I just installed the development version a few minutes ago, still experiencing the same issues.
Here’s what the diagnostics gave me:
<!-- There are currently 1 identities cached -->
<!-- Using OAuth - version 1.1 of API - statuses/user_timeline -->
<!-- NOT verifying SSL peer -->
<!-- Setting timeout to 1 seconds -->
<!-- wp_remote_request() variables in lib/wp_twitteroauth.php:
$args = Array
(
[method] => GET
[timeout] => 1
[sslverify] =>
)
-->
<!-- wp_remote_request() in lib/wp_twitteroauth.php successfully completed in 23.3700 seconds -->
<!-- Successfully read data from Twitter --><!-- Rotating Tweets - got new data - time taken: 23.3971 seconds --><!-- Storing cache entry for tsocmusic10 in rotatingtweets-cache -->
I’ll download and install the latest development version and tell you what the diagnostics give me after that, and then I’ll try switching things around with Core Control. Thanks so much for all your help!