Social Media Share Buttons | MashShare - Version 3.3.8

Version Description

  • Fix: Zero shares are not shown with the use of the inline post plugin
  • Fix: jQuery nearest library not detected with older jQuery versions
Download this release

Release Info

Developer ReneHermi
Plugin Icon 128x128 Social Media Share Buttons | MashShare
Version 3.3.8
Comparing to
See all releases

Code changes from version 3.3.7 to 3.3.8

assets/js/mashsb.js CHANGED
@@ -51,6 +51,12 @@ var strict;
51
  jQuery(document).ready(function ($) {
52
 
53
  mashsb_check_cache();
 
 
 
 
 
 
54
 
55
  /**
56
  * Check Cache
@@ -181,19 +187,19 @@ jQuery(document).ready(function ($) {
181
 
182
  if (typeof mashsb !== 'undefined' && mashsb.subscribe === 'content') {
183
  /* Toogle container display:none */
184
- jQuery('.mashicon-subscribe').not('.trigger_active').nearest('.mashsb-toggle-container').hide();
185
- jQuery('.mashicon-subscribe').click(function () {
186
- var trig = jQuery(this);
187
  if (trig.hasClass('trigger_active')) {
188
- jQuery(trig).nearest('.mashsb-toggle-container').slideToggle('fast');
189
  trig.removeClass('trigger_active');
190
- //jQuery(".mashicon-subscribe").css({"padding-bottom":"10px"});
191
  } else {
192
- jQuery('.trigger_active').nearest('.mashsb-toggle-container').slideToggle('slow');
193
- jQuery('.trigger_active').removeClass('trigger_active');
194
- jQuery(trig).nearest('.mashsb-toggle-container').slideToggle('fast');
195
  trig.addClass('trigger_active');
196
- //jQuery(".mashicon-subscribe").css({"padding-bottom":"13px"});
197
  }
198
  ;
199
  return false;
@@ -331,7 +337,7 @@ jQuery(document).ready(function ($) {
331
  ajaxListener.action = getAction(ajaxListener.data);
332
  }
333
 
334
- // jQuery overwrites onstatechange (darn you jQuery!),
335
  // we need to monitor readyState and the status
336
  var pointer = this;
337
  interval[ajaxListener.action] = window.setInterval(ajaxListener.callback, 100, pointer);
51
  jQuery(document).ready(function ($) {
52
 
53
  mashsb_check_cache();
54
+
55
+ // Fix for the inline post plugin which removes the zero share count
56
+ if ($('.mashsbcount').text() == ''){
57
+ console.log('test');
58
+ $('.mashsbcount').text(0);
59
+ }
60
 
61
  /**
62
  * Check Cache
187
 
188
  if (typeof mashsb !== 'undefined' && mashsb.subscribe === 'content') {
189
  /* Toogle container display:none */
190
+ $('.mashicon-subscribe').not('.trigger_active').nearest('.mashsb-toggle-container').hide();
191
+ $('.mashicon-subscribe').click(function () {
192
+ var trig = $(this);
193
  if (trig.hasClass('trigger_active')) {
194
+ $(trig).nearest('.mashsb-toggle-container').slideToggle('fast');
195
  trig.removeClass('trigger_active');
196
+ //$(".mashicon-subscribe").css({"padding-bottom":"10px"});
197
  } else {
198
+ $('.trigger_active').nearest('.mashsb-toggle-container').slideToggle('slow');
199
+ $('.trigger_active').removeClass('trigger_active');
200
+ $(trig).nearest('.mashsb-toggle-container').slideToggle('fast');
201
  trig.addClass('trigger_active');
202
+ //$(".mashicon-subscribe").css({"padding-bottom":"13px"});
203
  }
204
  ;
205
  return false;
337
  ajaxListener.action = getAction(ajaxListener.data);
338
  }
339
 
340
+ // $ overwrites onstatechange (darn you jQuery!),
341
  // we need to monitor readyState and the status
342
  var pointer = this;
343
  interval[ajaxListener.action] = window.setInterval(ajaxListener.callback, 100, pointer);
assets/js/mashsb.min.js CHANGED
@@ -1 +1 @@
1
- var strict;!function(a,b){a.fn.nearest=function(c){function d(b){f=f?f.add(b):a(b)}var e,f,g,h,i,j=b.querySelectorAll;return this.each(function(){e=this,a.each(c.split(","),function(){if(h=a.trim(this),h.indexOf("#"))for(i=e.parentNode;i;){if(g=j?i.querySelectorAll(h):a(i).find(h),g.length){d(g);break}i=i.parentNode}else d(j?b.querySelectorAll(h):a(h))})}),f||a()}}(jQuery,document),jQuery(document).ready(function(a){function b(){setTimeout(function(){"1"==mashsb.refresh&&c()},6e3)}function c(){var a=window.location.href;a+=a.indexOf("?")>-1?"&mashsb-refresh":"?mashsb-refresh";var b=new XMLHttpRequest;b.open("GET",a,!0),b.send()}function d(a){if("undefined"!=typeof mashsb&&1==mashsb.round_shares){if(a>1e6)return shares=Math.round(a/1e6*10)/10+"M",shares;if(a>1e3)return shares=Math.round(a/1e3*10)/10+"k",shares}return a.toFixed(0)}b(),a(".onoffswitch").on("click",function(){var b=a(this).parents(".mashsb-container");b.find(".onoffswitch").hide(),b.find(".secondary-shares").show(),b.find(".onoffswitch2").show()}),a(".onoffswitch2").on("click",function(){var b=a(this).parents(".mashsb-container");b.find(".onoffswitch").show(),b.find(".secondary-shares").hide()}),"undefined"==typeof lashare_fb&&"undefined"!=typeof mashsb&&a(".mashicon-facebook").click(function(b){winWidth=520,winHeight=550;var c=screen.height/2-winHeight/2,d=screen.width/2-winWidth/2,e=a(this).attr("href");return window.open(e,"sharer","top="+c+",left="+d+",toolbar=0,status=0,width="+winWidth+",height="+winHeight),b.preventDefault(b),!1}),"undefined"!=typeof mashsb&&a(".mashicon-twitter").click(function(b){winWidth=520,winHeight=350;var c=screen.height/2-winHeight/2,d=screen.width/2-winWidth/2,e=a(this).attr("href");return"1"===mashsb.twitter_popup&&window.open(e,"sharer","top="+c+",left="+d+",toolbar=0,status=0,width="+winWidth+",height="+winHeight),b.preventDefault(),!1}),"undefined"!=typeof mashsb&&"content"===mashsb.subscribe&&(jQuery(".mashicon-subscribe").not(".trigger_active").nearest(".mashsb-toggle-container").hide(),jQuery(".mashicon-subscribe").click(function(){var a=jQuery(this);return a.hasClass("trigger_active")?(jQuery(a).nearest(".mashsb-toggle-container").slideToggle("fast"),a.removeClass("trigger_active")):(jQuery(".trigger_active").nearest(".mashsb-toggle-container").slideToggle("slow"),jQuery(".trigger_active").removeClass("trigger_active"),jQuery(a).nearest(".mashsb-toggle-container").slideToggle("fast"),a.addClass("trigger_active")),!1})),"undefined"!=typeof mashsb&&"link"===mashsb.subscribe&&a(".mashicon-subscribe").click(function(){var b=mashsb.subscribe_url;a(this).attr("href",b)}),function(a){a.fn.countTo=function(b){return b=b||{},a(this).each(function(){function c(){k+=g,j++,d(k),"function"==typeof e.onUpdate&&e.onUpdate.call(h,k),j>=f&&(i.removeData("countTo"),clearInterval(l.interval),k=e.to,"function"==typeof e.onComplete&&e.onComplete.call(h,k))}function d(a){var b=e.formatter.call(h,a,e);i.text(b)}var e=a.extend({},a.fn.countTo.defaults,{from:a(this).data("from"),to:a(this).data("to"),speed:a(this).data("speed"),refreshInterval:a(this).data("refresh-interval"),decimals:a(this).data("decimals")},b),f=Math.ceil(e.speed/e.refreshInterval),g=(e.to-e.from)/f,h=this,i=a(this),j=0,k=e.from,l=i.data("countTo")||{};i.data("countTo",l),l.interval&&clearInterval(l.interval),l.interval=setInterval(c,e.refreshInterval),d(k)})},a.fn.countTo.defaults={from:0,to:0,speed:1e3,refreshInterval:100,decimals:0,formatter:d,onUpdate:null,onComplete:null}}(jQuery),"undefined"!=typeof mashsb&&1==mashsb.animate_shares&&a(".mashsbcount").length&&a(".mashsbcount").countTo({from:0,to:mashsb.shares,speed:1e3,refreshInterval:100})}),function(a,b){"function"==typeof define&&define.amd?define(b):"object"==typeof exports?module.exports=b():a.ResizeSensor=b()}(this,function(){function a(a,b){var c=Object.prototype.toString.call(a),d="[object Array]"===c||"[object NodeList]"===c||"[object HTMLCollection]"===c||"undefined"!=typeof jQuery&&a instanceof jQuery||"undefined"!=typeof Elements&&a instanceof Elements,e=0,f=a.length;if(d)for(;f>e;e++)b(a[e]);else b(a)}var b=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(a){return window.setTimeout(a,20)},c=function(d,e){function f(){var a=[];this.add=function(b){a.push(b)};var b,c;this.call=function(){for(b=0,c=a.length;c>b;b++)a[b].call()},this.remove=function(d){var e=[];for(b=0,c=a.length;c>b;b++)a[b]!==d&&e.push(a[b]);a=e},this.length=function(){return a.length}}function g(a,b){return a.currentStyle?a.currentStyle[b]:window.getComputedStyle?window.getComputedStyle(a,null).getPropertyValue(b):a.style[b]}function h(a,c){if(a.resizedAttached){if(a.resizedAttached)return void a.resizedAttached.add(c)}else a.resizedAttached=new f,a.resizedAttached.add(c);a.resizeSensor=document.createElement("div"),a.resizeSensor.className="resize-sensor";var d="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;",e="position: absolute; left: 0; top: 0; transition: 0s;";a.resizeSensor.style.cssText=d,a.resizeSensor.innerHTML='<div class="resize-sensor-expand" style="'+d+'"><div style="'+e+'"></div></div><div class="resize-sensor-shrink" style="'+d+'"><div style="'+e+' width: 200%; height: 200%"></div></div>',a.appendChild(a.resizeSensor),"static"==g(a,"position")&&(a.style.position="relative");var h=a.resizeSensor.childNodes[0],i=h.childNodes[0],j=a.resizeSensor.childNodes[1],k=function(){i.style.width=1e5+"px",i.style.height=1e5+"px",h.scrollLeft=1e5,h.scrollTop=1e5,j.scrollLeft=1e5,j.scrollTop=1e5};k();var l=!1,m=function(){a.resizedAttached&&(l&&(a.resizedAttached.call(),l=!1),b(m))};b(m);var n,o,p,q,r=function(){((p=a.offsetWidth)!=n||(q=a.offsetHeight)!=o)&&(l=!0,n=p,o=q),k()},s=function(a,b,c){a.attachEvent?a.attachEvent("on"+b,c):a.addEventListener(b,c)};s(h,"scroll",r),s(j,"scroll",r)}a(d,function(a){h(a,e)}),this.detach=function(a){c.detach(d,a)}};return c.detach=function(b,c){a(b,function(a){a.resizedAttached&&"function"==typeof c&&(a.resizedAttached.remove(c),a.resizedAttached.length())||a.resizeSensor&&(a.contains(a.resizeSensor)&&a.removeChild(a.resizeSensor),delete a.resizeSensor,delete a.resizedAttached)})},c});
1
+ var strict;!function(a,b){a.fn.nearest=function(c){function d(b){f=f?f.add(b):a(b)}var e,f,g,h,i,j=b.querySelectorAll;return this.each(function(){e=this,a.each(c.split(","),function(){if(h=a.trim(this),h.indexOf("#"))for(i=e.parentNode;i;){if(g=j?i.querySelectorAll(h):a(i).find(h),g.length){d(g);break}i=i.parentNode}else d(j?b.querySelectorAll(h):a(h))})}),f||a()}}(jQuery,document),jQuery(document).ready(function(a){function b(){setTimeout(function(){"1"==mashsb.refresh&&c()},6e3)}function c(){var a=window.location.href;a+=a.indexOf("?")>-1?"&mashsb-refresh":"?mashsb-refresh";var b=new XMLHttpRequest;b.open("GET",a,!0),b.send()}function d(a){if("undefined"!=typeof mashsb&&1==mashsb.round_shares){if(a>1e6)return shares=Math.round(a/1e6*10)/10+"M",shares;if(a>1e3)return shares=Math.round(a/1e3*10)/10+"k",shares}return a.toFixed(0)}b(),""==a(".mashsbcount").text()&&(console.log("test"),a(".mashsbcount").text(0)),a(".onoffswitch").on("click",function(){var b=a(this).parents(".mashsb-container");b.find(".onoffswitch").hide(),b.find(".secondary-shares").show(),b.find(".onoffswitch2").show()}),a(".onoffswitch2").on("click",function(){var b=a(this).parents(".mashsb-container");b.find(".onoffswitch").show(),b.find(".secondary-shares").hide()}),"undefined"==typeof lashare_fb&&"undefined"!=typeof mashsb&&a(".mashicon-facebook").click(function(b){winWidth=520,winHeight=550;var c=screen.height/2-winHeight/2,d=screen.width/2-winWidth/2,e=a(this).attr("href");return window.open(e,"sharer","top="+c+",left="+d+",toolbar=0,status=0,width="+winWidth+",height="+winHeight),b.preventDefault(b),!1}),"undefined"!=typeof mashsb&&a(".mashicon-twitter").click(function(b){winWidth=520,winHeight=350;var c=screen.height/2-winHeight/2,d=screen.width/2-winWidth/2,e=a(this).attr("href");return"1"===mashsb.twitter_popup&&window.open(e,"sharer","top="+c+",left="+d+",toolbar=0,status=0,width="+winWidth+",height="+winHeight),b.preventDefault(),!1}),"undefined"!=typeof mashsb&&"content"===mashsb.subscribe&&(a(".mashicon-subscribe").not(".trigger_active").nearest(".mashsb-toggle-container").hide(),a(".mashicon-subscribe").click(function(){var b=a(this);return b.hasClass("trigger_active")?(a(b).nearest(".mashsb-toggle-container").slideToggle("fast"),b.removeClass("trigger_active")):(a(".trigger_active").nearest(".mashsb-toggle-container").slideToggle("slow"),a(".trigger_active").removeClass("trigger_active"),a(b).nearest(".mashsb-toggle-container").slideToggle("fast"),b.addClass("trigger_active")),!1})),"undefined"!=typeof mashsb&&"link"===mashsb.subscribe&&a(".mashicon-subscribe").click(function(){var b=mashsb.subscribe_url;a(this).attr("href",b)}),function(a){a.fn.countTo=function(b){return b=b||{},a(this).each(function(){function c(){k+=g,j++,d(k),"function"==typeof e.onUpdate&&e.onUpdate.call(h,k),j>=f&&(i.removeData("countTo"),clearInterval(l.interval),k=e.to,"function"==typeof e.onComplete&&e.onComplete.call(h,k))}function d(a){var b=e.formatter.call(h,a,e);i.text(b)}var e=a.extend({},a.fn.countTo.defaults,{from:a(this).data("from"),to:a(this).data("to"),speed:a(this).data("speed"),refreshInterval:a(this).data("refresh-interval"),decimals:a(this).data("decimals")},b),f=Math.ceil(e.speed/e.refreshInterval),g=(e.to-e.from)/f,h=this,i=a(this),j=0,k=e.from,l=i.data("countTo")||{};i.data("countTo",l),l.interval&&clearInterval(l.interval),l.interval=setInterval(c,e.refreshInterval),d(k)})},a.fn.countTo.defaults={from:0,to:0,speed:1e3,refreshInterval:100,decimals:0,formatter:d,onUpdate:null,onComplete:null}}(jQuery),"undefined"!=typeof mashsb&&1==mashsb.animate_shares&&a(".mashsbcount").length&&a(".mashsbcount").countTo({from:0,to:mashsb.shares,speed:1e3,refreshInterval:100})}),function(a,b){"function"==typeof define&&define.amd?define(b):"object"==typeof exports?module.exports=b():a.ResizeSensor=b()}(this,function(){function a(a,b){var c=Object.prototype.toString.call(a),d="[object Array]"===c||"[object NodeList]"===c||"[object HTMLCollection]"===c||"undefined"!=typeof jQuery&&a instanceof jQuery||"undefined"!=typeof Elements&&a instanceof Elements,e=0,f=a.length;if(d)for(;f>e;e++)b(a[e]);else b(a)}var b=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(a){return window.setTimeout(a,20)},c=function(d,e){function f(){var a=[];this.add=function(b){a.push(b)};var b,c;this.call=function(){for(b=0,c=a.length;c>b;b++)a[b].call()},this.remove=function(d){var e=[];for(b=0,c=a.length;c>b;b++)a[b]!==d&&e.push(a[b]);a=e},this.length=function(){return a.length}}function g(a,b){return a.currentStyle?a.currentStyle[b]:window.getComputedStyle?window.getComputedStyle(a,null).getPropertyValue(b):a.style[b]}function h(a,c){if(a.resizedAttached){if(a.resizedAttached)return void a.resizedAttached.add(c)}else a.resizedAttached=new f,a.resizedAttached.add(c);a.resizeSensor=document.createElement("div"),a.resizeSensor.className="resize-sensor";var d="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;",e="position: absolute; left: 0; top: 0; transition: 0s;";a.resizeSensor.style.cssText=d,a.resizeSensor.innerHTML='<div class="resize-sensor-expand" style="'+d+'"><div style="'+e+'"></div></div><div class="resize-sensor-shrink" style="'+d+'"><div style="'+e+' width: 200%; height: 200%"></div></div>',a.appendChild(a.resizeSensor),"static"==g(a,"position")&&(a.style.position="relative");var h=a.resizeSensor.childNodes[0],i=h.childNodes[0],j=a.resizeSensor.childNodes[1],k=function(){i.style.width=1e5+"px",i.style.height=1e5+"px",h.scrollLeft=1e5,h.scrollTop=1e5,j.scrollLeft=1e5,j.scrollTop=1e5};k();var l=!1,m=function(){a.resizedAttached&&(l&&(a.resizedAttached.call(),l=!1),b(m))};b(m);var n,o,p,q,r=function(){((p=a.offsetWidth)!=n||(q=a.offsetHeight)!=o)&&(l=!0,n=p,o=q),k()},s=function(a,b,c){a.attachEvent?a.attachEvent("on"+b,c):a.addEventListener(b,c)};s(h,"scroll",r),s(j,"scroll",r)}a(d,function(a){h(a,e)}),this.detach=function(a){c.detach(d,a)}};return c.detach=function(b,c){a(b,function(a){a.resizedAttached&&"function"==typeof c&&(a.resizedAttached.remove(c),a.resizedAttached.length())||a.resizeSensor&&(a.contains(a.resizeSensor)&&a.removeChild(a.resizeSensor),delete a.resizeSensor,delete a.resizedAttached)})},c});
includes/template-functions.php CHANGED
@@ -902,8 +902,7 @@ function getFakecount() {
902
 
903
 
904
  $fakecount = isset($mashsb_options['fake_count']) && is_numeric ($mashsb_options['fake_count']) ?
905
- round( $mashsb_options['fake_count'] * mashsb_get_fake_factor(), 0 ) :
906
- 0;
907
 
908
  return $fakecount;
909
 
902
 
903
 
904
  $fakecount = isset($mashsb_options['fake_count']) && is_numeric ($mashsb_options['fake_count']) ?
905
+ round( $mashsb_options['fake_count'] * mashsb_get_fake_factor(), 0 ) : 0;
 
906
 
907
  return $fakecount;
908
 
mashshare.php CHANGED
@@ -6,7 +6,7 @@
6
  * Description: Mashshare is a Share functionality inspired by the the great website Mashable for Facebook and Twitter. More networks available.
7
  * Author: René Hermenau
8
  * Author URI: https://www.mashshare.net
9
- * Version: 3.3.7
10
  * Text Domain: mashsb
11
  * Domain Path: /languages
12
  * Credits: Thanks go to Pippin Williamson and the edd team. When we started with Mashshare we decided to use the EDD code base and
@@ -37,7 +37,7 @@ if( !defined( 'ABSPATH' ) )
37
 
38
  // Plugin version
39
  if( !defined( 'MASHSB_VERSION' ) ) {
40
- define( 'MASHSB_VERSION', '3.3.7' );
41
  }
42
 
43
  // Debug mode
6
  * Description: Mashshare is a Share functionality inspired by the the great website Mashable for Facebook and Twitter. More networks available.
7
  * Author: René Hermenau
8
  * Author URI: https://www.mashshare.net
9
+ * Version: 3.3.8
10
  * Text Domain: mashsb
11
  * Domain Path: /languages
12
  * Credits: Thanks go to Pippin Williamson and the edd team. When we started with Mashshare we decided to use the EDD code base and
37
 
38
  // Plugin version
39
  if( !defined( 'MASHSB_VERSION' ) ) {
40
+ define( 'MASHSB_VERSION', '3.3.8' );
41
  }
42
 
43
  // Debug mode
readme.txt CHANGED
@@ -9,7 +9,7 @@ License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
  Tags: Share buttons, Social Sharing, social media, Facebook, Twitter, Subscribe, Traffic posts, pages, widget, social share buttons, analytics, email
10
  Requires at least: 3.6+
11
  Tested up to: 4.7.2
12
- Stable tag: 3.3.7
13
 
14
  Social Media Share Buttons for Twitter, Facebook and other social networks. Highly customizable Social Media ecosystem
15
 
@@ -316,6 +316,10 @@ Read here more FAQ: [https://www.mashshare.net/faq/](https://www.mashshare.net/f
316
 
317
  == Changelog ==
318
 
 
 
 
 
319
  = 3.3.7 =
320
  * New: Check once a day if facebook access token is expired and throw a message
321
  * New: Add feedback form if user is deactivating MashShare
9
  Tags: Share buttons, Social Sharing, social media, Facebook, Twitter, Subscribe, Traffic posts, pages, widget, social share buttons, analytics, email
10
  Requires at least: 3.6+
11
  Tested up to: 4.7.2
12
+ Stable tag: 3.3.8
13
 
14
  Social Media Share Buttons for Twitter, Facebook and other social networks. Highly customizable Social Media ecosystem
15
 
316
 
317
  == Changelog ==
318
 
319
+ = 3.3.8 =
320
+ * Fix: Zero shares are not shown with the use of the inline post plugin
321
+ * Fix: jQuery nearest library not detected with older jQuery versions
322
+
323
  = 3.3.7 =
324
  * New: Check once a day if facebook access token is expired and throw a message
325
  * New: Add feedback form if user is deactivating MashShare