Social Media Share Buttons | MashShare - Version 3.6.4

Version Description

  • New: Compatible up to WordPress 5.2
  • Fix: Do not call the facebook api directly any longer
  • Fix: Undefined variable notice after uninstallation and deleting all MashShare settings an installation again
Download this release

Release Info

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

Code changes from version 3.6.3 to 3.6.4

assets/js/mashsb.js CHANGED
@@ -11,6 +11,8 @@ jQuery(document).ready(function ($) {
11
  * Get facebook share count vi js client request
12
  *
13
  * @returns {undefined}
 
 
14
  */
15
  var mashsb_get_fb_shares = function ()
16
  {
@@ -56,7 +58,7 @@ jQuery(document).ready(function ($) {
56
  }
57
  // Make sure page has been loaded completely before requesting any shares via ajax
58
  // This also prevents hitting the server too often
59
- setTimeout(mashsb_get_fb_shares, 3000);
60
 
61
  /**
62
  * If page is older than 30 second it's cached. So do not call FB API again
11
  * Get facebook share count vi js client request
12
  *
13
  * @returns {undefined}
14
+ *
15
+ * not used any longer
16
  */
17
  var mashsb_get_fb_shares = function ()
18
  {
58
  }
59
  // Make sure page has been loaded completely before requesting any shares via ajax
60
  // This also prevents hitting the server too often
61
+ //setTimeout(mashsb_get_fb_shares, 3000);
62
 
63
  /**
64
  * If page is older than 30 second it's cached. So do not call FB API again
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(){return b()?!1:void setTimeout(function(){"1"==mashsb.refresh&&e()},6e3)}function e(){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 f(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 g=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(g,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),d(),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(),!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:f,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(){return b()?!1:void setTimeout(function(){"1"==mashsb.refresh&&d()},6e3)}function d(){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 e(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();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),c(),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(),!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:e,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/admin/settings/register-settings.php CHANGED
@@ -150,7 +150,7 @@ function mashsb_get_registered_settings() {
150
  'caching_method' => array(
151
  'id' => 'caching_method',
152
  'name' => __( 'Caching Method', 'mashsb' ),
153
- 'desc' => sprintf(__( 'The <i>Async Cache Refresh</i> method never adds additonal load time for a visitor and refreshes the cache asyncronously in the background. <br><br>- New posts are updated at each hour. <br>- Posts older than 3 weeks are updated every 4 hours<br>- Post older than 2 months are updated every 12 hours<br><br> <i>Refresh while loading</i> rebuilds expired cache while page is loading and adds a little extra time during inital page load. <br><br><strong>If shares are not updating</strong> or site is heavy cached try <i>Refresh while loading!</i> That\'s the default method.<br>Shares still not shown? <a href="%1s" target="_blank">Read this first!</a>', 'mashsb' ), 'http://docs.mashshare.net/article/4-try-this-first-before-troubleshooting'),
154
  'type' => 'select',
155
  'options' => array(
156
  'async_cache' => 'Async Cache Refresh',
150
  'caching_method' => array(
151
  'id' => 'caching_method',
152
  'name' => __( 'Caching Method', 'mashsb' ),
153
+ 'desc' => sprintf(__( '<strong>Async Cache Refresh</strong> <br/>Refreshes the cache asyncronously in the background. <br><br>- New posts are updated at each hour. <br>- Posts older than 3 weeks are updated every 4 hours<br>- Post older than 2 months are updated every 12 hours<br><br> <strong>Refresh while loading</strong> <br/> Rebuilds expired cache while page is loaded after cache expiration time. <br><br><strong>If shares are not updating</strong> or site is heavy cached activate <i>Refresh while loading!</i> <br/>That\'s the default method.<br>Shares still not shown? <a href="%1s" target="_blank">Read this first!</a>', 'mashsb' ), 'http://docs.mashshare.net/article/4-try-this-first-before-troubleshooting'),
154
  'type' => 'select',
155
  'options' => array(
156
  'async_cache' => 'Async Cache Refresh',
includes/install.php CHANGED
@@ -123,7 +123,9 @@ function mashsb_install() {
123
  * Setup the default network options
124
  * Store our initial social networks in separate option row.
125
  */
126
- if( is_plugin_inactive( 'mashshare-networks/mashshare-networks.php' ) ) {
 
 
127
  $networks = array(
128
  'Facebook',
129
  'Twitter',
123
  * Setup the default network options
124
  * Store our initial social networks in separate option row.
125
  */
126
+
127
+ $networks = get_option('mashsb_networks');
128
+ if( is_plugin_inactive( 'mashshare-networks/mashshare-networks.php' ) || false === $networks || empty($networks) ) {
129
  $networks = array(
130
  'Facebook',
131
  'Twitter',
includes/scripts.php CHANGED
@@ -72,7 +72,8 @@ function mashsb_load_scripts( $hook ) {
72
 
73
  $status = apply_filters('mashsbStatus', false);
74
 
75
- $refresh = mashsb_is_cache_refresh() ? 1 : 0;
 
76
 
77
  wp_localize_script( 'mashsb', 'mashsb', array(
78
  'shares' => isset($post->ID) ? mashsb_get_total_shares_post_meta($post->ID) + (int)getFakecount() : false,
72
 
73
  $status = apply_filters('mashsbStatus', false);
74
 
75
+ //$refresh = mashsb_is_cache_refresh() ? 1 : 0;
76
+ $refresh = 0;
77
 
78
  wp_localize_script( 'mashsb', 'mashsb', array(
79
  'shares' => isset($post->ID) ? mashsb_get_total_shares_post_meta($post->ID) + (int)getFakecount() : false,
includes/sharedcount.class.php CHANGED
@@ -107,7 +107,7 @@ class mashsbSharedcount {
107
  break;
108
  default:
109
  $counts['shares']['fb'] = $sharecounts['Facebook']['share_count'];
110
- $counts['shares']['fb_https'] = $sharecounts['https']['Facebook']['share_count'];
111
  }
112
  isset( $sharecounts['Twitter'] ) ? $counts['shares']['tw'] = $sharecounts['Twitter'] : $counts['shares']['tw'] = 0;
113
  isset( $sharecounts['GooglePlusOne'] ) ? $counts['shares']['gp'] = $sharecounts['GooglePlusOne'] : $counts['shares']['gp'] = 0;
107
  break;
108
  default:
109
  $counts['shares']['fb'] = $sharecounts['Facebook']['share_count'];
110
+ $counts['shares']['fb_https'] = isset($sharecounts['https']['Facebook']['share_count']) ? $sharecounts['https']['Facebook']['share_count'] : '';
111
  }
112
  isset( $sharecounts['Twitter'] ) ? $counts['shares']['tw'] = $sharecounts['Twitter'] : $counts['shares']['tw'] = 0;
113
  isset( $sharecounts['GooglePlusOne'] ) ? $counts['shares']['gp'] = $sharecounts['GooglePlusOne'] : $counts['shares']['gp'] = 0;
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.6.3
10
  * Text Domain: mashsb
11
  * Domain Path: /languages
12
 
@@ -35,7 +35,7 @@ if( !defined( 'ABSPATH' ) )
35
 
36
  // Plugin version
37
  if( !defined( 'MASHSB_VERSION' ) ) {
38
- define( 'MASHSB_VERSION', '3.6.3' );
39
  }
40
 
41
  // Debug mode
@@ -44,7 +44,7 @@ if( !defined( 'MASHSB_DEBUG' ) ) {
44
  }
45
 
46
 
47
- if( !class_exists( 'mashshare' ) ) :
48
 
49
  /**
50
  * Main mashsb Class
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.6.4
10
  * Text Domain: mashsb
11
  * Domain Path: /languages
12
 
35
 
36
  // Plugin version
37
  if( !defined( 'MASHSB_VERSION' ) ) {
38
+ define( 'MASHSB_VERSION', '3.6.4' );
39
  }
40
 
41
  // Debug mode
44
  }
45
 
46
 
47
+ if( !class_exists( 'Mashshare' ) ) :
48
 
49
  /**
50
  * Main mashsb Class
readme.txt CHANGED
@@ -8,8 +8,8 @@ License: GPLv2 or later
8
  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: 5.1
12
- Stable tag: 3.6.3
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,11 @@ Read here more about this: http://docs.mashshare.net/article/10-facebook-is-show
250
 
251
  == Changelog ==
252
 
 
 
 
 
 
253
  = 3.6.3 =
254
  * Fix: Option Cumulate Http(s) Shares not working for sharedcount.com API endpoint
255
  * Fix: Tweets can be requested via opensharecount.com
@@ -315,7 +320,9 @@ https://www.mashshare.net/changelog/
315
 
316
  == Upgrade Notice ==
317
 
318
- = 3.6.3 =
319
- * Fix: Option Cumulate Http(s) Shares not working for sharedcount.com API endpoint
 
 
320
 
321
 
8
  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: 5.2
12
+ Stable tag: 3.6.4
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.6.4 =
254
+ * New: Compatible up to WordPress 5.2
255
+ * Fix: Do not call the facebook api directly any longer
256
+ * Fix: Undefined variable notice after uninstallation and deleting all MashShare settings an installation again
257
+
258
  = 3.6.3 =
259
  * Fix: Option Cumulate Http(s) Shares not working for sharedcount.com API endpoint
260
  * Fix: Tweets can be requested via opensharecount.com
320
 
321
  == Upgrade Notice ==
322
 
323
+ = 3.6.4 =
324
+ * New: Compatible up to WordPress 5.2
325
+ * Fix: Do not call the facebook api directly any longer
326
+ * Fix: Undefined variable notice after uninstallation and deleting all MashShare settings an installation again
327
 
328