Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author Sarah

    (@shen045)

    Can you give me a link to your site?
    The counters are now done using JavaScript on the client side (as before,they were slowing the page loading considerably). At least one person has found that a minification plugin (in that case Better WordPress Minification) interferes with the share count JavaScript.
    I can have a look at your site and see if I can see what the issue is.
    Cheers,
    Sarah

    Thread Starter CreativeWP

    (@creativewp)

    See this page, and you will see the social media is not working, and yes, I turned off the minifications.

    https://tools.pingdom.com/fpt/#!/cR2ab6/https://tradingplanets.com/

    Thanks,

    Thread Starter CreativeWP

    (@creativewp)

    This is the main error I am getting for each of the buttons counters.

    Warning The request got a 4XX, 5XX response or couldn’t be loaded

    Plugin Author Sarah

    (@shen045)

    Do you have any security plugins installed (e.g. Better WordPress Security, Bulletproof Security)?
    It looks like ajax callbacks are blocked on your site, even though the requests this plugin makes are nonced. I think some of the security plugins have options to shut it down, so I might have to look into those.

    Thread Starter CreativeWP

    (@creativewp)

    My bad, I added deregister_heartbeat and this was making it impossible to work. Sorry,

    Thread Starter CreativeWP

    (@creativewp)

    I took this off:

    function my_deregister_heartbeat() {
    	global $pagenow;
    
    	if ( 'post.php' != $pagenow && 'post-new.php' != $pagenow ) {
    		wp_deregister_script('heartbeat');
    		wp_register_script('heartbeat', false);
    	}
    }
    add_action( 'admin_enqueue_scripts', 'my_deregister_heartbeat' );

    Now Ajax on my site is taxing the website! Any help?

    Plugin Author Sarah

    (@shen045)

    In what way is it taxing the website? There is almost no processing involved in getting the share counts. When the ajax request is received by WordPress, it simply sends off a request to the appropriate service, and when it receives a reply, it extracts the count and sends it back to the browser. There is usually a wait time, but the server isn’t actually doing any processing during this time.

    If it is a problem though, you might need to look into something a bit more custom. Perhaps caching the post counts and only refreshing them periodically? The counts would be stale for some period of time, but if your traffic volume is substantial, it might be worth it.
    Another alternative is that some social networks do allow requests to be made directly from the client side to their servers. Not all do, but I think Facebook, Twitter and LinkedIn currently allow this, so that could reduce the load on the server somewhat.

    Thread Starter CreativeWP

    (@creativewp)

    Thank you for answering, I think the problem is actually Woocommerce. Every time I install it, it makes the server go high, and it uses ajax to call some process. Then your buttons now are called in ajax which them over kills the server. ??

    Once I updated to the new buttons, the numbers of processors when from 1 to 9, then my website became super sluggish. Terrible, and sad.

    Plugin Author Sarah

    (@shen045)

    Yes, WooCommmerce does use a fair bit of ajax. Loading the post counts on the server side on a per-request basis isn’t feasible, as it adds several seconds to the load time.

    Switching the client-side code to get the counts directly from Facebook, LinkedIn and Twitter would probably be your best bet. It would remove 60% of the ajax calls from this plugin, but you’d still have ajax calls for Google+ and StumbleUpon.

    It could be that the parallel nature of the requests is the issue with your configuration. It is getting 5 almost simultaneous requests and so is spinning up extra threads to deal with them, even though it doesn’t really need to. It might be better in your case to consolidate them into a single ajax request, even though that would mean the UI would take longer to update as it would have to wait for all the server requests to complete.

    Thread Starter CreativeWP

    (@creativewp)

    Thank you, thank you. What I did, is just to download version 1.0.2 (svn) of your plugging and does the trick. It was working just fine before. Unless I should know something coming up with these social networks!?

    Thank you,

    Plugin Author Sarah

    (@shen045)

    With the networks you are using, that version should be fine. I don’t think Reddit works in that version, but if you’re not using that, then no problem.

    If you are happy with the page load times you’re getting, then that version should work fine for you. There were some sites that were having their page load times extended by 4 or 5 seconds by doing the share counts on the server side. For some non-US hosted sites using all the services, it could even be up to 10 seconds. But it depends on a lot of factors, including the locations of your servers and which services are being used.

    I may consider in a future version putting this back in as an option – it would default to client side loading, but you could check a box to drop the ajax and load server side instead. Will be a wee while before I can get around to that though.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Counter on Social Networks do not display’ is closed to new replies.