Social Media Share Buttons | MashShare - Version 3.5.3

Version Description

  • New: Disable share count for new installations as default setting
  • New: Admin notice to recommend to disable the share count agregation to be complicant with upcoming GDPR
  • New: Compatible with WordPress 4.9.6
  • Tweak: Google short urls are not longer supported and removed
Download this release

Release Info

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

Code changes from version 3.5.2 to 3.5.3

assets/css/mashsb-admin.css CHANGED
@@ -1190,4 +1190,4 @@ color: #0097df;
1190
.token_status{
1191
line-height: 19px;
1192
margin-top: 5px;
1193
- }
1190
.token_status{
1191
line-height: 19px;
1192
margin-top: 5px;
1193
+ }
assets/css/mashsb.css CHANGED
@@ -557,4 +557,4 @@ color:#8A8C8E;
557
}
558
.mashsb-main .mashsb-buttons .mashsb-pure-icons .icon:before {
559
margin-right:0px;
560
- }
557
}
558
.mashsb-main .mashsb-buttons .mashsb-pure-icons .icon:before {
559
margin-right:0px;
560
+ }
includes/admin/admin-notices.php CHANGED
@@ -47,6 +47,8 @@ function mashsb_admin_messages() {
47
return;
48
}
49
50
// Rate Limit warning
51
// if( mashsb_is_admin_page() && mashsb_rate_limit_exceeded() ) {
52
// echo '<div class="error">';
@@ -100,11 +102,11 @@ function mashsb_admin_messages() {
100
echo '</div>';
101
}
102
// Check google API key
103
- if( mashsb_is_admin_page() && ( mashsb_check_google_apikey() && isset( $mashsb_options['mashsu_methods'] ) && $mashsb_options['mashsu_methods'] === 'google' ) ) {
104
- echo '<div class="error">';
105
- echo '<p>' . sprintf( __( 'Google API key is invalid. Go to <a href="%s"><i>Mashshare->Settings->Short URL Integration</i></a> and check the Google API key.', 'mashsb' ), admin_url( 'admin.php?page=mashsb-settings#mashsb_settingsshorturl_header' ) ) . '</p>';
106
- echo '</div>';
107
- }
108
// Check Bitly API key
109
if( mashsb_is_admin_page() && (false === mashsb_check_bitly_apikey() && isset( $mashsb_options['mashsu_methods'] ) && $mashsb_options['mashsu_methods'] === 'bitly' ) ) {
110
echo '<div class="error">';
@@ -431,4 +433,42 @@ function mashsb_is_invalid_fb_api_key(){
431
} else {
432
return $status;
433
}
434
}
47
return;
48
}
49
50
+ mashsb_show_update_notice_gdpr();
51
+
52
// Rate Limit warning
53
// if( mashsb_is_admin_page() && mashsb_rate_limit_exceeded() ) {
54
// echo '<div class="error">';
102
echo '</div>';
103
}
104
// Check google API key
105
+ // if( mashsb_is_admin_page() && ( mashsb_check_google_apikey() && isset( $mashsb_options['mashsu_methods'] ) && $mashsb_options['mashsu_methods'] === 'google' ) ) {
106
+ // echo '<div class="error">';
107
+ // echo '<p>' . sprintf( __( 'Google API key is invalid. Go to <a href="%s"><i>Mashshare->Settings->Short URL Integration</i></a> and check the Google API key.', 'mashsb' ), admin_url( 'admin.php?page=mashsb-settings#mashsb_settingsshorturl_header' ) ) . '</p>';
108
+ // echo '</div>';
109
+ // }
110
// Check Bitly API key
111
if( mashsb_is_admin_page() && (false === mashsb_check_bitly_apikey() && isset( $mashsb_options['mashsu_methods'] ) && $mashsb_options['mashsu_methods'] === 'bitly' ) ) {
112
echo '<div class="error">';
433
} else {
434
return $status;
435
}
436
+ }
437
+
438
+
439
+ /**
440
+ * Return update notice for gdpr compliance
441
+ * @since 3.5.3.0
442
+ */
443
+ function mashsb_show_update_notice_gdpr() {
444
+
445
+
446
+ $message = sprintf(__( '<h2 style="color:white;">MashShare GDPR Compliance</h2>'
447
+ . 'MashShare share count should be disabled due to european GDPR requirements. <br>If you still like to enable share count beside share buttons go to <a href="'.admin_url().'admin.php?page=mashsb-settings" style="color:white;">MashShare > Settings > Disable Sharecount</a><br><br>Enabling the share count aggregation is not GDPR compliant and is not recommended if your website must be GDPR conform.'
448
+ , 'mashsb' ),
449
+ admin_url() . 'admin.php?page=mashsb-settings'
450
+ );
451
+
452
+ if( get_option( 'mashsb_show_update_notice_gdpr' ) === 'no' ) {
453
+ return false;
454
+ }
455
+
456
+ // admin notice after updating Mashshare
457
+ echo '<div class="mashsb-notice-gdpr mashsb_update_notice_gdpr update-nag" style="background-color: #00abed;color: white;padding: 20px;margin-top: 20px;border: 3px solid white;">' . $message .
458
+ '<p><a href="'.admin_url().'admin.php?page=mashsb-settings&mashsb-action=hide_gdpr_notice" class="mashsb_hide_gdpr" title="I got it" style="text-decoration:none;color:white;">- I Understand! Do Not Show This Message Again -</a></a>'.
459
+ '</div>';
460
+
461
+
462
+ }
463
+
464
+ /**
465
+ * Hide GDPR notice
466
+ *
467
+ * @global array $mashsb_options
468
+ */
469
+ function mashsb_hide_gdpr_notice(){
470
+ global $mashsb_options;
471
+ // Get all settings
472
+ update_option( 'mashsb_show_update_notice_gdpr', 'no' );
473
}
474
+ add_action ('mashsb_hide_gdpr_notice', 'mashsb_hide_gdpr_notice');
includes/admin/settings/register-settings.php CHANGED
@@ -189,8 +189,8 @@ function mashsb_get_registered_settings() {
189
),
190
'disable_sharecount' => array(
191
'id' => 'disable_sharecount',
192
- 'name' => __( 'Disable Sharecount', 'mashsb' ),
193
- 'desc' => __( 'Use this when curl() is not supported on your server or share counts should not counted. This mode does not call the database and no SQL queries are generated. (Only less performance benefit. All db requests are cached) Default: false', 'mashsb' ),
194
'type' => 'checkbox'
195
),
196
'hide_sharecount' => array(
@@ -631,13 +631,13 @@ So the MashShare open graph data will be containing the same social meta data th
631
'type' => 'text',
632
'size' => 'large'
633
),
634
- array(
635
- 'id' => 'google_app_id',
636
- 'name' => __( 'Google API Key (goo.gl)', 'mashsb' ),
637
- 'desc' => sprintf(__( 'If you like to use goo.gl shortener get a free Google API key <a href="%s" target="_blank">here</a>. This turn urls into a format: http://goo.gl/cXnjsh. ' . mashsb_check_google_apikey(), 'mashsb' ),'https://console.developers.google.com/'),
638
- 'type' => 'text',
639
- 'size' => 'large'
640
- ),
641
array(
642
'id' => 'mashsu_methods',
643
'name' => __( 'Shorturl method', 'mashsb' ),
@@ -646,7 +646,6 @@ So the MashShare open graph data will be containing the same social meta data th
646
'options' => array(
647
'wpshortlinks' => 'WP Short links',
648
'bitly' => 'Bitly',
649
- 'google' => 'Goo.gl',
650
'disabled' => 'Short URLs Disabled',
651
)
652
),
189
),
190
'disable_sharecount' => array(
191
'id' => 'disable_sharecount',
192
+ 'name' => __( 'Disable Sharecount GDPR / DSGVO', '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
),
196
'hide_sharecount' => array(
631
'type' => 'text',
632
'size' => 'large'
633
),
634
+ // array(
635
+ // 'id' => 'google_app_id',
636
+ // 'name' => __( 'Google API Key (goo.gl)', 'mashsb' ),
637
+ // 'desc' => sprintf(__( 'If you like to use goo.gl shortener get a free Google API key <a href="%s" target="_blank">here</a>. This turn urls into a format: http://goo.gl/cXnjsh. ' . mashsb_check_google_apikey(), 'mashsb' ),'https://console.developers.google.com/'),
638
+ // 'type' => 'text',
639
+ // 'size' => 'large'
640
+ // ),
641
array(
642
'id' => 'mashsu_methods',
643
'name' => __( 'Shorturl method', 'mashsb' ),
646
'options' => array(
647
'wpshortlinks' => 'WP Short links',
648
'bitly' => 'Bitly',
649
'disabled' => 'Short URLs Disabled',
650
)
651
),
includes/admin/upgrades/upgrade-functions.php CHANGED
@@ -30,6 +30,10 @@ function mashsb_do_automatic_upgrades() {
30
if( version_compare( $mashsb_version, '3.2.4', '<' ) ) {
31
mashsb_upgrade_v1();
32
}
33
// Check if version number in DB is lower than version number in current plugin
34
if( version_compare( $mashsb_version, MASHSB_VERSION, '<' ) ) {
35
30
if( version_compare( $mashsb_version, '3.2.4', '<' ) ) {
31
mashsb_upgrade_v1();
32
}
33
+
34
+ // if( version_compare( $mashsb_version, '3.5.3', '<' ) ) {
35
+ // mashsb_upgrade_3_5_3();
36
+ // }
37
// Check if version number in DB is lower than version number in current plugin
38
if( version_compare( $mashsb_version, MASHSB_VERSION, '<' ) ) {
39
includes/admin/welcome.php CHANGED
@@ -46,26 +46,7 @@ class MASHSB_Welcome {
46
* @return void
47
*/
48
public function add_admin_menus() {
49
- // // About Page
50
- // add_dashboard_page(
51
- // __( 'Welcome to MashShare', 'mashsb' ), __( 'Welcome to MashShare', 'mashsb' ), $this->minimum_capability, 'mashsb-about', array($this, 'about_screen')
52
- // );
53
- //
54
- // // Changelog Page
55
- // $mashsb_about = add_dashboard_page(
56
- // __( 'MashShare Changelog', 'mashsb' ), __( 'MashShare Changelog', 'mashsb' ), $this->minimum_capability, 'mashsb-changelog', array($this, 'changelog_screen')
57
- // );
58
- //
59
- // // Getting Started Page
60
- // $mashsb_quickstart = add_submenu_page(
61
- // 'mashsb-settings', __( 'Quickstart', 'mashsb' ), __( 'Quickstart', 'mashsb' ), $this->minimum_capability, 'mashsb-getting-started', array($this, 'getting_started_screen')
62
- // );
63
- //
64
- // // Credits Page
65
- // $mashsb_credits = add_dashboard_page(
66
- // __( 'The people that build MashShare', 'mashsb' ), __( 'The people that build MashShare', 'mashsb' ), $this->minimum_capability, 'mashsb-credits', array($this, 'credits_screen')
67
- // );
68
- //
69
// Getting Started Page
70
$mashsb_quickstart = add_submenu_page(
71
'mashsb-settings', __( 'Quickstart', 'mashsb' ), __( 'Quickstart', 'mashsb' ), $this->minimum_capability, 'mashsb-getting-started', array($this, 'getting_started_screen')
@@ -150,7 +131,7 @@ class MASHSB_Welcome {
150
$this->tabs();
151
?>
152
<?php if (isset($_GET['redirect'])) {?>
153
- <p class="about-description mashsb-notice" style="background-color:#00abed;color:white;padding:20px;margin-top:20px;border:3px solid white;"><?php _e( '<strong>Facebook</strong> and <strong>Twitter Share Buttons</strong> successfully enabled on all your posts! <br> You can use the steps below to customize MashShare.', 'mashsb' ); ?></p>
154
<?php } ?>
155
<div class="changelog clear">
156
<h1><?php _e( 'Create Your First Social Sharing Button', 'mashsb' ); ?></h1>
46
* @return void
47
*/
48
public function add_admin_menus() {
49
+
50
// Getting Started Page
51
$mashsb_quickstart = add_submenu_page(
52
'mashsb-settings', __( 'Quickstart', 'mashsb' ), __( 'Quickstart', 'mashsb' ), $this->minimum_capability, 'mashsb-getting-started', array($this, 'getting_started_screen')
131
$this->tabs();
132
?>
133
<?php if (isset($_GET['redirect'])) {?>
134
+ <p class="about-description mashsb-notice" style="background-color:#00abed;color:white;padding:20px;margin-top:20px;border:3px solid white;"><?php _e( '<strong>Facebook</strong> and <strong>Twitter Share Buttons</strong> have been enabled on all your posts! <br>Use the instructions below to customize MashShare.<br><br><strong>GDPR / DSGVO:</strong> If you like to enable share count beside share buttons go to <a href="'.admin_url().'admin.php?page=mashsb-settings" style="color:white;">MashShare > Settings > Disable Sharecount</a><br>Enable the share count aggregation is not GDPR / GSDVO compliant and is not recommended if your website must be GDPR conform.', 'mashsb' ); ?></p>
135
<?php } ?>
136
<div class="changelog clear">
137
<h1><?php _e( 'Create Your First Social Sharing Button', 'mashsb' ); ?></h1>
includes/install.php CHANGED
@@ -101,6 +101,7 @@ function mashsb_install() {
101
'button_margin' => '1',
102
'text_align_center' => '1',
103
'mashsharer_round' => '1',
104
);
105
update_option( 'mashsb_settings', $settings_default );
106
}
101
'button_margin' => '1',
102
'text_align_center' => '1',
103
'mashsharer_round' => '1',
104
+ 'disable_sharecount' => '1'
105
);
106
update_option( 'mashsb_settings', $settings_default );
107
}
includes/scripts.php CHANGED
@@ -31,6 +31,12 @@ add_action( 'admin_enqueue_scripts', 'mashsb_load_plugins_admin_scripts', 10 );
31
* @param string $hook Page hook
32
*/
33
function mashsb_load_scripts( $hook ) {
34
global $mashsb_options, $post, $mashsb_sharecount;
35
if( !apply_filters( 'mashsb_load_scripts', mashsbGetActiveStatus(), $hook ) ) {
36
mashdebug()->info( "mashsb_load_script not active" );
31
* @param string $hook Page hook
32
*/
33
function mashsb_load_scripts( $hook ) {
34
+
35
+ if (is_admin()){
36
+ return false;
37
+ }
38
+
39
+
40
global $mashsb_options, $post, $mashsb_sharecount;
41
if( !apply_filters( 'mashsb_load_scripts', mashsbGetActiveStatus(), $hook ) ) {
42
mashdebug()->info( "mashsb_load_script not active" );
includes/sharecount-functions.php CHANGED
@@ -205,6 +205,10 @@ function mashsb_rate_limit_exceeded(){
205
function mashsb_is_cache_refresh() {
206
global $post, $mashsb_options;
207
208
// Force Cache Reload
209
if( isset( $_GET['mashsb-refresh'] ) ) {
210
return true;
205
function mashsb_is_cache_refresh() {
206
global $post, $mashsb_options;
207
208
+ if (isset($mashsb_options['disable_sharecount'])){
209
+ return false;
210
+ }
211
+
212
// Force Cache Reload
213
if( isset( $_GET['mashsb-refresh'] ) ) {
214
return true;
includes/shorturls.php CHANGED
@@ -19,6 +19,7 @@ if( !defined( 'ABSPATH' ) ) {
19
*
20
* @since 3.0.0
21
* @return string
22
*/
23
24
function mashsb_check_google_apikey() {
@@ -158,9 +159,9 @@ function mashsb_get_shortened_url( $url ) {
158
}
159
160
// Google shortlink
161
- if( isset( $mashsb_options['mashsu_methods'] ) && $mashsb_options['mashsu_methods'] === 'google' ) {
162
- $shorturl = mashsb_get_google_link( $url );
163
- }
164
165
// Get expiration time
166
$expiration = mashsb_get_expiration();
@@ -181,6 +182,7 @@ function mashsb_get_shortened_url( $url ) {
181
*
182
* @param string $url
183
* @return string
184
*/
185
function mashsb_get_google_link( $url ) {
186
global $mashsb_options;
19
*
20
* @since 3.0.0
21
* @return string
22
+ * @deprecated since 3.5.3
23
*/
24
25
function mashsb_check_google_apikey() {
159
}
160
161
// Google shortlink
162
+ // if( isset( $mashsb_options['mashsu_methods'] ) && $mashsb_options['mashsu_methods'] === 'google' ) {
163
+ // $shorturl = mashsb_get_google_link( $url );
164
+ // }
165
166
// Get expiration time
167
$expiration = mashsb_get_expiration();
182
*
183
* @param string $url
184
* @return string
185
+ * @deprecated since 3.5.3
186
*/
187
function mashsb_get_google_link( $url ) {
188
global $mashsb_options;
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.2
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.2' );
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.3
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.3' );
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.2
13
14
Social Media Share Buttons for Twitter, Facebook and other social networks. Highly customizable Social Media ecosystem
15
@@ -249,6 +249,12 @@ Read here more about this: http://docs.mashshare.net/article/10-facebook-is-show
249
250
== Changelog ==
251
252
= 3.5.2 =
253
* Fix: Warning A non-numeric value encountered
254
@@ -324,5 +330,5 @@ https://www.mashshare.net/changelog/
324
325
== Upgrade Notice ==
326
327
- = 3.5.2 =
328
- 3.5.2 * Fix minor issues. Compatible up to WordPress 4.9.5
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.3
13
14
Social Media Share Buttons for Twitter, Facebook and other social networks. Highly customizable Social Media ecosystem
15
249
250
== Changelog ==
251
252
+ = 3.5.3 =
253
+ * New: Disable share count for new installations as default setting
254
+ * New: Admin notice to recommend to disable the share count agregation to be complicant with upcoming GDPR
255
+ * New: Compatible with WordPress 4.9.6
256
+ * Tweak: Google short urls are not longer supported and removed
257
+
258
= 3.5.2 =
259
* Fix: Warning A non-numeric value encountered
260
330
331
== Upgrade Notice ==
332
333
+ = 3.5.3 =
334
+ * Important changes for upcoming GDPR compliance
uninstall.php CHANGED
@@ -31,6 +31,7 @@ if( mashsb_get_option( 'uninstall_on_delete' ) ) {
31
delete_option( 'mashsb_tracking_last_send');
32
delete_option( 'mashsb_update_notice_101');
33
delete_option( 'mashsb_valid_fb_api_key');
34
35
36
/* Delete all post meta options */
31
delete_option( 'mashsb_tracking_last_send');
32
delete_option( 'mashsb_update_notice_101');
33
delete_option( 'mashsb_valid_fb_api_key');
34
+ delete_option( 'mashsb_show_update_notice_gdpr');
35
36
37
/* Delete all post meta options */