Simple Share Buttons Adder - Version 7.5.18

Version Description

  • Fix: Make sure all custom/advanced css fields work properly and separately.
  • Add: Style to avoid decoration to the buttons.
  • Fix: Major conflict with classic and modern buttons if no networks selected.
Download this release

Release Info

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

Code changes from version 7.4.18 to 7.5.18

css/ssba.css CHANGED
@@ -46,11 +46,11 @@
46
  max-width: 84px;
47
  }
48
 
49
- #ssba-plus-2 {
50
  width: 100%;
51
  }
52
 
53
- #ssba-classic-2 {
54
  width: 100%;
55
  }
56
 
46
  max-width: 84px;
47
  }
48
 
49
+ .ssba-plus-2 {
50
  width: 100%;
51
  }
52
 
53
+ .ssba-classic-2 {
54
  width: 100%;
55
  }
56
 
css/style.css CHANGED
@@ -13,6 +13,10 @@
13
  width: 100%;
14
  }
15
 
 
 
 
 
16
  .ssba-float-right-btn {
17
  float:right;
18
  margin: 20px 0 0 20px;
13
  width: 100%;
14
  }
15
 
16
+ .ssba a {
17
+ text-decoration: none!important;
18
+ }
19
+
20
  .ssba-float-right-btn {
21
  float:right;
22
  margin: 20px 0 0 20px;
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.18' );
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.5.18' );
13
 
14
  global $simple_share_buttons_adder_plugin;
15
 
php/class-admin-bits.php CHANGED
@@ -409,11 +409,6 @@ class Admin_Bits {
409
  'sharedcount_api_key' => $ssba_post['sharedcount_api_key'],
410
  'sharedcount_plan' => $ssba_post['sharedcount_plan'],
411
 
412
- // New share counts.
413
- 'twitter_newsharecounts' => $ssba_post['twitter_newsharecounts'],
414
- 'plus_twitter_newsharecounts' => $ssba_post['plus_twitter_newsharecounts'],
415
- 'bar_twitter_newsharecounts' => $ssba_post['bar_twitter_newsharecounts'],
416
-
417
  // Facebook.
418
  'facebook_insights' => $ssba_post['facebook_insights'],
419
  'facebook_app_id' => $ssba_post['facebook_app_id'],
409
  'sharedcount_api_key' => $ssba_post['sharedcount_api_key'],
410
  'sharedcount_plan' => $ssba_post['sharedcount_plan'],
411
 
 
 
 
 
 
412
  // Facebook.
413
  'facebook_insights' => $ssba_post['facebook_insights'],
414
  'facebook_app_id' => $ssba_post['facebook_app_id'],
php/class-admin-panel.php CHANGED
@@ -557,17 +557,6 @@ class Admin_Panel {
557
  ),
558
  );
559
 
560
- // Newsharecounts.com enable.
561
- $opts22 = array(
562
- 'form_group' => false,
563
- 'type' => 'checkbox',
564
- 'name' => 'twitter_newsharecounts',
565
- 'label' => '',
566
- 'tooltip' => 'Switch on to enable the use of the newsharecounts.com API for Twitter share counts',
567
- 'value' => 'Y',
568
- 'checked' => isset( $arr_settings['twitter_newsharecounts'] ) && 'Y' === $arr_settings['twitter_newsharecounts'] ? esc_attr( 'checked' ) : null,
569
- );
570
-
571
  // Sharedcount enable.
572
  $opts23 = array(
573
  'form_group' => false,
@@ -1575,21 +1564,21 @@ class Admin_Panel {
1575
  }
1576
 
1577
  foreach ( $arr_buttons as $non_buttons ) {
1578
- if ( ! in_array( $non_buttons, $selected_button_array, true ) ) {
1579
  $non_selected_buttons[] = $non_buttons;
1580
  }
1581
  }
1582
 
1583
  // Plus buttons.
1584
  foreach ( $arr_buttons as $non_plus_buttons ) {
1585
- if ( ! in_array( $non_plus_buttons, $selected_plus_button_array, true ) ) {
1586
  $non_plus_selected_buttons[] = $non_plus_buttons;
1587
  }
1588
  }
1589
 
1590
  // Bar Buttons.
1591
  foreach ( $arr_buttons as $non_bar_buttons ) {
1592
- if ( ! in_array( $non_bar_buttons, $selected_bar_button_array, true ) ) {
1593
  $non_bar_selected_buttons[] = $non_bar_buttons;
1594
  }
1595
  }
@@ -1620,7 +1609,7 @@ class Admin_Panel {
1620
  $arr_bar_buttons = array_merge( $selected_bar_button_array, $non_bar_selected_buttons );
1621
  }
1622
 
1623
- include_once( "{$this->plugin->dir_path}/templates/admin-panel.php" );
1624
  }
1625
 
1626
  /**
557
  ),
558
  );
559
 
 
 
 
 
 
 
 
 
 
 
 
560
  // Sharedcount enable.
561
  $opts23 = array(
562
  'form_group' => false,
1564
  }
1565
 
1566
  foreach ( $arr_buttons as $non_buttons ) {
1567
+ if ( is_array( $selected_button_array ) && ! in_array( $non_buttons, $selected_button_array, true ) ) {
1568
  $non_selected_buttons[] = $non_buttons;
1569
  }
1570
  }
1571
 
1572
  // Plus buttons.
1573
  foreach ( $arr_buttons as $non_plus_buttons ) {
1574
+ if ( is_array( $selected_plus_button_array ) && ! in_array( $non_plus_buttons, $selected_plus_button_array, true ) ) {
1575
  $non_plus_selected_buttons[] = $non_plus_buttons;
1576
  }
1577
  }
1578
 
1579
  // Bar Buttons.
1580
  foreach ( $arr_buttons as $non_bar_buttons ) {
1581
+ if ( is_array( $selected_bar_button_array ) && ! in_array( $non_bar_buttons, $selected_bar_button_array, true ) ) {
1582
  $non_bar_selected_buttons[] = $non_bar_buttons;
1583
  }
1584
  }
1609
  $arr_bar_buttons = array_merge( $selected_bar_button_array, $non_bar_selected_buttons );
1610
  }
1611
 
1612
+ include_once "{$this->plugin->dir_path}/templates/admin-panel.php";
1613
  }
1614
 
1615
  /**
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_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 ) . '">';
@@ -268,7 +268,7 @@ class Buttons {
268
  // Just return buttons.
269
  $html_content = $html_share_buttons;
270
  }
271
- } // End if().
272
 
273
  // Return content and share buttons.
274
  return $html_content;
@@ -425,7 +425,7 @@ class Buttons {
425
  $arr_selected_ssba = 'Y' === $arr_settings['ssba_new_buttons'] ? explode( ',', $arr_settings['ssba_selected_plus_buttons'] ) : explode( ',', $arr_settings['ssba_selected_buttons'] );
426
 
427
  // Check if array is not empty.
428
- if ( '' !== $arr_settings['ssba_selected_buttons'] ) {
429
 
430
  // Add post ID to settings array.
431
  $arr_settings['post_id'] = $int_post_id;
@@ -780,21 +780,6 @@ class Buttons {
780
  // Close href.
781
  $html_share_buttons .= '</a>';
782
 
783
- // If show share count is set to Y.
784
- if ( ( ( 'Y' === $arr_settings['ssba_show_share_count'] && 'Y' !== $arr_settings['ssba_new_buttons'] )
785
- ||
786
- ( 'Y' === $arr_settings['ssba_plus_show_share_count'] && 'Y' === $arr_settings['ssba_new_buttons'] )
787
- ||
788
- ( 'Y' === $arr_settings['ssba_bar_show_share_count'] && isset( $arr_settings['bar_call'] )
789
- )
790
- && $boo_show_share_count
791
- ) ) {
792
- // Newsharedcount needs to be enabled.
793
- if ( 'Y' === $arr_settings['twitter_newsharecounts'] ) {
794
- $html_share_buttons .= '<span class="' . esc_attr( $count_class ) . '">' . esc_html( $this->ssba_twitter_count( $url_current_page ) ) . '</span>';
795
- }
796
- }
797
-
798
  // Add closing li if plus.
799
  if ( 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ) {
800
  $html_share_buttons .= '</li>';
@@ -804,32 +789,6 @@ class Buttons {
804
  return $html_share_buttons;
805
  }
806
 
807
- /**
808
- * Get twitter share count.
809
- *
810
- * @param string $url_current_page The current page url.
811
- *
812
- * @return int|string
813
- */
814
- public function ssba_twitter_count( $url_current_page ) {
815
- // Get results from newsharecounts and return the number of shares.
816
- $result = wp_safe_remote_get( 'http://public.newsharecounts.com/count.json?url=' . $url_current_page, array(
817
- 'timeout' => 6,
818
- ) );
819
-
820
- // Check there was an error.
821
- if ( is_wp_error( $result ) ) {
822
- return 0;
823
- }
824
-
825
- // Decode data.
826
- $result = json_decode( $result['body'], true );
827
- $count = isset( $result['count'] ) ? $result['count'] : 0;
828
-
829
- // Return.
830
- return $this->ssba_format_number( $count );
831
- }
832
-
833
  /**
834
  * Get google+ button.
835
  *
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 class="' . 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 ) . '">';
268
  // Just return buttons.
269
  $html_content = $html_share_buttons;
270
  }
271
+ }
272
 
273
  // Return content and share buttons.
274
  return $html_content;
425
  $arr_selected_ssba = 'Y' === $arr_settings['ssba_new_buttons'] ? explode( ',', $arr_settings['ssba_selected_plus_buttons'] ) : explode( ',', $arr_settings['ssba_selected_buttons'] );
426
 
427
  // Check if array is not empty.
428
+ if ( is_array( $arr_selected_ssba ) && '' !== $arr_selected_ssba[0] ) {
429
 
430
  // Add post ID to settings array.
431
  $arr_settings['post_id'] = $int_post_id;
780
  // Close href.
781
  $html_share_buttons .= '</a>';
782
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
783
  // Add closing li if plus.
784
  if ( 'Y' === $arr_settings['ssba_new_buttons'] || isset( $arr_settings['bar_call'] ) ) {
785
  $html_share_buttons .= '</li>';
789
  return $html_share_buttons;
790
  }
791
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
792
  /**
793
  * Get google+ button.
794
  *
php/class-database.php CHANGED
@@ -200,11 +200,6 @@ class Database {
200
  'sharedcount_share_api_key' => '',
201
  'sharedcount_share_plan' => 'free',
202
 
203
- // Newsharecounts.
204
- 'twitter_newsharecounts' => '',
205
- 'plus_twitter_newsharecounts' => '',
206
- 'share_twitter_newsharecounts' => '',
207
-
208
  // New with sharethis.
209
  'facebook_insights' => '',
210
  'facebook_app_id' => '',
@@ -407,17 +402,6 @@ class Database {
407
  $this->class_ssba->ssba_update_options( $new );
408
  }
409
 
410
- // If version is less than 6.1.5.
411
- if ( $version < '6.1.5' ) {
412
- // New settings.
413
- $new = array(
414
- 'twitter_newsharecounts' => '',
415
- );
416
-
417
- // Update settings.
418
- $this->class_ssba->ssba_update_options( $new );
419
- }
420
-
421
  // If version is less than 6.2.0.
422
  if ( $version < '6.2.0' ) {
423
  // New settings.
200
  'sharedcount_share_api_key' => '',
201
  'sharedcount_share_plan' => 'free',
202
 
 
 
 
 
 
203
  // New with sharethis.
204
  'facebook_insights' => '',
205
  'facebook_app_id' => '',
402
  $this->class_ssba->ssba_update_options( $new );
403
  }
404
 
 
 
 
 
 
 
 
 
 
 
 
405
  // If version is less than 6.2.0.
406
  if ( $version < '6.2.0' ) {
407
  // New settings.
php/class-styles.php CHANGED
@@ -149,7 +149,7 @@ class Styles {
149
  } // End if().
150
 
151
  // Check if custom styles haven't been set.
152
- if ( 'Y' !== $arr_settings['ssba_custom_styles_enabled'] ) {
153
  $div_padding = '' !== $arr_settings['ssba_div_padding'] ? 'padding: ' . $arr_settings['ssba_div_padding'] . 'px;' : '';
154
  $border_width = '' !== $arr_settings['ssba_border_width'] ? 'border: ' . $arr_settings['ssba_border_width'] . 'px solid ' . $arr_settings['ssba_div_border'] . ';' : '';
155
  $div_background1 = '' !== $arr_settings['ssba_div_background'] ? 'background-color: ' . $arr_settings['ssba_div_background'] . ';' : '';
@@ -160,32 +160,6 @@ class Styles {
160
  $font_color = '' !== $arr_settings['ssba_font_color'] ? 'color: ' . $arr_settings['ssba_font_color'] . '!important;' : '';
161
  $font_weight = '' !== $arr_settings['ssba_font_weight'] ? 'font-weight: ' . $arr_settings['ssba_font_weight'] . ';' : '';
162
 
163
- // Plus styles.
164
- $plus_height = '' !== $arr_settings['ssba_plus_height'] ? 'height: ' . $arr_settings['ssba_plus_height'] . 'px!important;' : 'height: 48px!important;';
165
- $plus_width = '' !== $arr_settings['ssba_plus_width'] ? 'width: ' . $arr_settings['ssba_plus_width'] . 'px!important;' : 'width: 48px!important;';
166
- $plus_icon = '' !== $arr_settings['ssba_plus_icon_size'] ? 'line-' . $plus_height . '; font-size: ' . $arr_settings['ssba_plus_icon_size'] . 'px;' : 'line-' . $plus_height . '; font-size: 18px;';
167
- $plus_margin = '' !== $arr_settings['ssba_plus_margin'] ? 'margin-left: ' . $arr_settings['ssba_plus_margin'] . 'px!important;' : 'margin-left: 7px!important;';
168
- $plus_font_style = '' !== $arr_settings['ssba_plus_font_family'] ? 'font-family: ' . $arr_settings['ssba_plus_font_family'] . ';' : 'font-family: inherit;';
169
- $plus_font_size = '' !== $arr_settings['ssba_plus_font_size'] ? 'font-size: ' . $arr_settings['ssba_plus_font_size'] . 'px;' : 'font-size: 12px;';
170
- $plus_font_weight = '' !== $arr_settings['ssba_plus_font_weight'] ? 'font-weight: ' . $arr_settings['ssba_plus_font_weight'] . ';' : 'font-weight: normal;';
171
- $plus_font_color = '' !== $arr_settings['ssba_plus_font_color'] ? 'color: ' . $arr_settings['ssba_plus_font_color'] . '!important;' : '';
172
- $plus_icon_color = '' !== $arr_settings['ssba_plus_icon_color'] ? 'color: ' . $arr_settings['ssba_plus_icon_color'] . '!important;' : '';
173
- $plus_icon_hover = '' !== $arr_settings['ssba_plus_icon_hover_color'] ? 'color: ' . $arr_settings['ssba_plus_icon_hover_color'] . '!important;' : '';
174
- $plus_button_color = '' !== $arr_settings['ssba_plus_button_color'] ? 'background-color: ' . $arr_settings['ssba_plus_button_color'] . '!important;' : '';
175
- $plus_button_hover = '' !== $arr_settings['ssba_plus_button_hover_color'] ? 'background-color: ' . $arr_settings['ssba_plus_button_hover_color'] . '!important;' : '';
176
-
177
- // Share bar styles.
178
- $bar_height = '' !== $arr_settings['ssba_bar_height'] ? 'height: ' . $arr_settings['ssba_bar_height'] . 'px!important;' : 'height: 48px!important;';
179
- $bar_width = '' !== $arr_settings['ssba_bar_width'] ? 'width: ' . $arr_settings['ssba_bar_width'] . 'px!important;' : 'width: 48px!important;';
180
- $bar_icon = '' !== $arr_settings['ssba_bar_icon_size'] ? 'line-' . $bar_height . '; font-size: ' . $arr_settings['ssba_bar_icon_size'] . 'px;' : 'line-' . $bar_height . '; font-size: 18px;';
181
- $bar_margin = '' !== $arr_settings['ssba_bar_margin'] ? 'margin: ' . $arr_settings['ssba_bar_margin'] . 'px 0!important;' : '';
182
- $bar_button_color = '' !== $arr_settings['ssba_bar_button_color'] ? 'background-color: ' . $arr_settings['ssba_bar_button_color'] . '!important;' : '';
183
- $bar_button_hover = '' !== $arr_settings['ssba_bar_button_hover_color'] ? 'background-color: ' . $arr_settings['ssba_bar_button_hover_color'] . '!important;' : '';
184
- $bar_icon_color = '' !== $arr_settings['ssba_bar_icon_color'] ? 'color: ' . $arr_settings['ssba_bar_icon_color'] . '!important;' : '';
185
- $bar_icon_hover = '' !== $arr_settings['ssba_bar_icon_hover_color'] ? 'color: ' . $arr_settings['ssba_bar_icon_hover_color'] . '!important;' : '';
186
- $bar_break_point = 'Y' !== $arr_settings['ssba_bar_mobile'] ? 'display: none;' : 'display: block;';
187
- $the_breakpoint = '' === $arr_settings['ssba_mobile_breakpoint'] || null === $arr_settings['ssba_mobile_breakpoint'] ? '750' : $arr_settings['ssba_mobile_breakpoint'];
188
-
189
  // Use set options.
190
  $html_ssba_style = ' .ssba {
191
  ' . esc_html( $div_padding ) . '
@@ -204,7 +178,7 @@ class Styles {
204
  box-sizing: unset;
205
  }
206
 
207
- #ssba-classic-2 .ssbp-text {
208
  display: none!important;
209
  }
210
 
@@ -213,7 +187,6 @@ class Styles {
213
  padding: ' . esc_html( $arr_settings['ssba_padding'] ) . 'px;
214
  ';
215
 
216
- if ( 'Y' !== $arr_settings['ssba_new_buttons'] ) {
217
  $html_ssba_style .= 'line-height: ' . esc_html( (int) $arr_settings['ssba_size'] - 5 ) . 'px; }
218
  .ssba, .ssba a
219
  {
@@ -226,69 +199,6 @@ class Styles {
226
  }
227
  ';
228
 
229
- } else {
230
- $html_ssba_style .=
231
- '}
232
- .ssbp-list li a {' .
233
- esc_html( $plus_height ) . ' ' .
234
- esc_html( $plus_width ) . ' ' .
235
- esc_html( $plus_button_color ) . '
236
- }
237
- .ssbp-list li a:hover {' .
238
- esc_html( $plus_button_hover ) . '
239
- }
240
-
241
- .ssbp-list li a::before {' .
242
- esc_html( $plus_icon ) .
243
- esc_html( $plus_icon_color ) .
244
- '}
245
- .ssbp-list li a:hover::before {' .
246
- esc_html( $plus_icon_hover ) .
247
- '}
248
- .ssbp-list li {
249
- ' . esc_html( $plus_margin ) . '
250
- }
251
-
252
- .ssba-share-text {
253
- ' . esc_html( $plus_font_size ) . ' '
254
- . esc_html( $plus_font_color ) . ' '
255
- . esc_html( $plus_font_weight ) . ' '
256
- . esc_html( $plus_font_style ) . '
257
- }';
258
- } // End if().
259
-
260
- if ( 'Y' === $arr_settings['ssba_bar_enabled'] ) {
261
- $html_ssba_style .= '
262
- #ssba-bar-2 .ssbp-bar-list {
263
- max-' . esc_html( $bar_width ) . ';
264
- }
265
- #ssba-bar-2 .ssbp-bar-list li a {' .
266
- esc_html( $bar_height ) . ' ' .
267
- esc_html( $bar_width ) . ' ' .
268
- esc_html( $bar_button_color ) . '
269
- }
270
- #ssba-bar-2 .ssbp-bar-list li a:hover {' .
271
- esc_html( $bar_button_hover ) . '
272
- }
273
-
274
- #ssba-bar-2 .ssbp-bar-list li a::before {' .
275
- esc_html( $bar_icon ) .
276
- esc_html( $bar_icon_color ) .
277
- '}
278
- #ssba-bar-2 .ssbp-bar-list li a:hover::before {' .
279
- esc_html( $bar_icon_hover ) .
280
- '}
281
- #ssba-bar-2 .ssbp-bar-list li {
282
- ' . esc_html( $bar_margin ) . '
283
- }';
284
-
285
- $html_ssba_style .= '@media only screen and ( max-width: ' . $the_breakpoint . 'px ) {
286
- #ssba-bar-2 {
287
- ' . $bar_break_point . '
288
- }
289
- }';
290
- }
291
-
292
  // If counters option is set to Y.
293
  if ( 'Y' === $arr_settings['ssba_show_share_count'] ) {
294
  // Styles that apply to all counter css sets.
@@ -355,7 +265,7 @@ class Styles {
355
  border-right-color: #42a7e2;
356
  }';
357
  }
358
- } // End if().
359
 
360
  // If there's any additional css.
361
  if ( '' !== $arr_settings['ssba_additional_css'] ) {
@@ -364,11 +274,136 @@ class Styles {
364
  }
365
 
366
  wp_add_inline_style( "{$this->plugin->assets_prefix}-ssba", $html_ssba_style ); // WPCS: XSS ok.
367
- } else { // Else use set options.
368
  // Use custom styles.
369
  $html_ssba_style = $arr_settings['ssba_custom_styles'];
370
 
371
  wp_add_inline_style( "{$this->plugin->assets_prefix}-ssba", $html_ssba_style ); // WPCS: XSS ok.
372
- } // End if().
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
373
  }
374
  }
149
  } // End if().
150
 
151
  // Check if custom styles haven't been set.
152
+ if ( 'Y' !== $arr_settings['ssba_custom_styles_enabled'] && 'Y' !== $arr_settings['ssba_new_buttons'] ) {
153
  $div_padding = '' !== $arr_settings['ssba_div_padding'] ? 'padding: ' . $arr_settings['ssba_div_padding'] . 'px;' : '';
154
  $border_width = '' !== $arr_settings['ssba_border_width'] ? 'border: ' . $arr_settings['ssba_border_width'] . 'px solid ' . $arr_settings['ssba_div_border'] . ';' : '';
155
  $div_background1 = '' !== $arr_settings['ssba_div_background'] ? 'background-color: ' . $arr_settings['ssba_div_background'] . ';' : '';
160
  $font_color = '' !== $arr_settings['ssba_font_color'] ? 'color: ' . $arr_settings['ssba_font_color'] . '!important;' : '';
161
  $font_weight = '' !== $arr_settings['ssba_font_weight'] ? 'font-weight: ' . $arr_settings['ssba_font_weight'] . ';' : '';
162
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
163
  // Use set options.
164
  $html_ssba_style = ' .ssba {
165
  ' . esc_html( $div_padding ) . '
178
  box-sizing: unset;
179
  }
180
 
181
+ .ssba-classic-2 .ssbp-text {
182
  display: none!important;
183
  }
184
 
187
  padding: ' . esc_html( $arr_settings['ssba_padding'] ) . 'px;
188
  ';
189
 
 
190
  $html_ssba_style .= 'line-height: ' . esc_html( (int) $arr_settings['ssba_size'] - 5 ) . 'px; }
191
  .ssba, .ssba a
192
  {
199
  }
200
  ';
201
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
202
  // If counters option is set to Y.
203
  if ( 'Y' === $arr_settings['ssba_show_share_count'] ) {
204
  // Styles that apply to all counter css sets.
265
  border-right-color: #42a7e2;
266
  }';
267
  }
268
+ }
269
 
270
  // If there's any additional css.
271
  if ( '' !== $arr_settings['ssba_additional_css'] ) {
274
  }
275
 
276
  wp_add_inline_style( "{$this->plugin->assets_prefix}-ssba", $html_ssba_style ); // WPCS: XSS ok.
277
+ } elseif ( 'Y' !== $arr_settings['ssba_new_buttons'] ) { // Else use set options.
278
  // Use custom styles.
279
  $html_ssba_style = $arr_settings['ssba_custom_styles'];
280
 
281
  wp_add_inline_style( "{$this->plugin->assets_prefix}-ssba", $html_ssba_style ); // WPCS: XSS ok.
282
+ }
283
+
284
+ if ( 'Y' === $arr_settings['ssba_new_buttons'] && 'Y' !== $arr_settings['ssba_plus_custom_styles_enabled'] ) {
285
+ // Plus styles.
286
+ $plus_height = '' !== $arr_settings['ssba_plus_height'] ? 'height: ' . $arr_settings['ssba_plus_height'] . 'px!important;' : 'height: 48px!important;';
287
+ $plus_width = '' !== $arr_settings['ssba_plus_width'] ? 'width: ' . $arr_settings['ssba_plus_width'] . 'px!important;' : 'width: 48px!important;';
288
+ $plus_icon = '' !== $arr_settings['ssba_plus_icon_size'] ? 'line-' . $plus_height . '; font-size: ' . $arr_settings['ssba_plus_icon_size'] . 'px;' : 'line-' . $plus_height . '; font-size: 18px;';
289
+ $plus_margin = '' !== $arr_settings['ssba_plus_margin'] ? 'margin-left: ' . $arr_settings['ssba_plus_margin'] . 'px!important;' : 'margin-left: 7px!important;';
290
+ $plus_font_style = '' !== $arr_settings['ssba_plus_font_family'] ? 'font-family: ' . $arr_settings['ssba_plus_font_family'] . ';' : 'font-family: inherit;';
291
+ $plus_font_size = '' !== $arr_settings['ssba_plus_font_size'] ? 'font-size: ' . $arr_settings['ssba_plus_font_size'] . 'px;' : 'font-size: 12px;';
292
+ $plus_font_weight = '' !== $arr_settings['ssba_plus_font_weight'] ? 'font-weight: ' . $arr_settings['ssba_plus_font_weight'] . ';' : 'font-weight: normal;';
293
+ $plus_font_color = '' !== $arr_settings['ssba_plus_font_color'] ? 'color: ' . $arr_settings['ssba_plus_font_color'] . '!important;' : '';
294
+ $plus_icon_color = '' !== $arr_settings['ssba_plus_icon_color'] ? 'color: ' . $arr_settings['ssba_plus_icon_color'] . '!important;' : '';
295
+ $plus_icon_hover = '' !== $arr_settings['ssba_plus_icon_hover_color'] ? 'color: ' . $arr_settings['ssba_plus_icon_hover_color'] . '!important;' : '';
296
+ $plus_button_color = '' !== $arr_settings['ssba_plus_button_color'] ? 'background-color: ' . $arr_settings['ssba_plus_button_color'] . '!important;' : '';
297
+ $plus_button_hover = '' !== $arr_settings['ssba_plus_button_hover_color'] ? 'background-color: ' . $arr_settings['ssba_plus_button_hover_color'] . '!important;' : '';
298
+
299
+ $html_ssba_style =
300
+ '.ssba img
301
+ {border: 0;
302
+ box-shadow: none !important;
303
+ display: inline !important;
304
+ vertical-align: middle;
305
+ box-sizing: unset;
306
+ }
307
+
308
+ .ssba-classic-2 .ssbp-text {
309
+ display: none!important;
310
+ }
311
+ .ssbp-list li a {' .
312
+ esc_html( $plus_height ) . ' ' .
313
+ esc_html( $plus_width ) . ' ' .
314
+ esc_html( $plus_button_color ) . '
315
+ }
316
+ .ssbp-list li a:hover {' .
317
+ esc_html( $plus_button_hover ) . '
318
+ }
319
+
320
+ .ssbp-list li a::before {' .
321
+ esc_html( $plus_icon ) .
322
+ esc_html( $plus_icon_color ) .
323
+ '}
324
+ .ssbp-list li a:hover::before {' .
325
+ esc_html( $plus_icon_hover ) .
326
+ '}
327
+ .ssbp-list li {
328
+ ' . esc_html( $plus_margin ) . '
329
+ }
330
+
331
+ .ssba-share-text {
332
+ ' . esc_html( $plus_font_size ) . ' '
333
+ . esc_html( $plus_font_color ) . ' '
334
+ . esc_html( $plus_font_weight ) . ' '
335
+ . esc_html( $plus_font_style ) . '
336
+ }';
337
+
338
+ if ( '' !== $arr_settings['ssba_plus_additional_css'] && 'Y' === $arr_settings['ssba_new_buttons'] ) {
339
+ $html_ssba_style .= $arr_settings['ssba_plus_additional_css'];
340
+ }
341
+
342
+ wp_add_inline_style( "{$this->plugin->assets_prefix}-ssba", $html_ssba_style ); // WPCS: XSS ok.
343
+ } elseif ( 'Y' === $arr_settings['ssba_new_buttons'] ) {
344
+ // Use custom styles.
345
+ $html_ssba_style = $arr_settings['ssba_plus_custom_styles'];
346
+
347
+ wp_add_inline_style( "{$this->plugin->assets_prefix}-ssba", $html_ssba_style ); // WPCS: XSS ok.
348
+ }
349
+
350
+ // If sharebar custom css is enabled use it.
351
+ // Check if custom styles haven't been set.
352
+ if ( 'Y' !== $arr_settings['ssba_bar_custom_styles_enabled'] && 'Y' === $arr_settings['ssba_bar_enabled'] ) {
353
+ // Share bar styles.
354
+ $bar_height = '' !== $arr_settings['ssba_bar_height'] ? 'height: ' . $arr_settings['ssba_bar_height'] . 'px!important;' : 'height: 48px!important;';
355
+ $bar_width = '' !== $arr_settings['ssba_bar_width'] ? 'width: ' . $arr_settings['ssba_bar_width'] . 'px!important;' : 'width: 48px!important;';
356
+ $bar_icon = '' !== $arr_settings['ssba_bar_icon_size'] ? 'line-' . $bar_height . '; font-size: ' . $arr_settings['ssba_bar_icon_size'] . 'px;' : 'line-' . $bar_height . '; font-size: 18px;';
357
+ $bar_margin = '' !== $arr_settings['ssba_bar_margin'] ? 'margin: ' . $arr_settings['ssba_bar_margin'] . 'px 0!important;' : '';
358
+ $bar_button_color = '' !== $arr_settings['ssba_bar_button_color'] ? 'background-color: ' . $arr_settings['ssba_bar_button_color'] . '!important;' : '';
359
+ $bar_button_hover = '' !== $arr_settings['ssba_bar_button_hover_color'] ? 'background-color: ' . $arr_settings['ssba_bar_button_hover_color'] . '!important;' : '';
360
+ $bar_icon_color = '' !== $arr_settings['ssba_bar_icon_color'] ? 'color: ' . $arr_settings['ssba_bar_icon_color'] . '!important;' : '';
361
+ $bar_icon_hover = '' !== $arr_settings['ssba_bar_icon_hover_color'] ? 'color: ' . $arr_settings['ssba_bar_icon_hover_color'] . '!important;' : '';
362
+ $bar_break_point = 'Y' !== $arr_settings['ssba_bar_mobile'] ? 'display: none;' : 'display: block;';
363
+ $the_breakpoint = '' === $arr_settings['ssba_mobile_breakpoint'] || null === $arr_settings['ssba_mobile_breakpoint'] ? '750' : $arr_settings['ssba_mobile_breakpoint'];
364
+
365
+ $html_bar_ssba_style = '
366
+ #ssba-bar-2 .ssbp-bar-list {
367
+ max-' . esc_html( $bar_width ) . ';
368
+ }
369
+ #ssba-bar-2 .ssbp-bar-list li a {' .
370
+ esc_html( $bar_height ) . ' ' .
371
+ esc_html( $bar_width ) . ' ' .
372
+ esc_html( $bar_button_color ) . '
373
+ }
374
+ #ssba-bar-2 .ssbp-bar-list li a:hover {' .
375
+ esc_html( $bar_button_hover ) . '
376
+ }
377
+
378
+ #ssba-bar-2 .ssbp-bar-list li a::before {' .
379
+ esc_html( $bar_icon ) .
380
+ esc_html( $bar_icon_color ) .
381
+ '}
382
+ #ssba-bar-2 .ssbp-bar-list li a:hover::before {' .
383
+ esc_html( $bar_icon_hover ) .
384
+ '}
385
+ #ssba-bar-2 .ssbp-bar-list li {
386
+ ' . esc_html( $bar_margin ) . '
387
+ }';
388
+
389
+ $html_bar_ssba_style .= '@media only screen and ( max-width: ' . $the_breakpoint . 'px ) {
390
+ #ssba-bar-2 {
391
+ ' . $bar_break_point . '
392
+ }
393
+ }';
394
+
395
+ // If there's any additional css.
396
+ if ( '' !== $arr_settings['ssba_bar_additional_css'] ) {
397
+ // Add the additional CSS.
398
+ $html_bar_ssba_style .= $arr_settings['ssba_bar_additional_css'];
399
+ }
400
+
401
+ wp_add_inline_style( "{$this->plugin->assets_prefix}-ssba", $html_bar_ssba_style ); // WPCS: XSS ok.
402
+ } elseif ( 'Y' === $arr_settings['ssba_bar_enabled'] ) {
403
+ // Use custom styles.
404
+ $html_ssba_bar_style = $arr_settings['ssba_bar_custom_styles'];
405
+
406
+ wp_add_inline_style( "{$this->plugin->assets_prefix}-ssba", $html_ssba_bar_style ); // WPCS: XSS ok.
407
+ }
408
  }
409
  }
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  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.5
6
- Stable tag: 7.4.18
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,11 @@ Please visit the <a href="https://wordpress.org/support/plugin/simple-share-butt
66
 
67
  == Changelog ==
68
 
 
 
 
 
 
69
  = 7.4.18 =
70
  * Fix: Mobile disable option for Share Bar.
71
  * Add: Ignore plugin Facebook SDK option.
2
  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: 5.0.2
6
+ Stable tag: 7.5.18
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.5.18 =
70
+ * Fix: Make sure all custom/advanced css fields work properly and separately.
71
+ * Add: Style to avoid decoration to the buttons.
72
+ * Fix: Major conflict with classic and modern buttons if no networks selected.
73
+
74
  = 7.4.18 =
75
  * Fix: Mobile disable option for Share Bar.
76
  * Add: Ignore plugin Facebook SDK option.
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.18
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.5.18
7
  * Author: Simple Share Buttons
8
  * Author URI: https://simplesharebuttons.com
9
  * License: GPLv2