Social Media Share Buttons | MashShare - Version 3.1.3

Version Description

  • Fix: Share Buttons are not shown on a few ajax based themes. (Remove is_main_query() condition)
  • Fix: WP Shorturls are enabled per default
  • Fix: Warning message when log folder is not writeable
  • Fix: Warning message when curl_init not availabe
  • Fix: Possible Security Warning Issue Resolved when using Vaultpress
  • Tweak: New admin footer in mashshare settings pages
Download this release

Release Info

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

Code changes from version 3.1.2 to 3.1.3

includes/admin/admin-footer.php CHANGED
@@ -13,16 +13,13 @@
13
if( !defined( 'ABSPATH' ) ) exit;
14
15
/**
16
- * Add rating links to the admin dashboard
17
*
18
- * @since 1.0.0
19
- * @global string $typenow
20
* @param string $footer_text The existing footer text
21
* @return string
22
*/
23
- function mashsb_admin_rate_us( $footer_text ) {
24
- global $typenow;
25
-
26
if ( mashsb_is_admin_page() ) {
27
$rate_text = sprintf( __( 'Thank you for using <a href="%1$s" target="_blank">Mashshare</a>! Please <a href="%2$s" target="_blank">rate us</a> on <a href="%2$s" target="_blank">WordPress.org</a> and help to support this project.<br>Something not working as expected or need help? Read our <a href="%3$s" target="blank">Documentation</a>', 'mashsb' ),
28
'https://www.mashshare.net',
@@ -30,9 +27,6 @@ function mashsb_admin_rate_us( $footer_text ) {
30
'https://www.mashshare.net/documentation/'
31
);
32
33
- return str_replace( '</span>', '', '' ) . $rate_text . '</span>';
34
- } else {
35
- return $footer_text;
36
}
37
}
38
- add_filter( 'admin_footer_text', 'mashsb_admin_rate_us' );
13
if( !defined( 'ABSPATH' ) ) exit;
14
15
/**
16
+ * Add rating links to the settings footer
17
*
18
+ * @since 1.0.0
19
* @param string $footer_text The existing footer text
20
* @return string
21
*/
22
+ function mashsb_admin_rate_us() {
23
if ( mashsb_is_admin_page() ) {
24
$rate_text = sprintf( __( 'Thank you for using <a href="%1$s" target="_blank">Mashshare</a>! Please <a href="%2$s" target="_blank">rate us</a> on <a href="%2$s" target="_blank">WordPress.org</a> and help to support this project.<br>Something not working as expected or need help? Read our <a href="%3$s" target="blank">Documentation</a>', 'mashsb' ),
25
'https://www.mashshare.net',
27
'https://www.mashshare.net/documentation/'
28
);
29
30
+ return $rate_text;
31
}
32
}
includes/admin/admin-notices.php CHANGED
@@ -45,6 +45,12 @@ function mashsb_admin_messages() {
45
46
if( !current_user_can( 'update_plugins' ) )
47
return;
48
49
// notice no Networks enabled
50
if( mashsb_is_admin_page() && !mashsb_check_active_networks() ) {
45
46
if( !current_user_can( 'update_plugins' ) )
47
return;
48
+
49
+ if( mashsb_is_admin_page() && !function_exists( 'curl_init' ) ) {
50
+ echo '<div class="error">';
51
+ echo '<p>' . sprintf(__('MashShare needs the PHP extension cURL which is not installed on your server. Please <a href="%s" target="_blank">install and activate</a> it to be able to collect share count of your posts.', 'mashsb'), 'https://www.google.com/search?btnG=1&pws=0&q=enable+curl+on+php') . '</p>';
52
+ echo '</div>';
53
+ }
54
55
// notice no Networks enabled
56
if( mashsb_is_admin_page() && !mashsb_check_active_networks() ) {
includes/admin/settings/display-settings.php CHANGED
@@ -94,22 +94,17 @@ function mashsb_do_settings_fields( $page, $section ) {
94
echo '<tr class="row"><th class="row th">';
95
96
if( !empty( $field['args']['label_for'] ) || empty( $field['args']['desc'] ) ) {
97
- //if( empty( $field['args']['desc'] ) ) {
98
- //echo '<label for="' . esc_attr( $field['args']['label_for'] ) . '" class="col-title">' . $field['title'] . '</label>';
99
echo '<div class="col-title">' . $field['title'] . '</div>';
100
} else {
101
- //echo '<div class="col-title">' . $field['title'] . '<span class="description">' . $field['args']['desc'] . '</span></div>';
102
echo '<div class="col-title">' . $field['title'] .
103
'<a class="mashsb-helper" href="#"></a>' .
104
'<div class="mashsb-message">' . $field['args']['desc'] . '</div>' .
105
'</div>';
106
}
107
echo '</th>';
108
- //if( !empty( $field['args']['name'] ) ) {
109
echo '<td>';
110
call_user_func( $field['callback'], $field['args'] );
111
echo '</td>';
112
- //}
113
echo '</tr>';
114
}
115
echo '</tbody></table>';
@@ -137,18 +132,7 @@ function mashsb_options_page() {
137
<div class="mashsb_admin">
138
<span class="mashsharelogo"> <?php echo __( 'MashShare ', 'mashsb' ); ?></span><span class="mashsb-version"><?php echo MASHSB_VERSION; ?></span>
139
<div class="about-text" style="clear:both;">
140
- <?php
141
- if( !function_exists( 'curl_init' ) ) {
142
- echo '<br><span style="color:red;">' . __( 'php_curl is not working on your server. </span><a href="http://us.informatiweb.net/programmation/32--enable-curl-extension-of-php-on-windows.html" target="_blank">Please enable it.</a>' );
143
- }
144
- ?>
145
- <!--<iframe src="//www.facebook.com/plugins/like.php?href=https%3A%2F%2Fwww.facebook.com%2Fmashshare.net&amp;width=100&amp;layout=standard&amp;action=like&amp;show_faces=false&amp;share=true&amp;height=35&amp;appId=449277011881884" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:400px; height:25px;" allowTransparency="true"></iframe>-->
146
<ul id="mash-social-admin-head">
147
- <!--<iframe src="//www.facebook.com/plugins/like.php?href=https%3A%2F%2Fwww.mashshare.net%2F&amp;width=100&amp;layout=standard&amp;action=like&amp;show_faces=false&amp;share=true&amp;height=35&amp;appId=449277011881884" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:96px; height:20px;" allowTransparency="true"></iframe>
148
- <li><a class="twitter-follow-button" href="https://twitter.com/mashshare" data-size="small" id="twitter-wjs" style="display: block;">Follow @mashshare</a></li>
149
- <li><a class="twitter-follow-button" href="https://twitter.com/renehermenau" data-size="small" id="twitter-wjs" style="display: block;">Follow @renehermenau</a></li>
150
- <li><a href="https://twitter.com/intent/tweet?button_hashtag=mashshare&text=Boost%20your%20traffic%20more%20than%20double%20with%20incredible%20fast%20share%20share%20buttons" class="twitter-hashtag-button" data-size="small" data-related="mashshare" data-url="https://www.mashshare.net/" data-dnt="true">Tweet #mashshare</a></li>
151
- //-->
152
<?php echo mashsb_share_buttons(); ?>
153
</ul>
154
@@ -187,6 +171,7 @@ function mashsb_options_page() {
187
submit_button();
188
?>
189
</form>
190
</div> <!-- new //-->
191
</div><!-- #tab_container-->
192
<div class="mashsb-sidebar">
94
echo '<tr class="row"><th class="row th">';
95
96
if( !empty( $field['args']['label_for'] ) || empty( $field['args']['desc'] ) ) {
97
echo '<div class="col-title">' . $field['title'] . '</div>';
98
} else {
99
echo '<div class="col-title">' . $field['title'] .
100
'<a class="mashsb-helper" href="#"></a>' .
101
'<div class="mashsb-message">' . $field['args']['desc'] . '</div>' .
102
'</div>';
103
}
104
echo '</th>';
105
echo '<td>';
106
call_user_func( $field['callback'], $field['args'] );
107
echo '</td>';
108
echo '</tr>';
109
}
110
echo '</tbody></table>';
132
<div class="mashsb_admin">
133
<span class="mashsharelogo"> <?php echo __( 'MashShare ', 'mashsb' ); ?></span><span class="mashsb-version"><?php echo MASHSB_VERSION; ?></span>
134
<div class="about-text" style="clear:both;">
135
<ul id="mash-social-admin-head">
136
<?php echo mashsb_share_buttons(); ?>
137
</ul>
138
171
submit_button();
172
?>
173
</form>
174
+ <div><?php echo mashsb_admin_rate_us(); ?></div>
175
</div> <!-- new //-->
176
</div><!-- #tab_container-->
177
<div class="mashsb-sidebar">
includes/install.php CHANGED
@@ -89,7 +89,8 @@ function mashsb_install() {
89
'twitter_card' => '1',
90
'open_graph' => '1',
91
'mashsb_sharemethod' => 'mashengine',
92
- 'caching_method' => 'async_cache'
93
);
94
95
update_option( 'mashsb_settings', $settings_new );
89
'twitter_card' => '1',
90
'open_graph' => '1',
91
'mashsb_sharemethod' => 'mashengine',
92
+ 'caching_method' => 'async_cache',
93
+ 'mashsu_methods' => 'disabled',
94
);
95
96
update_option( 'mashsb_settings', $settings_new );
includes/libraries/class-google-shorturl.php CHANGED
@@ -29,6 +29,7 @@ class mashsb_google_shorturl
29
private static $buffer = array();
30
31
function __construct($apiKey = null) {
32
# Extended output mode
33
$extended = false;
34
29
private static $buffer = array();
30
31
function __construct($apiKey = null) {
32
+
33
# Extended output mode
34
$extended = false;
35
includes/logger.php CHANGED
@@ -78,7 +78,11 @@ class mashsbLogger {
78
79
private function write($string)
80
{
81
- return fwrite($this->stream, $string);
82
}
83
84
/* Check if mashshare debug mode is enabled
78
79
private function write($string)
80
{
81
+ try {
82
+ return ($this->stream === null) ? false : fwrite($this->stream, $string);
83
+ } catch(Exception $e) {
84
+ return false;
85
+ }
86
}
87
88
/* Check if mashshare debug mode is enabled
includes/shorturls.php CHANGED
@@ -22,17 +22,22 @@ if( !defined( 'ABSPATH' ) ) {
22
*/
23
24
function mashsb_check_google_apikey() {
25
global $mashsb_options;
26
$appid = isset( $mashsb_options['google_app_id'] ) ? $appid = $mashsb_options['google_app_id'] : $appid = '';
27
- $shorturl = new mashsb_google_shorturl( $appid );
28
29
- $statusArr = $shorturl->checkApiKey( 'http://www.google.de' );
30
isset( $statusArr['error']['errors'][0]['reason'] ) ? $statusArr['error']['errors'][0]['reason'] : $statusArr['error']['errors'][0]['reason'] = '';
31
32
- if( !empty( $statusArr['error']['errors'][0]['reason'] ) ){
33
return '<strong style="color:red;font-weight:bold;"> Notice: </strong>' . $statusArr['error']['errors'][0]['reason'];
34
- }
35
}
36
/*
37
* Check if Bitly API Key is working properly
38
*
22
*/
23
24
function mashsb_check_google_apikey() {
25
+
26
global $mashsb_options;
27
$appid = isset( $mashsb_options['google_app_id'] ) ? $appid = $mashsb_options['google_app_id'] : $appid = '';
28
29
+ if( function_exists( 'curl_init' ) ) {
30
+ $shorturl = new mashsb_google_shorturl( $appid );
31
+ $statusArr = $shorturl->checkApiKey( 'http://www.google.de' );
32
+ }
33
+
34
isset( $statusArr['error']['errors'][0]['reason'] ) ? $statusArr['error']['errors'][0]['reason'] : $statusArr['error']['errors'][0]['reason'] = '';
35
36
+ if( !empty( $statusArr['error']['errors'][0]['reason'] ) ) {
37
return '<strong style="color:red;font-weight:bold;"> Notice: </strong>' . $statusArr['error']['errors'][0]['reason'];
38
+ }
39
}
40
+
41
/*
42
* Check if Bitly API Key is working properly
43
*
includes/template-functions.php CHANGED
@@ -669,9 +669,11 @@ function mashshare_filter_content( $content ) {
669
$excluded = isset( $mashsb_options['excluded_from'] ) ? $mashsb_options['excluded_from'] : null;
670
$singular = isset( $mashsb_options['singular'] ) ? $singular = true : $singular = false;
671
672
- if( !is_main_query() ) {
673
return $content;
674
- }
675
676
if( mashsb_is_excluded() ){
677
return $content;
669
$excluded = isset( $mashsb_options['excluded_from'] ) ? $mashsb_options['excluded_from'] : null;
670
$singular = isset( $mashsb_options['singular'] ) ? $singular = true : $singular = false;
671
672
+ /*
673
+ * Deprecated because of Ticket# https://github.com/mashshare/Mashshare/issues/24
674
+ * if( !is_main_query() ) {
675
return $content;
676
+ }*/
677
678
if( mashsb_is_excluded() ){
679
return $content;
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.1.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.1.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.1.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.1.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
10
Requires at least: 3.6+
11
Tested up to: 4.5.2
12
- Stable tag: 3.1.2
13
14
Social Media Share Buttons for Twitter, Facebook and other social networks. Highly customizable Social Media ecosystem
15
@@ -317,6 +317,14 @@ Read here more FAQ: [https://www.mashshare.net/faq/](https://www.mashshare.net/f
317
318
== Changelog ==
319
320
= 3.1.2 =
321
* New: Option to show Social Sharing options meta box only for specific user roles
322
9
Tags: Share buttons, Social Sharing, social media, Facebook, Twitter, Subscribe, Traffic posts, pages, widget, social share buttons, analytics, email
10
Requires at least: 3.6+
11
Tested up to: 4.5.2
12
+ Stable tag: 3.1.3
13
14
Social Media Share Buttons for Twitter, Facebook and other social networks. Highly customizable Social Media ecosystem
15
317
318
== Changelog ==
319
320
+ = 3.1.3 =
321
+ * Fix: Share Buttons are not shown on a few ajax based themes. (Remove is_main_query() condition)
322
+ * Fix: WP Shorturls are enabled per default
323
+ * Fix: Warning message when log folder is not writeable
324
+ * Fix: Warning message when curl_init not availabe
325
+ * Fix: Possible Security Warning Issue Resolved when using Vaultpress
326
+ * Tweak: New admin footer in mashshare settings pages
327
+
328
= 3.1.2 =
329
* New: Option to show Social Sharing options meta box only for specific user roles
330