Version Description
- Fix: Better wording for gdpr complicance in its settings
- Fix: Do not output any open graph tags if share options meta box is disabled
- Fix: Prevent facebook popup opening twice and causing chrome blocker
- New: Integration of twitcount.com to get twitter shares back
Download this release
Release Info
Developer | ReneHermi |
Plugin | Social Media Share Buttons | MashShare |
Version | 3.5.9 |
Comparing to | |
See all releases |
Code changes from version 3.5.8 to 3.5.9
- assets/js/mashsb.js +479 -480
- assets/js/mashsb.min.js +1 -1
- includes/admin/settings/register-settings.php +2 -2
- includes/header-meta-tags.php +7 -2
- includes/mashengine.php +6 -6
- includes/sharedcount.class.php +0 -30
- mashshare.php +2 -4
- readme.txt +9 -73
assets/js/mashsb.js
CHANGED
@@ -1,480 +1,479 @@
|
|
1 |
-
var strict;
|
2 |
-
|
3 |
-
jQuery(document).ready(function ($) {
|
4 |
-
|
5 |
-
/* Show Whatsapp button on mobile devices iPhones and Android only */
|
6 |
-
if (navigator.userAgent.match(/(iPhone)/i) || navigator.userAgent.match(/(Android)/i)) {
|
7 |
-
$('.mashicon-whatsapp').show();
|
8 |
-
}
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Get facebook share count vi js client request
|
12 |
-
*
|
13 |
-
* @returns {undefined}
|
14 |
-
*/
|
15 |
-
var mashsb_get_fb_shares = function ()
|
16 |
-
{
|
17 |
-
|
18 |
-
|
19 |
-
if (document.querySelector('.mashsb-buttons') === null) {
|
20 |
-
return false;
|
21 |
-
}
|
22 |
-
|
23 |
-
if ('undefined' !== typeof (mashsb.refresh) && mashsb.refresh === '0') {
|
24 |
-
return false;
|
25 |
-
}
|
26 |
-
|
27 |
-
if ('undefined' === typeof (mashsb.share_url) && mashsb.share_url !== '') {
|
28 |
-
return false;
|
29 |
-
}
|
30 |
-
|
31 |
-
if ('undefined' === typeof (mashsb.postid) && mashsb.postid !== '') {
|
32 |
-
return false;
|
33 |
-
}
|
34 |
-
|
35 |
-
if (mashsb_is_rate_limit()) {
|
36 |
-
return false;
|
37 |
-
}
|
38 |
-
|
39 |
-
//mashsb.share_url = 'https://www.google.de';
|
40 |
-
|
41 |
-
var facebookGraphURL = 'https://graph.facebook.com/?id=' + mashsb.share_url;
|
42 |
-
$.ajax({
|
43 |
-
type: 'GET',
|
44 |
-
url: facebookGraphURL,
|
45 |
-
dataType: 'json',
|
46 |
-
success: function (data) {
|
47 |
-
mashsb_set_fb_sharecount(data);
|
48 |
-
console.log(data);
|
49 |
-
},
|
50 |
-
error: function (e) {
|
51 |
-
console.log(e)
|
52 |
-
}
|
53 |
-
})
|
54 |
-
|
55 |
-
|
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
|
63 |
-
* @returns {Boolean}
|
64 |
-
*/
|
65 |
-
function mashsb_is_rate_limit() {
|
66 |
-
|
67 |
-
if ("undefined" === typeof (mashsb.servertime)) {
|
68 |
-
return true;
|
69 |
-
}
|
70 |
-
|
71 |
-
var serverTime = Number(mashsb.servertime);
|
72 |
-
var clientTime = Math.floor(Date.now() / 1000);
|
73 |
-
|
74 |
-
if (clientTime > (serverTime + 30)) {
|
75 |
-
console.log('rate limited: ' + (serverTime + 30));
|
76 |
-
return true;
|
77 |
-
} else {
|
78 |
-
console.log('not rate limited: ' + (serverTime + 30));
|
79 |
-
return false;
|
80 |
-
}
|
81 |
-
}
|
82 |
-
|
83 |
-
/**
|
84 |
-
* Store FB return data in mashshare cache vi js client request
|
85 |
-
* @returns {undefined}
|
86 |
-
*/
|
87 |
-
function mashsb_set_fb_sharecount(result) {
|
88 |
-
|
89 |
-
if ('undefined' === typeof (result.share)) {
|
90 |
-
console.log('No valid result' + result);
|
91 |
-
return false;
|
92 |
-
}
|
93 |
-
|
94 |
-
var data = {
|
95 |
-
action: 'mashsb_set_fb_shares',
|
96 |
-
shares: result.share,
|
97 |
-
postid: mashsb.postid,
|
98 |
-
url: mashsb.share_url,
|
99 |
-
nonce: mashsb.nonce
|
100 |
-
}
|
101 |
-
|
102 |
-
$.ajax({
|
103 |
-
type: "post",
|
104 |
-
url: mashsb.ajaxurl,
|
105 |
-
data: data,
|
106 |
-
success: function (res) {
|
107 |
-
console.log('Save fb results: ' + res);
|
108 |
-
},
|
109 |
-
error: function (e) {
|
110 |
-
console.log('Unknown error ' + e)
|
111 |
-
}
|
112 |
-
})
|
113 |
-
}
|
114 |
-
|
115 |
-
|
116 |
-
// pinterest button logic
|
117 |
-
$('body')
|
118 |
-
.off('click', '.mashicon-pinterest')
|
119 |
-
.on('click', '.mashicon-pinterest', function (e) {
|
120 |
-
e.preventDefault();
|
121 |
-
console.log('preventDefault:' + e);
|
122 |
-
winWidth = 520;
|
123 |
-
winHeight = 350;
|
124 |
-
var winTop = (screen.height / 2) - (winHeight / 2);
|
125 |
-
var winLeft = (screen.width / 2) - (winWidth / 2);
|
126 |
-
var url = $(this).attr('data-mashsb-url');
|
127 |
-
|
128 |
-
window.open(url, 'sharer', 'top=' + winTop + ',left=' + winLeft + ',toolbar=0,status=0,width=' + winWidth + ',height=' + winHeight + ',resizable=yes');
|
129 |
-
|
130 |
-
});
|
131 |
-
|
132 |
-
/* Load Pinterest Popup window
|
133 |
-
*
|
134 |
-
* @param string html container
|
135 |
-
* @returns void
|
136 |
-
*/
|
137 |
-
function load_pinterest(html) {
|
138 |
-
|
139 |
-
mashnet_load_pinterest_body();
|
140 |
-
|
141 |
-
jQuery('.mashnet_pinterest_header').fadeIn(500);
|
142 |
-
jQuery('.mashnet_pinterest_inner').html(html);
|
143 |
-
|
144 |
-
/* Close Pinterest popup*/
|
145 |
-
jQuery('.mashnet_pinterest_close').click(function (e) {
|
146 |
-
e.preventDefault();
|
147 |
-
jQuery('.mashnet_pinterest_header').hide();
|
148 |
-
});
|
149 |
-
}
|
150 |
-
|
151 |
-
/**
|
152 |
-
* Load pinterest wrapper
|
153 |
-
*
|
154 |
-
* @returns voids
|
155 |
-
*/
|
156 |
-
function load_pinterest_body() {
|
157 |
-
var winWidth = window.innerWidth;
|
158 |
-
var popupWidth = 350;
|
159 |
-
var popupHeight = 310;
|
160 |
-
|
161 |
-
/* Load Pinterest popup into body of page */
|
162 |
-
if (winWidth <= 330)
|
163 |
-
var popupWidth = 310;
|
164 |
-
if (winWidth > 400)
|
165 |
-
var popupWidth = 390;
|
166 |
-
if (winWidth > 500)
|
167 |
-
var popupWidth = 490;
|
168 |
-
|
169 |
-
var winTop = (window.innerHeight / 2) - (popupHeight / 2);
|
170 |
-
var winLeft = (window.innerWidth / 2) - (popupWidth / 2);
|
171 |
-
var struct = '<div class="mashnet_pinterest_header" style="position:fixed;z-index:999999;max-width:' + popupWidth + 'px; margin-left:' + winLeft + 'px;top:' + winTop + 'px;">\n\
|
172 |
-
<div class="mashnet_pinit_wrapper" style="background-color:white;"><span class="mashnet_pin_it">Pin it! </span><span class="mashnet_pinicon"></span> \n\
|
173 |
-
<div class="mashnet_pinterest_close" style="float:right;"><a href="#">X</a></div></div>\n\
|
174 |
-
<div class="mashnet_pinterest_inner"></div>\n\
|
175 |
-
</div>\n\
|
176 |
-
';
|
177 |
-
|
178 |
-
jQuery('body').append(struct);
|
179 |
-
}
|
180 |
-
|
181 |
-
/* Get all images on site
|
182 |
-
*
|
183 |
-
* @return html
|
184 |
-
* */
|
185 |
-
function get_images(url) {
|
186 |
-
|
187 |
-
var allImages = jQuery('img').not("[nopin='nopin']");
|
188 |
-
var html = '';
|
189 |
-
var url = '';
|
190 |
-
|
191 |
-
var largeImages = allImages.filter(function () {
|
192 |
-
return (jQuery(this).width() > 70) || (jQuery(this).height() > 70)
|
193 |
-
})
|
194 |
-
for (i = 0; i < largeImages.length; i++) {
|
195 |
-
html += '<li><a target="_blank" rel="noopener" id="mashnetPinterestPopup" href="https://pinterest.com/pin/create/button/?url=' + encodeURIComponent(window.location.href) + '%2F&media=' + largeImages[i].src + '&description=' + largeImages[i].alt + '"><img src="' + largeImages[i].src + '"></a></li>';
|
196 |
-
}
|
197 |
-
}
|
198 |
-
|
199 |
-
|
200 |
-
// check the sharecount caching method
|
201 |
-
//mashsb_check_cache();
|
202 |
-
|
203 |
-
// Fix for the inline post plugin which removes the zero share count
|
204 |
-
if ($('.mashsbcount').text() == '') {
|
205 |
-
$('.mashsbcount').text(0);
|
206 |
-
}
|
207 |
-
|
208 |
-
/**
|
209 |
-
* Check Cache
|
210 |
-
*
|
211 |
-
*/
|
212 |
-
function mashsb_check_cache() {
|
213 |
-
setTimeout(function () {
|
214 |
-
if (typeof (mashsb) && mashsb.refresh == "1") {
|
215 |
-
mashsb_update_cache();
|
216 |
-
}
|
217 |
-
|
218 |
-
}, 6000);
|
219 |
-
}
|
220 |
-
|
221 |
-
function mashsb_update_cache() {
|
222 |
-
var mashsb_url = window.location.href;
|
223 |
-
if (mashsb_url.indexOf("?") > -1) {
|
224 |
-
mashsb_url += "&mashsb-refresh";
|
225 |
-
} else {
|
226 |
-
mashsb_url += "?mashsb-refresh";
|
227 |
-
}
|
228 |
-
var xhr = new XMLHttpRequest();
|
229 |
-
xhr.open("GET", mashsb_url, true);
|
230 |
-
xhr.send();
|
231 |
-
}
|
232 |
-
|
233 |
-
/* Opens a new minus button when plus sign is clicked */
|
234 |
-
/* Toogle function for more services */
|
235 |
-
$('.onoffswitch').on('click', function () {
|
236 |
-
var $parent = $(this).parents('.mashsb-container');
|
237 |
-
$parent.find('.onoffswitch').hide();
|
238 |
-
$parent.find('.secondary-shares').show();
|
239 |
-
$parent.find('.onoffswitch2').show();
|
240 |
-
});
|
241 |
-
$('.onoffswitch2').on('click', function () {
|
242 |
-
var $parent = $(this).parents('.mashsb-container');
|
243 |
-
$parent.find('.onoffswitch').show();
|
244 |
-
$parent.find('.secondary-shares').hide();
|
245 |
-
});
|
246 |
-
|
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 |
-
|
253 |
-
|
254 |
-
var
|
255 |
-
var
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
var
|
269 |
-
var
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
$('.mashicon-subscribe').
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
$('.trigger_active').
|
292 |
-
$('.
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
;
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
*
|
313 |
-
* @
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
shares
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
shares
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
*
|
337 |
-
*
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
*
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
* jQuery
|
436 |
-
*
|
437 |
-
*
|
438 |
-
*
|
439 |
-
*
|
440 |
-
* http://www.
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
//
|
463 |
-
|
464 |
-
p
|
465 |
-
|
466 |
-
el
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
}(jQuery, document));
|
1 |
+
var strict;
|
2 |
+
|
3 |
+
jQuery(document).ready(function ($) {
|
4 |
+
|
5 |
+
/* Show Whatsapp button on mobile devices iPhones and Android only */
|
6 |
+
if (navigator.userAgent.match(/(iPhone)/i) || navigator.userAgent.match(/(Android)/i)) {
|
7 |
+
$('.mashicon-whatsapp').show();
|
8 |
+
}
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Get facebook share count vi js client request
|
12 |
+
*
|
13 |
+
* @returns {undefined}
|
14 |
+
*/
|
15 |
+
var mashsb_get_fb_shares = function ()
|
16 |
+
{
|
17 |
+
|
18 |
+
|
19 |
+
if (document.querySelector('.mashsb-buttons') === null) {
|
20 |
+
return false;
|
21 |
+
}
|
22 |
+
|
23 |
+
if ('undefined' !== typeof (mashsb.refresh) && mashsb.refresh === '0') {
|
24 |
+
return false;
|
25 |
+
}
|
26 |
+
|
27 |
+
if ('undefined' === typeof (mashsb.share_url) && mashsb.share_url !== '') {
|
28 |
+
return false;
|
29 |
+
}
|
30 |
+
|
31 |
+
if ('undefined' === typeof (mashsb.postid) && mashsb.postid !== '') {
|
32 |
+
return false;
|
33 |
+
}
|
34 |
+
|
35 |
+
if (mashsb_is_rate_limit()) {
|
36 |
+
return false;
|
37 |
+
}
|
38 |
+
|
39 |
+
//mashsb.share_url = 'https://www.google.de';
|
40 |
+
|
41 |
+
var facebookGraphURL = 'https://graph.facebook.com/?id=' + mashsb.share_url;
|
42 |
+
$.ajax({
|
43 |
+
type: 'GET',
|
44 |
+
url: facebookGraphURL,
|
45 |
+
dataType: 'json',
|
46 |
+
success: function (data) {
|
47 |
+
mashsb_set_fb_sharecount(data);
|
48 |
+
console.log(data);
|
49 |
+
},
|
50 |
+
error: function (e) {
|
51 |
+
console.log(e)
|
52 |
+
}
|
53 |
+
})
|
54 |
+
|
55 |
+
|
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
|
63 |
+
* @returns {Boolean}
|
64 |
+
*/
|
65 |
+
function mashsb_is_rate_limit() {
|
66 |
+
|
67 |
+
if ("undefined" === typeof (mashsb.servertime)) {
|
68 |
+
return true;
|
69 |
+
}
|
70 |
+
|
71 |
+
var serverTime = Number(mashsb.servertime);
|
72 |
+
var clientTime = Math.floor(Date.now() / 1000);
|
73 |
+
|
74 |
+
if (clientTime > (serverTime + 30)) {
|
75 |
+
console.log('rate limited: ' + (serverTime + 30));
|
76 |
+
return true;
|
77 |
+
} else {
|
78 |
+
console.log('not rate limited: ' + (serverTime + 30));
|
79 |
+
return false;
|
80 |
+
}
|
81 |
+
}
|
82 |
+
|
83 |
+
/**
|
84 |
+
* Store FB return data in mashshare cache vi js client request
|
85 |
+
* @returns {undefined}
|
86 |
+
*/
|
87 |
+
function mashsb_set_fb_sharecount(result) {
|
88 |
+
|
89 |
+
if ('undefined' === typeof (result.share)) {
|
90 |
+
console.log('No valid result' + result);
|
91 |
+
return false;
|
92 |
+
}
|
93 |
+
|
94 |
+
var data = {
|
95 |
+
action: 'mashsb_set_fb_shares',
|
96 |
+
shares: result.share,
|
97 |
+
postid: mashsb.postid,
|
98 |
+
url: mashsb.share_url,
|
99 |
+
nonce: mashsb.nonce
|
100 |
+
}
|
101 |
+
|
102 |
+
$.ajax({
|
103 |
+
type: "post",
|
104 |
+
url: mashsb.ajaxurl,
|
105 |
+
data: data,
|
106 |
+
success: function (res) {
|
107 |
+
console.log('Save fb results: ' + res);
|
108 |
+
},
|
109 |
+
error: function (e) {
|
110 |
+
console.log('Unknown error ' + e)
|
111 |
+
}
|
112 |
+
})
|
113 |
+
}
|
114 |
+
|
115 |
+
|
116 |
+
// pinterest button logic
|
117 |
+
$('body')
|
118 |
+
.off('click', '.mashicon-pinterest')
|
119 |
+
.on('click', '.mashicon-pinterest', function (e) {
|
120 |
+
e.preventDefault();
|
121 |
+
console.log('preventDefault:' + e);
|
122 |
+
winWidth = 520;
|
123 |
+
winHeight = 350;
|
124 |
+
var winTop = (screen.height / 2) - (winHeight / 2);
|
125 |
+
var winLeft = (screen.width / 2) - (winWidth / 2);
|
126 |
+
var url = $(this).attr('data-mashsb-url');
|
127 |
+
|
128 |
+
window.open(url, 'sharer', 'top=' + winTop + ',left=' + winLeft + ',toolbar=0,status=0,width=' + winWidth + ',height=' + winHeight + ',resizable=yes');
|
129 |
+
|
130 |
+
});
|
131 |
+
|
132 |
+
/* Load Pinterest Popup window
|
133 |
+
*
|
134 |
+
* @param string html container
|
135 |
+
* @returns void
|
136 |
+
*/
|
137 |
+
function load_pinterest(html) {
|
138 |
+
|
139 |
+
mashnet_load_pinterest_body();
|
140 |
+
|
141 |
+
jQuery('.mashnet_pinterest_header').fadeIn(500);
|
142 |
+
jQuery('.mashnet_pinterest_inner').html(html);
|
143 |
+
|
144 |
+
/* Close Pinterest popup*/
|
145 |
+
jQuery('.mashnet_pinterest_close').click(function (e) {
|
146 |
+
e.preventDefault();
|
147 |
+
jQuery('.mashnet_pinterest_header').hide();
|
148 |
+
});
|
149 |
+
}
|
150 |
+
|
151 |
+
/**
|
152 |
+
* Load pinterest wrapper
|
153 |
+
*
|
154 |
+
* @returns voids
|
155 |
+
*/
|
156 |
+
function load_pinterest_body() {
|
157 |
+
var winWidth = window.innerWidth;
|
158 |
+
var popupWidth = 350;
|
159 |
+
var popupHeight = 310;
|
160 |
+
|
161 |
+
/* Load Pinterest popup into body of page */
|
162 |
+
if (winWidth <= 330)
|
163 |
+
var popupWidth = 310;
|
164 |
+
if (winWidth > 400)
|
165 |
+
var popupWidth = 390;
|
166 |
+
if (winWidth > 500)
|
167 |
+
var popupWidth = 490;
|
168 |
+
|
169 |
+
var winTop = (window.innerHeight / 2) - (popupHeight / 2);
|
170 |
+
var winLeft = (window.innerWidth / 2) - (popupWidth / 2);
|
171 |
+
var struct = '<div class="mashnet_pinterest_header" style="position:fixed;z-index:999999;max-width:' + popupWidth + 'px; margin-left:' + winLeft + 'px;top:' + winTop + 'px;">\n\
|
172 |
+
<div class="mashnet_pinit_wrapper" style="background-color:white;"><span class="mashnet_pin_it">Pin it! </span><span class="mashnet_pinicon"></span> \n\
|
173 |
+
<div class="mashnet_pinterest_close" style="float:right;"><a href="#">X</a></div></div>\n\
|
174 |
+
<div class="mashnet_pinterest_inner"></div>\n\
|
175 |
+
</div>\n\
|
176 |
+
';
|
177 |
+
|
178 |
+
jQuery('body').append(struct);
|
179 |
+
}
|
180 |
+
|
181 |
+
/* Get all images on site
|
182 |
+
*
|
183 |
+
* @return html
|
184 |
+
* */
|
185 |
+
function get_images(url) {
|
186 |
+
|
187 |
+
var allImages = jQuery('img').not("[nopin='nopin']");
|
188 |
+
var html = '';
|
189 |
+
var url = '';
|
190 |
+
|
191 |
+
var largeImages = allImages.filter(function () {
|
192 |
+
return (jQuery(this).width() > 70) || (jQuery(this).height() > 70)
|
193 |
+
})
|
194 |
+
for (i = 0; i < largeImages.length; i++) {
|
195 |
+
html += '<li><a target="_blank" rel="noopener" id="mashnetPinterestPopup" href="https://pinterest.com/pin/create/button/?url=' + encodeURIComponent(window.location.href) + '%2F&media=' + largeImages[i].src + '&description=' + largeImages[i].alt + '"><img src="' + largeImages[i].src + '"></a></li>';
|
196 |
+
}
|
197 |
+
}
|
198 |
+
|
199 |
+
|
200 |
+
// check the sharecount caching method
|
201 |
+
//mashsb_check_cache();
|
202 |
+
|
203 |
+
// Fix for the inline post plugin which removes the zero share count
|
204 |
+
if ($('.mashsbcount').text() == '') {
|
205 |
+
$('.mashsbcount').text(0);
|
206 |
+
}
|
207 |
+
|
208 |
+
/**
|
209 |
+
* Check Cache
|
210 |
+
*
|
211 |
+
*/
|
212 |
+
function mashsb_check_cache() {
|
213 |
+
setTimeout(function () {
|
214 |
+
if (typeof (mashsb) && mashsb.refresh == "1") {
|
215 |
+
mashsb_update_cache();
|
216 |
+
}
|
217 |
+
|
218 |
+
}, 6000);
|
219 |
+
}
|
220 |
+
|
221 |
+
function mashsb_update_cache() {
|
222 |
+
var mashsb_url = window.location.href;
|
223 |
+
if (mashsb_url.indexOf("?") > -1) {
|
224 |
+
mashsb_url += "&mashsb-refresh";
|
225 |
+
} else {
|
226 |
+
mashsb_url += "?mashsb-refresh";
|
227 |
+
}
|
228 |
+
var xhr = new XMLHttpRequest();
|
229 |
+
xhr.open("GET", mashsb_url, true);
|
230 |
+
xhr.send();
|
231 |
+
}
|
232 |
+
|
233 |
+
/* Opens a new minus button when plus sign is clicked */
|
234 |
+
/* Toogle function for more services */
|
235 |
+
$('.onoffswitch').on('click', function () {
|
236 |
+
var $parent = $(this).parents('.mashsb-container');
|
237 |
+
$parent.find('.onoffswitch').hide();
|
238 |
+
$parent.find('.secondary-shares').show();
|
239 |
+
$parent.find('.onoffswitch2').show();
|
240 |
+
});
|
241 |
+
$('.onoffswitch2').on('click', function () {
|
242 |
+
var $parent = $(this).parents('.mashsb-container');
|
243 |
+
$parent.find('.onoffswitch').show();
|
244 |
+
$parent.find('.secondary-shares').hide();
|
245 |
+
});
|
246 |
+
|
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 (e) {
|
251 |
+
winWidth = 520;
|
252 |
+
winHeight = 550;
|
253 |
+
var winTop = (screen.height / 2) - (winHeight / 2);
|
254 |
+
var winLeft = (screen.width / 2) - (winWidth / 2);
|
255 |
+
var url = $(this).attr('href');
|
256 |
+
|
257 |
+
window.open(url, 'sharer', 'top=' + winTop + ',left=' + winLeft + ',toolbar=0,status=0,width=' + winWidth + ',height=' + winHeight);
|
258 |
+
e.preventDefault();
|
259 |
+
return false;
|
260 |
+
});
|
261 |
+
}
|
262 |
+
|
263 |
+
if (typeof mashsb !== 'undefined') {
|
264 |
+
$('.mashicon-twitter').click(function (e) {
|
265 |
+
winWidth = 520;
|
266 |
+
winHeight = 350;
|
267 |
+
var winTop = (screen.height / 2) - (winHeight / 2);
|
268 |
+
var winLeft = (screen.width / 2) - (winWidth / 2);
|
269 |
+
var url = $(this).attr('href');
|
270 |
+
|
271 |
+
// deprecated and removed because TW popup opens twice
|
272 |
+
if (mashsb.twitter_popup === '1') {
|
273 |
+
window.open(url, 'sharer', 'top=' + winTop + ',left=' + winLeft + ',toolbar=0,status=0,width=' + winWidth + ',height=' + winHeight);
|
274 |
+
}
|
275 |
+
e.preventDefault();
|
276 |
+
return false;
|
277 |
+
});
|
278 |
+
}
|
279 |
+
|
280 |
+
if (typeof mashsb !== 'undefined' && mashsb.subscribe === 'content') {
|
281 |
+
/* Toogle container display:none */
|
282 |
+
$('.mashicon-subscribe').not('.trigger_active').nearest('.mashsb-toggle-container').hide();
|
283 |
+
$('.mashicon-subscribe').click(function () {
|
284 |
+
var trig = $(this);
|
285 |
+
if (trig.hasClass('trigger_active')) {
|
286 |
+
$(trig).nearest('.mashsb-toggle-container').slideToggle('fast');
|
287 |
+
trig.removeClass('trigger_active');
|
288 |
+
//$(".mashicon-subscribe").css({"padding-bottom":"10px"});
|
289 |
+
} else {
|
290 |
+
$('.trigger_active').nearest('.mashsb-toggle-container').slideToggle('slow');
|
291 |
+
$('.trigger_active').removeClass('trigger_active');
|
292 |
+
$(trig).nearest('.mashsb-toggle-container').slideToggle('fast');
|
293 |
+
trig.addClass('trigger_active');
|
294 |
+
//$(".mashicon-subscribe").css({"padding-bottom":"13px"});
|
295 |
+
}
|
296 |
+
;
|
297 |
+
return false;
|
298 |
+
});
|
299 |
+
}
|
300 |
+
|
301 |
+
if (typeof mashsb !== 'undefined' && mashsb.subscribe === 'link') {
|
302 |
+
$('.mashicon-subscribe').click(function () {
|
303 |
+
var href = mashsb.subscribe_url;
|
304 |
+
$(this).attr("href", href);
|
305 |
+
});
|
306 |
+
}
|
307 |
+
;
|
308 |
+
|
309 |
+
|
310 |
+
/* Round the shares callback function
|
311 |
+
*
|
312 |
+
* @param {type} value
|
313 |
+
* @returns {String|@exp;value@call;toFixed}
|
314 |
+
*/
|
315 |
+
function roundShares(value) {
|
316 |
+
if (typeof mashsb !== "undefined" && mashsb.round_shares == 1) {
|
317 |
+
if (value > 1000000) {
|
318 |
+
shares = Math.round((value / 1000000) * 10) / 10 + 'M';
|
319 |
+
return shares;
|
320 |
+
|
321 |
+
}
|
322 |
+
if (value > 1000) {
|
323 |
+
shares = Math.round((value / 1000) * 10) / 10 + 'k';
|
324 |
+
return shares;
|
325 |
+
|
326 |
+
}
|
327 |
+
}
|
328 |
+
/* zero decimals */
|
329 |
+
return value.toFixed(0);
|
330 |
+
}
|
331 |
+
|
332 |
+
|
333 |
+
|
334 |
+
/* Count up script jquery-countTo
|
335 |
+
* by mhuggins
|
336 |
+
*
|
337 |
+
* Source: https://github.com/mhuggins/jquery-countTo
|
338 |
+
*/
|
339 |
+
(function ($) {
|
340 |
+
$.fn.countTo = function (options) {
|
341 |
+
options = options || {};
|
342 |
+
|
343 |
+
return $(this).each(function () {
|
344 |
+
// set options for current element
|
345 |
+
var settings = $.extend({}, $.fn.countTo.defaults, {
|
346 |
+
from: $(this).data('from'),
|
347 |
+
to: $(this).data('to'),
|
348 |
+
speed: $(this).data('speed'),
|
349 |
+
refreshInterval: $(this).data('refresh-interval'),
|
350 |
+
decimals: $(this).data('decimals')
|
351 |
+
}, options);
|
352 |
+
|
353 |
+
// how many times to update the value, and how much to increment the value on each update
|
354 |
+
var loops = Math.ceil(settings.speed / settings.refreshInterval),
|
355 |
+
increment = (settings.to - settings.from) / loops;
|
356 |
+
|
357 |
+
// references & variables that will change with each update
|
358 |
+
var self = this,
|
359 |
+
$self = $(this),
|
360 |
+
loopCount = 0,
|
361 |
+
value = settings.from,
|
362 |
+
data = $self.data('countTo') || {};
|
363 |
+
|
364 |
+
$self.data('countTo', data);
|
365 |
+
|
366 |
+
// if an existing interval can be found, clear it first
|
367 |
+
if (data.interval) {
|
368 |
+
clearInterval(data.interval);
|
369 |
+
}
|
370 |
+
data.interval = setInterval(updateTimer, settings.refreshInterval);
|
371 |
+
|
372 |
+
// initialize the element with the starting value
|
373 |
+
render(value);
|
374 |
+
|
375 |
+
function updateTimer() {
|
376 |
+
value += increment;
|
377 |
+
loopCount++;
|
378 |
+
|
379 |
+
render(value);
|
380 |
+
|
381 |
+
if (typeof (settings.onUpdate) == 'function') {
|
382 |
+
settings.onUpdate.call(self, value);
|
383 |
+
}
|
384 |
+
|
385 |
+
if (loopCount >= loops) {
|
386 |
+
// remove the interval
|
387 |
+
$self.removeData('countTo');
|
388 |
+
clearInterval(data.interval);
|
389 |
+
value = settings.to;
|
390 |
+
|
391 |
+
if (typeof (settings.onComplete) == 'function') {
|
392 |
+
settings.onComplete.call(self, value);
|
393 |
+
}
|
394 |
+
}
|
395 |
+
}
|
396 |
+
|
397 |
+
function render(value) {
|
398 |
+
var formattedValue = settings.formatter.call(self, value, settings);
|
399 |
+
$self.text(formattedValue);
|
400 |
+
}
|
401 |
+
});
|
402 |
+
};
|
403 |
+
|
404 |
+
$.fn.countTo.defaults = {
|
405 |
+
from: 0, // the number the element should start at
|
406 |
+
to: 0, // the number the element should end at
|
407 |
+
speed: 1000, // how long it should take to count between the target numbers
|
408 |
+
refreshInterval: 100, // how often the element should be updated
|
409 |
+
decimals: 0, // the number of decimal places to show
|
410 |
+
//formatter: formatter, // handler for formatting the value before rendering
|
411 |
+
formatter: roundShares,
|
412 |
+
onUpdate: null, // callback method for every time the element is updated
|
413 |
+
onComplete: null // callback method for when the element finishes updating
|
414 |
+
};
|
415 |
+
|
416 |
+
function formatter(value, settings) {
|
417 |
+
return value.toFixed(settings.decimals);
|
418 |
+
}
|
419 |
+
|
420 |
+
|
421 |
+
}(jQuery));
|
422 |
+
|
423 |
+
/*
|
424 |
+
* Start the counter
|
425 |
+
*
|
426 |
+
*/
|
427 |
+
if (typeof mashsb !== 'undefined' && mashsb.animate_shares == 1 && $('.mashsbcount').length) {
|
428 |
+
$('.mashsbcount').countTo({from: 0, to: mashsb.shares, speed: 1000, refreshInterval: 100});
|
429 |
+
}
|
430 |
+
});
|
431 |
+
|
432 |
+
|
433 |
+
/*!------------------------------------------------------
|
434 |
+
* jQuery nearest v1.0.3
|
435 |
+
* http://github.com/jjenzz/jQuery.nearest
|
436 |
+
* ------------------------------------------------------
|
437 |
+
* Copyright (c) 2012 J. Smith (@jjenzz)
|
438 |
+
* Dual licensed under the MIT and GPL licenses:
|
439 |
+
* http://www.opensource.org/licenses/mit-license.php
|
440 |
+
* http://www.gnu.org/licenses/gpl.html
|
441 |
+
*/
|
442 |
+
(function ($, d) {
|
443 |
+
$.fn.nearest = function (selector) {
|
444 |
+
var self, nearest, el, s, p,
|
445 |
+
hasQsa = d.querySelectorAll;
|
446 |
+
|
447 |
+
function update(el) {
|
448 |
+
nearest = nearest ? nearest.add(el) : $(el);
|
449 |
+
}
|
450 |
+
|
451 |
+
this.each(function () {
|
452 |
+
self = this;
|
453 |
+
|
454 |
+
$.each(selector.split(','), function () {
|
455 |
+
s = $.trim(this);
|
456 |
+
|
457 |
+
if (!s.indexOf('#')) {
|
458 |
+
// selector starts with an ID
|
459 |
+
update((hasQsa ? d.querySelectorAll(s) : $(s)));
|
460 |
+
} else {
|
461 |
+
// is a class or tag selector
|
462 |
+
// so need to traverse
|
463 |
+
p = self.parentNode;
|
464 |
+
while (p) {
|
465 |
+
el = hasQsa ? p.querySelectorAll(s) : $(p).find(s);
|
466 |
+
if (el.length) {
|
467 |
+
update(el);
|
468 |
+
break;
|
469 |
+
}
|
470 |
+
p = p.parentNode;
|
471 |
+
}
|
472 |
+
}
|
473 |
+
});
|
474 |
+
|
475 |
+
});
|
476 |
+
|
477 |
+
return nearest || $();
|
478 |
+
};
|
479 |
+
}(jQuery, document));
|
|
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
|
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(),!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/admin/settings/register-settings.php
CHANGED
@@ -124,7 +124,7 @@ function mashsb_get_registered_settings() {
|
|
124 |
'mashsb_sharemethod' => array(
|
125 |
'id' => 'mashsb_sharemethod',
|
126 |
'name' => __( 'Share Count', 'mashsb' ),
|
127 |
-
'desc' => __( '- <i>MashEngine</i> collects shares by direct request to social networks.<br><br><i>SharedCount.com</i> is a third party service free for up to 10.000 daily requests. It collects shares for Facebook, Pinterest, Stumbleupon. (For GDPR compliance you should select the sharedcount.com service.)<br><br>Twitter count is aggreagated via <a href="https://
|
128 |
'type' => 'select',
|
129 |
'options' => array(
|
130 |
'mashengine' => 'MashEngine',
|
@@ -189,7 +189,7 @@ function mashsb_get_registered_settings() {
|
|
189 |
),
|
190 |
'disable_sharecount' => array(
|
191 |
'id' => 'disable_sharecount',
|
192 |
-
'name' => __( '
|
193 |
'desc' => __( 'Use this if share counts should not be counted. You need to disable share counts if you want to be GDPR compliant, because the share count agregation is collecting shares from third party social networks. Default: false', 'mashsb' ),
|
194 |
'type' => 'checkbox'
|
195 |
),
|
124 |
'mashsb_sharemethod' => array(
|
125 |
'id' => 'mashsb_sharemethod',
|
126 |
'name' => __( 'Share Count', 'mashsb' ),
|
127 |
+
'desc' => __( '- <i>MashEngine</i> collects shares by direct request to social networks.<br><br><i>SharedCount.com</i> is a third party service free for up to 10.000 daily requests. It collects shares for Facebook, Pinterest, Stumbleupon. (For GDPR compliance you should select the sharedcount.com service.)<br><br>Twitter count is aggreagated via <a href="https://twitcount.com" target="_blank" rel="external nofollow">https://twitcount.com</a>. You must sign up with your Twitter account for this free service to get the twitter share count. Visit the site http://twitcount.com, fill in your website domain and click on <i>Sign up</i>. <br><br><strong>Note: You need <a href="https://mashshare.net/downloads/mashshare-social-networks-addon/" target="_blank">MashShare Social Network Add-On</a> for enabling Twitter count.</strong>', 'mashsb' ),
|
128 |
'type' => 'select',
|
129 |
'options' => array(
|
130 |
'mashengine' => 'MashEngine',
|
189 |
),
|
190 |
'disable_sharecount' => array(
|
191 |
'id' => 'disable_sharecount',
|
192 |
+
'name' => __( 'Activate GDPR/DSGVO compliance', 'mashsb' ),
|
193 |
'desc' => __( 'Use this if share counts should not be counted. You need to disable share counts if you want to be GDPR compliant, because the share count agregation is collecting shares from third party social networks. Default: false', 'mashsb' ),
|
194 |
'type' => 'checkbox'
|
195 |
),
|
includes/header-meta-tags.php
CHANGED
@@ -658,7 +658,12 @@ class MASHSB_HEADER_META_TAGS {
|
|
658 |
* @return object
|
659 |
*/
|
660 |
function mashsb_meta_tags_init() {
|
661 |
-
global $mashsb_meta_tags;
|
|
|
|
|
|
|
|
|
|
|
662 |
|
663 |
if( !is_null( $mashsb_meta_tags ) ) {
|
664 |
return $mashsb_meta_tags;
|
@@ -670,6 +675,6 @@ function mashsb_meta_tags_init() {
|
|
670 |
|
671 |
add_action( 'wp_head', 'mashsb_meta_tags_init', 1 );
|
672 |
|
673 |
-
// Remove Social Warfare tags open graph tags (
|
674 |
add_filter( 'sw_meta_tags', '__return_false', 99 );
|
675 |
|
658 |
* @return object
|
659 |
*/
|
660 |
function mashsb_meta_tags_init() {
|
661 |
+
global $mashsb_meta_tags, $mashsb_options;
|
662 |
+
|
663 |
+
// Do not show meta boxes
|
664 |
+
if(isset($mashsb_options['user_roles_for_sharing_options']) && in_array('disable', $mashsb_options['user_roles_for_sharing_options'])){
|
665 |
+
return;
|
666 |
+
}
|
667 |
|
668 |
if( !is_null( $mashsb_meta_tags ) ) {
|
669 |
return $mashsb_meta_tags;
|
675 |
|
676 |
add_action( 'wp_head', 'mashsb_meta_tags_init', 1 );
|
677 |
|
678 |
+
// Remove Social Warfare tags open graph tags (Sorry Social Warfare guys - You do a great job)
|
679 |
add_filter( 'sw_meta_tags', '__return_false', 99 );
|
680 |
|
includes/mashengine.php
CHANGED
@@ -121,12 +121,12 @@ class mashengine {
|
|
121 |
}
|
122 |
if( isset( $mashsb_options['cumulate_http_https'] ) ) {
|
123 |
if( class_exists( 'mashnetTwitter' ) ) {
|
124 |
-
$RollingCurlX->addRequest( "
|
125 |
-
$RollingCurlX->addRequest( "
|
126 |
}
|
127 |
} else {
|
128 |
if( class_exists( 'mashnetTwitter' ) ) {
|
129 |
-
$RollingCurlX->addRequest( "
|
130 |
}
|
131 |
}
|
132 |
|
@@ -213,14 +213,14 @@ class mashengine {
|
|
213 |
}
|
214 |
if( isset( $mashsb_options['cumulate_http_https'] ) ) {
|
215 |
if( class_exists( 'mashnetTwitter' ) ) {
|
216 |
-
$RollingCurlX->addRequest( "
|
217 |
-
$RollingCurlX->addRequest( "
|
218 |
}
|
219 |
$RollingCurlX->addRequest( "https://api.pinterest.com/v1/urls/count.json?url=" . $this->http_scheme_url, $post_data, array($this, 'getCount'), array('pinterest'), $headers );
|
220 |
$RollingCurlX->addRequest( "https://api.pinterest.com/v1/urls/count.json?url=" . $this->https_scheme_url, $post_data, array($this, 'getCount'), array('pinterest'), $headers );
|
221 |
} else {
|
222 |
if( class_exists( 'mashnetTwitter' ) ) {
|
223 |
-
$RollingCurlX->addRequest( "
|
224 |
}
|
225 |
$RollingCurlX->addRequest( "https://api.pinterest.com/v1/urls/count.json?url=" . $this->url, $post_data, array($this, 'getCount'), array('pinterest'), $headers );
|
226 |
}
|
121 |
}
|
122 |
if( isset( $mashsb_options['cumulate_http_https'] ) ) {
|
123 |
if( class_exists( 'mashnetTwitter' ) ) {
|
124 |
+
$RollingCurlX->addRequest( "https://counts.twitcount.com/counts.php?url=" . $this->https_scheme_url, $post_data, array($this, 'getCount'), array('twitter'), $headers );
|
125 |
+
$RollingCurlX->addRequest( "https://counts.twitcount.com/counts.php?url=" . $this->http_scheme_url, $post_data, array($this, 'getCount'), array('twitter'), $headers );
|
126 |
}
|
127 |
} else {
|
128 |
if( class_exists( 'mashnetTwitter' ) ) {
|
129 |
+
$RollingCurlX->addRequest( "https://counts.twitcount.com/counts.php?url=" . $this->url, $post_data, array($this, 'getCount'), array('twitter'), $headers );
|
130 |
}
|
131 |
}
|
132 |
|
213 |
}
|
214 |
if( isset( $mashsb_options['cumulate_http_https'] ) ) {
|
215 |
if( class_exists( 'mashnetTwitter' ) ) {
|
216 |
+
$RollingCurlX->addRequest( "https://counts.twitcount.com/counts.php?url=" . $this->https_scheme_url, $post_data, array($this, 'getCount'), array('twitter'), $headers );
|
217 |
+
$RollingCurlX->addRequest( "https://counts.twitcount.com/counts.php?url=" . $this->http_scheme_url, $post_data, array($this, 'getCount'), array('twitter'), $headers );
|
218 |
}
|
219 |
$RollingCurlX->addRequest( "https://api.pinterest.com/v1/urls/count.json?url=" . $this->http_scheme_url, $post_data, array($this, 'getCount'), array('pinterest'), $headers );
|
220 |
$RollingCurlX->addRequest( "https://api.pinterest.com/v1/urls/count.json?url=" . $this->https_scheme_url, $post_data, array($this, 'getCount'), array('pinterest'), $headers );
|
221 |
} else {
|
222 |
if( class_exists( 'mashnetTwitter' ) ) {
|
223 |
+
$RollingCurlX->addRequest( "https://counts.twitcount.com/counts.php?url=" . $this->url, $post_data, array($this, 'getCount'), array('twitter'), $headers );
|
224 |
}
|
225 |
$RollingCurlX->addRequest( "https://api.pinterest.com/v1/urls/count.json?url=" . $this->url, $post_data, array($this, 'getCount'), array('pinterest'), $headers );
|
226 |
}
|
includes/sharedcount.class.php
CHANGED
@@ -181,36 +181,6 @@ class mashsbSharedcount {
|
|
181 |
return 0;
|
182 |
}
|
183 |
|
184 |
-
|
185 |
-
// /**
|
186 |
-
// * Get Twitter shares via opensharecount.com
|
187 |
-
// * @global type $mashsb_options
|
188 |
-
// * @return int
|
189 |
-
// */
|
190 |
-
// private function getTwitterShares(){
|
191 |
-
// mashdebug()->info( "Get Twitter Shares: " . $this->url );
|
192 |
-
// global $mashsb_options;
|
193 |
-
//
|
194 |
-
// try {
|
195 |
-
// $counts = $this->_curl( 'http://opensharecount.com/count.json?url=' . $this->url );
|
196 |
-
//
|
197 |
-
// if( isset( $counts["Error"] ) ) {
|
198 |
-
// return 0;
|
199 |
-
// }
|
200 |
-
//
|
201 |
-
// mashdebug()->error( "Twitter total count: " . $counts['count'] );
|
202 |
-
// MASHSB()->logger->info( "URL: " . urldecode( $this->url ) . " http://opensharecount.com Twitter total_count: " . $counts['count'] );
|
203 |
-
// return $counts['count'];
|
204 |
-
// } catch ( Exception $e ) {
|
205 |
-
// mashdebug()->error( "error: " . $counts );
|
206 |
-
// MASHSB()->logger->info( 'ERROR: Curl()' . $counts );
|
207 |
-
// return 0;
|
208 |
-
// }
|
209 |
-
// mashdebug()->error( "error2: " . $counts );
|
210 |
-
// MASHSB()->logger->info( 'ERROR 2: Curl()' . $counts );
|
211 |
-
// return 0;
|
212 |
-
// }
|
213 |
-
|
214 |
}
|
215 |
|
216 |
?>
|
181 |
return 0;
|
182 |
}
|
183 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
184 |
}
|
185 |
|
186 |
?>
|
mashshare.php
CHANGED
@@ -6,11 +6,9 @@
|
|
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.
|
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
|
13 |
-
* essential parts of the EDD framework because its very reliable and robust. Check out more by pippin on https://pippinsplugins.com/
|
14 |
|
15 |
*
|
16 |
* Mashshare Share Buttons is free software: you can redistribute it and/or modify
|
@@ -37,7 +35,7 @@ if( !defined( 'ABSPATH' ) )
|
|
37 |
|
38 |
// Plugin version
|
39 |
if( !defined( 'MASHSB_VERSION' ) ) {
|
40 |
-
define( 'MASHSB_VERSION', '3.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.9
|
10 |
* Text Domain: mashsb
|
11 |
* Domain Path: /languages
|
|
|
|
|
12 |
|
13 |
*
|
14 |
* Mashshare Share Buttons is free software: you can redistribute it and/or modify
|
35 |
|
36 |
// Plugin version
|
37 |
if( !defined( 'MASHSB_VERSION' ) ) {
|
38 |
+
define( 'MASHSB_VERSION', '3.5.9' );
|
39 |
}
|
40 |
|
41 |
// 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: 5.0
|
12 |
-
Stable tag: 3.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,12 @@ Read here more about this: http://docs.mashshare.net/article/10-facebook-is-show
|
|
250 |
|
251 |
== Changelog ==
|
252 |
|
|
|
|
|
|
|
|
|
|
|
|
|
253 |
= 3.5.8 =
|
254 |
* New: Compatible up to WordPress 5.0.3
|
255 |
* Fix: Make sure to not disable TLS while using native curl implementation
|
@@ -282,81 +288,11 @@ Read here more about this: http://docs.mashshare.net/article/10-facebook-is-show
|
|
282 |
* New: Compatible with WordPress 4.9.6
|
283 |
* Tweak: Google short urls are not longer supported and removed
|
284 |
|
285 |
-
= 3.5.2 =
|
286 |
-
* Fix: Warning A non-numeric value encountered
|
287 |
-
|
288 |
-
= 3.5.1 =
|
289 |
-
* Fix: Fake shares not added after latest update
|
290 |
-
* Fix: Do not collect shares if page is previewed. Fixes an issue where shares from a post are collected from the main page, resulting in wrong share counts
|
291 |
-
|
292 |
-
= 3.5.0 =
|
293 |
-
* New: Tested up to WordPress 4.9.5
|
294 |
-
* New: Improved share count aggregation
|
295 |
-
* New: Add rel="noopener" to all network buttons
|
296 |
-
* Tweak: Remove opt-in notice
|
297 |
-
* Tweak: Remove rate limit notice
|
298 |
-
* Fix: Calls to networks api are still made when sharecount is disabled
|
299 |
-
|
300 |
-
= 3.4.9 =
|
301 |
-
* New: Add new short code parameter [mashshare icons=1] allows to show icon buttons only
|
302 |
-
* Fix: Remove access token notice
|
303 |
-
* Tweak: Lower request break to 5min if facebook api req/hours limits are reached
|
304 |
-
|
305 |
-
= 3.4.8 =
|
306 |
-
* New: Extend shortcode and allow selection of certain networks and button size [mashshare networks="facebook,twitter,linkedin" services="3" size="small"]
|
307 |
-
* Tweak: Remove Facebook Access Token. Will be replaced by queue processing soon to prevent exceeding facebook api limits
|
308 |
-
* Tweak: Clean up debug mode
|
309 |
-
* Tweak: Clean up Welcome page
|
310 |
-
* Tweak: Clean up sidebar
|
311 |
-
* Fix: Tweet button
|
312 |
-
|
313 |
-
= 3.4.7 =
|
314 |
-
* Fix: 100% PHP7 compatibility! No more warnings with php7 compatibility checker
|
315 |
-
|
316 |
-
= 3.4.6 =
|
317 |
-
* New: Make use of Twitter character limit of 280 characters.
|
318 |
-
* Tweak: Compatible up to WordPress 4.9
|
319 |
-
|
320 |
-
= 3.4.5 =
|
321 |
-
* New: Create custom values for open graph meta tag og:type, e.g video, product
|
322 |
-
* Fix: undefined var title
|
323 |
-
* Fix: Pinterest popup not opening when network add-on is not installed
|
324 |
-
* Fix: Remove deprecated code and make mashsb.js smaller
|
325 |
-
* Fix: Facebook access token validation function not working
|
326 |
-
|
327 |
-
= 3.4.4 =
|
328 |
-
* Fix: Check fb access token not working properly
|
329 |
-
|
330 |
-
= 3.4.3 =
|
331 |
-
* Fix: Facebook and twitter buttons missing on multisite activations when bimber theme is used
|
332 |
-
* Fix: Whatsapp button not shown on sticky sharebar add-on when network add-on is not installed
|
333 |
-
* Tweak: Return a more clear error notice when access token is not valid.
|
334 |
-
|
335 |
-
= 3.4.2 =
|
336 |
-
* Tweak: Better admin descriptions
|
337 |
-
* New: Tested up to WP 4.8
|
338 |
-
|
339 |
-
= 3.4.1 =
|
340 |
-
* New: Support for PHPUnit 6
|
341 |
-
* Fix: Move invisible sub menus from dashboard to MashShare menu section to prevent confusion if a plugin like Menu Editor Pro is active which makes even invisible menu entries visible
|
342 |
-
|
343 |
-
= 3.4.1 =
|
344 |
-
* Cleaning up readme.txt. MashShare plugin has been disabled on wordpress.org for using too many keywords and a few other issues with its readme.txt
|
345 |
-
|
346 |
-
= 3.4.0 =
|
347 |
-
* New: Google Analytics add-on allows to append utm_source tracking params for traffic tracking with google Analytics
|
348 |
-
* Fix: Pinterest and google plus share counts are not cummulated together with http/https option
|
349 |
-
* Fix: Remove admin notice if Facebook access token is empty
|
350 |
-
* Fix: Remove console.log test notice
|
351 |
-
* Fix: Check if multi_curl_exec is allowed
|
352 |
-
* Fix: Share count not incrementing if transient mashsb_limit_req expiration is not set. (Caused by Possible WP Bug or custom theme transient filter)
|
353 |
-
* Tweak: Use https endpoint for facebook sharing url
|
354 |
-
|
355 |
See release notes and complete changelog at:
|
356 |
https://www.mashshare.net/changelog/
|
357 |
|
358 |
== Upgrade Notice ==
|
359 |
|
360 |
-
= 3.5.
|
361 |
-
*
|
362 |
|
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.0
|
12 |
+
Stable tag: 3.5.9
|
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.9 =
|
254 |
+
* Fix: Better wording for gdpr complicance in its settings
|
255 |
+
* Fix: Do not output any open graph tags if share options meta box is disabled
|
256 |
+
* Fix: Prevent facebook popup opening twice and causing chrome blocker
|
257 |
+
* New: Integration of twitcount.com to get twitter shares back
|
258 |
+
|
259 |
= 3.5.8 =
|
260 |
* New: Compatible up to WordPress 5.0.3
|
261 |
* Fix: Make sure to not disable TLS while using native curl implementation
|
288 |
* New: Compatible with WordPress 4.9.6
|
289 |
* Tweak: Google short urls are not longer supported and removed
|
290 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
291 |
See release notes and complete changelog at:
|
292 |
https://www.mashshare.net/changelog/
|
293 |
|
294 |
== Upgrade Notice ==
|
295 |
|
296 |
+
= 3.5.9 =
|
297 |
+
* Fix: Prevent facebook popup opening twice and causing chrome blocker. Several fixes and improvements
|
298 |
|