Support » Plugin: Rotating Tweets (Twitter widget and shortcode) » Plug-in Loads EXTREMELY Slow

  • Resolved mistryrn

    (@mistryrn)


    Hey everyone,

    I’m putting the final touches on a WordPress site for a client (http://thesoundofchange.org/2014/) and this plug-in is acting a bit strange.

    When I run it on my localhost, everything loads fine (within 1-2 seconds), but when I try it on the server (link above), it takes anywhere from 8-12 seconds to load, which is problematic because the footer doesn’t load until this plug-in does.

    I currently have all the default settings in place, should I try changing something?
    I’ve read about other plug-ins like “Lazy Widget Loader” that would at least allow me to load the footer and then this plug-in, so I might just use that if I can’t speed things up.

    Any advice would be greatly appreciated. Thanks!

    http://wordpress.org/plugins/rotatingtweets/

Viewing 15 replies - 1 through 15 (of 24 total)
  • Plugin Author Martin Tod

    (@mpntod)

    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:

    1. 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.
    2. Try P3 to confirm that it really is Rotating Tweets that is delaying things.
    3. 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.

    mistryrn

    (@mistryrn)

    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!)

    mistryrn

    (@mistryrn)

    Also, I initially had the default connection settings.

    mistryrn

    (@mistryrn)

    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?

    Plugin Author Martin Tod

    (@mpntod)

    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.

    mistryrn

    (@mistryrn)

    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.

    Plugin Author Martin Tod

    (@mpntod)

    Is it my imagination or is it running faster now?

    I’ve added some extra timing diagnostics to the development version.

    Martin

    Plugin Author Martin Tod

    (@mpntod)

    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

    Plugin Author Martin Tod

    (@mpntod)

    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

    mistryrn

    (@mistryrn)

    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?

    Plugin Author Martin Tod

    (@mpntod)

    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?

    mistryrn

    (@mistryrn)

    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.

    mistryrn

    (@mistryrn)

    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 -->

    Plugin Author Martin Tod

    (@mpntod)

    Two things that are odd:

    1. It’s not cacheing. Even if you reload the page immediately, it’s not using the cache. I’ve added some more diagnostics to try and unpick this and record whether it is saving or not.
    2. It’s taking an incredibly long time to run WordPress’s wp_remote_request() function. I don’t know what server you use, and don’t have too many ideas on this, but one option might be to try switching different transports on and off with Core Control to see if one of the other transports is faster than the others.
    mistryrn

    (@mistryrn)

    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!

Viewing 15 replies - 1 through 15 (of 24 total)
  • The topic ‘Plug-in Loads EXTREMELY Slow’ is closed to new replies.