Simple Share Buttons Adder - Version 7.4.11

Version Description

  • Fix: Missing variables and indexes.
Download this release

Release Info

Developer DavidoffNeal
Plugin Icon 128x128 Simple Share Buttons Adder
Version 7.4.11
Comparing to
See all releases

Code changes from version 7.4.10 to 7.4.11

instance.php CHANGED
@@ -9,7 +9,7 @@ namespace SimpleShareButtonsAdder;
9
 
10
  define( 'SSBA_FILE', __FILE__ );
11
  define( 'SSBA_ROOT', dirname( __FILE__ ) );
12
- define( 'SSBA_VERSION', '7.4.10' );
13
 
14
  global $simple_share_buttons_adder_plugin;
15
 
9
 
10
  define( 'SSBA_FILE', __FILE__ );
11
  define( 'SSBA_ROOT', dirname( __FILE__ ) );
12
+ define( 'SSBA_VERSION', '7.4.11' );
13
 
14
  global $simple_share_buttons_adder_plugin;
15
 
php/class-buttons.php CHANGED
@@ -196,7 +196,7 @@ class Buttons {
196
  $wrap_id = 'Y' !== $arr_settings['ssba_new_buttons'] ? 'ssba-classic-2' : 'ssba-modern-2';
197
 
198
  // Ssba div.
199
- $html_share_buttons = '<!-- Simple Share Buttons Adder (' . esc_html( SSBA_VERSION ) . ') simplesharebuttons.com --><div id="' . esc_attr( $wrap_id ) . '" class="ssba ssbp-wrap' . esc_attr( ' ' . $arr_settings['ssba_plus_position'] ) . ' ssbp--theme-' . esc_attr( $arr_settings['ssba_plus_button_style'] ) . '">';
200
 
201
  // Center if set so.
202
  $html_share_buttons .= '<div style="text-align:' . esc_attr( $alignment ) . '">';
@@ -309,7 +309,7 @@ class Buttons {
309
  wp_enqueue_style( "{$this->plugin->assets_prefix}-ssba" );
310
  }
311
 
312
- $html_share_buttons .= '<div id="ssba-bar-2" class="' . esc_attr( $arr_settings['ssba_bar_position'] ) . ' ssbp-wrap ssbp--theme-' . esc_attr( $arr_settings['ssba_bar_style'] ) . '" >';
313
  $html_share_buttons .= '<div class="ssbp-container">';
314
  $html_share_buttons .= '<ul class="ssbp-bar-list">';
315
 
@@ -479,7 +479,19 @@ class Buttons {
479
  public function ssba_facebook( $arr_settings, $url_current_page, $str_page_title, $boo_show_share_count ) {
480
  $nofollow = 'Y' === $arr_settings['ssba_rel_nofollow'] ? ' rel="nofollow"' : '';
481
  $network = 'Facebook';
482
- $target = 'Y' === $arr_settings['ssba_share_new_window'] ? ' target="_blank" ' : '';
 
 
 
 
 
 
 
 
 
 
 
 
483
  $plus_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-facebook ssbp-btn' : '';
484
  $count_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-each-share' : ' ssba_sharecount';
485
  $html_share_buttons = '';
@@ -704,7 +716,19 @@ class Buttons {
704
  public function ssba_twitter( $arr_settings, $url_current_page, $str_page_title, $boo_show_share_count ) {
705
  $nofollow = 'Y' === $arr_settings['ssba_rel_nofollow'] ? ' rel="nofollow"' : '';
706
  $network = 'Twitter';
707
- $target = 'Y' === $arr_settings['ssba_share_new_window'] ? ' target="_blank" ' : '';
 
 
 
 
 
 
 
 
 
 
 
 
708
  $plus_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-twitter ssbp-btn' : '';
709
  $count_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-each-share' : ' ssba_sharecount';
710
  $html_share_buttons = '';
@@ -791,7 +815,19 @@ class Buttons {
791
  public function ssba_google( $arr_settings, $url_current_page, $str_page_title, $boo_show_share_count ) {
792
  $nofollow = 'Y' === $arr_settings['ssba_rel_nofollow'] ? ' rel="nofollow"' : '';
793
  $network = 'Google+';
794
- $target = 'Y' === $arr_settings['ssba_share_new_window'] ? ' target="_blank" ' : '';
 
 
 
 
 
 
 
 
 
 
 
 
795
  $plus_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-google ssbp-btn' : '';
796
  $count_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-each-share' : ' ssba_sharecount';
797
  $html_share_buttons = '';
@@ -894,7 +930,19 @@ class Buttons {
894
  public function ssba_diggit( $arr_settings, $url_current_page, $str_page_title, $boo_show_share_count ) {
895
  $nofollow = 'Y' === $arr_settings['ssba_rel_nofollow'] ? ' rel="nofollow"' : '';
896
  $network = 'Digg';
897
- $target = 'Y' === $arr_settings['ssba_share_new_window'] ? ' target="_blank" ' : '';
 
 
 
 
 
 
 
 
 
 
 
 
898
  $plus_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-diggit ssbp-btn' : '';
899
  $count_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-each-share' : ' ssba_sharecount';
900
  $html_share_buttons = '';
@@ -944,7 +992,19 @@ class Buttons {
944
  public function ssba_reddit( $arr_settings, $url_current_page, $str_page_title, $boo_show_share_count ) {
945
  $nofollow = 'Y' === $arr_settings['ssba_rel_nofollow'] ? ' rel="nofollow"' : '';
946
  $network = 'Reddit';
947
- $target = 'Y' === $arr_settings['ssba_share_new_window'] ? ' target="_blank" ' : '';
 
 
 
 
 
 
 
 
 
 
 
 
948
  $plus_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-reddit ssbp-btn' : '';
949
  $count_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-each-share' : ' ssba_sharecount';
950
  $html_share_buttons = '';
@@ -1026,7 +1086,20 @@ class Buttons {
1026
  public function ssba_linkedin( $arr_settings, $url_current_page, $str_page_title, $boo_show_share_count ) {
1027
  $nofollow = 'Y' === $arr_settings['ssba_rel_nofollow'] ? ' rel="nofollow"' : '';
1028
  $network = 'Linkedin';
1029
- $target = 'Y' === $arr_settings['ssba_share_new_window'] ? ' target="_blank" ' : '';
 
 
 
 
 
 
 
 
 
 
 
 
 
1030
  $plus_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-linkedin ssbp-btn' : '';
1031
  $count_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-each-share' : ' ssba_sharecount';
1032
  $html_share_buttons = '';
@@ -1109,7 +1182,20 @@ class Buttons {
1109
  public function ssba_pinterest( $arr_settings, $url_current_page, $str_page_title, $boo_show_share_count ) {
1110
  $nofollow = 'Y' === $arr_settings['ssba_rel_nofollow'] ? ' rel="nofollow"' : '';
1111
  $network = 'Pinterest';
1112
- $target = 'Y' === $arr_settings['ssba_share_new_window'] ? ' target="_blank" ' : '';
 
 
 
 
 
 
 
 
 
 
 
 
 
1113
  $plus_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-pinterest ssbp-btn' : '';
1114
  $count_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-each-share' : ' ssba_sharecount';
1115
  $html_share_buttons = '';
@@ -1207,7 +1293,20 @@ class Buttons {
1207
  public function ssba_stumbleupon( $arr_settings, $url_current_page, $str_page_title, $boo_show_share_count ) {
1208
  $nofollow = 'Y' === $arr_settings['ssba_rel_nofollow'] ? ' rel="nofollow"' : '';
1209
  $network = 'StumbleUpon';
1210
- $target = 'Y' === $arr_settings['ssba_share_new_window'] ? ' target="_blank" ' : '';
 
 
 
 
 
 
 
 
 
 
 
 
 
1211
  $url = 'http://www.stumbleupon.com/submit?url=' . esc_attr( $url_current_page ) . '&amp;title=' . esc_attr( $str_page_title );
1212
  $plus_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-stumbleupon ssbp-btn' : '';
1213
  $count_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-each-share' : ' ssba_sharecount';
@@ -1339,7 +1438,20 @@ class Buttons {
1339
  public function ssba_flattr( $arr_settings, $url_current_page, $str_page_title, $boo_show_share_count ) {
1340
  $nofollow = 'Y' === $arr_settings['ssba_rel_nofollow'] ? ' rel="nofollow"' : '';
1341
  $network = 'Flattr';
1342
- $target = 'Y' === $arr_settings['ssba_share_new_window'] ? ' target="_blank" ' : '';
 
 
 
 
 
 
 
 
 
 
 
 
 
1343
  $plus_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-flattr ssbp-btn' : '';
1344
  $count_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-each-share' : ' ssba_sharecount';
1345
  $html_share_buttons = '';
@@ -1396,7 +1508,20 @@ class Buttons {
1396
  $buffer = '' !== $arr_settings['ssba_buffer_text'] ? $arr_settings['ssba_buffer_text'] : '';
1397
  $nofollow = 'Y' === $arr_settings['ssba_rel_nofollow'] ? ' rel="nofollow"' : '';
1398
  $network = 'Buffer';
1399
- $target = 'Y' === $arr_settings['ssba_share_new_window'] ? ' target="_blank" ' : '';
 
 
 
 
 
 
 
 
 
 
 
 
 
1400
  $plus_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-buffer ssbp-btn' : '';
1401
  $count_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-each-share' : ' ssba_sharecount';
1402
  $html_share_buttons = '';
@@ -1446,7 +1571,20 @@ class Buttons {
1446
  public function ssba_tumblr( $arr_settings, $url_current_page, $str_page_title, $boo_show_share_count ) {
1447
  $nofollow = 'Y' === $arr_settings['ssba_rel_nofollow'] ? ' rel="nofollow"' : '';
1448
  $network = 'Tumblr';
1449
- $target = 'Y' === $arr_settings['ssba_share_new_window'] ? ' target="_blank" ' : '';
 
 
 
 
 
 
 
 
 
 
 
 
 
1450
  $plus_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-tumblr ssbp-btn' : '';
1451
  $count_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-each-share' : ' ssba_sharecount';
1452
  $html_share_buttons = '';
@@ -1526,6 +1664,7 @@ class Buttons {
1526
  public function ssba_print( $arr_settings, $url_current_page, $str_page_title, $boo_show_share_count ) {
1527
  $plus_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-print ssbp-btn' : '';
1528
  $count_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-each-share' : ' ssba_sharecount';
 
1529
  $html_share_buttons = '';
1530
 
1531
  // Add li if plus.
@@ -1572,7 +1711,20 @@ class Buttons {
1572
  public function ssba_vk( $arr_settings, $url_current_page, $str_page_title, $boo_show_share_count ) {
1573
  $nofollow = 'Y' === $arr_settings['ssba_rel_nofollow'] ? ' rel="nofollow"' : '';
1574
  $network = 'VK';
1575
- $target = 'Y' === $arr_settings['ssba_share_new_window'] ? ' target="_blank" ' : '';
 
 
 
 
 
 
 
 
 
 
 
 
 
1576
  $plus_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-vk ssbp-btn' : '';
1577
  $html_share_buttons = '';
1578
 
@@ -1621,7 +1773,20 @@ class Buttons {
1621
  public function ssba_yummly( $arr_settings, $url_current_page, $str_page_title, $boo_show_share_count ) {
1622
  $nofollow = 'Y' === $arr_settings['ssba_rel_nofollow'] ? ' rel="nofollow"' : '';
1623
  $network = 'Yummly';
1624
- $target = 'Y' === $arr_settings['ssba_share_new_window'] ? ' target="_blank" ' : '';
 
 
 
 
 
 
 
 
 
 
 
 
 
1625
  $plus_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-yummly ssbp-btn' : '';
1626
  $count_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-each-share' : ' ssba_sharecount';
1627
  $html_share_buttons = '';
@@ -1706,7 +1871,20 @@ class Buttons {
1706
 
1707
  $nofollow = 'Y' === $arr_settings['ssba_rel_nofollow'] ? ' rel="nofollow"' : '';
1708
  $network = 'Whatsapp';
1709
- $target = 'Y' === $arr_settings['ssba_share_new_window'] ? ' target="_blank" ' : '';
 
 
 
 
 
 
 
 
 
 
 
 
 
1710
  $plus_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-whatsapp ssbp-btn' : '';
1711
  $html_share_buttons = '';
1712
 
@@ -1755,7 +1933,20 @@ class Buttons {
1755
  public function ssba_xing( $arr_settings, $url_current_page, $str_page_title, $boo_show_share_count ) {
1756
  $nofollow = 'Y' === $arr_settings['ssba_rel_nofollow'] ? ' rel="nofollow"' : '';
1757
  $network = 'Xing';
1758
- $target = 'Y' === $arr_settings['ssba_share_new_window'] ? ' target="_blank" ' : '';
 
 
 
 
 
 
 
 
 
 
 
 
 
1759
  $plus_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-xing ssbp-btn' : '';
1760
  $html_share_buttons = '';
1761
 
196
  $wrap_id = 'Y' !== $arr_settings['ssba_new_buttons'] ? 'ssba-classic-2' : 'ssba-modern-2';
197
 
198
  // Ssba div.
199
+ $html_share_buttons = '<!-- Simple Share Buttons Adder (' . esc_html( SSBA_VERSION ) . ') simplesharebuttons.com --><div id="' . esc_attr( $wrap_id ) . '" class="ssba ssbp-wrap' . esc_attr( ' ' . $arr_settings['ssba_plus_align'] ) . ' ssbp--theme-' . esc_attr( $arr_settings['ssba_plus_button_style'] ) . '">';
200
 
201
  // Center if set so.
202
  $html_share_buttons .= '<div style="text-align:' . esc_attr( $alignment ) . '">';
309
  wp_enqueue_style( "{$this->plugin->assets_prefix}-ssba" );
310
  }
311
 
312
+ $html_share_buttons = '<div id="ssba-bar-2" class="' . esc_attr( $arr_settings['ssba_bar_position'] ) . ' ssbp-wrap ssbp--theme-' . esc_attr( $arr_settings['ssba_bar_style'] ) . '" >';
313
  $html_share_buttons .= '<div class="ssbp-container">';
314
  $html_share_buttons .= '<ul class="ssbp-bar-list">';
315
 
479
  public function ssba_facebook( $arr_settings, $url_current_page, $str_page_title, $boo_show_share_count ) {
480
  $nofollow = 'Y' === $arr_settings['ssba_rel_nofollow'] ? ' rel="nofollow"' : '';
481
  $network = 'Facebook';
482
+ $target =
483
+ ( 'Y' === $arr_settings['ssba_plus_share_new_window']
484
+ && 'Y' === $arr_settings['ssba_new_buttons']
485
+ && ! isset( $arr_settings['bar_call']
486
+ ) )
487
+ ||
488
+ ( 'Y' === $arr_settings['ssba_share_new_window']
489
+ && 'Y' !== $arr_settings['ssba_new_buttons']
490
+ && ! isset( $arr_settings['bar_call']
491
+ ) )
492
+ ||
493
+ ( 'Y' === $arr_settings['ssba_bar_share_new_window'] && isset( $arr_settings['bar_call']
494
+ ) ) ? ' target="_blank" ' : '';
495
  $plus_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-facebook ssbp-btn' : '';
496
  $count_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-each-share' : ' ssba_sharecount';
497
  $html_share_buttons = '';
716
  public function ssba_twitter( $arr_settings, $url_current_page, $str_page_title, $boo_show_share_count ) {
717
  $nofollow = 'Y' === $arr_settings['ssba_rel_nofollow'] ? ' rel="nofollow"' : '';
718
  $network = 'Twitter';
719
+ $target =
720
+ ( 'Y' === $arr_settings['ssba_plus_share_new_window']
721
+ && 'Y' === $arr_settings['ssba_new_buttons']
722
+ && ! isset( $arr_settings['bar_call']
723
+ ) )
724
+ ||
725
+ ( 'Y' === $arr_settings['ssba_share_new_window']
726
+ && 'Y' !== $arr_settings['ssba_new_buttons']
727
+ && ! isset( $arr_settings['bar_call']
728
+ ) )
729
+ ||
730
+ ( 'Y' === $arr_settings['ssba_bar_share_new_window'] && isset( $arr_settings['bar_call']
731
+ ) ) ? ' target="_blank" ' : '';
732
  $plus_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-twitter ssbp-btn' : '';
733
  $count_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-each-share' : ' ssba_sharecount';
734
  $html_share_buttons = '';
815
  public function ssba_google( $arr_settings, $url_current_page, $str_page_title, $boo_show_share_count ) {
816
  $nofollow = 'Y' === $arr_settings['ssba_rel_nofollow'] ? ' rel="nofollow"' : '';
817
  $network = 'Google+';
818
+ $target =
819
+ ( 'Y' === $arr_settings['ssba_plus_share_new_window']
820
+ && 'Y' === $arr_settings['ssba_new_buttons']
821
+ && ! isset( $arr_settings['bar_call']
822
+ ) )
823
+ ||
824
+ ( 'Y' === $arr_settings['ssba_share_new_window']
825
+ && 'Y' !== $arr_settings['ssba_new_buttons']
826
+ && ! isset( $arr_settings['bar_call']
827
+ ) )
828
+ ||
829
+ ( 'Y' === $arr_settings['ssba_bar_share_new_window'] && isset( $arr_settings['bar_call']
830
+ ) ) ? ' target="_blank" ' : '';
831
  $plus_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-google ssbp-btn' : '';
832
  $count_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-each-share' : ' ssba_sharecount';
833
  $html_share_buttons = '';
930
  public function ssba_diggit( $arr_settings, $url_current_page, $str_page_title, $boo_show_share_count ) {
931
  $nofollow = 'Y' === $arr_settings['ssba_rel_nofollow'] ? ' rel="nofollow"' : '';
932
  $network = 'Digg';
933
+ $target =
934
+ ( 'Y' === $arr_settings['ssba_plus_share_new_window']
935
+ && 'Y' === $arr_settings['ssba_new_buttons']
936
+ && ! isset( $arr_settings['bar_call']
937
+ ) )
938
+ ||
939
+ ( 'Y' === $arr_settings['ssba_share_new_window']
940
+ && 'Y' !== $arr_settings['ssba_new_buttons']
941
+ && ! isset( $arr_settings['bar_call']
942
+ ) )
943
+ ||
944
+ ( 'Y' === $arr_settings['ssba_bar_share_new_window'] && isset( $arr_settings['bar_call']
945
+ ) ) ? ' target="_blank" ' : '';
946
  $plus_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-diggit ssbp-btn' : '';
947
  $count_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-each-share' : ' ssba_sharecount';
948
  $html_share_buttons = '';
992
  public function ssba_reddit( $arr_settings, $url_current_page, $str_page_title, $boo_show_share_count ) {
993
  $nofollow = 'Y' === $arr_settings['ssba_rel_nofollow'] ? ' rel="nofollow"' : '';
994
  $network = 'Reddit';
995
+ $target =
996
+ ( 'Y' === $arr_settings['ssba_plus_share_new_window']
997
+ && 'Y' === $arr_settings['ssba_new_buttons']
998
+ && ! isset( $arr_settings['bar_call']
999
+ ) )
1000
+ ||
1001
+ ( 'Y' === $arr_settings['ssba_share_new_window']
1002
+ && 'Y' !== $arr_settings['ssba_new_buttons']
1003
+ && ! isset( $arr_settings['bar_call']
1004
+ ) )
1005
+ ||
1006
+ ( 'Y' === $arr_settings['ssba_bar_share_new_window'] && isset( $arr_settings['bar_call']
1007
+ ) ) ? ' target="_blank" ' : '';
1008
  $plus_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-reddit ssbp-btn' : '';
1009
  $count_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-each-share' : ' ssba_sharecount';
1010
  $html_share_buttons = '';
1086
  public function ssba_linkedin( $arr_settings, $url_current_page, $str_page_title, $boo_show_share_count ) {
1087
  $nofollow = 'Y' === $arr_settings['ssba_rel_nofollow'] ? ' rel="nofollow"' : '';
1088
  $network = 'Linkedin';
1089
+ $target =
1090
+ ( 'Y' === $arr_settings['ssba_plus_share_new_window']
1091
+ && 'Y' === $arr_settings['ssba_new_buttons']
1092
+ && ! isset( $arr_settings['bar_call']
1093
+ ) )
1094
+ ||
1095
+ ( 'Y' === $arr_settings['ssba_share_new_window']
1096
+ && 'Y' !== $arr_settings['ssba_new_buttons']
1097
+ && ! isset( $arr_settings['bar_call']
1098
+ ) )
1099
+ ||
1100
+ ( 'Y' === $arr_settings['ssba_bar_share_new_window']
1101
+ && isset( $arr_settings['bar_call']
1102
+ ) ) ? ' target="_blank" ' : '';
1103
  $plus_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-linkedin ssbp-btn' : '';
1104
  $count_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-each-share' : ' ssba_sharecount';
1105
  $html_share_buttons = '';
1182
  public function ssba_pinterest( $arr_settings, $url_current_page, $str_page_title, $boo_show_share_count ) {
1183
  $nofollow = 'Y' === $arr_settings['ssba_rel_nofollow'] ? ' rel="nofollow"' : '';
1184
  $network = 'Pinterest';
1185
+ $target =
1186
+ ( 'Y' === $arr_settings['ssba_plus_share_new_window']
1187
+ && 'Y' === $arr_settings['ssba_new_buttons']
1188
+ && ! isset( $arr_settings['bar_call']
1189
+ ) )
1190
+ ||
1191
+ ( 'Y' === $arr_settings['ssba_share_new_window']
1192
+ && 'Y' !== $arr_settings['ssba_new_buttons']
1193
+ && ! isset( $arr_settings['bar_call']
1194
+ ) )
1195
+ ||
1196
+ ( 'Y' === $arr_settings['ssba_bar_share_new_window']
1197
+ && isset( $arr_settings['bar_call']
1198
+ ) ) ? ' target="_blank" ' : '';
1199
  $plus_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-pinterest ssbp-btn' : '';
1200
  $count_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-each-share' : ' ssba_sharecount';
1201
  $html_share_buttons = '';
1293
  public function ssba_stumbleupon( $arr_settings, $url_current_page, $str_page_title, $boo_show_share_count ) {
1294
  $nofollow = 'Y' === $arr_settings['ssba_rel_nofollow'] ? ' rel="nofollow"' : '';
1295
  $network = 'StumbleUpon';
1296
+ $target =
1297
+ ( 'Y' === $arr_settings['ssba_plus_share_new_window']
1298
+ && 'Y' === $arr_settings['ssba_new_buttons']
1299
+ && ! isset( $arr_settings['bar_call']
1300
+ ) )
1301
+ ||
1302
+ ( 'Y' === $arr_settings['ssba_share_new_window']
1303
+ && 'Y' !== $arr_settings['ssba_new_buttons']
1304
+ && ! isset( $arr_settings['bar_call']
1305
+ ) )
1306
+ ||
1307
+ ( 'Y' === $arr_settings['ssba_bar_share_new_window']
1308
+ && isset( $arr_settings['bar_call']
1309
+ ) ) ? ' target="_blank" ' : '';
1310
  $url = 'http://www.stumbleupon.com/submit?url=' . esc_attr( $url_current_page ) . '&amp;title=' . esc_attr( $str_page_title );
1311
  $plus_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-stumbleupon ssbp-btn' : '';
1312
  $count_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-each-share' : ' ssba_sharecount';
1438
  public function ssba_flattr( $arr_settings, $url_current_page, $str_page_title, $boo_show_share_count ) {
1439
  $nofollow = 'Y' === $arr_settings['ssba_rel_nofollow'] ? ' rel="nofollow"' : '';
1440
  $network = 'Flattr';
1441
+ $target =
1442
+ ( 'Y' === $arr_settings['ssba_plus_share_new_window']
1443
+ && 'Y' === $arr_settings['ssba_new_buttons']
1444
+ && ! isset( $arr_settings['bar_call']
1445
+ ) )
1446
+ ||
1447
+ ( 'Y' === $arr_settings['ssba_share_new_window']
1448
+ && 'Y' !== $arr_settings['ssba_new_buttons']
1449
+ && ! isset( $arr_settings['bar_call']
1450
+ ) )
1451
+ ||
1452
+ ( 'Y' === $arr_settings['ssba_bar_share_new_window']
1453
+ && isset( $arr_settings['bar_call']
1454
+ ) ) ? ' target="_blank" ' : '';
1455
  $plus_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-flattr ssbp-btn' : '';
1456
  $count_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-each-share' : ' ssba_sharecount';
1457
  $html_share_buttons = '';
1508
  $buffer = '' !== $arr_settings['ssba_buffer_text'] ? $arr_settings['ssba_buffer_text'] : '';
1509
  $nofollow = 'Y' === $arr_settings['ssba_rel_nofollow'] ? ' rel="nofollow"' : '';
1510
  $network = 'Buffer';
1511
+ $target =
1512
+ ( 'Y' === $arr_settings['ssba_plus_share_new_window']
1513
+ && 'Y' === $arr_settings['ssba_new_buttons']
1514
+ && ! isset( $arr_settings['bar_call']
1515
+ ) )
1516
+ ||
1517
+ ( 'Y' === $arr_settings['ssba_share_new_window']
1518
+ && 'Y' !== $arr_settings['ssba_new_buttons']
1519
+ && ! isset( $arr_settings['bar_call']
1520
+ ) )
1521
+ ||
1522
+ ( 'Y' === $arr_settings['ssba_bar_share_new_window']
1523
+ && isset( $arr_settings['bar_call']
1524
+ ) ) ? ' target="_blank" ' : '';
1525
  $plus_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-buffer ssbp-btn' : '';
1526
  $count_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-each-share' : ' ssba_sharecount';
1527
  $html_share_buttons = '';
1571
  public function ssba_tumblr( $arr_settings, $url_current_page, $str_page_title, $boo_show_share_count ) {
1572
  $nofollow = 'Y' === $arr_settings['ssba_rel_nofollow'] ? ' rel="nofollow"' : '';
1573
  $network = 'Tumblr';
1574
+ $target =
1575
+ ( 'Y' === $arr_settings['ssba_plus_share_new_window']
1576
+ && 'Y' === $arr_settings['ssba_new_buttons']
1577
+ && ! isset( $arr_settings['bar_call']
1578
+ ) )
1579
+ ||
1580
+ ( 'Y' === $arr_settings['ssba_share_new_window']
1581
+ && 'Y' !== $arr_settings['ssba_new_buttons']
1582
+ && ! isset( $arr_settings['bar_call']
1583
+ ) )
1584
+ ||
1585
+ ( 'Y' === $arr_settings['ssba_bar_share_new_window']
1586
+ && isset( $arr_settings['bar_call']
1587
+ ) ) ? ' target="_blank" ' : '';
1588
  $plus_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-tumblr ssbp-btn' : '';
1589
  $count_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-each-share' : ' ssba_sharecount';
1590
  $html_share_buttons = '';
1664
  public function ssba_print( $arr_settings, $url_current_page, $str_page_title, $boo_show_share_count ) {
1665
  $plus_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-print ssbp-btn' : '';
1666
  $count_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-each-share' : ' ssba_sharecount';
1667
+ $network = 'Print';
1668
  $html_share_buttons = '';
1669
 
1670
  // Add li if plus.
1711
  public function ssba_vk( $arr_settings, $url_current_page, $str_page_title, $boo_show_share_count ) {
1712
  $nofollow = 'Y' === $arr_settings['ssba_rel_nofollow'] ? ' rel="nofollow"' : '';
1713
  $network = 'VK';
1714
+ $target =
1715
+ ( 'Y' === $arr_settings['ssba_plus_share_new_window']
1716
+ && 'Y' === $arr_settings['ssba_new_buttons']
1717
+ && ! isset( $arr_settings['bar_call']
1718
+ ) )
1719
+ ||
1720
+ ( 'Y' === $arr_settings['ssba_share_new_window']
1721
+ && 'Y' !== $arr_settings['ssba_new_buttons']
1722
+ && ! isset( $arr_settings['bar_call']
1723
+ ) )
1724
+ ||
1725
+ ( 'Y' === $arr_settings['ssba_bar_share_new_window']
1726
+ && isset( $arr_settings['bar_call']
1727
+ ) ) ? ' target="_blank" ' : '';
1728
  $plus_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-vk ssbp-btn' : '';
1729
  $html_share_buttons = '';
1730
 
1773
  public function ssba_yummly( $arr_settings, $url_current_page, $str_page_title, $boo_show_share_count ) {
1774
  $nofollow = 'Y' === $arr_settings['ssba_rel_nofollow'] ? ' rel="nofollow"' : '';
1775
  $network = 'Yummly';
1776
+ $target =
1777
+ ( 'Y' === $arr_settings['ssba_plus_share_new_window']
1778
+ && 'Y' === $arr_settings['ssba_new_buttons']
1779
+ && ! isset( $arr_settings['bar_call']
1780
+ ) )
1781
+ ||
1782
+ ( 'Y' === $arr_settings['ssba_share_new_window']
1783
+ && 'Y' !== $arr_settings['ssba_new_buttons']
1784
+ && ! isset( $arr_settings['bar_call']
1785
+ ) )
1786
+ ||
1787
+ ( 'Y' === $arr_settings['ssba_bar_share_new_window']
1788
+ && isset( $arr_settings['bar_call']
1789
+ ) ) ? ' target="_blank" ' : '';
1790
  $plus_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-yummly ssbp-btn' : '';
1791
  $count_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-each-share' : ' ssba_sharecount';
1792
  $html_share_buttons = '';
1871
 
1872
  $nofollow = 'Y' === $arr_settings['ssba_rel_nofollow'] ? ' rel="nofollow"' : '';
1873
  $network = 'Whatsapp';
1874
+ $target =
1875
+ ( 'Y' === $arr_settings['ssba_plus_share_new_window']
1876
+ && 'Y' === $arr_settings['ssba_new_buttons']
1877
+ && ! isset( $arr_settings['bar_call']
1878
+ ) )
1879
+ ||
1880
+ ( 'Y' === $arr_settings['ssba_share_new_window']
1881
+ && 'Y' !== $arr_settings['ssba_new_buttons']
1882
+ && ! isset( $arr_settings['bar_call']
1883
+ ) )
1884
+ ||
1885
+ ( 'Y' === $arr_settings['ssba_bar_share_new_window']
1886
+ && isset( $arr_settings['bar_call']
1887
+ ) ) ? ' target="_blank" ' : '';
1888
  $plus_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-whatsapp ssbp-btn' : '';
1889
  $html_share_buttons = '';
1890
 
1933
  public function ssba_xing( $arr_settings, $url_current_page, $str_page_title, $boo_show_share_count ) {
1934
  $nofollow = 'Y' === $arr_settings['ssba_rel_nofollow'] ? ' rel="nofollow"' : '';
1935
  $network = 'Xing';
1936
+ $target =
1937
+ ( 'Y' === $arr_settings['ssba_plus_share_new_window']
1938
+ && 'Y' === $arr_settings['ssba_new_buttons']
1939
+ && ! isset( $arr_settings['bar_call']
1940
+ ) )
1941
+ ||
1942
+ ( 'Y' === $arr_settings['ssba_share_new_window']
1943
+ && 'Y' !== $arr_settings['ssba_new_buttons']
1944
+ && ! isset( $arr_settings['bar_call']
1945
+ ) )
1946
+ ||
1947
+ ( 'Y' === $arr_settings['ssba_bar_share_new_window']
1948
+ && isset( $arr_settings['bar_call']
1949
+ ) ) ? ' target="_blank" ' : '';
1950
  $plus_class = 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ? ' ssbp-xing ssbp-btn' : '';
1951
  $html_share_buttons = '';
1952
 
php/class-database.php CHANGED
@@ -46,14 +46,12 @@ class Database {
46
  }
47
 
48
  /**
49
- * Activate ssba function.
 
 
 
50
  */
51
- public function activate() {
52
- // Likely a reactivation, return doing nothing.
53
- if ( false !== get_option( 'ssba_version' ) ) {
54
- return;
55
- }
56
-
57
  // Array ready with defaults.
58
  $ssba_settings = array(
59
  'ssba_image_set' => 'somacro',
@@ -209,6 +207,34 @@ class Database {
209
  'accepted_sharethis_terms' => 'Y',
210
  );
211
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
212
  // Json encode.
213
  $json_settings = wp_json_encode( $ssba_settings );
214
 
@@ -244,7 +270,7 @@ class Database {
244
  'ssba_plus_align' => 'left',
245
  'ssba_bar_align' => 'left',
246
  'ssba_before_or_after_plus' => 'after',
247
- 'ssba_bar_new_window' => 'Y',
248
  'ssba_plus_share_text' => esc_html__( 'Share this...', 'simple-share-buttons-adder' ),
249
  'ssba_plus_text_placement' => 'above',
250
  'ssba_plus_font_family' => '',
@@ -507,7 +533,7 @@ class Database {
507
  delete_option( 'ssba_twitter_text' );
508
  delete_option( 'ssba_flattr_user_id' );
509
  delete_option( 'ssba_flattr_url' );
510
- delete_option( 'ssba_bar_new_window' );
511
  delete_option( 'ssba_link_to_ssb' );
512
  delete_option( 'ssba_show_share_count' );
513
  delete_option( 'ssba_bar_count_style' );
46
  }
47
 
48
  /**
49
+ * Add any settings default if it doesn't exist already.
50
+ *
51
+ * @param bool $return_array Whether to return the default setting array or not.
52
+ * @action admin_init
53
  */
54
+ public function get_setting_array( $return_array = false ) {
 
 
 
 
 
55
  // Array ready with defaults.
56
  $ssba_settings = array(
57
  'ssba_image_set' => 'somacro',
207
  'accepted_sharethis_terms' => 'Y',
208
  );
209
 
210
+ if ( $return_array ) {
211
+ return $ssba_settings;
212
+ }
213
+
214
+ // The current setting if any.
215
+ $current_settings = json_decode( get_option( 'ssba_settings', true ) );
216
+ $current_settings = is_array( $current_settings ) && null !== $current_settings && false !== $current_settings ? $current_settings : array();
217
+
218
+ foreach ( $ssba_settings as $setting_name => $value ) {
219
+ if ( ! isset( $current_settings[ $setting_name ] ) ) {
220
+ $current_settings[ $setting_name ] = $value;
221
+ }
222
+ }
223
+
224
+ update_option( 'ssba_settings', wp_json_encode( $current_settings ) );
225
+ }
226
+
227
+ /**
228
+ * Activate ssba function.
229
+ */
230
+ public function activate() {
231
+ // Likely a reactivation, return doing nothing.
232
+ if ( false !== get_option( 'ssba_version' ) ) {
233
+ return;
234
+ }
235
+
236
+ $ssba_settings = $this->get_setting_array( true );
237
+
238
  // Json encode.
239
  $json_settings = wp_json_encode( $ssba_settings );
240
 
270
  'ssba_plus_align' => 'left',
271
  'ssba_bar_align' => 'left',
272
  'ssba_before_or_after_plus' => 'after',
273
+ 'ssba_share_new_window' => 'Y',
274
  'ssba_plus_share_text' => esc_html__( 'Share this...', 'simple-share-buttons-adder' ),
275
  'ssba_plus_text_placement' => 'above',
276
  'ssba_plus_font_family' => '',
533
  delete_option( 'ssba_twitter_text' );
534
  delete_option( 'ssba_flattr_user_id' );
535
  delete_option( 'ssba_flattr_url' );
536
+ delete_option( 'ssba_share_new_window' );
537
  delete_option( 'ssba_link_to_ssb' );
538
  delete_option( 'ssba_show_share_count' );
539
  delete_option( 'ssba_bar_count_style' );
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: sharethis, scottstorebloom, surlyrightclick, DavidoffNeal
3
  Tags: share buttons, social buttons, facebook, twitter, google+, share, share links, stumble upon, linkedin, pinterest, yummly, vk
4
  Requires at least: 4.5
5
  Tested up to: 4.9.4
6
- Stable tag: 7.4.10
7
  License: GPLv2 or later
8
 
9
  A simple plugin that enables you to add share buttons to all of your posts and/or pages.
@@ -66,6 +66,9 @@ Please visit the <a href="https://wordpress.org/support/plugin/simple-share-butt
66
 
67
  == Changelog ==
68
 
 
 
 
69
  = 7.4.10 =
70
  * Feature: Add share bar buttons
71
  * Feature: Add “Modern Share Buttons”, which allows for more advanced customization ability using CSS-based settings.
3
  Tags: share buttons, social buttons, facebook, twitter, google+, share, share links, stumble upon, linkedin, pinterest, yummly, vk
4
  Requires at least: 4.5
5
  Tested up to: 4.9.4
6
+ Stable tag: 7.4.11
7
  License: GPLv2 or later
8
 
9
  A simple plugin that enables you to add share buttons to all of your posts and/or pages.
66
 
67
  == Changelog ==
68
 
69
+ = 7.4.11 =
70
+ * Fix: Missing variables and indexes.
71
+
72
  = 7.4.10 =
73
  * Feature: Add share bar buttons
74
  * Feature: Add “Modern Share Buttons”, which allows for more advanced customization ability using CSS-based settings.
simple-share-buttons-adder.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Simple Share Buttons Adder
4
  * Plugin URI: https://simplesharebuttons.com
5
  * Description: A simple plugin that enables you to add share buttons to all of your posts and/or pages.
6
- * Version: 7.4.10
7
  * Author: Simple Share Buttons
8
  * Author URI: https://simplesharebuttons.com
9
  * License: GPLv2
3
  * Plugin Name: Simple Share Buttons Adder
4
  * Plugin URI: https://simplesharebuttons.com
5
  * Description: A simple plugin that enables you to add share buttons to all of your posts and/or pages.
6
+ * Version: 7.4.11
7
  * Author: Simple Share Buttons
8
  * Author URI: https://simplesharebuttons.com
9
  * License: GPLv2