Hupso Share Buttons for Twitter, Facebook & Google+ - Version 3.9.11

Version Description

  • Removed option to show or hide share buttons in excerpts due to incompatibility with some themes (it will be added back in next version)
Download this release

Release Info

Developer kasal
Plugin Icon 128x128 Hupso Share Buttons for Twitter, Facebook & Google+
Version 3.9.11
Comparing to
See all releases

Code changes from version 3.9.10 to 3.9.11

Files changed (2) hide show
  1. readme.txt +4 -1
  2. share-buttons-hupso.php +32 -49
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://www.hupso.com/
4
  Tags: twitter, facebook, google, social sharing, share buttons, social share buttons, share icons, stumbleupon, addthis, sharethis, sexybookmarks, addtoany
5
  Requires at least: 2.8
6
  Tested up to: 3.5.1
7
- Stable tag: 3.9.10
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -257,6 +257,9 @@ Please send bug reports and suggestion using [this feedback form](http://www.hup
257
 
258
  == Changelog ==
259
 
 
 
 
260
  = 3.9.10 =
261
  * Bugfix for shortcodes
262
 
4
  Tags: twitter, facebook, google, social sharing, share buttons, social share buttons, share icons, stumbleupon, addthis, sharethis, sexybookmarks, addtoany
5
  Requires at least: 2.8
6
  Tested up to: 3.5.1
7
+ Stable tag: 3.9.11
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
257
 
258
  == Changelog ==
259
 
260
+ = 3.9.11 =
261
+ * Removed option to show or hide share buttons in excerpts due to incompatibility with some themes (it will be added back in next version)
262
+
263
  = 3.9.10 =
264
  * Bugfix for shortcodes
265
 
share-buttons-hupso.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Hupso Share Buttons for Twitter, Facebook & Google+
4
  Plugin URI: http://www.hupso.com/share/
5
  Description: Add simple social sharing buttons to your articles. Your visitors will be able to easily share your content on the most popular social networks: Twitter, Facebook, Google Plus, Linkedin, StumbleUpon, Digg, Reddit, Bebo and Delicous. These services are used by millions of people every day, so sharing your content there will increase traffic to your website.
6
- Version: 3.9.10
7
  Author: kasal
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -47,7 +47,7 @@ if ( ! function_exists( 'is_ssl' ) ) {
47
 
48
  add_filter( 'the_content', 'hupso_the_content_normal', 10 );
49
  add_filter( 'get_the_excerpt', 'hupso_get_the_excerpt', 1);
50
- add_filter( 'the_excerpt', 'hupso_the_excerpt', 100 );
51
 
52
  load_plugin_textdomain( 'share_buttons_hupso', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
53
 
@@ -120,7 +120,6 @@ function hupso_plugin_uninstall() {
120
  delete_option( 'hupso_show_pages' );
121
  delete_option( 'hupso_show_frontpage' );
122
  delete_option( 'hupso_show_category' );
123
- delete_option( 'hupso_show_excerpts' );
124
  delete_option( 'hupso_show_search' );
125
  delete_option( 'hupso_twitter_tweet' );
126
  delete_option( 'hupso_facebook_like' );
@@ -223,6 +222,12 @@ function hupso_set_facebook_thumbnail() {
223
  }
224
  }
225
 
 
 
 
 
 
 
226
  function hupso_admin_settings_show() {
227
  global $hupso_all_services, $hupso_default_services, $hupso_plugin_url;
228
 
@@ -632,7 +637,6 @@ function hupso_admin_settings_show() {
632
  $hupso_show_pages_checked = '';
633
  $hupso_show_frontpage_checked = '';
634
  $hupso_show_category_checked = '';
635
- $hupso_show_excerpts_checked = '';
636
 
637
  /* posts */
638
  $hupso_show_posts = get_option( 'hupso_show_posts', '1' );
@@ -662,13 +666,6 @@ function hupso_admin_settings_show() {
662
  else
663
  $hupso_show_category_checked = '';
664
 
665
- /* excerpts */
666
- $hupso_show_excerpts = get_option( 'hupso_show_excerpts', '1' );
667
- if ( $hupso_show_excerpts == 1 )
668
- $hupso_show_excerpts_checked = $checked;
669
- else
670
- $hupso_show_excerpts_checked = '';
671
-
672
  /* search pages */
673
  $hupso_show_search = get_option( 'hupso_show_search', '1');
674
  if ( $hupso_show_search == '1' )
@@ -690,8 +687,6 @@ function hupso_admin_settings_show() {
690
  <input type="checkbox" name="hupso_show_pages" value="1" <?php echo $hupso_show_pages_checked; ?> /> <?php _e('Pages', 'share_buttons_hupso'); ?><br/>
691
  <input type="checkbox" name="hupso_show_frontpage" value="1" <?php echo $hupso_show_frontpage_checked; ?> /> <?php _e('Front page', 'share_buttons_hupso'); ?><br/>
692
  <input type="checkbox" name="hupso_show_category" value="1" <?php echo $hupso_show_category_checked; ?> /> <?php _e('Archive pages (categories, tags, dates, authors)', 'share_buttons_hupso'); ?><br/>
693
- <input type="checkbox" name="hupso_show_excerpts" value="1" <?php echo $hupso_show_excerpts_checked; ?> /> <?php _e('Excerpts', 'share_buttons_hupso'); ?><br/>
694
-
695
  <input type="checkbox" name="hupso_show_search" value="1" <?php echo $hupso_show_search_checked; ?> /> <?php _e('Search pages', 'share_buttons_hupso'); ?><br/>
696
  <input type="checkbox" name="hupso_password_protected" value="1" <?php echo $hupso_password_protected_checked; ?> /> <?php _e('Password protected posts', 'share_buttons_hupso'); ?><br/>
697
 
@@ -1051,9 +1046,6 @@ function hupso_admin_settings_save() {
1051
  $hupso_show_category = @$_POST[ 'hupso_show_category' ];
1052
  update_option( 'hupso_show_category', $hupso_show_category );
1053
 
1054
- $hupso_show_excerpts = @$_POST[ 'hupso_show_excerpts' ];
1055
- update_option( 'hupso_show_excerpts', $hupso_show_excerpts );
1056
-
1057
  $hupso_show_search = @$_POST[ 'hupso_show_search' ];
1058
  update_option( 'hupso_show_search', $hupso_show_search );
1059
 
@@ -1154,34 +1146,13 @@ function hupso_admin_settings_save() {
1154
 
1155
  }
1156
 
 
1157
  function hupso_the_widget( $content ) {
1158
  global $hupso_state;
1159
  $hupso_state = 'widget';
1160
  return hupso_the_content ( $content );
1161
  }
1162
 
1163
- function hupso_get_the_excerpt( $content ) {
1164
- $content = hupso_remove_shortcodes( $content );
1165
- $hupso_show_excerpts = get_option( 'hupso_show_excerpts' , '1' );
1166
- if ( $hupso_show_excerpts == 1 ) {
1167
- return hupso_the_content ( $content );
1168
- }
1169
- else {
1170
- return $content;
1171
- }
1172
- }
1173
-
1174
- function hupso_the_excerpt( $content ) {
1175
- $content = hupso_remove_shortcodes( $content );
1176
- return $content;
1177
- }
1178
-
1179
- function hupso_remove_shortcodes( $content ) {
1180
- $content = str_ireplace('[hupso_hide]', '', $content);
1181
- $content = str_ireplace('[hupso]', '', $content);
1182
- return $content;
1183
- }
1184
-
1185
  function hupso_the_content_normal( $content ) {
1186
  global $hupso_state;
1187
  $hupso_state = 'normal';
@@ -1193,19 +1164,22 @@ function hupso_the_content( $content ) {
1193
  global $hupso_plugin_url, $wp_version, $hupso_dev, $hupso_state, $HUPSO_SHOW, $hupso_p;
1194
 
1195
  if ($HUPSO_SHOW == false) {
1196
- $content = hupso_remove_shortcodes( $content );
 
1197
  return $content;
1198
  }
1199
 
1200
  /* Do now show share buttons when [hupso_hide] is used */
1201
  if ( ($hupso_state == 'normal') && ( stripos($content, '[hupso_hide]') !== false ) ) {
1202
- $content = hupso_remove_shortcodes( $content );
 
1203
  return $content;
1204
  }
1205
 
1206
  /* Do not show share buttons in feeds */
1207
  if ( ($hupso_state == 'normal') && (is_feed()) ) {
1208
- $content = hupso_remove_shortcodes( $content );
 
1209
  return $content;
1210
  }
1211
 
@@ -1227,19 +1201,22 @@ function hupso_the_content( $content ) {
1227
 
1228
  $hupso_show_search = get_option( 'hupso_show_search' , '1' );
1229
  if ( ($hupso_state == 'normal') && (is_search()) && ($hupso_show_search != 1) ) {
1230
- $content = hupso_remove_shortcodes( $content );
 
1231
  return $content;
1232
  }
1233
 
1234
  $hupso_show_posts = get_option( 'hupso_show_posts' , '1' );
1235
  if ( ($hupso_state == 'normal') && (is_single()) && ($hupso_show_posts != 1) ) {
1236
- $content = hupso_remove_shortcodes( $content );
 
1237
  return $content;
1238
  }
1239
 
1240
  $hupso_show_pages = get_option( 'hupso_show_pages' , '1' );
1241
  if ( ($hupso_state == 'normal') && (is_page()) && ($hupso_show_pages != 1) ) {
1242
- $content = hupso_remove_shortcodes( $content );
 
1243
  return $content;
1244
  }
1245
 
@@ -1248,12 +1225,14 @@ function hupso_the_content( $content ) {
1248
 
1249
  /* Do not show share buttons if option is disabled */
1250
  if ( ($hupso_state == 'normal') && (is_home()) && ($hupso_show_frontpage != 1) ) {
1251
- $content = hupso_remove_shortcodes( $content );
 
1252
  return $content;
1253
  }
1254
  /* Do not show share buttons if option is disabled */
1255
  if ( ($hupso_state == 'normal') && (is_archive()) && ($hupso_show_category != 1) ) {
1256
- $content = hupso_remove_shortcodes( $content );
 
1257
  return $content;
1258
  }
1259
 
@@ -1270,7 +1249,8 @@ function hupso_the_content( $content ) {
1270
  $hupso_hide_categories = array();
1271
  }
1272
  if ( ($hupso_state == 'normal') && (@in_array($current_category, (array) $hupso_hide_categories)) ) {
1273
- $content = hupso_remove_shortcodes( $content );
 
1274
  return $content;
1275
  }
1276
 
@@ -1292,6 +1272,9 @@ function hupso_the_content( $content ) {
1292
  $post_title = '';
1293
  }
1294
 
 
 
 
1295
  $hupso_page_url = get_option( 'hupso_page_url', '' );
1296
  $hupso_page_title = stripslashes(get_option( 'hupso_page_title', '' ));
1297
 
@@ -1377,7 +1360,7 @@ function hupso_the_content( $content ) {
1377
  if ( ($hupso_shortcode_params != '') && ($h_url != '') ) {
1378
  $new_url = $h_url;
1379
  }
1380
-
1381
  switch ( $button_type ) {
1382
  case 'share_button':
1383
  $code .= 'var hupso_url="' . $new_url . '";';
@@ -1447,7 +1430,7 @@ function hupso_the_content( $content ) {
1447
  }
1448
 
1449
  if ( stripos($content, '[hupso]') !== false) {
1450
- $new_content = str_ireplace( '[hupso]', '<div' . $hupso_css_out. '>' . $code . '</div>', $content);
1451
  }
1452
  else {
1453
  switch ( $position ) {
3
  Plugin Name: Hupso Share Buttons for Twitter, Facebook & Google+
4
  Plugin URI: http://www.hupso.com/share/
5
  Description: Add simple social sharing buttons to your articles. Your visitors will be able to easily share your content on the most popular social networks: Twitter, Facebook, Google Plus, Linkedin, StumbleUpon, Digg, Reddit, Bebo and Delicous. These services are used by millions of people every day, so sharing your content there will increase traffic to your website.
6
+ Version: 3.9.11
7
  Author: kasal
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
47
 
48
  add_filter( 'the_content', 'hupso_the_content_normal', 10 );
49
  add_filter( 'get_the_excerpt', 'hupso_get_the_excerpt', 1);
50
+ add_filter( 'the_excerpt', 'hupso_the_content_normal', 100 );
51
 
52
  load_plugin_textdomain( 'share_buttons_hupso', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
53
 
120
  delete_option( 'hupso_show_pages' );
121
  delete_option( 'hupso_show_frontpage' );
122
  delete_option( 'hupso_show_category' );
 
123
  delete_option( 'hupso_show_search' );
124
  delete_option( 'hupso_twitter_tweet' );
125
  delete_option( 'hupso_facebook_like' );
222
  }
223
  }
224
 
225
+ function hupso_get_the_excerpt($content) {
226
+ $content = str_ireplace('[hupso_hide]', '', $content);
227
+ $content = str_ireplace('[hupso]', '', $content);
228
+ return $content;
229
+ }
230
+
231
  function hupso_admin_settings_show() {
232
  global $hupso_all_services, $hupso_default_services, $hupso_plugin_url;
233
 
637
  $hupso_show_pages_checked = '';
638
  $hupso_show_frontpage_checked = '';
639
  $hupso_show_category_checked = '';
 
640
 
641
  /* posts */
642
  $hupso_show_posts = get_option( 'hupso_show_posts', '1' );
666
  else
667
  $hupso_show_category_checked = '';
668
 
 
 
 
 
 
 
 
669
  /* search pages */
670
  $hupso_show_search = get_option( 'hupso_show_search', '1');
671
  if ( $hupso_show_search == '1' )
687
  <input type="checkbox" name="hupso_show_pages" value="1" <?php echo $hupso_show_pages_checked; ?> /> <?php _e('Pages', 'share_buttons_hupso'); ?><br/>
688
  <input type="checkbox" name="hupso_show_frontpage" value="1" <?php echo $hupso_show_frontpage_checked; ?> /> <?php _e('Front page', 'share_buttons_hupso'); ?><br/>
689
  <input type="checkbox" name="hupso_show_category" value="1" <?php echo $hupso_show_category_checked; ?> /> <?php _e('Archive pages (categories, tags, dates, authors)', 'share_buttons_hupso'); ?><br/>
 
 
690
  <input type="checkbox" name="hupso_show_search" value="1" <?php echo $hupso_show_search_checked; ?> /> <?php _e('Search pages', 'share_buttons_hupso'); ?><br/>
691
  <input type="checkbox" name="hupso_password_protected" value="1" <?php echo $hupso_password_protected_checked; ?> /> <?php _e('Password protected posts', 'share_buttons_hupso'); ?><br/>
692
 
1046
  $hupso_show_category = @$_POST[ 'hupso_show_category' ];
1047
  update_option( 'hupso_show_category', $hupso_show_category );
1048
 
 
 
 
1049
  $hupso_show_search = @$_POST[ 'hupso_show_search' ];
1050
  update_option( 'hupso_show_search', $hupso_show_search );
1051
 
1146
 
1147
  }
1148
 
1149
+
1150
  function hupso_the_widget( $content ) {
1151
  global $hupso_state;
1152
  $hupso_state = 'widget';
1153
  return hupso_the_content ( $content );
1154
  }
1155
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1156
  function hupso_the_content_normal( $content ) {
1157
  global $hupso_state;
1158
  $hupso_state = 'normal';
1164
  global $hupso_plugin_url, $wp_version, $hupso_dev, $hupso_state, $HUPSO_SHOW, $hupso_p;
1165
 
1166
  if ($HUPSO_SHOW == false) {
1167
+ $content = str_ireplace('[hupso_hide]', '', $content);
1168
+ $content = str_ireplace('[hupso]', '', $content);
1169
  return $content;
1170
  }
1171
 
1172
  /* Do now show share buttons when [hupso_hide] is used */
1173
  if ( ($hupso_state == 'normal') && ( stripos($content, '[hupso_hide]') !== false ) ) {
1174
+ $content = str_ireplace('[hupso_hide]', '', $content);
1175
+ $content = str_ireplace('[hupso]', '', $content);
1176
  return $content;
1177
  }
1178
 
1179
  /* Do not show share buttons in feeds */
1180
  if ( ($hupso_state == 'normal') && (is_feed()) ) {
1181
+ $content = str_ireplace('[hupso_hide]', '', $content);
1182
+ $content = str_ireplace('[hupso]', '', $content);
1183
  return $content;
1184
  }
1185
 
1201
 
1202
  $hupso_show_search = get_option( 'hupso_show_search' , '1' );
1203
  if ( ($hupso_state == 'normal') && (is_search()) && ($hupso_show_search != 1) ) {
1204
+ $content = str_ireplace('[hupso_hide]', '', $content);
1205
+ $content = str_ireplace('[hupso]', '', $content);
1206
  return $content;
1207
  }
1208
 
1209
  $hupso_show_posts = get_option( 'hupso_show_posts' , '1' );
1210
  if ( ($hupso_state == 'normal') && (is_single()) && ($hupso_show_posts != 1) ) {
1211
+ $content = str_ireplace('[hupso_hide]', '', $content);
1212
+ $content = str_ireplace('[hupso]', '', $content);
1213
  return $content;
1214
  }
1215
 
1216
  $hupso_show_pages = get_option( 'hupso_show_pages' , '1' );
1217
  if ( ($hupso_state == 'normal') && (is_page()) && ($hupso_show_pages != 1) ) {
1218
+ $content = str_ireplace('[hupso_hide]', '', $content);
1219
+ $content = str_ireplace('[hupso]', '', $content);
1220
  return $content;
1221
  }
1222
 
1225
 
1226
  /* Do not show share buttons if option is disabled */
1227
  if ( ($hupso_state == 'normal') && (is_home()) && ($hupso_show_frontpage != 1) ) {
1228
+ $content = str_ireplace('[hupso_hide]', '', $content);
1229
+ $content = str_ireplace('[hupso]', '', $content);
1230
  return $content;
1231
  }
1232
  /* Do not show share buttons if option is disabled */
1233
  if ( ($hupso_state == 'normal') && (is_archive()) && ($hupso_show_category != 1) ) {
1234
+ $content = str_ireplace('[hupso_hide]', '', $content);
1235
+ $content = str_ireplace('[hupso]', '', $content);
1236
  return $content;
1237
  }
1238
 
1249
  $hupso_hide_categories = array();
1250
  }
1251
  if ( ($hupso_state == 'normal') && (@in_array($current_category, (array) $hupso_hide_categories)) ) {
1252
+ $content = str_ireplace('[hupso_hide]', '', $content);
1253
+ $content = str_ireplace('[hupso]', '', $content);
1254
  return $content;
1255
  }
1256
 
1272
  $post_title = '';
1273
  }
1274
 
1275
+
1276
+
1277
+
1278
  $hupso_page_url = get_option( 'hupso_page_url', '' );
1279
  $hupso_page_title = stripslashes(get_option( 'hupso_page_title', '' ));
1280
 
1360
  if ( ($hupso_shortcode_params != '') && ($h_url != '') ) {
1361
  $new_url = $h_url;
1362
  }
1363
+
1364
  switch ( $button_type ) {
1365
  case 'share_button':
1366
  $code .= 'var hupso_url="' . $new_url . '";';
1430
  }
1431
 
1432
  if ( stripos($content, '[hupso]') !== false) {
1433
+ $new_content = str_ireplace('[hupso]', '<div' . $hupso_css_out. '>' . $code . '</div>', $content);
1434
  }
1435
  else {
1436
  switch ( $position ) {