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

Version Description

  • Bugfix for Share button not loading properly
  • Settings are now deleted on plugin uninstall
Download this release

Release Info

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

Code changes from version 3.0 to 3.1

Files changed (2) hide show
  1. readme.txt +5 -1
  2. share-buttons-hupso.php +57 -14
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://www.hupso.com/
4
  Tags: twitter, facebook, google+, social, sharing, stumbleupon, addthis, sharethis, sexybookmarks, addtoany, lockerz, shareaholic
5
  Requires at least: 2.8
6
  Tested up to: 3.4
7
- Stable tag: 3.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -95,6 +95,10 @@ Please send bug reports and suggestion using [this feedback form](http://www.hup
95
 
96
  == Changelog ==
97
 
 
 
 
 
98
  = 3.0 =
99
  * New button type: Counters (support for Facebook Like, Facebook Send, Twitter Tweet, Google +1, Linkedin Share)
100
  * Featured post image (post thumbnail) is now used as Facebook thumbnail when sharing to Facebook
4
  Tags: twitter, facebook, google+, social, sharing, stumbleupon, addthis, sharethis, sexybookmarks, addtoany, lockerz, shareaholic
5
  Requires at least: 2.8
6
  Tested up to: 3.4
7
+ Stable tag: 3.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
95
 
96
  == Changelog ==
97
 
98
+ = 3.1 =
99
+ * Bugfix for Share button not loading properly
100
+ * Settings are now deleted on plugin uninstall
101
+
102
  = 3.0 =
103
  * New button type: Counters (support for Facebook Like, Facebook Send, Twitter Tweet, Google +1, Linkedin Share)
104
  * Featured post image (post thumbnail) is now used as Facebook thumbnail when sharing to Facebook
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.0
7
  Author: kasal
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -11,8 +11,6 @@ License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
12
  $hupso_dev = '';
13
 
14
- $share_image = __('Share');
15
-
16
  $hupso_plugin_url = plugins_url() . '/hupso-share-buttons-for-twitter-facebook-google';
17
  add_filter( 'the_content', 'hupso_the_content', 10 );
18
  add_filter( 'get_the_excerpt', 'hupso_get_the_excerpt', 1);
@@ -28,15 +26,55 @@ if ( is_admin() ) {
28
  add_action( 'admin_head', 'hupso_admin_head' );
29
  add_action( 'wp_head', 'hupso_set_facebook_thumbnail', 1 );
30
 
31
-
32
- $all_services = array(
33
  'Twitter', 'Facebook', 'Google Plus', 'Linkedin', 'StumbleUpon', 'Digg', 'Reddit', 'Bebo', 'Delicious'
34
  );
35
- $default_services = array(
36
  'Twitter', 'Facebook', 'Google Plus', 'Linkedin', 'StumbleUpon', 'Digg', 'Reddit', 'Bebo', 'Delicious'
37
  );
38
 
39
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40
  function hupso_admin_menu() {
41
  add_options_page('', '', 'manage_options', __FILE__, 'hupso_admin_settings_show', '', 6);
42
  }
@@ -66,7 +104,9 @@ function hupso_get_the_excerpt($content) {
66
  }
67
 
68
  function hupso_admin_settings_show() {
69
- global $all_services, $default_services, $hupso_plugin_url;
 
 
70
 
71
  if ( !current_user_can( 'manage_options' ) ) {
72
  wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
@@ -319,7 +359,7 @@ function hupso_admin_settings_show() {
319
 
320
  function hupso_admin_settings_save() {
321
 
322
- global $all_services, $default_services, $hupso_plugin_url;
323
  update_option( 'hupso_custom', '1' );
324
 
325
  if ( $_POST[ 'button_type' ] != '' )
@@ -337,7 +377,7 @@ function hupso_admin_settings_save() {
337
 
338
  /* save button size */
339
  if ( $post ) {
340
- $hupso_button_size = $_POST[ 'button_type' ];
341
  update_option( 'hupso_button_size', $hupso_button_size );
342
  } else {
343
  $hupso_button_size = get_option ( 'hupso_button_size', 'button100x23');
@@ -355,7 +395,7 @@ function hupso_admin_settings_save() {
355
 
356
  /* save services */
357
  $hupso_vars = 'var hupso_services=new Array(';
358
- foreach ( $all_services as $service_text ) {
359
  $service_name = strtolower( $service_text );
360
  $service_name = str_replace( ' ', '', $service_name );
361
  if ( $post ) {
@@ -363,7 +403,7 @@ function hupso_admin_settings_save() {
363
  update_option( 'hupso_' . $service_name, $value );
364
  }
365
  else {
366
- $value = get_option ( 'hupso_' . $service_name, in_array( $service_text, $default_services ) );
367
  }
368
  if ( $value == '1' ) {
369
  $hupso_vars .= '"' . $service_text .'",';
@@ -541,14 +581,14 @@ function hupso_the_content( $content ) {
541
 
542
  function hupso_settings_print_services() {
543
 
544
- global $all_services, $default_services, $hupso_plugin_url;
545
 
546
- foreach ( $all_services as $service_text ) {
547
  $service_name = strtolower( $service_text );
548
  $service_name = str_replace( ' ', '', $service_name );
549
 
550
  $checked = '';
551
- $value = get_option( 'hupso_' . $service_name , in_array( $service_text, $default_services ) );
552
  if ( $value == "1" ) {
553
  $checked = 'checked="checked"';
554
  }
@@ -573,4 +613,7 @@ function hupso_plugin_action_links( $links, $file ) {
573
  }
574
 
575
 
 
 
 
576
  ?>
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.1
7
  Author: kasal
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
12
  $hupso_dev = '';
13
 
 
 
14
  $hupso_plugin_url = plugins_url() . '/hupso-share-buttons-for-twitter-facebook-google';
15
  add_filter( 'the_content', 'hupso_the_content', 10 );
16
  add_filter( 'get_the_excerpt', 'hupso_get_the_excerpt', 1);
26
  add_action( 'admin_head', 'hupso_admin_head' );
27
  add_action( 'wp_head', 'hupso_set_facebook_thumbnail', 1 );
28
 
29
+ $hupso_all_services = array(
 
30
  'Twitter', 'Facebook', 'Google Plus', 'Linkedin', 'StumbleUpon', 'Digg', 'Reddit', 'Bebo', 'Delicious'
31
  );
32
+ $hupso_default_services = array(
33
  'Twitter', 'Facebook', 'Google Plus', 'Linkedin', 'StumbleUpon', 'Digg', 'Reddit', 'Bebo', 'Delicious'
34
  );
35
 
36
 
37
+ if ( function_exists('register_activation_hook') )
38
+ register_activation_hook( __FILE__, 'hupso_plugin_activation' );
39
+
40
+ if ( function_exists('register_uninstall_hook') )
41
+ register_uninstall_hook( __FILE__, 'hupso_plugin_uninstall' );
42
+
43
+ function hupso_plugin_uninstall() {
44
+ delete_option( 'hupso_custom' );
45
+ delete_option( 'hupso_button_type' );
46
+ delete_option( 'hupso_button_size' );
47
+ delete_option( 'hupso_toolbar_size' );
48
+ delete_option( 'hupso_menu_type' );
49
+ delete_option( 'hupso_button_position' );
50
+ delete_option( 'hupso_show_frontpage' );
51
+ delete_option( 'hupso_show_category' );
52
+ delete_option( 'hupso_twitter_tweet' );
53
+ delete_option( 'hupso_facebook_like' );
54
+ delete_option( 'hupso_facebook_send' );
55
+ delete_option( 'hupso_google_plus_one' );
56
+ delete_option( 'hupso_linkedin_share' );
57
+ delete_option( 'hupso_share_buttons_code' );
58
+ delete_option( 'hupso_twitter' );
59
+ delete_option( 'hupso_facebook' );
60
+ delete_option( 'hupso_googleplus' );
61
+ delete_option( 'hupso_linkedin' );
62
+ delete_option( 'hupso_stumbleupon' );
63
+ delete_option( 'hupso_digg' );
64
+ delete_option( 'hupso_reddit' );
65
+ delete_option( 'hupso_bebo' );
66
+ delete_option( 'hupso_delicious' );
67
+ }
68
+
69
+ function hupso_plugin_activation() {
70
+
71
+ /* Fix for bug in version 3.0 */
72
+ $size = get_option( 'hupso_button_size', '');
73
+ if ( ($size == 'share_button') or ($size == 'share_toolbar') or ($size == 'counters') ) {
74
+ update_option( 'hupso_button_size', 'button100x23');
75
+ }
76
+ }
77
+
78
  function hupso_admin_menu() {
79
  add_options_page('', '', 'manage_options', __FILE__, 'hupso_admin_settings_show', '', 6);
80
  }
104
  }
105
 
106
  function hupso_admin_settings_show() {
107
+ global $hupso_all_services, $hupso_default_services, $hupso_plugin_url;
108
+
109
+ $hupso_share_image = __('Share');
110
 
111
  if ( !current_user_can( 'manage_options' ) ) {
112
  wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
359
 
360
  function hupso_admin_settings_save() {
361
 
362
+ global $hupso_all_services, $hupso_default_services, $hupso_plugin_url;
363
  update_option( 'hupso_custom', '1' );
364
 
365
  if ( $_POST[ 'button_type' ] != '' )
377
 
378
  /* save button size */
379
  if ( $post ) {
380
+ $hupso_button_size = $_POST[ 'size' ];
381
  update_option( 'hupso_button_size', $hupso_button_size );
382
  } else {
383
  $hupso_button_size = get_option ( 'hupso_button_size', 'button100x23');
395
 
396
  /* save services */
397
  $hupso_vars = 'var hupso_services=new Array(';
398
+ foreach ( $hupso_all_services as $service_text ) {
399
  $service_name = strtolower( $service_text );
400
  $service_name = str_replace( ' ', '', $service_name );
401
  if ( $post ) {
403
  update_option( 'hupso_' . $service_name, $value );
404
  }
405
  else {
406
+ $value = get_option ( 'hupso_' . $service_name, in_array( $service_text, $hupso_default_services ) );
407
  }
408
  if ( $value == '1' ) {
409
  $hupso_vars .= '"' . $service_text .'",';
581
 
582
  function hupso_settings_print_services() {
583
 
584
+ global $hupso_all_services, $hupso_default_services, $hupso_plugin_url;
585
 
586
+ foreach ( $hupso_all_services as $service_text ) {
587
  $service_name = strtolower( $service_text );
588
  $service_name = str_replace( ' ', '', $service_name );
589
 
590
  $checked = '';
591
+ $value = get_option( 'hupso_' . $service_name , in_array( $service_text, $hupso_default_services ) );
592
  if ( $value == "1" ) {
593
  $checked = 'checked="checked"';
594
  }
613
  }
614
 
615
 
616
+
617
+
618
+
619
  ?>