Version Description
- [New] Compatible with Recover Social Share Counts add-on
- [Bugfix] Logged in users were able to see their Social Account Linking interface at other users' BuddyPress profile page too
- [Bugfix] Vkontakte share count was not working in some cases
Download this release
Release Info
Developer | the_champ |
Plugin | WordPress Social Share, Social Login and Social Comments Plugin – Super Socializer |
Version | 7.8.6 |
Comparing to | |
See all releases |
Code changes from version 7.8.5 to 7.8.6
- helper.php +2 -4
- inc/social_sharing.php +116 -101
- js/front/combined.js +24 -18
- js/front/sharing/sharing.js +22 -16
- readme.txt +12 -2
- super_socializer.php +2 -2
helper.php
CHANGED
@@ -119,9 +119,7 @@ function the_champ_like_buttons_page(){
|
|
119 |
*/
|
120 |
function the_champ_validate_options($theChampOptions){
|
121 |
foreach($theChampOptions as $k => $v){
|
122 |
-
if(
|
123 |
-
$theChampOptions[$k] = $theChampOptions[$k];
|
124 |
-
}else{
|
125 |
$theChampOptions[$k] = esc_attr(trim($v));
|
126 |
}
|
127 |
}
|
@@ -686,7 +684,7 @@ function the_champ_unlink(){
|
|
686 |
add_action('wp_ajax_the_champ_unlink', 'the_champ_unlink');
|
687 |
|
688 |
function the_champ_add_linking_tab() {
|
689 |
-
if(the_champ_social_login_enabled()){
|
690 |
global $theChampLoginOptions;
|
691 |
if(isset($theChampLoginOptions['bp_linking'])){
|
692 |
global $bp, $user_ID;
|
119 |
*/
|
120 |
function the_champ_validate_options($theChampOptions){
|
121 |
foreach($theChampOptions as $k => $v){
|
122 |
+
if(is_string($v)){
|
|
|
|
|
123 |
$theChampOptions[$k] = esc_attr(trim($v));
|
124 |
}
|
125 |
}
|
684 |
add_action('wp_ajax_the_champ_unlink', 'the_champ_unlink');
|
685 |
|
686 |
function the_champ_add_linking_tab() {
|
687 |
+
if(bp_is_my_profile() && the_champ_social_login_enabled()){
|
688 |
global $theChampLoginOptions;
|
689 |
if(isset($theChampLoginOptions['bp_linking'])){
|
690 |
global $bp, $user_ID;
|
inc/social_sharing.php
CHANGED
@@ -840,130 +840,145 @@ function the_champ_sharing_count(){
|
|
840 |
}
|
841 |
$transientExpirationTime = $multiplier * $theChampSharingOptions['share_count_cache_refresh_count'];
|
842 |
|
843 |
-
|
844 |
-
|
845 |
-
|
846 |
-
|
847 |
-
|
848 |
-
|
849 |
-
|
850 |
-
|
851 |
-
|
852 |
-
|
853 |
-
|
854 |
-
|
855 |
-
break;
|
856 |
-
case 'delicious':
|
857 |
-
$url = 'http://feeds.delicious.com/v2/json/urlinfo/data?url='. $targetUrl;
|
858 |
-
break;
|
859 |
-
case 'pinterest':
|
860 |
-
$url = 'http://api.pinterest.com/v1/urls/count.json?callback=theChamp&url='. $targetUrl;
|
861 |
-
break;
|
862 |
-
case 'buffer':
|
863 |
-
$url = 'https://api.bufferapp.com/1/links/shares.json?url='. $targetUrl;
|
864 |
-
break;
|
865 |
-
case 'stumbleupon':
|
866 |
-
$url = 'http://www.stumbleupon.com/services/1.01/badge.getinfo?url='. $targetUrl;
|
867 |
-
break;
|
868 |
-
case 'google_plus':
|
869 |
-
$url = 'http://share.yandex.ru/gpp.xml?url='. $targetUrl;
|
870 |
-
break;
|
871 |
-
case 'vkontakte':
|
872 |
-
$url = 'https://vk.com/share.php?act=count&url='. $targetUrl;
|
873 |
-
break;
|
874 |
-
default:
|
875 |
-
$url = '';
|
876 |
-
}
|
877 |
-
if($url == '') { continue; }
|
878 |
-
$response = wp_remote_get( $url, array( 'timeout' => 15 ) );
|
879 |
-
if( ! is_wp_error( $response ) && isset( $response['response']['code'] ) && 200 === $response['response']['code'] ){
|
880 |
-
$body = wp_remote_retrieve_body( $response );
|
881 |
-
if($provider == 'pinterest'){
|
882 |
-
$body = str_replace(array('theChamp(', ')'), '', $body);
|
883 |
-
}
|
884 |
-
if(!in_array($provider, array('google', 'vkontakte'))){
|
885 |
-
$body = json_decode($body);
|
886 |
-
}
|
887 |
switch($provider){
|
888 |
case 'twitter':
|
889 |
-
|
890 |
-
$responseData[$targetUrl]['twitter'] = $body -> count;
|
891 |
-
$shareCountTransient['twitter'] = $body -> count;
|
892 |
-
} else {
|
893 |
-
$responseData[$targetUrl]['twitter'] = 0;
|
894 |
-
}
|
895 |
break;
|
896 |
case 'linkedin':
|
897 |
-
|
898 |
-
$responseData[$targetUrl]['linkedin'] = $body -> count;
|
899 |
-
$shareCountTransient['linkedin'] = $body -> count;
|
900 |
-
}else{
|
901 |
-
$responseData[$targetUrl]['linkedin'] = 0;
|
902 |
-
}
|
903 |
break;
|
904 |
case 'reddit':
|
905 |
-
$
|
906 |
-
if(!empty($body -> data -> children)){
|
907 |
-
$children = $body -> data -> children;
|
908 |
-
if(!empty($children[0] -> data -> score)){
|
909 |
-
$responseData[$targetUrl]['reddit'] = $children[0] -> data -> score;
|
910 |
-
$shareCountTransient['reddit'] = $children[0] -> data -> score;
|
911 |
-
}
|
912 |
-
}
|
913 |
break;
|
914 |
case 'delicious':
|
915 |
-
|
916 |
-
$responseData[$targetUrl]['delicious'] = $body[0] -> total_posts;
|
917 |
-
$shareCountTransient['delicious'] = $body[0] -> total_posts;
|
918 |
-
}else{
|
919 |
-
$responseData[$targetUrl]['delicious'] = 0;
|
920 |
-
}
|
921 |
break;
|
922 |
case 'pinterest':
|
923 |
-
|
924 |
-
$responseData[$targetUrl]['pinterest'] = $body -> count;
|
925 |
-
$shareCountTransient['pinterest'] = $body -> count;
|
926 |
-
}else{
|
927 |
-
$responseData[$targetUrl]['pinterest'] = 0;
|
928 |
-
}
|
929 |
break;
|
930 |
case 'buffer':
|
931 |
-
|
932 |
-
$responseData[$targetUrl]['buffer'] = $body -> shares;
|
933 |
-
$shareCountTransient['buffer'] = $body -> shares;
|
934 |
-
}else{
|
935 |
-
$responseData[$targetUrl]['buffer'] = 0;
|
936 |
-
}
|
937 |
break;
|
938 |
case 'stumbleupon':
|
939 |
-
|
940 |
-
$responseData[$targetUrl]['stumbleupon'] = $body -> result -> views;
|
941 |
-
$shareCountTransient['stumbleupon'] = $body -> result -> views;
|
942 |
-
}else{
|
943 |
-
$responseData[$targetUrl]['stumbleupon'] = 0;
|
944 |
-
}
|
945 |
break;
|
946 |
case 'google_plus':
|
947 |
-
|
948 |
-
$responseData[$targetUrl]['google_plus'] = $body;
|
949 |
-
$shareCountTransient['google_plus'] = (int) str_replace( '"', '', $body );
|
950 |
-
}else{
|
951 |
-
$responseData[$targetUrl]['google_plus'] = 0;
|
952 |
-
}
|
953 |
break;
|
954 |
case 'vkontakte':
|
955 |
-
|
956 |
-
$responseData[$targetUrl]['vkontakte'] = $body;
|
957 |
-
$shareCountTransient['vkontakte'] = (int) str_replace(array('VK.Share.count(0, ', ');'), '', $body);
|
958 |
-
}else{
|
959 |
-
$responseData[$targetUrl]['vkontakte'] = 0;
|
960 |
-
}
|
961 |
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
962 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
963 |
}
|
964 |
}
|
965 |
-
|
|
|
966 |
}
|
|
|
967 |
do_action('heateor_ss_share_count_ajax_hook', $responseData);
|
968 |
|
969 |
$ajaxResponse['status'] = 1;
|
840 |
}
|
841 |
$transientExpirationTime = $multiplier * $theChampSharingOptions['share_count_cache_refresh_count'];
|
842 |
|
843 |
+
$targetUrlsArray = array();
|
844 |
+
$targetUrlsArray[] = $targetUrls;
|
845 |
+
$targetUrlsArray = apply_filters('heateor_ss_target_share_urls', $targetUrlsArray);
|
846 |
+
$shareCountTransientArray = array();
|
847 |
+
if(in_array('facebook', $sharingNetworks)){
|
848 |
+
$ajaxResponse['facebook_urls'] = $targetUrlsArray;
|
849 |
+
}
|
850 |
+
foreach($targetUrlsArray as $targetUrls){
|
851 |
+
$shareCountTransients = array();
|
852 |
+
foreach($targetUrls as $targetUrl){
|
853 |
+
$shareCountTransient = array();
|
854 |
+
foreach($sharingNetworks as $provider){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
855 |
switch($provider){
|
856 |
case 'twitter':
|
857 |
+
$url = $twitterCountApi . $targetUrl;
|
|
|
|
|
|
|
|
|
|
|
858 |
break;
|
859 |
case 'linkedin':
|
860 |
+
$url = 'http://www.linkedin.com/countserv/count/share?url='. $targetUrl .'&format=json';
|
|
|
|
|
|
|
|
|
|
|
861 |
break;
|
862 |
case 'reddit':
|
863 |
+
$url = 'http://www.reddit.com/api/info.json?url='. $targetUrl;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
864 |
break;
|
865 |
case 'delicious':
|
866 |
+
$url = 'http://feeds.delicious.com/v2/json/urlinfo/data?url='. $targetUrl;
|
|
|
|
|
|
|
|
|
|
|
867 |
break;
|
868 |
case 'pinterest':
|
869 |
+
$url = 'http://api.pinterest.com/v1/urls/count.json?callback=theChamp&url='. $targetUrl;
|
|
|
|
|
|
|
|
|
|
|
870 |
break;
|
871 |
case 'buffer':
|
872 |
+
$url = 'https://api.bufferapp.com/1/links/shares.json?url='. $targetUrl;
|
|
|
|
|
|
|
|
|
|
|
873 |
break;
|
874 |
case 'stumbleupon':
|
875 |
+
$url = 'http://www.stumbleupon.com/services/1.01/badge.getinfo?url='. $targetUrl;
|
|
|
|
|
|
|
|
|
|
|
876 |
break;
|
877 |
case 'google_plus':
|
878 |
+
$url = 'http://share.yandex.ru/gpp.xml?url='. $targetUrl;
|
|
|
|
|
|
|
|
|
|
|
879 |
break;
|
880 |
case 'vkontakte':
|
881 |
+
$url = 'https://vk.com/share.php?act=count&url='. $targetUrl;
|
|
|
|
|
|
|
|
|
|
|
882 |
break;
|
883 |
+
default:
|
884 |
+
$url = '';
|
885 |
+
}
|
886 |
+
if($url == '') { continue; }
|
887 |
+
$response = wp_remote_get( $url, array( 'timeout' => 15 ) );
|
888 |
+
if( ! is_wp_error( $response ) && isset( $response['response']['code'] ) && 200 === $response['response']['code'] ){
|
889 |
+
$body = wp_remote_retrieve_body( $response );
|
890 |
+
if($provider == 'pinterest'){
|
891 |
+
$body = str_replace(array('theChamp(', ')'), '', $body);
|
892 |
+
}
|
893 |
+
if(!in_array($provider, array('google', 'vkontakte'))){
|
894 |
+
$body = json_decode($body);
|
895 |
+
}
|
896 |
+
switch($provider){
|
897 |
+
case 'twitter':
|
898 |
+
if ( ! empty( $body -> count ) ) {
|
899 |
+
$shareCountTransient['twitter'] = $body -> count;
|
900 |
+
} else {
|
901 |
+
$shareCountTransient['twitter'] = 0;
|
902 |
+
}
|
903 |
+
break;
|
904 |
+
case 'linkedin':
|
905 |
+
if(!empty($body -> count)){
|
906 |
+
$shareCountTransient['linkedin'] = $body -> count;
|
907 |
+
}else{
|
908 |
+
$shareCountTransient['linkedin'] = 0;
|
909 |
+
}
|
910 |
+
break;
|
911 |
+
case 'reddit':
|
912 |
+
$shareCountTransient['reddit'] = 0;
|
913 |
+
if(!empty($body -> data -> children)){
|
914 |
+
$children = $body -> data -> children;
|
915 |
+
if(!empty($children[0] -> data -> score)){
|
916 |
+
$shareCountTransient['reddit'] = $children[0] -> data -> score;
|
917 |
+
}
|
918 |
+
}
|
919 |
+
break;
|
920 |
+
case 'delicious':
|
921 |
+
if(!empty($body[0] -> total_posts)){
|
922 |
+
$shareCountTransient['delicious'] = $body[0] -> total_posts;
|
923 |
+
}else{
|
924 |
+
$shareCountTransient['delicious'] = 0;
|
925 |
+
}
|
926 |
+
break;
|
927 |
+
case 'pinterest':
|
928 |
+
if(!empty($body -> count)){
|
929 |
+
$shareCountTransient['pinterest'] = $body -> count;
|
930 |
+
}else{
|
931 |
+
$shareCountTransient['pinterest'] = 0;
|
932 |
+
}
|
933 |
+
break;
|
934 |
+
case 'buffer':
|
935 |
+
if(!empty($body -> shares)){
|
936 |
+
$shareCountTransient['buffer'] = $body -> shares;
|
937 |
+
}else{
|
938 |
+
$shareCountTransient['buffer'] = 0;
|
939 |
+
}
|
940 |
+
break;
|
941 |
+
case 'stumbleupon':
|
942 |
+
if(!empty($body -> result) && isset( $body -> result -> views )){
|
943 |
+
$shareCountTransient['stumbleupon'] = $body -> result -> views;
|
944 |
+
}else{
|
945 |
+
$shareCountTransient['stumbleupon'] = 0;
|
946 |
+
}
|
947 |
+
break;
|
948 |
+
case 'google_plus':
|
949 |
+
if(!empty($body)){
|
950 |
+
$shareCountTransient['google_plus'] = (int) str_replace( '"', '', $body );
|
951 |
+
}else{
|
952 |
+
$shareCountTransient['google_plus'] = 0;
|
953 |
+
}
|
954 |
+
break;
|
955 |
+
case 'vkontakte':
|
956 |
+
if(!empty($body)){
|
957 |
+
$shareCountTransient['vkontakte'] = (int) str_replace(array('VK.Share.count(0, ', ');'), '', $body);
|
958 |
+
}else{
|
959 |
+
$shareCountTransient['vkontakte'] = 0;
|
960 |
+
}
|
961 |
+
break;
|
962 |
+
}
|
963 |
}
|
964 |
+
}
|
965 |
+
$shareCountTransients[] = $shareCountTransient;
|
966 |
+
}
|
967 |
+
$shareCountTransientArray[] = $shareCountTransients;
|
968 |
+
}
|
969 |
+
|
970 |
+
$finalShareCountTransient = array();
|
971 |
+
for($i = 0; $i < count($targetUrlsArray[0]); $i++){
|
972 |
+
$finalShareCountTransient = $shareCountTransientArray[0][$i];
|
973 |
+
for($j = 1; $j < count($shareCountTransientArray); $j++){
|
974 |
+
foreach($finalShareCountTransient as $key => $val){
|
975 |
+
$finalShareCountTransient[$key] += $shareCountTransientArray[$j][$i][$key];
|
976 |
}
|
977 |
}
|
978 |
+
$responseData[$targetUrlsArray[0][$i]] = $finalShareCountTransient;
|
979 |
+
set_transient('heateor_ss_share_count_' . heateor_ss_get_share_count_transient_id($targetUrlsArray[0][$i]), $finalShareCountTransient, $transientExpirationTime);
|
980 |
}
|
981 |
+
|
982 |
do_action('heateor_ss_share_count_ajax_hook', $responseData);
|
983 |
|
984 |
$ajaxResponse['status'] = 1;
|
js/front/combined.js
CHANGED
@@ -525,13 +525,14 @@ function theChampMoreSharingPopup(elem, postUrl, postTitle, twitterTitle){
|
|
525 |
bgDiv.parentNode.removeChild(bgDiv);
|
526 |
}
|
527 |
}
|
|
|
528 |
if(typeof theChampHorizontalSharingCountEnable == 'undefined'){
|
529 |
var theChampHorizontalSharingCountEnable = 0;
|
530 |
}
|
531 |
if(typeof theChampVerticalSharingCountEnable == 'undefined'){
|
532 |
var theChampVerticalSharingCountEnable = 0;
|
533 |
}
|
534 |
-
if(
|
535 |
// get sharing counts on window load
|
536 |
theChampLoadEvent(
|
537 |
function(){
|
@@ -585,10 +586,10 @@ function theChampGetSharingCounts(){
|
|
585 |
},
|
586 |
success: function(data, textStatus, XMLHttpRequest){
|
587 |
if(data.status == 1){
|
|
|
|
|
|
|
588 |
for(var i in data.message){
|
589 |
-
if(data.facebook){
|
590 |
-
heateorSsFacebookTargetUrls.push(i);
|
591 |
-
}
|
592 |
var sharingContainers = jQuery("div[super-socializer-data-href='"+i+"']");
|
593 |
|
594 |
jQuery(sharingContainers).each(function(){
|
@@ -596,8 +597,6 @@ function theChampGetSharingCounts(){
|
|
596 |
for(var j in data.message[i]){
|
597 |
if(j == 'google_plus'){
|
598 |
var sharingCount = parseInt(data.message[i][j]) || 0;
|
599 |
-
}else if(j == 'vkontakte'){
|
600 |
-
var sharingCount = parseInt(data.message[i][j].replace('VK.Share.count(0, ', '').replace(');', ''));
|
601 |
}else{
|
602 |
var sharingCount = data.message[i][j];
|
603 |
}
|
@@ -635,28 +634,35 @@ function theChampGetSharingCounts(){
|
|
635 |
|
636 |
function theChampFetchFacebookShares(targetUrls){
|
637 |
var loopCounter = 0;
|
638 |
-
for(var
|
639 |
-
|
640 |
-
|
|
|
|
|
641 |
}
|
642 |
}
|
643 |
|
644 |
-
function theChampFBShareJSONCall(targetUrl, loopCounter, targetUrlsLength) {
|
645 |
jQuery.getJSON('//graph.facebook.com/?id=' + targetUrl, function(data){
|
646 |
if(data.share && data.share.share_count){
|
647 |
-
var sharingContainers = jQuery("div[super-socializer-data-href='"+
|
648 |
|
649 |
jQuery(sharingContainers).each(function(){
|
650 |
var targetElement = jQuery(this).find('.the_champ_facebook_count');
|
|
|
651 |
var sharingCount = parseInt(data.share.share_count);
|
652 |
|
653 |
if(jQuery(targetElement).attr('ss_st_count') !== undefined){
|
654 |
sharingCount += parseInt(jQuery(targetElement).attr('ss_st_count'));
|
655 |
}
|
656 |
-
|
657 |
-
|
658 |
-
|
659 |
-
|
|
|
|
|
|
|
|
|
660 |
if ( ( typeof theChampReduceHorizontalSvgWidth != 'undefined' && jQuery(this).hasClass('the_champ_horizontal_sharing') ) || ( typeof theChampReduceVerticalSvgWidth != 'undefined' && jQuery(this).hasClass('the_champ_vertical_sharing') ) ) {
|
661 |
jQuery(targetElement).parents('li').find('.theChampSharingSvg').css('float', 'left');
|
662 |
}
|
@@ -677,8 +683,8 @@ function theChampFBShareJSONCall(targetUrl, loopCounter, targetUrlsLength) {
|
|
677 |
if(loopCounter == targetUrlsLength){
|
678 |
setTimeout(function(){
|
679 |
var facebookShares = {};
|
680 |
-
for(var i in heateorSsFacebookTargetUrls){
|
681 |
-
var sharingContainers = jQuery("div[super-socializer-data-href='"+heateorSsFacebookTargetUrls[i]+"']");
|
682 |
jQuery(sharingContainers).each(function(){
|
683 |
var facebookCountElement = jQuery(this).find('.the_champ_facebook_count');
|
684 |
var facebookCountElementBg = jQuery(this).find('i.theChampFacebookBackground');
|
@@ -689,7 +695,7 @@ function theChampFBShareJSONCall(targetUrl, loopCounter, targetUrlsLength) {
|
|
689 |
var startingCount = parseInt(jQuery(facebookCountElement).attr('ss_st_count').trim());
|
690 |
shareCount = Math.abs(shareCount - startingCount);
|
691 |
}
|
692 |
-
facebookShares[heateorSsFacebookTargetUrls[i]] = shareCount;
|
693 |
return;
|
694 |
}
|
695 |
});
|
525 |
bgDiv.parentNode.removeChild(bgDiv);
|
526 |
}
|
527 |
}
|
528 |
+
|
529 |
if(typeof theChampHorizontalSharingCountEnable == 'undefined'){
|
530 |
var theChampHorizontalSharingCountEnable = 0;
|
531 |
}
|
532 |
if(typeof theChampVerticalSharingCountEnable == 'undefined'){
|
533 |
var theChampVerticalSharingCountEnable = 0;
|
534 |
}
|
535 |
+
if(theChampHorizontalSharingCountEnable || theChampVerticalSharingCountEnable){
|
536 |
// get sharing counts on window load
|
537 |
theChampLoadEvent(
|
538 |
function(){
|
586 |
},
|
587 |
success: function(data, textStatus, XMLHttpRequest){
|
588 |
if(data.status == 1){
|
589 |
+
if(data.facebook){
|
590 |
+
heateorSsFacebookTargetUrls = data.facebook_urls;
|
591 |
+
}
|
592 |
for(var i in data.message){
|
|
|
|
|
|
|
593 |
var sharingContainers = jQuery("div[super-socializer-data-href='"+i+"']");
|
594 |
|
595 |
jQuery(sharingContainers).each(function(){
|
597 |
for(var j in data.message[i]){
|
598 |
if(j == 'google_plus'){
|
599 |
var sharingCount = parseInt(data.message[i][j]) || 0;
|
|
|
|
|
600 |
}else{
|
601 |
var sharingCount = data.message[i][j];
|
602 |
}
|
634 |
|
635 |
function theChampFetchFacebookShares(targetUrls){
|
636 |
var loopCounter = 0;
|
637 |
+
for(var i in targetUrls){
|
638 |
+
for(var j in targetUrls[i]){
|
639 |
+
loopCounter++;
|
640 |
+
theChampFBShareJSONCall(targetUrls[i][j], loopCounter, targetUrls[0].length*targetUrls.length, targetUrls[0][j]);
|
641 |
+
}
|
642 |
}
|
643 |
}
|
644 |
|
645 |
+
function theChampFBShareJSONCall(targetUrl, loopCounter, targetUrlsLength, dataHref) {
|
646 |
jQuery.getJSON('//graph.facebook.com/?id=' + targetUrl, function(data){
|
647 |
if(data.share && data.share.share_count){
|
648 |
+
var sharingContainers = jQuery("div[super-socializer-data-href='"+dataHref+"']");
|
649 |
|
650 |
jQuery(sharingContainers).each(function(){
|
651 |
var targetElement = jQuery(this).find('.the_champ_facebook_count');
|
652 |
+
var facebookBackground = jQuery(this).find('i.theChampFacebookBackground');
|
653 |
var sharingCount = parseInt(data.share.share_count);
|
654 |
|
655 |
if(jQuery(targetElement).attr('ss_st_count') !== undefined){
|
656 |
sharingCount += parseInt(jQuery(targetElement).attr('ss_st_count'));
|
657 |
}
|
658 |
+
if(jQuery(targetElement).text().trim() == '' || jQuery(targetElement).text().trim() == ' '){
|
659 |
+
jQuery(targetElement).html(theChampCalculateApproxCount(sharingCount)).css({'visibility': 'visible', 'display': 'block'});
|
660 |
+
jQuery(facebookBackground).attr('heateor-ss-fb-shares', sharingCount);
|
661 |
+
}else if(typeof jQuery(facebookBackground).attr('heateor-ss-fb-shares') != 'undefined'){
|
662 |
+
var tempShareCount = parseInt(jQuery(facebookBackground).attr('heateor-ss-fb-shares'));
|
663 |
+
jQuery(facebookBackground).attr('heateor-ss-fb-shares', sharingCount + tempShareCount);
|
664 |
+
jQuery(targetElement).html(theChampCalculateApproxCount(sharingCount + tempShareCount));
|
665 |
+
}
|
666 |
if ( ( typeof theChampReduceHorizontalSvgWidth != 'undefined' && jQuery(this).hasClass('the_champ_horizontal_sharing') ) || ( typeof theChampReduceVerticalSvgWidth != 'undefined' && jQuery(this).hasClass('the_champ_vertical_sharing') ) ) {
|
667 |
jQuery(targetElement).parents('li').find('.theChampSharingSvg').css('float', 'left');
|
668 |
}
|
683 |
if(loopCounter == targetUrlsLength){
|
684 |
setTimeout(function(){
|
685 |
var facebookShares = {};
|
686 |
+
for(var i in heateorSsFacebookTargetUrls[0]){
|
687 |
+
var sharingContainers = jQuery("div[super-socializer-data-href='"+heateorSsFacebookTargetUrls[0][i]+"']");
|
688 |
jQuery(sharingContainers).each(function(){
|
689 |
var facebookCountElement = jQuery(this).find('.the_champ_facebook_count');
|
690 |
var facebookCountElementBg = jQuery(this).find('i.theChampFacebookBackground');
|
695 |
var startingCount = parseInt(jQuery(facebookCountElement).attr('ss_st_count').trim());
|
696 |
shareCount = Math.abs(shareCount - startingCount);
|
697 |
}
|
698 |
+
facebookShares[heateorSsFacebookTargetUrls[0][i]] = shareCount;
|
699 |
return;
|
700 |
}
|
701 |
});
|
js/front/sharing/sharing.js
CHANGED
@@ -565,10 +565,10 @@ function theChampGetSharingCounts(){
|
|
565 |
},
|
566 |
success: function(data, textStatus, XMLHttpRequest){
|
567 |
if(data.status == 1){
|
|
|
|
|
|
|
568 |
for(var i in data.message){
|
569 |
-
if(data.facebook){
|
570 |
-
heateorSsFacebookTargetUrls.push(i);
|
571 |
-
}
|
572 |
var sharingContainers = jQuery("div[super-socializer-data-href='"+i+"']");
|
573 |
|
574 |
jQuery(sharingContainers).each(function(){
|
@@ -576,8 +576,6 @@ function theChampGetSharingCounts(){
|
|
576 |
for(var j in data.message[i]){
|
577 |
if(j == 'google_plus'){
|
578 |
var sharingCount = parseInt(data.message[i][j]) || 0;
|
579 |
-
}else if(j == 'vkontakte'){
|
580 |
-
var sharingCount = parseInt(data.message[i][j].replace('VK.Share.count(0, ', '').replace(');', ''));
|
581 |
}else{
|
582 |
var sharingCount = data.message[i][j];
|
583 |
}
|
@@ -615,27 +613,35 @@ function theChampGetSharingCounts(){
|
|
615 |
|
616 |
function theChampFetchFacebookShares(targetUrls){
|
617 |
var loopCounter = 0;
|
618 |
-
for(var
|
619 |
-
|
620 |
-
|
|
|
|
|
621 |
}
|
622 |
}
|
623 |
|
624 |
-
function theChampFBShareJSONCall(targetUrl, loopCounter, targetUrlsLength) {
|
625 |
jQuery.getJSON('//graph.facebook.com/?id=' + targetUrl, function(data){
|
626 |
if(data.share && data.share.share_count){
|
627 |
-
var sharingContainers = jQuery("div[super-socializer-data-href='"+
|
628 |
|
629 |
jQuery(sharingContainers).each(function(){
|
630 |
var targetElement = jQuery(this).find('.the_champ_facebook_count');
|
|
|
631 |
var sharingCount = parseInt(data.share.share_count);
|
632 |
|
633 |
if(jQuery(targetElement).attr('ss_st_count') !== undefined){
|
634 |
sharingCount += parseInt(jQuery(targetElement).attr('ss_st_count'));
|
635 |
}
|
636 |
-
|
637 |
-
|
638 |
-
|
|
|
|
|
|
|
|
|
|
|
639 |
if ( ( typeof theChampReduceHorizontalSvgWidth != 'undefined' && jQuery(this).hasClass('the_champ_horizontal_sharing') ) || ( typeof theChampReduceVerticalSvgWidth != 'undefined' && jQuery(this).hasClass('the_champ_vertical_sharing') ) ) {
|
640 |
jQuery(targetElement).parents('li').find('.theChampSharingSvg').css('float', 'left');
|
641 |
}
|
@@ -656,8 +662,8 @@ function theChampFBShareJSONCall(targetUrl, loopCounter, targetUrlsLength) {
|
|
656 |
if(loopCounter == targetUrlsLength){
|
657 |
setTimeout(function(){
|
658 |
var facebookShares = {};
|
659 |
-
for(var i in heateorSsFacebookTargetUrls){
|
660 |
-
var sharingContainers = jQuery("div[super-socializer-data-href='"+heateorSsFacebookTargetUrls[i]+"']");
|
661 |
jQuery(sharingContainers).each(function(){
|
662 |
var facebookCountElement = jQuery(this).find('.the_champ_facebook_count');
|
663 |
var facebookCountElementBg = jQuery(this).find('i.theChampFacebookBackground');
|
@@ -668,7 +674,7 @@ function theChampFBShareJSONCall(targetUrl, loopCounter, targetUrlsLength) {
|
|
668 |
var startingCount = parseInt(jQuery(facebookCountElement).attr('ss_st_count').trim());
|
669 |
shareCount = Math.abs(shareCount - startingCount);
|
670 |
}
|
671 |
-
facebookShares[heateorSsFacebookTargetUrls[i]] = shareCount;
|
672 |
return;
|
673 |
}
|
674 |
});
|
565 |
},
|
566 |
success: function(data, textStatus, XMLHttpRequest){
|
567 |
if(data.status == 1){
|
568 |
+
if(data.facebook){
|
569 |
+
heateorSsFacebookTargetUrls = data.facebook_urls;
|
570 |
+
}
|
571 |
for(var i in data.message){
|
|
|
|
|
|
|
572 |
var sharingContainers = jQuery("div[super-socializer-data-href='"+i+"']");
|
573 |
|
574 |
jQuery(sharingContainers).each(function(){
|
576 |
for(var j in data.message[i]){
|
577 |
if(j == 'google_plus'){
|
578 |
var sharingCount = parseInt(data.message[i][j]) || 0;
|
|
|
|
|
579 |
}else{
|
580 |
var sharingCount = data.message[i][j];
|
581 |
}
|
613 |
|
614 |
function theChampFetchFacebookShares(targetUrls){
|
615 |
var loopCounter = 0;
|
616 |
+
for(var i in targetUrls){
|
617 |
+
for(var j in targetUrls[i]){
|
618 |
+
loopCounter++;
|
619 |
+
theChampFBShareJSONCall(targetUrls[i][j], loopCounter, targetUrls[0].length*targetUrls.length, targetUrls[0][j]);
|
620 |
+
}
|
621 |
}
|
622 |
}
|
623 |
|
624 |
+
function theChampFBShareJSONCall(targetUrl, loopCounter, targetUrlsLength, dataHref) {
|
625 |
jQuery.getJSON('//graph.facebook.com/?id=' + targetUrl, function(data){
|
626 |
if(data.share && data.share.share_count){
|
627 |
+
var sharingContainers = jQuery("div[super-socializer-data-href='"+dataHref+"']");
|
628 |
|
629 |
jQuery(sharingContainers).each(function(){
|
630 |
var targetElement = jQuery(this).find('.the_champ_facebook_count');
|
631 |
+
var facebookBackground = jQuery(this).find('i.theChampFacebookBackground');
|
632 |
var sharingCount = parseInt(data.share.share_count);
|
633 |
|
634 |
if(jQuery(targetElement).attr('ss_st_count') !== undefined){
|
635 |
sharingCount += parseInt(jQuery(targetElement).attr('ss_st_count'));
|
636 |
}
|
637 |
+
if(jQuery(targetElement).text().trim() == '' || jQuery(targetElement).text().trim() == ' '){
|
638 |
+
jQuery(targetElement).html(theChampCalculateApproxCount(sharingCount)).css({'visibility': 'visible', 'display': 'block'});
|
639 |
+
jQuery(facebookBackground).attr('heateor-ss-fb-shares', sharingCount);
|
640 |
+
}else if(typeof jQuery(facebookBackground).attr('heateor-ss-fb-shares') != 'undefined'){
|
641 |
+
var tempShareCount = parseInt(jQuery(facebookBackground).attr('heateor-ss-fb-shares'));
|
642 |
+
jQuery(facebookBackground).attr('heateor-ss-fb-shares', sharingCount + tempShareCount);
|
643 |
+
jQuery(targetElement).html(theChampCalculateApproxCount(sharingCount + tempShareCount));
|
644 |
+
}
|
645 |
if ( ( typeof theChampReduceHorizontalSvgWidth != 'undefined' && jQuery(this).hasClass('the_champ_horizontal_sharing') ) || ( typeof theChampReduceVerticalSvgWidth != 'undefined' && jQuery(this).hasClass('the_champ_vertical_sharing') ) ) {
|
646 |
jQuery(targetElement).parents('li').find('.theChampSharingSvg').css('float', 'left');
|
647 |
}
|
662 |
if(loopCounter == targetUrlsLength){
|
663 |
setTimeout(function(){
|
664 |
var facebookShares = {};
|
665 |
+
for(var i in heateorSsFacebookTargetUrls[0]){
|
666 |
+
var sharingContainers = jQuery("div[super-socializer-data-href='"+heateorSsFacebookTargetUrls[0][i]+"']");
|
667 |
jQuery(sharingContainers).each(function(){
|
668 |
var facebookCountElement = jQuery(this).find('.the_champ_facebook_count');
|
669 |
var facebookCountElementBg = jQuery(this).find('i.theChampFacebookBackground');
|
674 |
var startingCount = parseInt(jQuery(facebookCountElement).attr('ss_st_count').trim());
|
675 |
shareCount = Math.abs(shareCount - startingCount);
|
676 |
}
|
677 |
+
facebookShares[heateorSsFacebookTargetUrls[0][i]] = shareCount;
|
678 |
return;
|
679 |
}
|
680 |
});
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.heateor.com/donate?action=Super+Socializer
|
|
4 |
Tags: the champ, champ, social login, social sharing, social commenting, social comments, social plugin, buddypress, bbpress, social share, comments, share post, user profile data, social analytics, online identity, social profile storage, id provider, single sign-on, social media tools, free social login, post to social networks, social authentication, social app, connect, capture social data, social sign-in, signin, sign up, signup, social connect, facebook login, twitter login, google login, google+ login, linkedin login, yahoo, vkontakte, instagram, reddit, digg, stumbleupon, delicious, float it, tumblr, social network
|
5 |
Requires at least: 2.5.0
|
6 |
Tested up to: 4.6.1
|
7 |
-
Stable tag: 7.8.
|
8 |
License: GPLv2 or later
|
9 |
|
10 |
The unique Social Plugin to let you integrate Social Login, Social Share and Social Comments at your website
|
@@ -204,6 +204,11 @@ Yes, we can help you with it. Just drop an email at support@heateor.com
|
|
204 |
8. **Social Commenting**: Disqus Commenting selected
|
205 |
|
206 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
207 |
= 7.8.5 =
|
208 |
* [Bugfix] Email sharing was not working in some cases
|
209 |
* [Bugfix] Myspace sharing was not working
|
@@ -1078,4 +1083,9 @@ Yes, we can help you with it. Just drop an email at support@heateor.com
|
|
1078 |
* [Bugfix] Email sharing was not working in some cases
|
1079 |
* [Bugfix] Myspace sharing was not working
|
1080 |
* [Bugfix] Myspace was not appearing in "More" share icons popup
|
1081 |
-
* [Bugfix] Colon (:) in post/page title was appearing encoded in Twitter sharing
|
|
|
|
|
|
|
|
|
|
4 |
Tags: the champ, champ, social login, social sharing, social commenting, social comments, social plugin, buddypress, bbpress, social share, comments, share post, user profile data, social analytics, online identity, social profile storage, id provider, single sign-on, social media tools, free social login, post to social networks, social authentication, social app, connect, capture social data, social sign-in, signin, sign up, signup, social connect, facebook login, twitter login, google login, google+ login, linkedin login, yahoo, vkontakte, instagram, reddit, digg, stumbleupon, delicious, float it, tumblr, social network
|
5 |
Requires at least: 2.5.0
|
6 |
Tested up to: 4.6.1
|
7 |
+
Stable tag: 7.8.6
|
8 |
License: GPLv2 or later
|
9 |
|
10 |
The unique Social Plugin to let you integrate Social Login, Social Share and Social Comments at your website
|
204 |
8. **Social Commenting**: Disqus Commenting selected
|
205 |
|
206 |
== Changelog ==
|
207 |
+
= 7.8.6 =
|
208 |
+
* [New] Compatible with <a href="https://www.heateor.com/recover-social-share-counts" target="_blank">Recover Social Share Counts</a> add-on
|
209 |
+
* [Bugfix] Logged in users were able to see their Social Account Linking interface at other users' BuddyPress profile page too
|
210 |
+
* [Bugfix] Vkontakte share count was not working in some cases
|
211 |
+
|
212 |
= 7.8.5 =
|
213 |
* [Bugfix] Email sharing was not working in some cases
|
214 |
* [Bugfix] Myspace sharing was not working
|
1083 |
* [Bugfix] Email sharing was not working in some cases
|
1084 |
* [Bugfix] Myspace sharing was not working
|
1085 |
* [Bugfix] Myspace was not appearing in "More" share icons popup
|
1086 |
+
* [Bugfix] Colon (:) in post/page title was appearing encoded in Twitter sharing
|
1087 |
+
|
1088 |
+
= 7.8.6 =
|
1089 |
+
* [New] Compatible with <a href="https://www.heateor.com/recover-social-share-counts" target="_blank">Recover Social Share Counts</a> add-on
|
1090 |
+
* [Bugfix] Logged in users were able to see their Social Account Linking interface at other users' BuddyPress profile page too
|
1091 |
+
* [Bugfix] Vkontakte share count was not working in some cases
|
super_socializer.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Super Socializer
|
4 |
Plugin URI: http://super-socializer-wordpress.heateor.com
|
5 |
Description: A complete 360 degree solution to provide all the social features like Social Login, Social Commenting, Social Sharing and more.
|
6 |
-
Version: 7.8.
|
7 |
Author: Team Heateor
|
8 |
Author URI: https://www.heateor.com
|
9 |
Text Domain: Super-Socializer
|
@@ -11,7 +11,7 @@ Domain Path: /languages
|
|
11 |
License: GPL2+
|
12 |
*/
|
13 |
defined('ABSPATH') or die("Cheating........Uh!!");
|
14 |
-
define('THE_CHAMP_SS_VERSION', '7.8.
|
15 |
|
16 |
require 'helper.php';
|
17 |
|
3 |
Plugin Name: Super Socializer
|
4 |
Plugin URI: http://super-socializer-wordpress.heateor.com
|
5 |
Description: A complete 360 degree solution to provide all the social features like Social Login, Social Commenting, Social Sharing and more.
|
6 |
+
Version: 7.8.6
|
7 |
Author: Team Heateor
|
8 |
Author URI: https://www.heateor.com
|
9 |
Text Domain: Super-Socializer
|
11 |
License: GPL2+
|
12 |
*/
|
13 |
defined('ABSPATH') or die("Cheating........Uh!!");
|
14 |
+
define('THE_CHAMP_SS_VERSION', '7.8.6');
|
15 |
|
16 |
require 'helper.php';
|
17 |
|