Cool Social Share Buttons with Share Count Script for PHP

The fastest share buttons with share count.

Last updated on
Subscribe to Internet Tips and Tools Feed

Social Network share buttons with share count can really slow down visitor's browsers that are using your website. Each button has to load the share count from the remote server of the social network. This sometimes causes pausing and freezing. Some of these buttons load asynchronously (async) with javascript and they may "claim" that they won't slow your website down. But this is not the case. Accessing the remote servers even asynchronously still causes the user to experience slowdowns.

With "Cool Social Share Buttons with Share Count Script for PHP" you can still display share buttons with share count for Google+, Facebook, Pinterest, Twitter and/or LinkedIn without slowing down your visitor's browsers because the share count is retrieved and cached on your server, so your visitor's browsers to not have to load any data from remote servers to display the share count.


Social Buttons:
Share Count Style:
Buttons Direction:

Copy the data below to your website:



Downloaded 0 times.
Please make a donation to reveal the download link.

Unzip the 3 files in and upload them to your website after you edit the following variables in coolsocial.php:

	/* Edit the variables below */

	$share_url = $_SERVER['HTTP_REFERER']; // The url to share will be detected by the webpage address
	//$share_url = ""; // Or uncomment this line to specify URL to like
	$share_text = ""; // Used on Twitter and Pinterest as description. Blank out to use current document.title
	$share_image = ""; // Used on Pinterest. Blank out to use the webpage's meta og: or itemprop tags
	$get_count_onclick = true; // Get count whenever a user clicks a social button
	$get_count_minutes = 720; // 0 = Don't get count every n minutes; (720 = Get count every 12 hours)
	$use_twitter_newsharecounts = false; // If true then register your website at

	$server="localhost"; // Usually keep as "localhost"
	$database="your_mysql_database"; includes these files:
coolsocial.phpThe PHP script for super fast share buttons with share count
coolsocial.cssThe css style sheets for the share buttons
db.phpRequired by coolsocial.php for mysql database functions

Last updated on January 8, 2017
Created on December 22, 2016

Back to
Subscribe to Internet Tips and Tools Feed        

User Comments

There are 3 comments.

Displaying first 50 comments.

1. Posted By: Clinton - - September 6, 2017, 1:31 am
No Database and where is this files @include_once('realsettings.php');?

2. Posted By: Jeff - - September 6, 2017, 10:27 am
Hi Clinton,

The database is automatically created on lines 188-197 of coolsocial.php. Try it! It works fine. realsettings.php is not included. That file is just in case you want to put your settings in a different file. The @ in front of include() will make sure that PHP does not display an error if it does not find the file. If you put your settings in coolsocial.php then you can comment out the line.


3. Posted By: Clinton - - September 8, 2017, 4:37 pm
thank you very much