Social Media Share Buttons | MashShare - Version 3.5.6

Version Description

  • Fix: Security fix to prevent XSS attacks
Download this release

Release Info

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

Code changes from version 3.5.5 to 3.5.6

assets/js/mashsb.js CHANGED
@@ -247,7 +247,7 @@ jQuery(document).ready(function ($) {
247
  /* Network sharer scripts */
248
  /* deactivate FB sharer when likeaftershare is enabled */
249
  if (typeof lashare_fb == "undefined" && typeof mashsb !== 'undefined') {
250
- $('.mashicon-facebook').click(function (mashfb) {
251
 
252
  winWidth = 520;
253
  winHeight = 550;
@@ -256,7 +256,7 @@ jQuery(document).ready(function ($) {
256
  var url = $(this).attr('href');
257
 
258
  window.open(url, 'sharer', 'top=' + winTop + ',left=' + winLeft + ',toolbar=0,status=0,width=' + winWidth + ',height=' + winHeight);
259
- mashfb.preventDefault(mashfb);
260
  return false;
261
  });
262
  }
247
  /* Network sharer scripts */
248
  /* deactivate FB sharer when likeaftershare is enabled */
249
  if (typeof lashare_fb == "undefined" && typeof mashsb !== 'undefined') {
250
+ $('.mashicon-facebook').click(function () {
251
 
252
  winWidth = 520;
253
  winHeight = 550;
256
  var url = $(this).attr('href');
257
 
258
  window.open(url, 'sharer', 'top=' + winTop + ',left=' + winLeft + ',toolbar=0,status=0,width=' + winWidth + ',height=' + winHeight);
259
+ e.preventDefault();
260
  return false;
261
  });
262
  }
assets/js/mashsb.min.js CHANGED
@@ -1 +1 @@
1
- var strict;jQuery(document).ready(function(a){function b(){if("undefined"==typeof mashsb.servertime)return!0;var a=Number(mashsb.servertime),b=Math.floor(Date.now()/1e3);return b>a+30?(console.log("rate limited: "+(a+30)),!0):(console.log("not rate limited: "+(a+30)),!1)}function c(b){if("undefined"==typeof b.share)return console.log("No valid result"+b),!1;var c={action:"mashsb_set_fb_shares",shares:b.share,postid:mashsb.postid,url:mashsb.share_url,nonce:mashsb.nonce};a.ajax({type:"post",url:mashsb.ajaxurl,data:c,success:function(a){console.log("Save fb results: "+a)},error:function(a){console.log("Unknown error "+a)}})}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)}(navigator.userAgent.match(/(iPhone)/i)||navigator.userAgent.match(/(Android)/i))&&a(".mashicon-whatsapp").show();var e=function(){if(null===document.querySelector(".mashsb-buttons"))return!1;if("undefined"!=typeof mashsb.refresh&&"0"===mashsb.refresh)return!1;if("undefined"==typeof mashsb.share_url&&""!==mashsb.share_url)return!1;if("undefined"==typeof mashsb.postid&&""!==mashsb.postid)return!1;if(b())return!1;var d="https://graph.facebook.com/?id="+mashsb.share_url;a.ajax({type:"GET",url:d,dataType:"json",success:function(a){c(a),console.log(a)},error:function(a){console.log(a)}})};setTimeout(e,3e3),a("body").off("click",".mashicon-pinterest").on("click",".mashicon-pinterest",function(b){b.preventDefault(),console.log("preventDefault:"+b),winWidth=520,winHeight=350;var c=screen.height/2-winHeight/2,d=screen.width/2-winWidth/2,e=a(this).attr("data-mashsb-url");window.open(e,"sharer","top="+c+",left="+d+",toolbar=0,status=0,width="+winWidth+",height="+winHeight+",resizable=yes")}),""==a(".mashsbcount").text()&&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){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);
1
+ var strict;jQuery(document).ready(function(a){function b(){if("undefined"==typeof mashsb.servertime)return!0;var a=Number(mashsb.servertime),b=Math.floor(Date.now()/1e3);return b>a+30?(console.log("rate limited: "+(a+30)),!0):(console.log("not rate limited: "+(a+30)),!1)}function c(b){if("undefined"==typeof b.share)return console.log("No valid result"+b),!1;var c={action:"mashsb_set_fb_shares",shares:b.share,postid:mashsb.postid,url:mashsb.share_url,nonce:mashsb.nonce};a.ajax({type:"post",url:mashsb.ajaxurl,data:c,success:function(a){console.log("Save fb results: "+a)},error:function(a){console.log("Unknown error "+a)}})}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)}(navigator.userAgent.match(/(iPhone)/i)||navigator.userAgent.match(/(Android)/i))&&a(".mashicon-whatsapp").show();var f=function(){if(null===document.querySelector(".mashsb-buttons"))return!1;if("undefined"!=typeof mashsb.refresh&&"0"===mashsb.refresh)return!1;if("undefined"==typeof mashsb.share_url&&""!==mashsb.share_url)return!1;if("undefined"==typeof mashsb.postid&&""!==mashsb.postid)return!1;if(b())return!1;var d="https://graph.facebook.com/?id="+mashsb.share_url;a.ajax({type:"GET",url:d,dataType:"json",success:function(a){c(a),console.log(a)},error:function(a){console.log(a)}})};setTimeout(f,3e3),a("body").off("click",".mashicon-pinterest").on("click",".mashicon-pinterest",function(b){b.preventDefault(),console.log("preventDefault:"+b),winWidth=520,winHeight=350;var c=screen.height/2-winHeight/2,d=screen.width/2-winWidth/2,e=a(this).attr("data-mashsb-url");window.open(e,"sharer","top="+c+",left="+d+",toolbar=0,status=0,width="+winWidth+",height="+winHeight+",resizable=yes")}),""==a(".mashsbcount").text()&&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(){winWidth=520,winHeight=550;var b=screen.height/2-winHeight/2,c=screen.width/2-winWidth/2,d=a(this).attr("href");return window.open(d,"sharer","top="+b+",left="+c+",toolbar=0,status=0,width="+winWidth+",height="+winHeight),e.preventDefault(),!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){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);
includes/sharecount-functions.php CHANGED
@@ -23,13 +23,11 @@ function mashsb_set_fb_sharecount() {
23
 
24
  // Ajax result
25
  $result = isset( $_POST['shares'] ) ? $_POST['shares'] : false;
26
- $comment_count = isset( $result['comment_count'] ) ? $result['comment_count'] : 0;
27
- $share_count = isset( $result['share_count'] ) ? $result['share_count'] : 0;
28
- //$url = isset( $result['share_url'] ) ? $result['share_url'] : '';
29
 
30
  if( !$postId || empty($postId) ) {
31
  wp_die('MashShare: do not collect shares');
32
- //wp_die(mashsb_set_fb_shares_transient( $url, $comment_count, $share_count) );
33
  }
34
 
35
  // Cache results
23
 
24
  // Ajax result
25
  $result = isset( $_POST['shares'] ) ? $_POST['shares'] : false;
26
+ $comment_count = isset( $result['comment_count'] ) ? (int)$result['comment_count'] : 0;
27
+ $share_count = isset( $result['share_count'] ) ? (int)$result['share_count'] : 0;
 
28
 
29
  if( !$postId || empty($postId) ) {
30
  wp_die('MashShare: do not collect shares');
 
31
  }
32
 
33
  // Cache results
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.5.5
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.5.5' );
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.5.6
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.5.6' );
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, dsgvo
10
  Requires at least: 3.6+
11
  Tested up to: 4.9
12
- Stable tag: 3.5.5
13
  Requires PHP: 5.2
14
 
15
  Social Media Share Buttons for Twitter, Facebook and other social networks. Highly customizable Social Media ecosystem
@@ -250,6 +250,9 @@ Read here more about this: http://docs.mashshare.net/article/10-facebook-is-show
250
 
251
  == Changelog ==
252
 
 
 
 
253
  = 3.5.5 =
254
  * Tweak: Explain better sharedcount and opensharecount integration
255
  * Fix: Error array_merge is not an array
@@ -345,9 +348,6 @@ https://www.mashshare.net/changelog/
345
 
346
  == Upgrade Notice ==
347
 
348
- = 3.5.5 =
349
- * New: Support for Yoast custom variables e.g. %%title%%
350
- * New: Add sharedcount.com 10.000 free daily api requests
351
- * New: Switch from newsharecount to opensharecount.com to collect twitter shares
352
- * New: Collect twitter shares with social network add-on
353
 
9
  Tags: Share buttons, Social Sharing, social media, Facebook, Twitter, Subscribe, Traffic posts, pages, widget, social share buttons, analytics, email, dsgvo
10
  Requires at least: 3.6+
11
  Tested up to: 4.9
12
+ Stable tag: 3.5.6
13
  Requires PHP: 5.2
14
 
15
  Social Media Share Buttons for Twitter, Facebook and other social networks. Highly customizable Social Media ecosystem
250
 
251
  == Changelog ==
252
 
253
+ = 3.5.6 =
254
+ * Fix: Security fix to prevent XSS attacks
255
+
256
  = 3.5.5 =
257
  * Tweak: Explain better sharedcount and opensharecount integration
258
  * Fix: Error array_merge is not an array
348
 
349
  == Upgrade Notice ==
350
 
351
+ = 3.5.6 =
352
+ * New: Security Fix
 
 
 
353