WordPress.org

Ready to get started?Download WordPress

Forums

Simple Share Buttons Adder
[resolved] The counter option slows down the loading of webpages (9 posts)

  1. jazzmofo
    Member
    Posted 4 months ago #

    Hi, the counter option slows down the loading of webpages. The facebook share icon in combination with the counter option, slows down the loading in extreme form. From around 2 seconds tot around 45 seconds. I've disabled the share count option and now my page are loading fast again. Can you fix this? Thanks! Carlo

    https://wordpress.org/plugins/simple-share-buttons-adder/

  2. David Neal
    Member
    Plugin Author

    Posted 4 months ago #

    Hi Carlo,

    The counters shall always have some effect, 45 seconds is indeed far longer than it should be though! You are the first to report this, so I'd be keen to hear more about your website/server setup.

    Do the counts show up eventually and display as they should if you wait?

    I'll try and put a max execution time that returns no counts for any sites that take too long.

    Thanks

  3. jazzmofo
    Member
    Posted 4 months ago #

    Hi David,

    It concerns http://supersnelgezond.nl

    The system runs on

    Processor Name QEMU Virtual CPU version 0.9.1
    Vendor ID AuthenticAMD
    Processor Speed (MHz) 2400.142
    Total Memory 3923532 kB
    Free Memory 1677460 kB

    with

    Exim 4.76 Running
    Apache 2.2.25 Running
    MySQL 5.5.31 Running
    Php 5.3.27 Installed

    and the latest version of WordPress (always up to date) and a bunch of plugins. Including an old (the only old one) version of Quick Cache (20111203), since that was the best one before they changed it into a free and paid version which contained a lot of bugs. I did switch that cache plugin off trying to trouble shoot and find out why the pages were loading so slow. It did not make any difference.

    I tested again this morning, enabling the counters.

    Tested              Load Time   Page Size  Requests	Page Speed
    April 28 09:36:10	1.75 s	    923.5 kB   127	    73
    April 28 09:35:41	5.98 s	    709.0 kB   127	    72

    The difference is not that big anymore, but stil a 4 seconds difference. The biggest time spend was on the "wait time" (or time to first byte), which was 2,9 seconds (http://fpt.pingdom.com#!/cvdCC6/http://supersnelgezond.nl/zuur-base-tabel-alkaline-dieet/).

    Still love your plugin, though. :-) I am only using is without the counters now.

    Hope this helps, Carlo

  4. valdirljr
    Member
    Posted 4 months ago #

    Hi!

    I'm programing a website in localhost, using WAMP and Windows 8.1 and have the same problem.
    The counters have a slow loading in the page, very seconds.
    I'll deploy this site in a webserver with LAMP in this week, and can't enable this feature for the client until this fix be released.
    I believe that this delay is the way you retrieve the information from the counters. Take a look at this plugin https://wordpress.org/plugins/social-count-plus/
    https://github.com/claudiosmweb/social-count-plus
    It may help = D

  5. Yuri Filus
    Member
    Posted 3 months ago #

    I "solved" it by lazy loading the share buttons with javascript.

  6. valdirljr
    Member
    Posted 3 months ago #

    Yuri Filus, share with us?

  7. Yuri Filus
    Member
    Posted 3 months ago #

    Sure!

    Add this in your javascript:

    var $share = $(".post-share"); // Share buttons container
    if ( $share[0] ) {
      $share.hide();
      var shareUrl = templateDir + '/include-share.php'; // Assign variable templateDir before script load <script>var templateDir="<?php bloginfo('template_directory'); ?>";</script>
      $.ajax({
        type: "GET",
        url: shareUrl,
        data: { url: document.URL },
        success: function(data) {
          $share.html(data)
            .slideDown(); // Some crazy effects
        }
      });
    }

    And create include-share.php in the root folder of your theme:

    <?php
      require_once( "../../../wp-load.php" );
      echo do_shortcode('[ssba url="' . $_GET['url'] . '"]');
    ?>

    Hope it helps!

  8. kaynars
    Member
    Posted 3 months ago #

    which javascript file?

  9. valdirljr
    Member
    Posted 3 months ago #

    Thanks Yuri Filus o/

Reply

You must log in to post.

About this Plugin

About this Topic