Simple Social Media Share Buttons – Social Sharing for Everyone - Version 2.0.15

Version Description

  • Please upgrade immediately. Releasing New features, few bugfixes and improvements.

=

Download this release

Release Info

Developer hiddenpearls
Plugin Icon 128x128 Simple Social Media Share Buttons – Social Sharing for Everyone
Version 2.0.15
Comparing to
See all releases

Code changes from version 2.0.14 to 2.0.15

Files changed (3) hide show
  1. assets/css/front.css +1 -1
  2. readme.txt +7 -2
  3. simple-social-buttons.php +298 -303
assets/css/front.css CHANGED
@@ -1899,7 +1899,7 @@ div[class*="simplesocialbuttons-float"].simplesocialbuttons.simplesocial-simple-
1899
  .simplesocialbuttons.simplesocial-flat-button-border button.simplesocial-gplus-share .ssb_counter{
1900
  color: #db4437;
1901
  }
1902
- .simplesocialbuttons.simplesocial-flat-button-border button:not(.simplesocial-whatsapp-share):not(.simplesocial-viber-share):not(.simplesocial-msng-share):not(.simplesocial-email-share):not(.simplesocial-print-share){
1903
  padding-right: 50px;
1904
  position: relative;
1905
  }
1899
  .simplesocialbuttons.simplesocial-flat-button-border button.simplesocial-gplus-share .ssb_counter{
1900
  color: #db4437;
1901
  }
1902
+ .simplesocialbuttons.simplesocial-flat-button-border.ssb_counter-activate button:not(.simplesocial-whatsapp-share):not(.simplesocial-viber-share):not(.simplesocial-msng-share):not(.simplesocial-email-share):not(.simplesocial-print-share){
1903
  padding-right: 50px;
1904
  position: relative;
1905
  }
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://wpbrigade.com/
4
  Tags: Social share, Social buttons, Whatsapp, Viber, LinkedIn, facebook, google, twitter, pinterest, plus one
5
  Requires at least: 4.0
6
  Tested up to: 4.9
7
- Stable tag: 2.0.14
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -146,12 +146,17 @@ theme = theme1 or theme2 or theme3 or theme4 or Flat or Circle or Official
146
 
147
  == Upgrade Notice ==
148
 
149
- = 2.0.14 =
150
  * Please upgrade immediately. Releasing New features, few bugfixes and improvements.
151
 
152
 
153
  == Changelog ==
154
 
 
 
 
 
 
155
  = 2.0.14 - 2018-03-20 =
156
  * Bug Fix: Headers already sent on upgrade routine.
157
 
4
  Tags: Social share, Social buttons, Whatsapp, Viber, LinkedIn, facebook, google, twitter, pinterest, plus one
5
  Requires at least: 4.0
6
  Tested up to: 4.9
7
+ Stable tag: 2.0.15
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
10
 
146
 
147
  == Upgrade Notice ==
148
 
149
+ = 2.0.15 =
150
  * Please upgrade immediately. Releasing New features, few bugfixes and improvements.
151
 
152
 
153
  == Changelog ==
154
 
155
+ = 2.0.15 - 2018-06-05 =
156
+ * New Feature: Button show on excerpt content.
157
+ * Bug Fix: Undefined $_SERVER['HTTP_USER_AGENT'] in function.
158
+ * Bug Fix: Special character issue in twitter.
159
+
160
  = 2.0.14 - 2018-03-20 =
161
  * Bug Fix: Headers already sent on upgrade routine.
162
 
simple-social-buttons.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Simple Social Buttons
4
  * Plugin URI: http://www.WPBrigade.com/wordpress/plugins/simple-social-buttons/
5
  * Description: Simple Social Buttons adds an advanced set of social media sharing buttons to your WordPress sites, such as: Google +1, Facebook, WhatsApp, Viber, Twitter, Reddit, LinkedIn and Pinterest. This makes it the most <code>Flexible Social Sharing Plugin ever for Everyone.</code>
6
- * Version: 2.0.14
7
  * Author: WPBrigade
8
  * Author URI: http://www.WPBrigade.com/
9
  * Text Domain: simple-social-buttons
@@ -30,7 +30,7 @@
30
 
31
  class SimpleSocialButtonsPR {
32
  public $pluginName = 'Simple Social Buttons';
33
- public $pluginVersion = '2.0.14';
34
  public $pluginPrefix = 'ssb_pr_';
35
  public $hideCustomMetaKey = '_ssb_hide';
36
  private $fb_app_id = '891268654262273';
@@ -90,6 +90,7 @@ class SimpleSocialButtonsPR {
90
  * Filter hooks
91
  */
92
  add_filter( 'the_content', array( $this, 'insert_buttons' ) );
 
93
  add_filter( 'the_excerpt', array( $this, 'insert_excerpt_buttons' ) );
94
 
95
  add_filter( 'plugin_row_meta', array( $this, '_row_meta' ), 10, 2 );
@@ -119,7 +120,7 @@ class SimpleSocialButtonsPR {
119
  function set_selected_networks() {
120
  $networks = get_option( 'ssb_networks' );
121
  $this->selected_networks = array_flip( array_merge( array( 0 ), explode( ',', $networks['icon_selection'] ) ) );
122
- }
123
 
124
  function set_selected_theme() {
125
  $theme = get_option( 'ssb_themes' );
@@ -156,14 +157,13 @@ class SimpleSocialButtonsPR {
156
  }
157
  }
158
 
159
-
160
  $_share_links = array();
161
  foreach ( $order as $social_name => $priority ) {
162
  if ( 'totalshare' == $social_name || 'viber' == $social_name || 'fblike' == $social_name || 'whatsapp' == $social_name || 'print' == $social_name || 'email' == $social_name || 'messenger' == $social_name ) {
163
  continue; }
164
  $_share_links[ $social_name ] = call_user_func( 'ssb_' . $social_name . '_generate_link', get_permalink( $post_id ) );
165
- $url = $this->http_or_https_resolve_url( get_permalink( $post_id ) );
166
- }
167
  // http url convert to https or vice versa
168
  $_alt_share_links = $this->http_or_https_link_generate( get_permalink( $post_id ) );
169
 
@@ -184,7 +184,7 @@ class SimpleSocialButtonsPR {
184
  update_post_meta( $post_id, 'ssb_cache_timestamp', floor( ( ( date( 'U' ) / 60 ) / 60 ) ) );
185
  echo json_encode( $share_counts );
186
  wp_die();
187
- }
188
 
189
  function ssb_output_cache_trigger( $info ) {
190
 
@@ -194,7 +194,7 @@ class SimpleSocialButtonsPR {
194
  return $info;
195
  }
196
  // if is home or front page return info
197
- if( is_home() || is_front_page() ){
198
  return $info;
199
  }
200
  // Return if we're on a WooCommerce account page.
@@ -209,7 +209,7 @@ class SimpleSocialButtonsPR {
209
  ob_start();
210
 
211
  ?>
212
- jQuery( document ).ready(function(){
213
  var ssb_admin_ajax = '<?php echo admin_url( 'admin-ajax.php' ); ?>';
214
  var is_ssb_used = jQuery('.simplesocialbuttons');
215
  var postID = <?php echo $info['postID']; ?> ;
@@ -234,7 +234,7 @@ class SimpleSocialButtonsPR {
234
 
235
  });
236
  }
237
- });
238
  <?php
239
  $info['footer_output'] .= ob_get_clean();
240
 
@@ -403,7 +403,7 @@ class SimpleSocialButtonsPR {
403
  */
404
  function insert_excerpt_buttons( $content ) {
405
 
406
- if ( is_single() || has_excerpt() ) {
407
  return $content;
408
  }
409
 
@@ -448,13 +448,13 @@ class SimpleSocialButtonsPR {
448
  return $content;
449
  }
450
 
451
- if ( is_archive() && $this->_get_settings( 'inline', 'show_on_archive', '0' ) == '0' && !is_tag() && !is_category() ) {
452
  return $content; }
453
  if ( is_category() && $this->_get_settings( 'inline', 'show_on_category', '0' ) == '0' ) {
454
  return $content; }
455
  if ( is_tag() && $this->_get_settings( 'inline', 'show_on_tag', '0' ) == '0' ) {
456
  return $content; }
457
- if ( is_search() && $this->_get_settings( 'inline', 'show_on_search', '0' ) == '0' ) {
458
  return $content; }
459
 
460
  // && 'false' == get_post_meta( get_the_ID(), $this->hideCustomMetaKey , true )
@@ -485,8 +485,8 @@ class SimpleSocialButtonsPR {
485
 
486
  $sharing_text = '';
487
 
488
- if ( isset( $this->inline_option['share_title'] ) && trim( $this->inline_option['share_title'] ) != '' ) {
489
- $sharing_text = '<span class="ssb_inline-share_heading '. $this->_get_settings( 'inline', 'icon_alignment', 'left' ) .'">'. $this->inline_option['share_title'] .'</span>' ;
490
  }
491
  if ( in_array( $this->get_post_type(), $this->_get_settings( 'inline', 'posts', array() ) ) ) {
492
  if ( $this->inline_option['location'] == 'above' || $this->inline_option['location'] == 'above_below' ) {
@@ -513,9 +513,10 @@ class SimpleSocialButtonsPR {
513
  $ssb_buttonscode = '';
514
  // get post permalink and title
515
  $permalink = get_permalink();
516
- $title = urlencode( get_the_title() );
 
517
 
518
- // Sorting the buttons
519
  $arrButtons = array();
520
  foreach ( $this->arrKnownButtons as $button_name ) {
521
  if ( ! empty( $order[ $button_name ] ) && (int) $order[ $button_name ] != 0 ) {
@@ -525,34 +526,34 @@ class SimpleSocialButtonsPR {
525
  // echo '<pre>'; print_r( $arrButtons ); echo '</pre>';
526
  @asort( $arrButtons );
527
 
528
- // add total share index in array.
529
  if ( $show_total ) {
530
- $arrButtons['totalshare'] = '100'; }
531
  $post_id = get_the_id();
532
 
533
  // get the value for http or https solve options
534
  $http_solve = false;
535
- if( isset( $this->extra_option['http_https_resolve'] ) ) {
536
- if ( false == get_post_meta( $post_id, 'ssb_old_counts', true ) ){
537
  $http_solve = true;
538
  }
539
  }
540
 
541
  // Reset the cache timestamp if needed
542
  // if false fetch the new share counts.
543
- if ( ( isset( $this->settings['cache'] ) && $this->settings['cache'] == 'off') || ( true == $http_solve ) ) {
544
 
545
  $_share_links = array();
546
  foreach ( $arrButtons as $social_name => $priority ) {
547
- if ( 'totalshare' == $social_name || 'viber' == $social_name || 'fblike' == $social_name || 'whatsapp' == $social_name || 'print' == $social_name || 'email' == $social_name || 'messenger' == $social_name) {
548
  continue; }
549
  $_share_links[ $social_name ] = call_user_func( 'ssb_' . $social_name . '_generate_link', $permalink );
550
- }
551
  // http url convert to https or vice versa
552
  $_alt_share_links = $this->http_or_https_link_generate( $permalink );
553
 
554
- //normal fetch
555
- $result = ssb_fetch_shares_via_curl_multi( array_filter( $_share_links ) );
556
 
557
  // $result = ssb_fetch_shares_via_curl_multi(
558
  // array(
@@ -564,14 +565,12 @@ class SimpleSocialButtonsPR {
564
  // 'reddit' => ssb_reddit_generate_link( 'http://stackoverflow.com/q/811074/1288' )
565
  // )
566
  // );
567
-
568
-
569
- //fetch http / https result and save in network_old_share_count meta tags
570
- $share_counts = ssb_fetch_fresh_counts( $result, $post_id , $_alt_share_links);
571
  // update_post_meta( $post_id,'ssb_cache_timestamp',floor( ( ( date( 'U' ) / 60) / 60 ) ) );
572
- } else {
573
- $share_counts = ssb_fetch_cached_counts( array_flip( $arrButtons ), $post_id );
574
- }
575
 
576
  $arrButtonsCode = array();
577
  foreach ( $arrButtons as $button_name => $button_sort ) {
@@ -584,7 +583,7 @@ class SimpleSocialButtonsPR {
584
  <span class="icon"><svg version="1.1" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMid meet" width="30px" height="18px" viewBox="-10 -6 60 36" class="ozWidgetRioButtonSvg_ ozWidgetRioButtonPlusOne_"><path d="M30 7h-3v4h-4v3h4v4h3v-4h4v-3h-4V7z"></path><path d="M11 9.9v4h5.4C16 16.3 14 18 11 18c-3.3 0-5.9-2.8-5.9-6S7.7 6 11 6c1.5 0 2.8.5 3.8 1.5l2.9-2.9C15.9 3 13.7 2 11 2 5.5 2 1 6.5 1 12s4.5 10 10 10c5.8 0 9.6-4.1 9.6-9.8 0-.7-.1-1.5-.2-2.2H11z"></path></svg></span>
585
  <span class="simplesocialtxt">Google Plus </span>';
586
  if ( $show_count ) {
587
- $_html .= '<span class="ssb_counter">'. $googleplus_share .'</span>';
588
  }
589
  $_html .= '</button>';
590
  } else {
@@ -599,7 +598,7 @@ class SimpleSocialButtonsPR {
599
  $arrButtonsCode[] = $_html;
600
 
601
  break;
602
- case 'fbshare':
603
  $fbshare_share = $share_counts['fbshare'] ? $share_counts['fbshare'] : 0;
604
 
605
  if ( $this->selected_theme == 'simple-icons' ) {
@@ -608,13 +607,13 @@ class SimpleSocialButtonsPR {
608
  <span class="simplesocialtxt">Share </span>';
609
 
610
  if ( $show_count ) {
611
- $_html .= ' <span class="ssb_counter">'. $fbshare_share .'</span>';;
612
  }
613
 
614
  $_html .= ' </button>';
615
- } else{
616
 
617
- $_html = '<button class="simplesocial-fb-share" target="_blank" data-href="https://www.facebook.com/sharer/sharer.php?u=' . $permalink . '" onclick="javascript:window.open(this.dataset.href, \'\', \'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600\');return false;"><span class="simplesocialtxt">Facebook </span> ';
618
 
619
  if ( $show_count ) {
620
  $_html .= '<span class="ssb_counter ssb_fbshare_counter">' . $fbshare_share . '</span>';
@@ -622,7 +621,7 @@ class SimpleSocialButtonsPR {
622
  $_html .= '</button>';
623
  }
624
 
625
- $arrButtonsCode[] = $_html;
626
 
627
  break;
628
  case 'twitter':
@@ -635,18 +634,17 @@ class SimpleSocialButtonsPR {
635
  <span class="icon"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 72 72"><path fill="none" d="M0 0h72v72H0z"/><path class="icon" fill="#fff" d="M68.812 15.14c-2.348 1.04-4.87 1.744-7.52 2.06 2.704-1.62 4.78-4.186 5.757-7.243-2.53 1.5-5.33 2.592-8.314 3.176C56.35 10.59 52.948 9 49.182 9c-7.23 0-13.092 5.86-13.092 13.093 0 1.026.118 2.02.338 2.98C25.543 24.527 15.9 19.318 9.44 11.396c-1.125 1.936-1.77 4.184-1.77 6.58 0 4.543 2.312 8.552 5.824 10.9-2.146-.07-4.165-.658-5.93-1.64-.002.056-.002.11-.002.163 0 6.345 4.513 11.638 10.504 12.84-1.1.298-2.256.457-3.45.457-.845 0-1.666-.078-2.464-.23 1.667 5.2 6.5 8.985 12.23 9.09-4.482 3.51-10.13 5.605-16.26 5.605-1.055 0-2.096-.06-3.122-.184 5.794 3.717 12.676 5.882 20.067 5.882 24.083 0 37.25-19.95 37.25-37.25 0-.565-.013-1.133-.038-1.693 2.558-1.847 4.778-4.15 6.532-6.774z"/></svg></span>';
636
 
637
  if ( $show_count ) {
638
- $_html .= '<i class="simplesocialtxt">Tweet '. $twitter_share .'</i>';
639
- } else{
640
  $_html .= '<i class="simplesocialtxt">Tweet </i>';
641
 
642
  }
643
 
644
- $_html .= '</button>';
645
-
646
 
647
  } else {
648
 
649
- $_html = '<button class="simplesocial-twt-share" data-href="https://twitter.com/share?text=' . $title . '&url=' . $permalink . '' . $via . '" rel="nofollow" onclick="javascript:window.open(this.dataset.href, \'\', \'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600\');return false;"><span class="simplesocialtxt">Twitter</span> ';
650
 
651
  if ( $show_count ) {
652
  $_html .= '<span class="ssb_counter ssb_twitter_counter">' . $twitter_share . '</span>';
@@ -667,7 +665,7 @@ class SimpleSocialButtonsPR {
667
  <span class="simplesocialtxt">Share</span>';
668
 
669
  if ( $show_count ) {
670
- $_html .= ' <span class="ssb_counter">'. $linkedin_share .'</span>';
671
  }
672
  $_html .= ' </button>';
673
  } else {
@@ -692,7 +690,7 @@ class SimpleSocialButtonsPR {
692
  <span class="icon"> <svg xmlns="http://www.w3.org/2000/svg" height="30px" width="30px" viewBox="-1 -1 31 31"><g><path d="M29.449,14.662 C29.449,22.722 22.868,29.256 14.75,29.256 C6.632,29.256 0.051,22.722 0.051,14.662 C0.051,6.601 6.632,0.067 14.75,0.067 C22.868,0.067 29.449,6.601 29.449,14.662" fill="#fff" stroke="#fff" stroke-width="1"></path><path d="M14.733,1.686 C7.516,1.686 1.665,7.495 1.665,14.662 C1.665,20.159 5.109,24.854 9.97,26.744 C9.856,25.718 9.753,24.143 10.016,23.022 C10.253,22.01 11.548,16.572 11.548,16.572 C11.548,16.572 11.157,15.795 11.157,14.646 C11.157,12.842 12.211,11.495 13.522,11.495 C14.637,11.495 15.175,12.326 15.175,13.323 C15.175,14.436 14.462,16.1 14.093,17.643 C13.785,18.935 14.745,19.988 16.028,19.988 C18.351,19.988 20.136,17.556 20.136,14.046 C20.136,10.939 17.888,8.767 14.678,8.767 C10.959,8.767 8.777,11.536 8.777,14.398 C8.777,15.513 9.21,16.709 9.749,17.359 C9.856,17.488 9.872,17.6 9.84,17.731 C9.741,18.141 9.52,19.023 9.477,19.203 C9.42,19.44 9.288,19.491 9.04,19.376 C7.408,18.622 6.387,16.252 6.387,14.349 C6.387,10.256 9.383,6.497 15.022,6.497 C19.555,6.497 23.078,9.705 23.078,13.991 C23.078,18.463 20.239,22.062 16.297,22.062 C14.973,22.062 13.728,21.379 13.302,20.572 C13.302,20.572 12.647,23.05 12.488,23.657 C12.193,24.784 11.396,26.196 10.863,27.058 C12.086,27.434 13.386,27.637 14.733,27.637 C21.95,27.637 27.801,21.828 27.801,14.662 C27.801,7.495 21.95,1.686 14.733,1.686" fill="#bd081c"></path></g></svg> </span>
693
  <span class="simplesocialtxt">Save</span>';
694
  if ( $show_count ) {
695
- $_html .= '<span class="ssb_counter">'. $pinterest_share .'</span>';
696
  }
697
  $_html .= ' </button>';
698
  } else {
@@ -712,7 +710,7 @@ class SimpleSocialButtonsPR {
712
  $total_share = $share_counts['total'] ? $share_counts['total'] : 0;
713
  $arrButtonsCode[] = "<span class='ssb_total_counter'>" . $total_share . '<span>Shares</span></span>';
714
  break;
715
- case 'reddit':
716
  $reddit_score = $share_counts['reddit'] ? $share_counts['reddit'] : 0;
717
 
718
  if ( $this->selected_theme == 'simple-icons' ) {
@@ -722,12 +720,12 @@ class SimpleSocialButtonsPR {
722
  xml:space="preserve"> <g> <path id="reddit" d="M307.523,231.062c1.11,2.838,1.614,5.769,1.614,8.681c0,5.862-2.025,11.556-5.423,16.204 c-3.36,4.593-8.121,8.158-13.722,9.727h0.01c-0.047,0.019-0.094,0.019-0.117,0.037c-0.023,0-0.061,0.019-0.079,0.019 c-2.623,0.896-5.312,1.316-7.98,1.316c-6.254,0-12.396-2.254-17.306-6.096c-4.872-3.826-8.56-9.324-9.717-15.845h-0.01 c0-0.019,0-0.042-0.009-0.069c0-0.019,0-0.038-0.019-0.065h0.019c-0.364-1.681-0.551-3.36-0.551-5.021 c0-5.647,1.923-11.07,5.097-15.551c3.164-4.453,7.626-7.99,12.848-9.811c0.019,0,0.038-0.01,0.038-0.01 c0.027,0,0.027-0.027,0.051-0.027c2.954-1.092,6.072-1.639,9.157-1.639c5.619,0,11.154,1.704,15.821,4.821 c4.611,3.066,8.354,7.561,10.23,13.143c0.019,0.037,0.019,0.07,0.037,0.103c0,0.037,0.019,0.057,0.037,0.084H307.523z M290.329,300.349c-2.202-1.428-4.751-2.291-7.448-2.291c-2.175,0-4.434,0.621-6.445,1.955l0,0 c-19.004,11.342-41.355,17.558-63.547,17.558c-16.65,0-33.199-3.514-48.192-10.879l-0.077-0.037l-0.075-0.028 c-2.261-0.924-4.837-2.889-7.647-4.76c-1.428-0.925-2.919-1.844-4.574-2.521c-1.633-0.695-3.447-1.181-5.386-1.181 c-1.605,0-3.292,0.359-4.957,1.115c-0.086,0.033-0.168,0.065-0.252,0.098h0.009c-2.616,0.999-4.66,2.829-5.974,4.994 c-1.372,2.23-2.046,4.826-2.046,7.411c0,2.334,0.551,4.667,1.691,6.786c1.085,2.007,2.754,3.762,4.938,4.938 c21.429,14.454,46.662,21.002,71.992,20.979c22.838,0,45.814-5.287,66.27-14.911l0.107-0.065l0.103-0.056 c2.697-1.597,6.282-3.029,9.661-5.115c1.671-1.064,3.304-2.296,4.704-3.897c1.4-1.591,2.525-3.551,3.16-5.875v-0.01 c0.266-1.026,0.392-2.025,0.392-3.024c0-1.899-0.467-3.701-1.241-5.32C294.361,303.775,292.504,301.778,290.329,300.349z M139.875,265.589c0.037,0,0.086,0.014,0.128,0.037c2.735,0.999,5.554,1.493,8.345,1.493c6.963,0,13.73-2.852,18.853-7.5 c5.115-4.662,8.618-11.257,8.618-18.775c0-0.196,0-0.392-0.009-0.625c0.019-0.336,0.028-0.705,0.028-1.083 c0-7.458-3.456-14.08-8.522-18.762c-5.085-4.686-11.836-7.551-18.825-7.551c-1.867,0-3.769,0.219-5.628,0.653 c-0.028,0-0.049,0.009-0.077,0.009c0,0-0.019,0-0.028,0c-9.252,1.937-17.373,8.803-20.37,18.248l0,0v0.01 c0,0.019-0.009,0.037-0.009,0.037c-0.861,2.586-1.262,5.255-1.262,7.896c0,5.787,1.913,11.426,5.211,16.064 c3.269,4.56,7.894,8.145,13.448,9.819C139.816,265.561,139.835,265.571,139.875,265.589z M430.033,198.094v0.038 c0.066,0.94,0.084,1.878,0.084,2.81c0,10.447-3.351,20.493-8.941,29.016c-5.218,7.976-12.414,14.649-20.703,19.177 c0.532,4.158,0.84,8.349,0.84,12.526c-0.01,22.495-7.766,44.607-21.272,62.329v0.009h-0.028 c-24.969,33.216-63.313,52.804-102.031,62.684h-0.01l-0.027,0.023c-20.647,5.013-41.938,7.574-63.223,7.574 c-31.729,0-63.433-5.722-93.018-17.585l-0.009-0.028h-0.028c-30.672-12.643-59.897-32.739-77.819-62.184 c-9.642-15.71-14.935-34.141-14.935-52.659c0-4.19,0.283-8.387,0.843-12.536c-8.072-4.545-15.063-10.99-20.255-18.687 c-5.542-8.266-9.056-17.95-9.5-28.187v-0.04v-0.037v-0.082c0.009-14.337,6.237-27.918,15.915-37.932 c9.677-10.011,22.896-16.554,37.075-16.554c0.196,0,0.392,0,0.588,0c1.487-0.101,2.987-0.159,4.488-0.159 c7.122,0,14.26,1.153,21.039,3.752l0.037,0.028l0.038,0.012c5.787,2.437,11.537,5.377,16.662,9.449 c1.661-0.871,3.472-1.851,5.504-2.625c31.064-18.395,67.171-25.491,102.358-27.538c0.306-17.431,2.448-35.68,10.949-51.65 c7.08-13.269,19.369-23.599,34-27.179l0.061-0.03l0.079-0.009c5.573-1.078,11.192-1.575,16.774-1.575 c14.869,0,29.561,3.521,43.31,9.017c6.086-9.185,14.776-16.354,24.97-20.375l0.098-0.056l0.098-0.037 c5.983-1.864,12.303-2.954,18.646-2.954c6.692,0,13.437,1.223,19.756,4.046v-0.023c0.009,0.023,0.019,0.023,0.019,0.023 c0.047,0.016,0.084,0.044,0.116,0.044c9.059,3.489,16.727,9.937,22.164,17.95c5.442,8.048,8.644,17.688,8.644,27.599 c0,1.827-0.103,3.657-0.317,5.489l-0.019,0.037c0,0.028,0,0.068-0.01,0.096c-1.063,12.809-7.551,24.047-16.736,32.063 c-9.24,8.048-21.207,12.909-33.49,12.909c-1.97,0-3.958-0.11-5.937-0.374c-12.182-0.931-23.541-6.826-31.886-15.595 c-8.373-8.755-13.768-20.453-13.768-33.08c0-0.611,0.056-1.237,0.074-1.843c-11.435-5.092-23.578-9.316-35.646-9.306 c-1.746,0-3.491,0.096-5.237,0.273h-0.019c-9.035,0.871-17.436,6.566-21.506,14.757v0.009v0.028 c-6.179,12.034-7.411,26.101-7.598,40.064c34.639,2.259,69.483,10.571,100.043,28.138h0.047l0.438,0.259 c0.579,0.343,1.652,0.931,2.623,1.449c2.101-1.704,4.322-3.456,6.856-4.966c9.264-6.17,20.241-9.238,31.223-9.238 c4.872,0,9.749,0.621,14.481,1.834h0.019l0.196,0.058c0.07,0.01,0.121,0.033,0.178,0.033v0.009 c11.183,2.845,21.3,9.267,28.917,17.927c7.612,8.674,12.731,19.648,13.73,31.561v0.025H430.033z M328.002,84.733 c0,0.469,0.01,0.95,0.057,1.44v0.028v0.056c0.224,6.018,3.065,11.619,7.383,15.756c4.34,4.14,10.1,6.702,15.942,6.725h0.08h0.079 c0.42,0.033,0.85,0.033,1.26,0.033c5.899,0.009,11.752-2.532,16.148-6.655c4.405-4.144,7.309-9.78,7.542-15.849l0.009-0.028v-0.037 c0.038-0.464,0.057-0.903,0.057-1.377c0-6.247-2.922-12.202-7.496-16.612c-4.555-4.406-10.688-7.136-16.735-7.12 c-1.951,0-3.884,0.266-5.778,0.854l-0.065,0.005l-0.056,0.023c-4.984,1.295-9.656,4.368-13.012,8.449 C330.046,74.486,328.002,79.508,328.002,84.733z M72.312,177.578c-4.63-2.156-9.418-3.696-14.15-3.676 c-0.794,0-1.597,0.047-2.39,0.133h-0.11l-0.11,0.014c-6.795,0.187-13.653,3.15-18.801,7.899 c-5.152,4.732-8.559,11.122-8.821,18.167v0.065l-0.012,0.058c-0.046,0.57-0.065,1.137-0.065,1.683 c0,4.345,1.333,8.545,3.593,12.368c1.673,2.847,3.867,5.441,6.348,7.701C45.735,204.602,58.142,189.845,72.312,177.578z M374.066,262.635c0-15.5-5.592-31.069-14.646-43.604c-18.053-25.119-46.055-41.502-75.187-50.636l-0.205-0.072 c-5.592-1.715-11.238-3.234-16.933-4.534c-17.025-3.876-34.48-5.806-51.917-5.806c-23.414,0-46.827,3.465-69.245,10.379 c-29.125,9.243-57.221,25.51-75.233,50.71v0.019c-9.129,12.587-14.475,28.208-14.475,43.763c0,5.727,0.716,11.453,2.23,17.025 l0.019,0.01c3.278,12.508,9.689,23.671,17.989,33.393c8.295,9.745,18.472,18.058,29.176,24.839c2.371,1.47,4.751,2.87,7.187,4.237 c31.094,17.356,66.898,24.964,102.445,24.964c6.012,0,12.06-0.214,18.033-0.644c35.797-2.959,71.742-13.525,100.8-35.115 l0.01-0.023c9.25-6.837,17.818-15.112,24.595-24.525c6.805-9.418,11.789-19.947,14.002-31.382V275.6l0.009-0.01 C373.627,271.32,374.066,266.985,374.066,262.635z M402.32,200.95c-0.009-3.762-0.868-7.507-2.753-11l-0.047-0.044l-0.019-0.056 c-2.521-5.19-6.479-9.11-11.248-11.782c-4.77-2.69-10.352-4.056-15.952-4.056c-5.063,0-10.1,1.132-14.57,3.379 c14.216,12.344,26.687,27.179,34.746,44.636c2.595-2.259,4.808-5.018,6.464-8.084C401.098,209.92,402.32,205.405,402.32,200.95z"/></svg></span>
723
  <span class="simplesocialtxt">reddit </span>';
724
  if ( $show_count ) {
725
- $_html .= '<span class="ssb_counter">'. $reddit_score .'</span>';
726
  }
727
 
728
- $_html .= '</button>';
729
  } else {
730
- $_html = '<button class="simplesocial-reddit-share" data-href="https://reddit.com/submit?url=' . $permalink . '&title=' . $title . '" onclick="javascript:window.open(this.dataset.href, \'\', \'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600\');return false;" ><span class="simplesocialtxt">Reddit</span> ';
731
 
732
  if ( $show_count ) {
733
  $_html .= '<span class="ssb_counter ssb_reddit_counter">' . $reddit_score . '</span>';
@@ -749,7 +747,7 @@ class SimpleSocialButtonsPR {
749
  $arrButtonsCode[] = '<button onclick="javascript:window.open(this.dataset.href, \'_blank\' );return false;" class="simplesocial-whatsapp-share" data-href="https://api.whatsapp.com/send?text=' . $permalink . '"><span class="simplesocialtxt">WhatsApp</span></button>';
750
  }
751
  break;
752
- case 'viber':
753
  if ( $this->selected_theme == 'simple-icons' ) {
754
  $arrButtonsCode[] = '<button onclick="javascript:window.open(this.dataset.href, \'_self\' );return false;" class="simplesocial-viber-share ssb_viber-icon" data-href="viber://forward?text=' . $permalink . '">
755
  <span class="icon"> <svg aria-labelledby="simpleicons-viber-icon" role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title id="simpleicons-viber-icon">Viber icon</title><path d="M20.812 2.343c-.596-.549-3.006-2.3-8.376-2.325 0 0-6.331-.38-9.415 2.451C1.302 4.189.698 6.698.634 9.82.569 12.934.487 18.774 6.12 20.36h.005l-.005 2.416s-.034.979.609 1.178c.779.24 1.236-.504 1.98-1.303.409-.439.972-1.088 1.397-1.582 3.851.322 6.813-.416 7.149-.525.777-.254 5.176-.816 5.893-6.658.738-6.021-.357-9.83-2.338-11.547v.004zm.652 11.112c-.615 4.876-4.184 5.187-4.83 5.396-.285.092-2.895.738-6.164.525 0 0-2.445 2.941-3.195 3.705-.121.121-.271.166-.361.145-.135-.029-.164-.18-.164-.404l.015-4.006c-.015 0 0 0 0 0-4.771-1.336-4.485-6.301-4.425-8.91.044-2.596.538-4.726 1.994-6.167 2.611-2.371 7.997-2.012 7.997-2.012 4.543.016 6.721 1.385 7.223 1.846 1.674 1.432 2.529 4.865 1.904 9.893l.006-.011zM7.741 4.983c.242 0 .459.109.629.311.004.002.58.695.83 1.034.235.32.551.83.711 1.115.285.51.104 1.032-.172 1.248l-.566.45c-.285.229-.25.653-.25.653s.84 3.157 3.959 3.953c0 0 .426.039.654-.246l.451-.569c.213-.285.734-.465 1.244-.181.285.15.795.466 1.116.704.339.24 1.032.826 1.036.826.33.271.404.689.18 1.109v.016c-.23.405-.541.78-.934 1.141h-.008c-.314.27-.629.42-.944.449-.03 0-.075.016-.136 0-.135 0-.27-.029-.404-.061v-.014c-.48-.135-1.275-.48-2.596-1.216-.855-.479-1.574-.96-2.189-1.455-.315-.255-.645-.54-.976-.87l-.076-.028-.03-.03-.029-.029c-.331-.33-.615-.66-.871-.98-.48-.609-.96-1.327-1.439-2.189-.735-1.32-1.08-2.115-1.215-2.596H5.7c-.045-.134-.075-.269-.06-.404-.015-.061 0-.105 0-.141.03-.299.189-.614.458-.944h.005c.355-.39.738-.704 1.146-.933.164-.091.329-.135.479-.135h.016l-.003.012zm4.095-.683h.116l.076.002h.02l.089.005h.511l.135.015h.074l.15.016h.03l.104.015h.016l.074.015c.046 0 .076.016.105.016h.091l.075.029.06.016.06.015.03.015h.045l.046.016h.029l.074.016.045.014.046.016.06.016.03.014c.03 0 .06.016.091.016l.044.015.046.016.119.044.061.031.135.06.045.015.045.016.09.045.061.015.029.015.076.031.029.014.061.031.045.014.045.03.059.03.046.029.03.016.061.03.044.03.075.045.045.016.074.044.016.015.045.031.09.074.046.03.044.03.031.014.045.031.074.074.061.045.045.03.016.015.029.016.074.061.046.044.03.03.045.029.045.031.029.015.12.12.06.061.135.135.031.029c.016.016.045.045.061.075l.029.03.166.194.045.06c.014.016.014.031.029.031l.09.135.045.045.09.12.076.12.045.09.059.105.045.09.016.029.029.061.076.15.074.149.031.075c.059.135.104.27.164.42.074.195.135.404.18.63.045.165.076.315.105.48l.029.27.045.3c.016.121.031.256.031.375.014.121.014.24.014.359v.256c0 .016-.006.029-.014.045-.016.03-.031.045-.061.075-.021.015-.049.046-.08.046-.029.014-.059.014-.09.014h-.045c-.029 0-.059-.014-.09-.029-.029-.016-.061-.03-.074-.061-.016-.029-.045-.061-.061-.09s-.031-.06-.031-.09v-.359c-.014-.209-.029-.425-.059-.639-.016-.146-.045-.284-.061-.42 0-.074-.016-.146-.029-.209l-.029-.15-.038-.141-.016-.09-.045-.15c-.029-.12-.074-.24-.119-.36-.029-.091-.061-.165-.105-.239l-.029-.076-.135-.27-.031-.045c-.061-.135-.135-.27-.225-.391l-.045-.074h-.201l-.064-.091c-.055-.089-.114-.165-.18-.239l-.125-.15-.015-.016-.046-.057-.035-.045-.075-.074-.015-.03-.07-.06-.045-.046-.083-.075-.04-.037-.046-.045-.015-.016c-.016-.015-.045-.045-.075-.06l-.076-.062-.03-.015-.061-.046-.074-.06-.045-.036-.03-.016-.06-.053c0-.016-.016-.016-.031-.016l-.029-.029-.015-.016v-.013l-.03-.014-.061-.037-.044-.031-.075-.045-.06-.045-.029-.016-.032-.013h-.09l-.019-.016-.065-.035-.009-.014-.03-.016-.045-.021h-.012l-.045-.016-.025-.015-.045-.015-.01-.011-.03-.016-.053-.029-.03-.015-.09-.03-.074-.029-.137-.016-.044-.029c-.015-.01-.03-.016-.046-.016l-.029-.015c-.029-.011-.045-.016-.075-.03l-.03-.016h-.029l-.061-.029-.029-.016-.045-.015h-.092c-.008 0-.019-.005-.03-.007h-.09l-.045-.016h-.015l-.045-.016h-.041c-.025-.014-.045-.014-.07-.014l-.01-.016-.06-.015c-.03-.016-.056-.016-.084-.016l-.045-.015-.05-.016-.045-.014-.061-.016h-.061l-.179-.022h-.09l-.116-.015h-.076l-.068-.008h-.03l-.054-.016h-.285l-.01-.015h-.061c-.03 0-.064-.015-.09-.03-.03-.016-.061-.029-.081-.06l-.03-.046c-.029-.029-.029-.06-.045-.09-.014-.028-.014-.059-.014-.089s0-.06.015-.09c.016-.029.029-.06.061-.075.015-.03.044-.044.074-.06.029-.016.061-.03.09-.03h.061l.015.066zm.554 1.574l.037.003.061.006c.008 0 .018 0 .029.003.022 0 .045.004.075.006l.06.008.024.016.045.015.048.015.045.016h.03l.042.015.07.015.056.016.026.014h.073l.119.028.046.015.045.015.045.016s.015 0 .015.015l.046.015.044.016.045.016c.015 0 .03.014.046.014.007 0 .014.016.025.016l.064.03h.029l.09.03.05.029.046.03.108.045.06.015.031.031c.045.014.09.044.135.059l.048.03.048.03.049.029c.045.03.082.046.121.076l.029.014.041.031.022.015.075.045.037.03.065.043.029.015.03.015.046.03.06.046c.015.014.022.014.034.029.01.015.016.015.025.03l.033.03.036.029.03.03.046.046.029.03.016.016.09.089.016.016c0 .015.015.03.029.03l.016.013.045.046.029.045.03.03.045.06.046.046.09.119.014.029.061.076.016.029.015.031.015.029.016.03c.016.015.016.03.029.06l.043.076.016.015.029.061.031.044c.014.015.014.029.029.045l.03.045.03.061.029.059.016.046c.015.044.045.075.06.12 0 .015.015.029.015.045l.045.119.061.195c0 .016.015.045.015.061l.046.135.044.18.046.24c.014.074.014.135.029.211.016.119.03.238.03.359l.015.21v.165c0 .016 0 .029-.015.045l-.044.043c-.029.023-.045.045-.074.061-.03.015-.061.029-.09.04-.031.016-.075.016-.105.016-.029 0-.061-.016-.09-.03-.016 0-.03-.016-.045-.021-.031-.014-.061-.039-.075-.065-.03-.03-.046-.06-.046-.091l-.014-.044v-.313c0-.133-.016-.256-.031-.385-.015-.135-.044-.285-.074-.42-.029-.09-.045-.18-.075-.26l-.03-.091-.029-.075-.016-.03-.045-.12-.045-.09-.075-.149-.069-.12v-.019l-.029-.047-.03-.038-.045-.075-.046-.061-.089-.119c-.046-.061-.09-.12-.142-.178-.014-.015-.029-.029-.029-.045l-.03-.029-.017-.016-.03-.014-.03-.027v-.146l-.119-.113-.075-.068v-.014l-.03-.031-.038-.029-.015-.016c0-.015-.016-.015-.029-.015l-.046-.016-.015-.015-.061-.045-.014-.016-.016-.015c-.012-.015-.023-.015-.03-.015l-.06-.045-.016-.016-.06-.029-.011-.016-.045-.029-.03-.016-.03-.029-.029-.031h-.016c-.029-.029-.06-.044-.105-.06l-.044-.03-.03-.014-.016-.016-.045-.03-.044-.015-.06-.03-.046-.015-.015-.016-.056-.014v-.012l-.091-.03-.06-.03-.03-.015h-.06c-.03-.015-.045-.015-.075-.03H13.2l-.045-.016h-.044l-.046-.014-.029-.016h-.061l-.061-.015-.029-.016h-.165l-.069-.015H12.3l-.046-.016c-.029-.014-.06-.029-.09-.06-.014-.03-.045-.06-.06-.089-.015-.031-.03-.061-.03-.091v-.09c.006-.046.016-.075.03-.105.008-.015.015-.03.03-.045.018-.03.045-.06.075-.075.015-.015.03-.015.044-.029.031-.016.061-.016.091-.016h.06l-.014.055zm.454 1.629c.015 0 .03 0 .044.004.016 0 .031 0 .046.002l.052.005c.104.009.213.024.318.046l.104.023.026.008.114.029.059.02.046.016c.045.014.091.045.135.06l.016.015.06.03.09.046.029.014c.016.016.031.016.046.03.015.016.045.03.06.045.061.03.105.075.15.105l.105.09.09.091.061.074.029.029.03.031.044.06.091.135.075.135.06.12.046.105c.044.104.06.195.09.299.029.091.045.196.06.285l.015.15.016.136V9.8c0 .045-.016.075-.03.105-.015.029-.046.074-.075.09-.03.029-.061.045-.105.061-.029.014-.06.014-.09.014-.029 0-.06 0-.09-.014l-.104-.046c-.03-.03-.06-.045-.091-.091-.015-.029-.029-.06-.045-.104v-.166l-.015-.105-.015-.119-.016-.105-.016-.06c0-.015-.014-.045-.014-.06-.03-.121-.09-.24-.15-.36l-.061-.06-.047-.06-.045-.045-.015-.03-.075-.06-.061-.061-.059-.045c-.016-.015-.03-.015-.061-.029l-.09-.061-.061-.03-.029-.015h-.016l-.076-.031-.09-.03-.09-.015h-.075l-.044-.015-.035-.007h-.045l-.06-.016h-.255l-.015-.075h-.039c-.03-.004-.055-.015-.08-.029-.035-.021-.064-.045-.09-.08-.018-.029-.034-.061-.045-.09-.008-.029-.012-.06-.012-.09 0-.037 0-.075.015-.113.015-.039.03-.07.06-.1l.061-.045c.029-.016.061-.03.09-.03l.062-.075h.032z"/></svg> </span>
@@ -760,44 +758,43 @@ class SimpleSocialButtonsPR {
760
  $arrButtonsCode[] = '<button onclick="javascript:window.open(this.dataset.href, \'_self\' );return false;" class="simplesocial-viber-share" data-href="viber://forward?text=' . $permalink . '"><span class="simplesocialtxt">Viber</span></button>';
761
  }
762
  break;
763
- case 'fblike':
764
  $_html = '<div class="fb-like ssb-fb-like" data-href="' . $permalink . '" data-layout="button_count" data-action="like" data-size="small" data-show-faces="false" data-share="false"></div>';
765
 
766
  $arrButtonsCode[] = $_html;
767
 
768
  break;
769
- case 'messenger':
770
-
771
- $link = urlencode( $permalink );
772
  $messenger_share_url = $this->is_mobile() ? "fb-messenger://share/?link=$link?app_id=$this->fb_app_id" : "http://www.facebook.com/dialog/send?app_id=$this->fb_app_id&redirect_uri=$link&link=$link&display=popup";
773
 
774
- if ( $this->selected_theme == 'simple-icons' ) {
775
- $arrButtonsCode[] = '<button onclick="javascript:window.open(this.dataset.href, \'_blank\', \'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600\' );return false;" class="simplesocial-viber-share ssb_msng-icon" data-href='. $messenger_share_url .'>
776
  <span class="icon"> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="18px" height="19px" viewBox="-889.5 1161 18 19" enable-background="new -889.5 1161 18 19" xml:space="preserve">
777
  <path opacity="0.99" fill="#FFFFFF" enable-background="new " d="M-880.5,1161c-5,0-9,3.8-9,8.5c0,2.4,1,4.5,2.7,6v4.5l3.8-2.3 c0.8,0.2,1.6,0.3,2.5,0.3c5,0,9-3.8,9-8.5S-875.5,1161-880.5,1161z M-879.6,1172.2l-2.4-2.4l-4.3,2.4l4.7-5.2l2.4,2.4l4.2-2.4 L-879.6,1172.2z"/>
778
  </svg> </span>
779
  <span class="simplesocialtxt">Messenger</span>
780
  </button>';
781
- } else {
782
 
783
- $arrButtonsCode[] = '<button class="simplesocial-msng-share" onclick="javascript:window.open( this.dataset.href, \'_blank\', \'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600\' );return false;" data-href="'. $messenger_share_url .'" ><span class="simplesocialtxt">Messenger</span></button> ';
784
- }
785
- break;
786
- case 'email':
787
- if ( $this->selected_theme == 'simple-icons' ) {
788
- $arrButtonsCode[] = ' <button onclick="javascript:window.location.href = this.dataset.href;return false;" class="ssb_email-icon simplesocial-email-share" data-href="mailto:?subject='. $title .'&body='. $permalink .'">
789
  <span class="icon"> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="16px" height="11.9px" viewBox="-1214.1 1563.9 16 11.9" enable-background="new -1214.1 1563.9 16 11.9" xml:space="preserve">
790
  <path d="M-1214.1,1565.2v1l8,4l8-4v-1c0-0.7-0.6-1.3-1.3-1.3h-13.4C-1213.5,1563.9-1214.1,1564.4-1214.1,1565.2z M-1214.1,1567.4v7.1c0,0.7,0.6,1.3,1.3,1.3h13.4c0.7,0,1.3-0.6,1.3-1.3v-7.1l-8,4L-1214.1,1567.4z"/> </svg> </span>
791
  <span class="simplesocialtxt">Email</span>
792
  </button>';
793
- } else {
794
-
795
- $arrButtonsCode[] = '<button onclick="javascript:window.location.href = this.dataset.href;return false;" class="simplesocial-email-share" data-href="mailto:?subject='. $title .'&body='. $permalink .'"><span class="simplesocialtxt">Email</span></button>';
796
- }
797
- break;
798
- case 'print':
799
- if ( $this->selected_theme == 'simple-icons' ) {
800
- $arrButtonsCode[] = ' <button onclick="javascript:window.print();return false;" class=" ssb_print-icon simplesocial-email-share" >
801
  <span class="icon"> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Layer_1" x="0px" y="0px" width="16px" height="13.7px" viewBox="-1296.9 1876.4 16 13.7" enable-background="new -1296.9 1876.4 16 13.7" xml:space="preserve"><g>
802
  <path fill="#FFFFFF" d="M-1288.9,1879.7c2.3,0,4.6,0,6.9,0c0.4,0,0.7,0.1,0.9,0.5c0.1,0.2,0.1,0.4,0.1,0.6c0,1.7,0,3.4,0,5.1 c0,0.7-0.4,1.1-1.1,1c-0.6,0-1.2,0-1.8,0c-0.1,0-0.2,0-0.2,0.2c0,0.7,0,1.4,0,2c0,0.6-0.4,1-1,1c-0.1,0-0.3,0-0.4,0 c-2.5,0-4.9,0-7.4,0c-0.3,0-0.5,0-0.8-0.1c-0.3-0.2-0.5-0.5-0.5-0.9c0-0.7,0-1.4,0-2c0-0.2-0.1-0.2-0.2-0.2c-0.6,0-1.2,0-1.7,0 c-0.7,0-1-0.4-1-1c0-1.7,0-3.4,0-5.1c0-0.4,0.2-0.8,0.6-0.9c0.2-0.1,0.3-0.1,0.5-0.1C-1293.5,1879.7-1291.2,1879.7-1288.9,1879.7z M-1288.9,1884.9C-1288.9,1884.9-1288.9,1884.9-1288.9,1884.9c-1.4,0-2.8,0-4.2,0c-0.1,0-0.2,0-0.2,0.2c0,0.3,0,0.7,0,1 c0,1,0,2,0,3c0,0.3,0.1,0.4,0.4,0.4c2.5,0,5.1,0,7.6,0c0.1,0,0.3,0,0.4,0c0.2,0,0.3-0.2,0.3-0.3c0-1.3,0-2.7,0-4 c0-0.2,0-0.2-0.2-0.2C-1286.1,1884.9-1287.5,1884.9-1288.9,1884.9z M-1284.2,1882.4c0.4,0,0.7-0.3,0.7-0.7c0-0.4-0.3-0.7-0.8-0.7 c-0.4,0-0.7,0.3-0.7,0.7C-1284.9,1882.1-1284.6,1882.4-1284.2,1882.4z"/>
803
  <path fill="#FFFFFF" d="M-1283.9,1879c-0.2,0-0.4,0-0.5,0c-3.1,0-6.2,0-9.3,0c-0.1,0-0.2,0-0.2-0.2c0-0.5,0-1,0-1.5 c0-0.5,0.4-1,0.9-1c0.1,0,0.2,0,0.3,0c2.6,0,5.2,0,7.8,0c0.6,0,1,0.4,1,1c0,0.5,0,0.9,0,1.4 C-1283.9,1878.9-1283.9,1879-1283.9,1879z"/>
@@ -806,11 +803,11 @@ class SimpleSocialButtonsPR {
806
  </g></svg></span>
807
  <span class="simplesocialtxt">Print</span>
808
  </button>';
809
- } else {
810
 
811
- $arrButtonsCode[] = '<button onclick="javascript:window.print();return false;" class="simplesocial-print-share" ><span class="simplesocialtxt">Print</span></button>';
812
- }
813
- break;
814
  }
815
  }
816
 
@@ -821,7 +818,7 @@ class SimpleSocialButtonsPR {
821
  $ssb_buttonscode .= '</div>' . "\n";
822
 
823
  }
824
- return $ssb_buttonscode;
825
  }
826
 
827
  /**
@@ -980,17 +977,16 @@ class SimpleSocialButtonsPR {
980
 
981
 
982
  /**
983
- * short code content
984
- *
985
- * @param $atts
986
- *
987
- * @since 2.0.2
988
- * @return string
989
- */
990
  function short_code_content( $atts ) {
991
 
992
  /*
993
-
994
  counter = true,false
995
  align = left ,right,centered,
996
  order = googleplus,twitter,pinterest,fbshare,linkedin,reddit,whatsapp,viber,fblike,messenger,email
@@ -1005,24 +1001,25 @@ class SimpleSocialButtonsPR {
1005
  Official = simple-icons
1006
  */
1007
 
1008
- $selected_theme = shortcode_atts( array(
1009
- 'theme' => '',
1010
- 'order' => null,
1011
- 'align' => '',
1012
- 'counter' => 'false',
1013
- ), $atts );
 
 
1014
 
1015
  $themes = array(
1016
- 'theme1' => 'sm-round',
1017
- 'theme2' => 'simple-round',
1018
- 'theme3' => 'round-txt',
1019
- 'theme4' => 'round-btm-border',
1020
- 'Flat' => 'flat-button-border',
1021
- 'Circle' => 'round-icon',
1022
  'Official' => 'simple-icons',
1023
  );
1024
 
1025
-
1026
  if ( key_exists( $selected_theme['theme'], $themes ) ) {
1027
  foreach ( $themes as $key => $value ) {
1028
 
@@ -1032,7 +1029,7 @@ class SimpleSocialButtonsPR {
1032
  }
1033
  }
1034
  } else {
1035
- $theme = $this->selected_theme;
1036
  }
1037
  if ( null !== $selected_theme['order'] ) {
1038
  $selected_theme['order'] = array_flip( array_merge( array( 0 ), explode( ',', $selected_theme['order'] ) ) );
@@ -1057,18 +1054,16 @@ class SimpleSocialButtonsPR {
1057
 
1058
  // if ( $this->inline['share_counts'] ) {
1059
  if ( $selected_theme['counter'] == 'true' ) {
1060
- $show_count = true;
1061
  $extra_class .= ' ssb_counter-activate';
1062
  } else {
1063
  $show_count = false;
1064
  }
1065
 
1066
-
1067
  $extra_class .= ' simplesocialbuttons-inline-' . $this->_get_settings( 'inline', 'animation', 'no-animation' );
1068
 
1069
  $ssb_buttons_code = $this->generate_buttons_short_code( $theme, $selected_theme['order'], $this->selected_networks, $show_count, $show_total, $extra_class );
1070
 
1071
-
1072
  }
1073
 
1074
  return $ssb_buttons_code;
@@ -1076,15 +1071,15 @@ class SimpleSocialButtonsPR {
1076
  }
1077
 
1078
  /**
1079
- * Generate buttons html code with specified order for short code
1080
- * @since 2.0.2
1081
- *
1082
- * @param mixed $order - order of social buttons
1083
- */
 
1084
  function generate_buttons_short_code( $short_code_theme, $short_code_order, $order = null, $show_count = false, $show_total = false, $extra_class = '' ) {
1085
 
1086
- //googleplus,fbshare,twitter,pinterest,whatsapp,viber,reddit,linkedin,messenger,email,print
1087
-
1088
  // define empty buttons code to use
1089
  $ssb_buttonscode = '';
1090
 
@@ -1093,13 +1088,12 @@ class SimpleSocialButtonsPR {
1093
  $title = urlencode( get_the_title() );
1094
  $post_id = get_the_id();
1095
 
1096
- if( false == $permalink ) {
1097
  $permalink = get_site_url();
1098
  $title = get_bloginfo( 'name' );
1099
  $post_id = 0;
1100
  }
1101
 
1102
-
1103
  // Sorting the buttons
1104
  $arrButtons = array();
1105
  if ( $short_code_order == null ) {
@@ -1110,7 +1104,6 @@ class SimpleSocialButtonsPR {
1110
  $arrButtons[ $button_name ] = $order[ $button_name ];
1111
  }
1112
  }
1113
-
1114
  } else {
1115
 
1116
  foreach ( $this->arrKnownButtons as $button_name ) {
@@ -1118,7 +1111,6 @@ class SimpleSocialButtonsPR {
1118
  $arrButtons[ $button_name ] = $short_code_order[ $button_name ];
1119
  }
1120
  }
1121
-
1122
  }
1123
  // echo '<pre>'; print_r( $arrButtons ); echo '</pre>';
1124
  @asort( $arrButtons );
@@ -1130,23 +1122,23 @@ class SimpleSocialButtonsPR {
1130
 
1131
  $non_exist_post_record = false;
1132
  // special case if post id not exist for example short code run on widget out side the loop in archive page and old counts not exsist
1133
- if( 0 == $post_id ) {
1134
  $non_exist_post_record = get_option( 'ssb_not_exist_post_old_counts' );
1135
  }
1136
 
1137
  // Reset the cache timestamp if needed
1138
  // if false fetch the new share counts.
1139
- if ( ( isset( $this->settings['cache'] ) && $this->settings['cache'] == 'off' ) || ( ! $non_exist_post_record) ) {
1140
 
1141
- $_share_links = array();
1142
  $_alt_share_links = array();
1143
  foreach ( $arrButtons as $social_name => $priority ) {
1144
- if ( 'totalshare' == $social_name || 'viber' == $social_name || 'fblike' == $social_name || 'whatsapp' == $social_name || 'print' == $social_name || 'email' == $social_name || 'messenger' == $social_name) {
1145
  continue;
1146
  }
1147
  $_share_links[ $social_name ] = call_user_func( 'ssb_' . $social_name . '_generate_link', $permalink );
1148
- $url = $this->http_or_https_resolve_url( $permalink );
1149
- //get alt hurl to cover http or https issue
1150
  $_alt_share_links[ $social_name ] = call_user_func( 'ssb_' . $social_name . '_generate_link', $url );
1151
  }
1152
 
@@ -1169,7 +1161,7 @@ class SimpleSocialButtonsPR {
1169
  <span class="icon"><svg version="1.1" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMid meet" width="30px" height="18px" viewBox="-10 -6 60 36" class="ozWidgetRioButtonSvg_ ozWidgetRioButtonPlusOne_"><path d="M30 7h-3v4h-4v3h4v4h3v-4h4v-3h-4V7z"></path><path d="M11 9.9v4h5.4C16 16.3 14 18 11 18c-3.3 0-5.9-2.8-5.9-6S7.7 6 11 6c1.5 0 2.8.5 3.8 1.5l2.9-2.9C15.9 3 13.7 2 11 2 5.5 2 1 6.5 1 12s4.5 10 10 10c5.8 0 9.6-4.1 9.6-9.8 0-.7-.1-1.5-.2-2.2H11z"></path></svg></span>
1170
  <span class="simplesocialtxt">Google Plus </span>';
1171
  if ( $show_count ) {
1172
- $_html .= '<span class="ssb_counter">'. $googleplus_share .'</span>';
1173
  }
1174
  $_html .= '</button>';
1175
  } else {
@@ -1194,13 +1186,14 @@ class SimpleSocialButtonsPR {
1194
  <span class="simplesocialtxt">Share </span>';
1195
 
1196
  if ( $show_count ) {
1197
- $_html .= ' <span class="ssb_counter">'. $fbshare_share .'</span>';;
 
1198
  }
1199
 
1200
  $_html .= ' </button>';
1201
- } else{
1202
 
1203
- $_html = '<button class="simplesocial-fb-share" target="_blank" data-href="https://www.facebook.com/sharer/sharer.php?u=' . $permalink . '" onclick="javascript:window.open(this.dataset.href, \'\', \'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600\');return false;"><span class="simplesocialtxt">Facebook </span> ';
1204
 
1205
  if ( $show_count ) {
1206
  $_html .= '<span class="ssb_counter ssb_fbshare_counter">' . $fbshare_share . '</span>';
@@ -1221,14 +1214,13 @@ class SimpleSocialButtonsPR {
1221
  <span class="icon"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 72 72"><path fill="none" d="M0 0h72v72H0z"/><path class="icon" fill="#fff" d="M68.812 15.14c-2.348 1.04-4.87 1.744-7.52 2.06 2.704-1.62 4.78-4.186 5.757-7.243-2.53 1.5-5.33 2.592-8.314 3.176C56.35 10.59 52.948 9 49.182 9c-7.23 0-13.092 5.86-13.092 13.093 0 1.026.118 2.02.338 2.98C25.543 24.527 15.9 19.318 9.44 11.396c-1.125 1.936-1.77 4.184-1.77 6.58 0 4.543 2.312 8.552 5.824 10.9-2.146-.07-4.165-.658-5.93-1.64-.002.056-.002.11-.002.163 0 6.345 4.513 11.638 10.504 12.84-1.1.298-2.256.457-3.45.457-.845 0-1.666-.078-2.464-.23 1.667 5.2 6.5 8.985 12.23 9.09-4.482 3.51-10.13 5.605-16.26 5.605-1.055 0-2.096-.06-3.122-.184 5.794 3.717 12.676 5.882 20.067 5.882 24.083 0 37.25-19.95 37.25-37.25 0-.565-.013-1.133-.038-1.693 2.558-1.847 4.778-4.15 6.532-6.774z"/></svg></span>';
1222
 
1223
  if ( $show_count ) {
1224
- $_html .= '<span class="simplesocialtxt">Tweet '. $twitter_share .'</span>';
1225
- } else{
1226
  $_html .= '<span class="simplesocialtxt">Tweet </span>';
1227
 
1228
  }
1229
 
1230
- $_html .= '</button>';
1231
-
1232
 
1233
  } else {
1234
 
@@ -1254,7 +1246,7 @@ class SimpleSocialButtonsPR {
1254
  <span class="simplesocialtxt">Share</span>';
1255
 
1256
  if ( $show_count ) {
1257
- $_html .= ' <span class="ssb_counter">'. $linkedin_share .'</span>';
1258
  }
1259
  $_html .= ' </button>';
1260
  } else {
@@ -1279,7 +1271,7 @@ class SimpleSocialButtonsPR {
1279
  <span class="icon"> <svg xmlns="http://www.w3.org/2000/svg" height="30px" width="30px" viewBox="-1 -1 31 31"><g><path d="M29.449,14.662 C29.449,22.722 22.868,29.256 14.75,29.256 C6.632,29.256 0.051,22.722 0.051,14.662 C0.051,6.601 6.632,0.067 14.75,0.067 C22.868,0.067 29.449,6.601 29.449,14.662" fill="#fff" stroke="#fff" stroke-width="1"></path><path d="M14.733,1.686 C7.516,1.686 1.665,7.495 1.665,14.662 C1.665,20.159 5.109,24.854 9.97,26.744 C9.856,25.718 9.753,24.143 10.016,23.022 C10.253,22.01 11.548,16.572 11.548,16.572 C11.548,16.572 11.157,15.795 11.157,14.646 C11.157,12.842 12.211,11.495 13.522,11.495 C14.637,11.495 15.175,12.326 15.175,13.323 C15.175,14.436 14.462,16.1 14.093,17.643 C13.785,18.935 14.745,19.988 16.028,19.988 C18.351,19.988 20.136,17.556 20.136,14.046 C20.136,10.939 17.888,8.767 14.678,8.767 C10.959,8.767 8.777,11.536 8.777,14.398 C8.777,15.513 9.21,16.709 9.749,17.359 C9.856,17.488 9.872,17.6 9.84,17.731 C9.741,18.141 9.52,19.023 9.477,19.203 C9.42,19.44 9.288,19.491 9.04,19.376 C7.408,18.622 6.387,16.252 6.387,14.349 C6.387,10.256 9.383,6.497 15.022,6.497 C19.555,6.497 23.078,9.705 23.078,13.991 C23.078,18.463 20.239,22.062 16.297,22.062 C14.973,22.062 13.728,21.379 13.302,20.572 C13.302,20.572 12.647,23.05 12.488,23.657 C12.193,24.784 11.396,26.196 10.863,27.058 C12.086,27.434 13.386,27.637 14.733,27.637 C21.95,27.637 27.801,21.828 27.801,14.662 C27.801,7.495 21.95,1.686 14.733,1.686" fill="#bd081c"></path></g></svg> </span>
1280
  <span class="simplesocialtxt">Save</span>';
1281
  if ( $show_count ) {
1282
- $_html .= '<span class="ssb_counter">'. $pinterest_share .'</span>';
1283
  }
1284
  $_html .= ' </button>';
1285
  } else {
@@ -1310,12 +1302,12 @@ class SimpleSocialButtonsPR {
1310
  xml:space="preserve"> <g> <path id="reddit" d="M307.523,231.062c1.11,2.838,1.614,5.769,1.614,8.681c0,5.862-2.025,11.556-5.423,16.204 c-3.36,4.593-8.121,8.158-13.722,9.727h0.01c-0.047,0.019-0.094,0.019-0.117,0.037c-0.023,0-0.061,0.019-0.079,0.019 c-2.623,0.896-5.312,1.316-7.98,1.316c-6.254,0-12.396-2.254-17.306-6.096c-4.872-3.826-8.56-9.324-9.717-15.845h-0.01 c0-0.019,0-0.042-0.009-0.069c0-0.019,0-0.038-0.019-0.065h0.019c-0.364-1.681-0.551-3.36-0.551-5.021 c0-5.647,1.923-11.07,5.097-15.551c3.164-4.453,7.626-7.99,12.848-9.811c0.019,0,0.038-0.01,0.038-0.01 c0.027,0,0.027-0.027,0.051-0.027c2.954-1.092,6.072-1.639,9.157-1.639c5.619,0,11.154,1.704,15.821,4.821 c4.611,3.066,8.354,7.561,10.23,13.143c0.019,0.037,0.019,0.07,0.037,0.103c0,0.037,0.019,0.057,0.037,0.084H307.523z M290.329,300.349c-2.202-1.428-4.751-2.291-7.448-2.291c-2.175,0-4.434,0.621-6.445,1.955l0,0 c-19.004,11.342-41.355,17.558-63.547,17.558c-16.65,0-33.199-3.514-48.192-10.879l-0.077-0.037l-0.075-0.028 c-2.261-0.924-4.837-2.889-7.647-4.76c-1.428-0.925-2.919-1.844-4.574-2.521c-1.633-0.695-3.447-1.181-5.386-1.181 c-1.605,0-3.292,0.359-4.957,1.115c-0.086,0.033-0.168,0.065-0.252,0.098h0.009c-2.616,0.999-4.66,2.829-5.974,4.994 c-1.372,2.23-2.046,4.826-2.046,7.411c0,2.334,0.551,4.667,1.691,6.786c1.085,2.007,2.754,3.762,4.938,4.938 c21.429,14.454,46.662,21.002,71.992,20.979c22.838,0,45.814-5.287,66.27-14.911l0.107-0.065l0.103-0.056 c2.697-1.597,6.282-3.029,9.661-5.115c1.671-1.064,3.304-2.296,4.704-3.897c1.4-1.591,2.525-3.551,3.16-5.875v-0.01 c0.266-1.026,0.392-2.025,0.392-3.024c0-1.899-0.467-3.701-1.241-5.32C294.361,303.775,292.504,301.778,290.329,300.349z M139.875,265.589c0.037,0,0.086,0.014,0.128,0.037c2.735,0.999,5.554,1.493,8.345,1.493c6.963,0,13.73-2.852,18.853-7.5 c5.115-4.662,8.618-11.257,8.618-18.775c0-0.196,0-0.392-0.009-0.625c0.019-0.336,0.028-0.705,0.028-1.083 c0-7.458-3.456-14.08-8.522-18.762c-5.085-4.686-11.836-7.551-18.825-7.551c-1.867,0-3.769,0.219-5.628,0.653 c-0.028,0-0.049,0.009-0.077,0.009c0,0-0.019,0-0.028,0c-9.252,1.937-17.373,8.803-20.37,18.248l0,0v0.01 c0,0.019-0.009,0.037-0.009,0.037c-0.861,2.586-1.262,5.255-1.262,7.896c0,5.787,1.913,11.426,5.211,16.064 c3.269,4.56,7.894,8.145,13.448,9.819C139.816,265.561,139.835,265.571,139.875,265.589z M430.033,198.094v0.038 c0.066,0.94,0.084,1.878,0.084,2.81c0,10.447-3.351,20.493-8.941,29.016c-5.218,7.976-12.414,14.649-20.703,19.177 c0.532,4.158,0.84,8.349,0.84,12.526c-0.01,22.495-7.766,44.607-21.272,62.329v0.009h-0.028 c-24.969,33.216-63.313,52.804-102.031,62.684h-0.01l-0.027,0.023c-20.647,5.013-41.938,7.574-63.223,7.574 c-31.729,0-63.433-5.722-93.018-17.585l-0.009-0.028h-0.028c-30.672-12.643-59.897-32.739-77.819-62.184 c-9.642-15.71-14.935-34.141-14.935-52.659c0-4.19,0.283-8.387,0.843-12.536c-8.072-4.545-15.063-10.99-20.255-18.687 c-5.542-8.266-9.056-17.95-9.5-28.187v-0.04v-0.037v-0.082c0.009-14.337,6.237-27.918,15.915-37.932 c9.677-10.011,22.896-16.554,37.075-16.554c0.196,0,0.392,0,0.588,0c1.487-0.101,2.987-0.159,4.488-0.159 c7.122,0,14.26,1.153,21.039,3.752l0.037,0.028l0.038,0.012c5.787,2.437,11.537,5.377,16.662,9.449 c1.661-0.871,3.472-1.851,5.504-2.625c31.064-18.395,67.171-25.491,102.358-27.538c0.306-17.431,2.448-35.68,10.949-51.65 c7.08-13.269,19.369-23.599,34-27.179l0.061-0.03l0.079-0.009c5.573-1.078,11.192-1.575,16.774-1.575 c14.869,0,29.561,3.521,43.31,9.017c6.086-9.185,14.776-16.354,24.97-20.375l0.098-0.056l0.098-0.037 c5.983-1.864,12.303-2.954,18.646-2.954c6.692,0,13.437,1.223,19.756,4.046v-0.023c0.009,0.023,0.019,0.023,0.019,0.023 c0.047,0.016,0.084,0.044,0.116,0.044c9.059,3.489,16.727,9.937,22.164,17.95c5.442,8.048,8.644,17.688,8.644,27.599 c0,1.827-0.103,3.657-0.317,5.489l-0.019,0.037c0,0.028,0,0.068-0.01,0.096c-1.063,12.809-7.551,24.047-16.736,32.063 c-9.24,8.048-21.207,12.909-33.49,12.909c-1.97,0-3.958-0.11-5.937-0.374c-12.182-0.931-23.541-6.826-31.886-15.595 c-8.373-8.755-13.768-20.453-13.768-33.08c0-0.611,0.056-1.237,0.074-1.843c-11.435-5.092-23.578-9.316-35.646-9.306 c-1.746,0-3.491,0.096-5.237,0.273h-0.019c-9.035,0.871-17.436,6.566-21.506,14.757v0.009v0.028 c-6.179,12.034-7.411,26.101-7.598,40.064c34.639,2.259,69.483,10.571,100.043,28.138h0.047l0.438,0.259 c0.579,0.343,1.652,0.931,2.623,1.449c2.101-1.704,4.322-3.456,6.856-4.966c9.264-6.17,20.241-9.238,31.223-9.238 c4.872,0,9.749,0.621,14.481,1.834h0.019l0.196,0.058c0.07,0.01,0.121,0.033,0.178,0.033v0.009 c11.183,2.845,21.3,9.267,28.917,17.927c7.612,8.674,12.731,19.648,13.73,31.561v0.025H430.033z M328.002,84.733 c0,0.469,0.01,0.95,0.057,1.44v0.028v0.056c0.224,6.018,3.065,11.619,7.383,15.756c4.34,4.14,10.1,6.702,15.942,6.725h0.08h0.079 c0.42,0.033,0.85,0.033,1.26,0.033c5.899,0.009,11.752-2.532,16.148-6.655c4.405-4.144,7.309-9.78,7.542-15.849l0.009-0.028v-0.037 c0.038-0.464,0.057-0.903,0.057-1.377c0-6.247-2.922-12.202-7.496-16.612c-4.555-4.406-10.688-7.136-16.735-7.12 c-1.951,0-3.884,0.266-5.778,0.854l-0.065,0.005l-0.056,0.023c-4.984,1.295-9.656,4.368-13.012,8.449 C330.046,74.486,328.002,79.508,328.002,84.733z M72.312,177.578c-4.63-2.156-9.418-3.696-14.15-3.676 c-0.794,0-1.597,0.047-2.39,0.133h-0.11l-0.11,0.014c-6.795,0.187-13.653,3.15-18.801,7.899 c-5.152,4.732-8.559,11.122-8.821,18.167v0.065l-0.012,0.058c-0.046,0.57-0.065,1.137-0.065,1.683 c0,4.345,1.333,8.545,3.593,12.368c1.673,2.847,3.867,5.441,6.348,7.701C45.735,204.602,58.142,189.845,72.312,177.578z M374.066,262.635c0-15.5-5.592-31.069-14.646-43.604c-18.053-25.119-46.055-41.502-75.187-50.636l-0.205-0.072 c-5.592-1.715-11.238-3.234-16.933-4.534c-17.025-3.876-34.48-5.806-51.917-5.806c-23.414,0-46.827,3.465-69.245,10.379 c-29.125,9.243-57.221,25.51-75.233,50.71v0.019c-9.129,12.587-14.475,28.208-14.475,43.763c0,5.727,0.716,11.453,2.23,17.025 l0.019,0.01c3.278,12.508,9.689,23.671,17.989,33.393c8.295,9.745,18.472,18.058,29.176,24.839c2.371,1.47,4.751,2.87,7.187,4.237 c31.094,17.356,66.898,24.964,102.445,24.964c6.012,0,12.06-0.214,18.033-0.644c35.797-2.959,71.742-13.525,100.8-35.115 l0.01-0.023c9.25-6.837,17.818-15.112,24.595-24.525c6.805-9.418,11.789-19.947,14.002-31.382V275.6l0.009-0.01 C373.627,271.32,374.066,266.985,374.066,262.635z M402.32,200.95c-0.009-3.762-0.868-7.507-2.753-11l-0.047-0.044l-0.019-0.056 c-2.521-5.19-6.479-9.11-11.248-11.782c-4.77-2.69-10.352-4.056-15.952-4.056c-5.063,0-10.1,1.132-14.57,3.379 c14.216,12.344,26.687,27.179,34.746,44.636c2.595-2.259,4.808-5.018,6.464-8.084C401.098,209.92,402.32,205.405,402.32,200.95z"/></svg></span>
1311
  <span class="simplesocialtxt">reddit </span>';
1312
  if ( $show_count ) {
1313
- $_html .= '<span class="ssb_counter">'. $reddit_score .'</span>';
1314
  }
1315
 
1316
- $_html .= '</button>';
1317
  } else {
1318
- $_html = '<button class="simplesocial-reddit-share" data-href="https://reddit.com/submit?url=' . $permalink . '&title=' . $title . '" onclick="javascript:window.open(this.dataset.href, \'\', \'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600\');return false;" ><span class="simplesocialtxt">Reddit</span> ';
1319
 
1320
  if ( $show_count ) {
1321
  $_html .= '<span class="ssb_counter ssb_reddit_counter">' . $reddit_score . '</span>';
@@ -1357,38 +1349,38 @@ class SimpleSocialButtonsPR {
1357
 
1358
  break;
1359
 
1360
- case 'messenger':
1361
- $link = urlencode( $permalink );
1362
- $messenger_share_url = $this->is_mobile() ? "fb-messenger://share/?link=$link?app_id=$this->fb_app_id" : "http://www.facebook.com/dialog/send?app_id=$this->fb_app_id&redirect_uri=$link&link=$link&display=popup";
1363
 
1364
- if ( $this->selected_theme == 'simple-icons' ) {
1365
- $arrButtonsCode[] = '<button onclick="javascript:window.open(this.dataset.href, \'_blank\', \'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600\' );return false;" class="simplesocial-viber-share ssb_msng-icon" data-href='. $messenger_share_url .'>
1366
  <span class="icon"> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="18px" height="19px" viewBox="-889.5 1161 18 19" enable-background="new -889.5 1161 18 19" xml:space="preserve">
1367
  <path opacity="0.99" fill="#FFFFFF" enable-background="new " d="M-880.5,1161c-5,0-9,3.8-9,8.5c0,2.4,1,4.5,2.7,6v4.5l3.8-2.3 c0.8,0.2,1.6,0.3,2.5,0.3c5,0,9-3.8,9-8.5S-875.5,1161-880.5,1161z M-879.6,1172.2l-2.4-2.4l-4.3,2.4l4.7-5.2l2.4,2.4l4.2-2.4 L-879.6,1172.2z"/>
1368
  </svg> </span>
1369
  <span class="simplesocialtxt">Messenger</span>
1370
  </button>';
1371
- } else {
1372
 
1373
- $arrButtonsCode[] = '<button class="simplesocial-msng-share" onclick="javascript:window.open( this.dataset.href, \'_blank\', \'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600\' );return false;" data-href="'. $messenger_share_url .'" ><span class="simplesocialtxt">Messenger</span></button> ';
1374
- }
1375
 
1376
- break;
1377
- case 'email':
1378
- if ( $this->selected_theme == 'simple-icons' ) {
1379
- $arrButtonsCode[] = ' <button onclick="javascript:window.location.href = this.dataset.href;return false;" class="ssb_email-icon simplesocial-email-share" data-href="mailto:?subject='. $title .'&body='. $permalink .'"><span class="simplesocialtxt">
1380
  <span class="icon"> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="16px" height="11.9px" viewBox="-1214.1 1563.9 16 11.9" enable-background="new -1214.1 1563.9 16 11.9" xml:space="preserve">
1381
  <path d="M-1214.1,1565.2v1l8,4l8-4v-1c0-0.7-0.6-1.3-1.3-1.3h-13.4C-1213.5,1563.9-1214.1,1564.4-1214.1,1565.2z M-1214.1,1567.4v7.1c0,0.7,0.6,1.3,1.3,1.3h13.4c0.7,0,1.3-0.6,1.3-1.3v-7.1l-8,4L-1214.1,1567.4z"/> </svg> </span>
1382
  <span class="simplesocialtxt">Email</span>
1383
  </button>';
1384
- } else {
1385
-
1386
- $arrButtonsCode[] = '<button onclick="javascript:window.location.href = this.dataset.href;return false;" class="simplesocial-email-share" data-href="mailto:?subject='. $title .'&body='. $permalink .'"><span class="simplesocialtxt">Email</span></button>';
1387
- }
1388
- break;
1389
- case 'print':
1390
- if ( $this->selected_theme == 'simple-icons' ) {
1391
- $arrButtonsCode[] = ' <button onclick="javascript:window.print();return false;" class="ssb_print-icon simplesocial-email-share" ><span class="simplesocialtxt">
1392
  <span class="icon"> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Layer_1" x="0px" y="0px" width="16px" height="13.7px" viewBox="-1296.9 1876.4 16 13.7" enable-background="new -1296.9 1876.4 16 13.7" xml:space="preserve"><g>
1393
  <path fill="#FFFFFF" d="M-1288.9,1879.7c2.3,0,4.6,0,6.9,0c0.4,0,0.7,0.1,0.9,0.5c0.1,0.2,0.1,0.4,0.1,0.6c0,1.7,0,3.4,0,5.1 c0,0.7-0.4,1.1-1.1,1c-0.6,0-1.2,0-1.8,0c-0.1,0-0.2,0-0.2,0.2c0,0.7,0,1.4,0,2c0,0.6-0.4,1-1,1c-0.1,0-0.3,0-0.4,0 c-2.5,0-4.9,0-7.4,0c-0.3,0-0.5,0-0.8-0.1c-0.3-0.2-0.5-0.5-0.5-0.9c0-0.7,0-1.4,0-2c0-0.2-0.1-0.2-0.2-0.2c-0.6,0-1.2,0-1.7,0 c-0.7,0-1-0.4-1-1c0-1.7,0-3.4,0-5.1c0-0.4,0.2-0.8,0.6-0.9c0.2-0.1,0.3-0.1,0.5-0.1C-1293.5,1879.7-1291.2,1879.7-1288.9,1879.7z M-1288.9,1884.9C-1288.9,1884.9-1288.9,1884.9-1288.9,1884.9c-1.4,0-2.8,0-4.2,0c-0.1,0-0.2,0-0.2,0.2c0,0.3,0,0.7,0,1 c0,1,0,2,0,3c0,0.3,0.1,0.4,0.4,0.4c2.5,0,5.1,0,7.6,0c0.1,0,0.3,0,0.4,0c0.2,0,0.3-0.2,0.3-0.3c0-1.3,0-2.7,0-4 c0-0.2,0-0.2-0.2-0.2C-1286.1,1884.9-1287.5,1884.9-1288.9,1884.9z M-1284.2,1882.4c0.4,0,0.7-0.3,0.7-0.7c0-0.4-0.3-0.7-0.8-0.7 c-0.4,0-0.7,0.3-0.7,0.7C-1284.9,1882.1-1284.6,1882.4-1284.2,1882.4z"/>
1394
  <path fill="#FFFFFF" d="M-1283.9,1879c-0.2,0-0.4,0-0.5,0c-3.1,0-6.2,0-9.3,0c-0.1,0-0.2,0-0.2-0.2c0-0.5,0-1,0-1.5 c0-0.5,0.4-1,0.9-1c0.1,0,0.2,0,0.3,0c2.6,0,5.2,0,7.8,0c0.6,0,1,0.4,1,1c0,0.5,0,0.9,0,1.4 C-1283.9,1878.9-1283.9,1879-1283.9,1879z"/>
@@ -1397,11 +1389,11 @@ class SimpleSocialButtonsPR {
1397
  </g></svg></span>
1398
  <span class="simplesocialtxt">Print</span>
1399
  </button>';
1400
- } else {
1401
 
1402
- $arrButtonsCode[] = '<button onclick="javascript:window.print();return false;" class="simplesocial-print-share" ><span class="simplesocialtxt">Print</span></button>';
1403
- }
1404
- break;
1405
  }
1406
  }
1407
 
@@ -1418,50 +1410,50 @@ class SimpleSocialButtonsPR {
1418
 
1419
 
1420
  /**
1421
- * Add Meta Tags
1422
- *
1423
- * @param int $post_id
1424
- * @since 2.0.9
1425
- * @return string
1426
- */
1427
  function add_meta_tags() {
1428
 
1429
  if ( class_exists( 'Jetpack' ) ) { // Check jetpack active.
1430
  return;
1431
- } else if( defined( 'WPSEO_VERSION' ) ) { // Check Yoast active.
1432
  return;
1433
  }
1434
- $og_tag = '';
1435
- $og_tag .= PHP_EOL . '<!-- Open Graph Meta Tags generated by Simple Social Buttons ' . $this->pluginVersion . ' -->' . PHP_EOL;
1436
- if ($this->og_get_title()) {
1437
- $og_tag .= '<meta property="og:title" content="'. get_the_title() ." - ". get_bloginfo( 'name' ) .'" />' . PHP_EOL;
1438
  }
1439
 
1440
  if ( $this->og_get_description() ) {
1441
- $og_tag .= '<meta property="og:description" content="'. $this->og_get_description() .'" />' . PHP_EOL;
1442
  }
1443
- $og_tag .= '<meta property="og:url" content="'. get_permalink() .'" />' . PHP_EOL;
1444
  if ( $this->og_get_blog() ) {
1445
- $og_tag .= '<meta property="og:site_name" content="'. $this->og_get_blog() .'" />' . PHP_EOL;
1446
  }
1447
  $og_tag .= $this->get_og_image();
1448
 
1449
  $og_tag .= '<meta name="twitter:card" content="summary_large_image" />' . PHP_EOL;
1450
  if ( $this->og_get_description() ) {
1451
- $og_tag .= '<meta name="twitter:description" content="'. $this->get_excerpt_by_id( get_the_id() ) .'" />' . PHP_EOL;
1452
  }
1453
 
1454
  if ( $this->og_get_title() ) {
1455
- $og_tag .= '<meta name="twitter:title" content="'. get_the_title() ." - ". get_bloginfo( 'name' ) .'" />' . PHP_EOL;
1456
  }
1457
  $og_tag .= $this->generate_twitter_image();
1458
 
1459
- echo apply_filters( 'ssb_og_tag', $og_tag );
1460
- }
1461
 
1462
 
1463
  function og_get_title() {
1464
- return get_the_title() ." - ". get_bloginfo( 'name' );
1465
  }
1466
 
1467
  function og_get_description() {
@@ -1469,145 +1461,146 @@ class SimpleSocialButtonsPR {
1469
  }
1470
 
1471
  function og_get_blog() {
1472
- return get_bloginfo( 'name' ) ;
1473
  }
1474
 
1475
 
1476
  /**
1477
- * Get the excerpt
1478
- *
1479
- * @param int $post_id
1480
- * @since 2.0.9
1481
- * @return string
1482
- */
1483
- function get_excerpt_by_id( $post_id ) {
1484
-
1485
- if( ! $post_id )
1486
- return;
1487
- // Check if the post has an excerpt
1488
- if( has_excerpt() ) {
1489
- $excerpt_length = apply_filters( 'excerpt_length', 35 );
1490
- return trim( get_the_excerpt() );
1491
- }
1492
-
1493
- $the_post = get_post( $post_id ); //Gets post ID
1494
- $the_excerpt = $the_post->post_content; //Gets post_content to be used as a basis for the excerpt
1495
- $excerpt_length = 60; //Sets excerpt length by words
1496
- $the_excerpt = strip_tags( strip_shortcodes( $the_excerpt ) ); //Strips tags and images
1497
- $words = explode( ' ', $the_excerpt, $excerpt_length + 1 );
1498
- if( count( $words ) > $excerpt_length ) {
1499
- array_pop( $words );
1500
- $the_excerpt = implode( ' ', $words );
1501
- }
1502
-
1503
- return trim( wp_strip_all_tags( $the_excerpt ) );
1504
- }
1505
-
1506
- /**
1507
- * Get Image from content.
1508
  *
1509
- * @since 2.0.10
 
 
1510
  */
1511
- public function get_content_images( $post ) {
1512
 
1513
- if( ! $post )
1514
- return;
 
 
 
 
 
 
1515
 
1516
- $content = $post->post_content;
1517
- $images = '';
1518
- if ( preg_match_all( '`<img [^>]+>`', $content, $matches ) ) {
1519
- foreach ( $matches[0] as $img ) {
1520
- if ( preg_match( '`src=(["\'])(.*?)\1`', $img, $match ) ) {
1521
- $images .= '<meta property="og:image" content="' . $match[2] . '" />' . PHP_EOL;
1522
- }
1523
- }
1524
- }
1525
- return $images;
1526
- }
1527
 
 
 
1528
 
1529
  /**
1530
- * Get the featured image.
1531
- *
1532
- * @since 2.0.10
1533
- */
1534
- public function generate_og_image() {
1535
- $_post_id = get_the_ID();
1536
 
1537
- if ( has_post_thumbnail( $_post_id ) ) {
1538
- return '<meta property="og:image" content="' . wp_get_attachment_url( get_post_thumbnail_id( get_the_ID() ) ) . '" />' . PHP_EOL ;
1539
- }
 
 
 
 
 
 
 
 
 
 
 
 
1540
 
1541
- return $this->get_content_images( get_post( $_post_id ) );
1542
- }
1543
 
1544
  /**
1545
- * Get Open Graph image.
1546
- *
1547
- * @since 2.0.10
1548
- */
1549
- public function get_og_image() {
1550
- $image = $this->generate_og_image() ;
 
 
 
 
1551
 
1552
- if ( $image ) {
1553
- return $image;
1554
- }
1555
- }
1556
 
1557
  /**
1558
- * Get the featured image for Twitter.
1559
- *
1560
- * @since 2.0.10
1561
- */
1562
- public function generate_twitter_image() {
1563
- $_post_id = get_the_ID();
 
 
 
 
 
1564
 
1565
- if ( has_post_thumbnail( $_post_id ) ) {
1566
- return '<meta property="twitter:image" content="' . wp_get_attachment_url( get_post_thumbnail_id( get_the_ID() ) ) . '" />' . PHP_EOL ;
1567
- }
 
 
 
 
 
 
 
 
1568
 
1569
- return $this->get_twitter_content_images( get_post( $_post_id ) );
1570
- }
1571
 
1572
  /**
1573
- * Get Image from content for Twitter.
1574
- *
1575
- * @since 2.0.10
1576
- */
1577
- public function get_twitter_content_images( $post ) {
1578
-
1579
- if ( ! $post ) {
1580
- return;
1581
- }
1582
-
1583
- $content = $post->post_content;
1584
- $images = '';
1585
- if ( preg_match_all( '`<img [^>]+>`', $content, $matches ) ) {
1586
- foreach ( $matches[0] as $img ) {
1587
- if ( preg_match( '`src=(["\'])(.*?)\1`', $img, $match ) ) {
1588
- $images .= '<meta property="twitter:image" content="' . $match[2] . '" />' . PHP_EOL;
1589
- }
1590
- }
1591
- }
1592
- return $images;
1593
- }
1594
 
1595
  /**
1596
- * User to convert http to https or vice versa
1597
- * @since 2.0.12
1598
- * @param $url
1599
- * @return url
1600
- */
1601
- public function http_or_https_resolve_url( $url ){
1602
-
1603
- $arr_parsed_url = parse_url($url);
1604
- if ( ! empty($arr_parsed_url['scheme'] ) ) {
1605
- if ( "http" === $arr_parsed_url['scheme'] )
1606
- {
1607
- return $url = str_replace( 'http', 'https', $url );
1608
- } else if ( "https" === $arr_parsed_url['scheme'] )
1609
- {
1610
- return $url = str_replace( 'https', 'http', $url );
1611
  }
1612
  }
1613
  }
@@ -1617,10 +1610,11 @@ class SimpleSocialButtonsPR {
1617
  *
1618
  * @since 2.0.13
1619
  */
1620
- public function is_mobile(){
1621
 
1622
- $useragent = $_SERVER['HTTP_USER_AGENT'];
1623
- if(preg_match('/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i',$useragent)||preg_match('/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i',substr($useragent,0,4))){
 
1624
  return true;
1625
  } else {
1626
  return false;
@@ -1628,21 +1622,22 @@ class SimpleSocialButtonsPR {
1628
  }
1629
 
1630
  /**
1631
- * convert url http to https or vice versa
 
1632
  * @param $permalink
1633
  * @since 2.0.14
1634
  * @return mixed
1635
  */
1636
- function http_or_https_link_generate( $permalink ){
1637
-
1638
- foreach ( $this->arrKnownButtons as $social_name ) {
1639
- if ( 'totalshare' == $social_name || 'viber' == $social_name || 'fblike' == $social_name || 'whatsapp' == $social_name || 'print' == $social_name || 'email' == $social_name || 'messenger' == $social_name) {
1640
- continue; }
1641
- $url = $this->http_or_https_resolve_url( $permalink );
1642
- //get alt hurl to cover http or https issue
1643
- $_alt_share_links[ $social_name ] = call_user_func( 'ssb_' . $social_name . '_generate_link', $url );
1644
  }
1645
- return $_alt_share_links;
1646
  }
1647
 
1648
  } // end class
3
  * Plugin Name: Simple Social Buttons
4
  * Plugin URI: http://www.WPBrigade.com/wordpress/plugins/simple-social-buttons/
5
  * Description: Simple Social Buttons adds an advanced set of social media sharing buttons to your WordPress sites, such as: Google +1, Facebook, WhatsApp, Viber, Twitter, Reddit, LinkedIn and Pinterest. This makes it the most <code>Flexible Social Sharing Plugin ever for Everyone.</code>
6
+ * Version: 2.0.15
7
  * Author: WPBrigade
8
  * Author URI: http://www.WPBrigade.com/
9
  * Text Domain: simple-social-buttons
30
 
31
  class SimpleSocialButtonsPR {
32
  public $pluginName = 'Simple Social Buttons';
33
+ public $pluginVersion = '2.0.15';
34
  public $pluginPrefix = 'ssb_pr_';
35
  public $hideCustomMetaKey = '_ssb_hide';
36
  private $fb_app_id = '891268654262273';
90
  * Filter hooks
91
  */
92
  add_filter( 'the_content', array( $this, 'insert_buttons' ) );
93
+
94
  add_filter( 'the_excerpt', array( $this, 'insert_excerpt_buttons' ) );
95
 
96
  add_filter( 'plugin_row_meta', array( $this, '_row_meta' ), 10, 2 );
120
  function set_selected_networks() {
121
  $networks = get_option( 'ssb_networks' );
122
  $this->selected_networks = array_flip( array_merge( array( 0 ), explode( ',', $networks['icon_selection'] ) ) );
123
+ }
124
 
125
  function set_selected_theme() {
126
  $theme = get_option( 'ssb_themes' );
157
  }
158
  }
159
 
 
160
  $_share_links = array();
161
  foreach ( $order as $social_name => $priority ) {
162
  if ( 'totalshare' == $social_name || 'viber' == $social_name || 'fblike' == $social_name || 'whatsapp' == $social_name || 'print' == $social_name || 'email' == $social_name || 'messenger' == $social_name ) {
163
  continue; }
164
  $_share_links[ $social_name ] = call_user_func( 'ssb_' . $social_name . '_generate_link', get_permalink( $post_id ) );
165
+ $url = $this->http_or_https_resolve_url( get_permalink( $post_id ) );
166
+ }
167
  // http url convert to https or vice versa
168
  $_alt_share_links = $this->http_or_https_link_generate( get_permalink( $post_id ) );
169
 
184
  update_post_meta( $post_id, 'ssb_cache_timestamp', floor( ( ( date( 'U' ) / 60 ) / 60 ) ) );
185
  echo json_encode( $share_counts );
186
  wp_die();
187
+ }
188
 
189
  function ssb_output_cache_trigger( $info ) {
190
 
194
  return $info;
195
  }
196
  // if is home or front page return info
197
+ if ( is_home() || is_front_page() ) {
198
  return $info;
199
  }
200
  // Return if we're on a WooCommerce account page.
209
  ob_start();
210
 
211
  ?>
212
+ jQuery( document ).ready(function(){
213
  var ssb_admin_ajax = '<?php echo admin_url( 'admin-ajax.php' ); ?>';
214
  var is_ssb_used = jQuery('.simplesocialbuttons');
215
  var postID = <?php echo $info['postID']; ?> ;
234
 
235
  });
236
  }
237
+ });
238
  <?php
239
  $info['footer_output'] .= ob_get_clean();
240
 
403
  */
404
  function insert_excerpt_buttons( $content ) {
405
 
406
+ if ( is_single() ) {
407
  return $content;
408
  }
409
 
448
  return $content;
449
  }
450
 
451
+ if ( is_archive() && $this->_get_settings( 'inline', 'show_on_archive', '0' ) == '0' && ! is_tag() && ! is_category() ) {
452
  return $content; }
453
  if ( is_category() && $this->_get_settings( 'inline', 'show_on_category', '0' ) == '0' ) {
454
  return $content; }
455
  if ( is_tag() && $this->_get_settings( 'inline', 'show_on_tag', '0' ) == '0' ) {
456
  return $content; }
457
+ if ( is_search() && $this->_get_settings( 'inline', 'show_on_search', '0' ) == '0' ) {
458
  return $content; }
459
 
460
  // && 'false' == get_post_meta( get_the_ID(), $this->hideCustomMetaKey , true )
485
 
486
  $sharing_text = '';
487
 
488
+ if ( isset( $this->inline_option['share_title'] ) && trim( $this->inline_option['share_title'] ) != '' ) {
489
+ $sharing_text = '<span class="ssb_inline-share_heading ' . $this->_get_settings( 'inline', 'icon_alignment', 'left' ) . '">' . $this->inline_option['share_title'] . '</span>';
490
  }
491
  if ( in_array( $this->get_post_type(), $this->_get_settings( 'inline', 'posts', array() ) ) ) {
492
  if ( $this->inline_option['location'] == 'above' || $this->inline_option['location'] == 'above_below' ) {
513
  $ssb_buttonscode = '';
514
  // get post permalink and title
515
  $permalink = get_permalink();
516
+ $title = urlencode( html_entity_decode( get_the_title(), ENT_COMPAT, 'UTF-8' ) );
517
+ // $title = urlencode( get_the_title() );
518
 
519
+ // Sorting the buttons
520
  $arrButtons = array();
521
  foreach ( $this->arrKnownButtons as $button_name ) {
522
  if ( ! empty( $order[ $button_name ] ) && (int) $order[ $button_name ] != 0 ) {
526
  // echo '<pre>'; print_r( $arrButtons ); echo '</pre>';
527
  @asort( $arrButtons );
528
 
529
+ // add total share index in array.
530
  if ( $show_total ) {
531
+ $arrButtons['totalshare'] = '100'; }
532
  $post_id = get_the_id();
533
 
534
  // get the value for http or https solve options
535
  $http_solve = false;
536
+ if ( isset( $this->extra_option['http_https_resolve'] ) ) {
537
+ if ( false == get_post_meta( $post_id, 'ssb_old_counts', true ) ) {
538
  $http_solve = true;
539
  }
540
  }
541
 
542
  // Reset the cache timestamp if needed
543
  // if false fetch the new share counts.
544
+ if ( ( isset( $this->settings['cache'] ) && $this->settings['cache'] == 'off' ) || ( true == $http_solve ) ) {
545
 
546
  $_share_links = array();
547
  foreach ( $arrButtons as $social_name => $priority ) {
548
+ if ( 'totalshare' == $social_name || 'viber' == $social_name || 'fblike' == $social_name || 'whatsapp' == $social_name || 'print' == $social_name || 'email' == $social_name || 'messenger' == $social_name ) {
549
  continue; }
550
  $_share_links[ $social_name ] = call_user_func( 'ssb_' . $social_name . '_generate_link', $permalink );
551
+ }
552
  // http url convert to https or vice versa
553
  $_alt_share_links = $this->http_or_https_link_generate( $permalink );
554
 
555
+ // normal fetch
556
+ $result = ssb_fetch_shares_via_curl_multi( array_filter( $_share_links ) );
557
 
558
  // $result = ssb_fetch_shares_via_curl_multi(
559
  // array(
565
  // 'reddit' => ssb_reddit_generate_link( 'http://stackoverflow.com/q/811074/1288' )
566
  // )
567
  // );
568
+ // fetch http / https result and save in network_old_share_count meta tags
569
+ $share_counts = ssb_fetch_fresh_counts( $result, $post_id, $_alt_share_links );
 
 
570
  // update_post_meta( $post_id,'ssb_cache_timestamp',floor( ( ( date( 'U' ) / 60) / 60 ) ) );
571
+ } else {
572
+ $share_counts = ssb_fetch_cached_counts( array_flip( $arrButtons ), $post_id );
573
+ }
574
 
575
  $arrButtonsCode = array();
576
  foreach ( $arrButtons as $button_name => $button_sort ) {
583
  <span class="icon"><svg version="1.1" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMid meet" width="30px" height="18px" viewBox="-10 -6 60 36" class="ozWidgetRioButtonSvg_ ozWidgetRioButtonPlusOne_"><path d="M30 7h-3v4h-4v3h4v4h3v-4h4v-3h-4V7z"></path><path d="M11 9.9v4h5.4C16 16.3 14 18 11 18c-3.3 0-5.9-2.8-5.9-6S7.7 6 11 6c1.5 0 2.8.5 3.8 1.5l2.9-2.9C15.9 3 13.7 2 11 2 5.5 2 1 6.5 1 12s4.5 10 10 10c5.8 0 9.6-4.1 9.6-9.8 0-.7-.1-1.5-.2-2.2H11z"></path></svg></span>
584
  <span class="simplesocialtxt">Google Plus </span>';
585
  if ( $show_count ) {
586
+ $_html .= '<span class="ssb_counter">' . $googleplus_share . '</span>';
587
  }
588
  $_html .= '</button>';
589
  } else {
598
  $arrButtonsCode[] = $_html;
599
 
600
  break;
601
+ case 'fbshare':
602
  $fbshare_share = $share_counts['fbshare'] ? $share_counts['fbshare'] : 0;
603
 
604
  if ( $this->selected_theme == 'simple-icons' ) {
607
  <span class="simplesocialtxt">Share </span>';
608
 
609
  if ( $show_count ) {
610
+ $_html .= ' <span class="ssb_counter">' . $fbshare_share . '</span>';
611
  }
612
 
613
  $_html .= ' </button>';
614
+ } else {
615
 
616
+ $_html = '<button class="simplesocial-fb-share" target="_blank" data-href="https://www.facebook.com/sharer/sharer.php?u=' . $permalink . '" onclick="javascript:window.open(this.dataset.href, \'\', \'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600\');return false;"><span class="simplesocialtxt">Facebook </span> ';
617
 
618
  if ( $show_count ) {
619
  $_html .= '<span class="ssb_counter ssb_fbshare_counter">' . $fbshare_share . '</span>';
621
  $_html .= '</button>';
622
  }
623
 
624
+ $arrButtonsCode[] = $_html;
625
 
626
  break;
627
  case 'twitter':
634
  <span class="icon"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 72 72"><path fill="none" d="M0 0h72v72H0z"/><path class="icon" fill="#fff" d="M68.812 15.14c-2.348 1.04-4.87 1.744-7.52 2.06 2.704-1.62 4.78-4.186 5.757-7.243-2.53 1.5-5.33 2.592-8.314 3.176C56.35 10.59 52.948 9 49.182 9c-7.23 0-13.092 5.86-13.092 13.093 0 1.026.118 2.02.338 2.98C25.543 24.527 15.9 19.318 9.44 11.396c-1.125 1.936-1.77 4.184-1.77 6.58 0 4.543 2.312 8.552 5.824 10.9-2.146-.07-4.165-.658-5.93-1.64-.002.056-.002.11-.002.163 0 6.345 4.513 11.638 10.504 12.84-1.1.298-2.256.457-3.45.457-.845 0-1.666-.078-2.464-.23 1.667 5.2 6.5 8.985 12.23 9.09-4.482 3.51-10.13 5.605-16.26 5.605-1.055 0-2.096-.06-3.122-.184 5.794 3.717 12.676 5.882 20.067 5.882 24.083 0 37.25-19.95 37.25-37.25 0-.565-.013-1.133-.038-1.693 2.558-1.847 4.778-4.15 6.532-6.774z"/></svg></span>';
635
 
636
  if ( $show_count ) {
637
+ $_html .= '<i class="simplesocialtxt">Tweet ' . $twitter_share . '</i>';
638
+ } else {
639
  $_html .= '<i class="simplesocialtxt">Tweet </i>';
640
 
641
  }
642
 
643
+ $_html .= '</button>';
 
644
 
645
  } else {
646
 
647
+ $_html = '<button class="simplesocial-twt-share" data-href="https://twitter.com/share?text=' . $title . '&url=' . $permalink . '' . $via . '" rel="nofollow" onclick="javascript:window.open(this.dataset.href, \'\', \'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600\');return false;"><span class="simplesocialtxt">Twitter</span> ';
648
 
649
  if ( $show_count ) {
650
  $_html .= '<span class="ssb_counter ssb_twitter_counter">' . $twitter_share . '</span>';
665
  <span class="simplesocialtxt">Share</span>';
666
 
667
  if ( $show_count ) {
668
+ $_html .= ' <span class="ssb_counter">' . $linkedin_share . '</span>';
669
  }
670
  $_html .= ' </button>';
671
  } else {
690
  <span class="icon"> <svg xmlns="http://www.w3.org/2000/svg" height="30px" width="30px" viewBox="-1 -1 31 31"><g><path d="M29.449,14.662 C29.449,22.722 22.868,29.256 14.75,29.256 C6.632,29.256 0.051,22.722 0.051,14.662 C0.051,6.601 6.632,0.067 14.75,0.067 C22.868,0.067 29.449,6.601 29.449,14.662" fill="#fff" stroke="#fff" stroke-width="1"></path><path d="M14.733,1.686 C7.516,1.686 1.665,7.495 1.665,14.662 C1.665,20.159 5.109,24.854 9.97,26.744 C9.856,25.718 9.753,24.143 10.016,23.022 C10.253,22.01 11.548,16.572 11.548,16.572 C11.548,16.572 11.157,15.795 11.157,14.646 C11.157,12.842 12.211,11.495 13.522,11.495 C14.637,11.495 15.175,12.326 15.175,13.323 C15.175,14.436 14.462,16.1 14.093,17.643 C13.785,18.935 14.745,19.988 16.028,19.988 C18.351,19.988 20.136,17.556 20.136,14.046 C20.136,10.939 17.888,8.767 14.678,8.767 C10.959,8.767 8.777,11.536 8.777,14.398 C8.777,15.513 9.21,16.709 9.749,17.359 C9.856,17.488 9.872,17.6 9.84,17.731 C9.741,18.141 9.52,19.023 9.477,19.203 C9.42,19.44 9.288,19.491 9.04,19.376 C7.408,18.622 6.387,16.252 6.387,14.349 C6.387,10.256 9.383,6.497 15.022,6.497 C19.555,6.497 23.078,9.705 23.078,13.991 C23.078,18.463 20.239,22.062 16.297,22.062 C14.973,22.062 13.728,21.379 13.302,20.572 C13.302,20.572 12.647,23.05 12.488,23.657 C12.193,24.784 11.396,26.196 10.863,27.058 C12.086,27.434 13.386,27.637 14.733,27.637 C21.95,27.637 27.801,21.828 27.801,14.662 C27.801,7.495 21.95,1.686 14.733,1.686" fill="#bd081c"></path></g></svg> </span>
691
  <span class="simplesocialtxt">Save</span>';
692
  if ( $show_count ) {
693
+ $_html .= '<span class="ssb_counter">' . $pinterest_share . '</span>';
694
  }
695
  $_html .= ' </button>';
696
  } else {
710
  $total_share = $share_counts['total'] ? $share_counts['total'] : 0;
711
  $arrButtonsCode[] = "<span class='ssb_total_counter'>" . $total_share . '<span>Shares</span></span>';
712
  break;
713
+ case 'reddit':
714
  $reddit_score = $share_counts['reddit'] ? $share_counts['reddit'] : 0;
715
 
716
  if ( $this->selected_theme == 'simple-icons' ) {
720
  xml:space="preserve"> <g> <path id="reddit" d="M307.523,231.062c1.11,2.838,1.614,5.769,1.614,8.681c0,5.862-2.025,11.556-5.423,16.204 c-3.36,4.593-8.121,8.158-13.722,9.727h0.01c-0.047,0.019-0.094,0.019-0.117,0.037c-0.023,0-0.061,0.019-0.079,0.019 c-2.623,0.896-5.312,1.316-7.98,1.316c-6.254,0-12.396-2.254-17.306-6.096c-4.872-3.826-8.56-9.324-9.717-15.845h-0.01 c0-0.019,0-0.042-0.009-0.069c0-0.019,0-0.038-0.019-0.065h0.019c-0.364-1.681-0.551-3.36-0.551-5.021 c0-5.647,1.923-11.07,5.097-15.551c3.164-4.453,7.626-7.99,12.848-9.811c0.019,0,0.038-0.01,0.038-0.01 c0.027,0,0.027-0.027,0.051-0.027c2.954-1.092,6.072-1.639,9.157-1.639c5.619,0,11.154,1.704,15.821,4.821 c4.611,3.066,8.354,7.561,10.23,13.143c0.019,0.037,0.019,0.07,0.037,0.103c0,0.037,0.019,0.057,0.037,0.084H307.523z M290.329,300.349c-2.202-1.428-4.751-2.291-7.448-2.291c-2.175,0-4.434,0.621-6.445,1.955l0,0 c-19.004,11.342-41.355,17.558-63.547,17.558c-16.65,0-33.199-3.514-48.192-10.879l-0.077-0.037l-0.075-0.028 c-2.261-0.924-4.837-2.889-7.647-4.76c-1.428-0.925-2.919-1.844-4.574-2.521c-1.633-0.695-3.447-1.181-5.386-1.181 c-1.605,0-3.292,0.359-4.957,1.115c-0.086,0.033-0.168,0.065-0.252,0.098h0.009c-2.616,0.999-4.66,2.829-5.974,4.994 c-1.372,2.23-2.046,4.826-2.046,7.411c0,2.334,0.551,4.667,1.691,6.786c1.085,2.007,2.754,3.762,4.938,4.938 c21.429,14.454,46.662,21.002,71.992,20.979c22.838,0,45.814-5.287,66.27-14.911l0.107-0.065l0.103-0.056 c2.697-1.597,6.282-3.029,9.661-5.115c1.671-1.064,3.304-2.296,4.704-3.897c1.4-1.591,2.525-3.551,3.16-5.875v-0.01 c0.266-1.026,0.392-2.025,0.392-3.024c0-1.899-0.467-3.701-1.241-5.32C294.361,303.775,292.504,301.778,290.329,300.349z M139.875,265.589c0.037,0,0.086,0.014,0.128,0.037c2.735,0.999,5.554,1.493,8.345,1.493c6.963,0,13.73-2.852,18.853-7.5 c5.115-4.662,8.618-11.257,8.618-18.775c0-0.196,0-0.392-0.009-0.625c0.019-0.336,0.028-0.705,0.028-1.083 c0-7.458-3.456-14.08-8.522-18.762c-5.085-4.686-11.836-7.551-18.825-7.551c-1.867,0-3.769,0.219-5.628,0.653 c-0.028,0-0.049,0.009-0.077,0.009c0,0-0.019,0-0.028,0c-9.252,1.937-17.373,8.803-20.37,18.248l0,0v0.01 c0,0.019-0.009,0.037-0.009,0.037c-0.861,2.586-1.262,5.255-1.262,7.896c0,5.787,1.913,11.426,5.211,16.064 c3.269,4.56,7.894,8.145,13.448,9.819C139.816,265.561,139.835,265.571,139.875,265.589z M430.033,198.094v0.038 c0.066,0.94,0.084,1.878,0.084,2.81c0,10.447-3.351,20.493-8.941,29.016c-5.218,7.976-12.414,14.649-20.703,19.177 c0.532,4.158,0.84,8.349,0.84,12.526c-0.01,22.495-7.766,44.607-21.272,62.329v0.009h-0.028 c-24.969,33.216-63.313,52.804-102.031,62.684h-0.01l-0.027,0.023c-20.647,5.013-41.938,7.574-63.223,7.574 c-31.729,0-63.433-5.722-93.018-17.585l-0.009-0.028h-0.028c-30.672-12.643-59.897-32.739-77.819-62.184 c-9.642-15.71-14.935-34.141-14.935-52.659c0-4.19,0.283-8.387,0.843-12.536c-8.072-4.545-15.063-10.99-20.255-18.687 c-5.542-8.266-9.056-17.95-9.5-28.187v-0.04v-0.037v-0.082c0.009-14.337,6.237-27.918,15.915-37.932 c9.677-10.011,22.896-16.554,37.075-16.554c0.196,0,0.392,0,0.588,0c1.487-0.101,2.987-0.159,4.488-0.159 c7.122,0,14.26,1.153,21.039,3.752l0.037,0.028l0.038,0.012c5.787,2.437,11.537,5.377,16.662,9.449 c1.661-0.871,3.472-1.851,5.504-2.625c31.064-18.395,67.171-25.491,102.358-27.538c0.306-17.431,2.448-35.68,10.949-51.65 c7.08-13.269,19.369-23.599,34-27.179l0.061-0.03l0.079-0.009c5.573-1.078,11.192-1.575,16.774-1.575 c14.869,0,29.561,3.521,43.31,9.017c6.086-9.185,14.776-16.354,24.97-20.375l0.098-0.056l0.098-0.037 c5.983-1.864,12.303-2.954,18.646-2.954c6.692,0,13.437,1.223,19.756,4.046v-0.023c0.009,0.023,0.019,0.023,0.019,0.023 c0.047,0.016,0.084,0.044,0.116,0.044c9.059,3.489,16.727,9.937,22.164,17.95c5.442,8.048,8.644,17.688,8.644,27.599 c0,1.827-0.103,3.657-0.317,5.489l-0.019,0.037c0,0.028,0,0.068-0.01,0.096c-1.063,12.809-7.551,24.047-16.736,32.063 c-9.24,8.048-21.207,12.909-33.49,12.909c-1.97,0-3.958-0.11-5.937-0.374c-12.182-0.931-23.541-6.826-31.886-15.595 c-8.373-8.755-13.768-20.453-13.768-33.08c0-0.611,0.056-1.237,0.074-1.843c-11.435-5.092-23.578-9.316-35.646-9.306 c-1.746,0-3.491,0.096-5.237,0.273h-0.019c-9.035,0.871-17.436,6.566-21.506,14.757v0.009v0.028 c-6.179,12.034-7.411,26.101-7.598,40.064c34.639,2.259,69.483,10.571,100.043,28.138h0.047l0.438,0.259 c0.579,0.343,1.652,0.931,2.623,1.449c2.101-1.704,4.322-3.456,6.856-4.966c9.264-6.17,20.241-9.238,31.223-9.238 c4.872,0,9.749,0.621,14.481,1.834h0.019l0.196,0.058c0.07,0.01,0.121,0.033,0.178,0.033v0.009 c11.183,2.845,21.3,9.267,28.917,17.927c7.612,8.674,12.731,19.648,13.73,31.561v0.025H430.033z M328.002,84.733 c0,0.469,0.01,0.95,0.057,1.44v0.028v0.056c0.224,6.018,3.065,11.619,7.383,15.756c4.34,4.14,10.1,6.702,15.942,6.725h0.08h0.079 c0.42,0.033,0.85,0.033,1.26,0.033c5.899,0.009,11.752-2.532,16.148-6.655c4.405-4.144,7.309-9.78,7.542-15.849l0.009-0.028v-0.037 c0.038-0.464,0.057-0.903,0.057-1.377c0-6.247-2.922-12.202-7.496-16.612c-4.555-4.406-10.688-7.136-16.735-7.12 c-1.951,0-3.884,0.266-5.778,0.854l-0.065,0.005l-0.056,0.023c-4.984,1.295-9.656,4.368-13.012,8.449 C330.046,74.486,328.002,79.508,328.002,84.733z M72.312,177.578c-4.63-2.156-9.418-3.696-14.15-3.676 c-0.794,0-1.597,0.047-2.39,0.133h-0.11l-0.11,0.014c-6.795,0.187-13.653,3.15-18.801,7.899 c-5.152,4.732-8.559,11.122-8.821,18.167v0.065l-0.012,0.058c-0.046,0.57-0.065,1.137-0.065,1.683 c0,4.345,1.333,8.545,3.593,12.368c1.673,2.847,3.867,5.441,6.348,7.701C45.735,204.602,58.142,189.845,72.312,177.578z M374.066,262.635c0-15.5-5.592-31.069-14.646-43.604c-18.053-25.119-46.055-41.502-75.187-50.636l-0.205-0.072 c-5.592-1.715-11.238-3.234-16.933-4.534c-17.025-3.876-34.48-5.806-51.917-5.806c-23.414,0-46.827,3.465-69.245,10.379 c-29.125,9.243-57.221,25.51-75.233,50.71v0.019c-9.129,12.587-14.475,28.208-14.475,43.763c0,5.727,0.716,11.453,2.23,17.025 l0.019,0.01c3.278,12.508,9.689,23.671,17.989,33.393c8.295,9.745,18.472,18.058,29.176,24.839c2.371,1.47,4.751,2.87,7.187,4.237 c31.094,17.356,66.898,24.964,102.445,24.964c6.012,0,12.06-0.214,18.033-0.644c35.797-2.959,71.742-13.525,100.8-35.115 l0.01-0.023c9.25-6.837,17.818-15.112,24.595-24.525c6.805-9.418,11.789-19.947,14.002-31.382V275.6l0.009-0.01 C373.627,271.32,374.066,266.985,374.066,262.635z M402.32,200.95c-0.009-3.762-0.868-7.507-2.753-11l-0.047-0.044l-0.019-0.056 c-2.521-5.19-6.479-9.11-11.248-11.782c-4.77-2.69-10.352-4.056-15.952-4.056c-5.063,0-10.1,1.132-14.57,3.379 c14.216,12.344,26.687,27.179,34.746,44.636c2.595-2.259,4.808-5.018,6.464-8.084C401.098,209.92,402.32,205.405,402.32,200.95z"/></svg></span>
721
  <span class="simplesocialtxt">reddit </span>';
722
  if ( $show_count ) {
723
+ $_html .= '<span class="ssb_counter">' . $reddit_score . '</span>';
724
  }
725
 
726
+ $_html .= '</button>';
727
  } else {
728
+ $_html = '<button class="simplesocial-reddit-share" data-href="https://reddit.com/submit?url=' . $permalink . '&title=' . $title . '" onclick="javascript:window.open(this.dataset.href, \'\', \'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600\');return false;" ><span class="simplesocialtxt">Reddit</span> ';
729
 
730
  if ( $show_count ) {
731
  $_html .= '<span class="ssb_counter ssb_reddit_counter">' . $reddit_score . '</span>';
747
  $arrButtonsCode[] = '<button onclick="javascript:window.open(this.dataset.href, \'_blank\' );return false;" class="simplesocial-whatsapp-share" data-href="https://api.whatsapp.com/send?text=' . $permalink . '"><span class="simplesocialtxt">WhatsApp</span></button>';
748
  }
749
  break;
750
+ case 'viber':
751
  if ( $this->selected_theme == 'simple-icons' ) {
752
  $arrButtonsCode[] = '<button onclick="javascript:window.open(this.dataset.href, \'_self\' );return false;" class="simplesocial-viber-share ssb_viber-icon" data-href="viber://forward?text=' . $permalink . '">
753
  <span class="icon"> <svg aria-labelledby="simpleicons-viber-icon" role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title id="simpleicons-viber-icon">Viber icon</title><path d="M20.812 2.343c-.596-.549-3.006-2.3-8.376-2.325 0 0-6.331-.38-9.415 2.451C1.302 4.189.698 6.698.634 9.82.569 12.934.487 18.774 6.12 20.36h.005l-.005 2.416s-.034.979.609 1.178c.779.24 1.236-.504 1.98-1.303.409-.439.972-1.088 1.397-1.582 3.851.322 6.813-.416 7.149-.525.777-.254 5.176-.816 5.893-6.658.738-6.021-.357-9.83-2.338-11.547v.004zm.652 11.112c-.615 4.876-4.184 5.187-4.83 5.396-.285.092-2.895.738-6.164.525 0 0-2.445 2.941-3.195 3.705-.121.121-.271.166-.361.145-.135-.029-.164-.18-.164-.404l.015-4.006c-.015 0 0 0 0 0-4.771-1.336-4.485-6.301-4.425-8.91.044-2.596.538-4.726 1.994-6.167 2.611-2.371 7.997-2.012 7.997-2.012 4.543.016 6.721 1.385 7.223 1.846 1.674 1.432 2.529 4.865 1.904 9.893l.006-.011zM7.741 4.983c.242 0 .459.109.629.311.004.002.58.695.83 1.034.235.32.551.83.711 1.115.285.51.104 1.032-.172 1.248l-.566.45c-.285.229-.25.653-.25.653s.84 3.157 3.959 3.953c0 0 .426.039.654-.246l.451-.569c.213-.285.734-.465 1.244-.181.285.15.795.466 1.116.704.339.24 1.032.826 1.036.826.33.271.404.689.18 1.109v.016c-.23.405-.541.78-.934 1.141h-.008c-.314.27-.629.42-.944.449-.03 0-.075.016-.136 0-.135 0-.27-.029-.404-.061v-.014c-.48-.135-1.275-.48-2.596-1.216-.855-.479-1.574-.96-2.189-1.455-.315-.255-.645-.54-.976-.87l-.076-.028-.03-.03-.029-.029c-.331-.33-.615-.66-.871-.98-.48-.609-.96-1.327-1.439-2.189-.735-1.32-1.08-2.115-1.215-2.596H5.7c-.045-.134-.075-.269-.06-.404-.015-.061 0-.105 0-.141.03-.299.189-.614.458-.944h.005c.355-.39.738-.704 1.146-.933.164-.091.329-.135.479-.135h.016l-.003.012zm4.095-.683h.116l.076.002h.02l.089.005h.511l.135.015h.074l.15.016h.03l.104.015h.016l.074.015c.046 0 .076.016.105.016h.091l.075.029.06.016.06.015.03.015h.045l.046.016h.029l.074.016.045.014.046.016.06.016.03.014c.03 0 .06.016.091.016l.044.015.046.016.119.044.061.031.135.06.045.015.045.016.09.045.061.015.029.015.076.031.029.014.061.031.045.014.045.03.059.03.046.029.03.016.061.03.044.03.075.045.045.016.074.044.016.015.045.031.09.074.046.03.044.03.031.014.045.031.074.074.061.045.045.03.016.015.029.016.074.061.046.044.03.03.045.029.045.031.029.015.12.12.06.061.135.135.031.029c.016.016.045.045.061.075l.029.03.166.194.045.06c.014.016.014.031.029.031l.09.135.045.045.09.12.076.12.045.09.059.105.045.09.016.029.029.061.076.15.074.149.031.075c.059.135.104.27.164.42.074.195.135.404.18.63.045.165.076.315.105.48l.029.27.045.3c.016.121.031.256.031.375.014.121.014.24.014.359v.256c0 .016-.006.029-.014.045-.016.03-.031.045-.061.075-.021.015-.049.046-.08.046-.029.014-.059.014-.09.014h-.045c-.029 0-.059-.014-.09-.029-.029-.016-.061-.03-.074-.061-.016-.029-.045-.061-.061-.09s-.031-.06-.031-.09v-.359c-.014-.209-.029-.425-.059-.639-.016-.146-.045-.284-.061-.42 0-.074-.016-.146-.029-.209l-.029-.15-.038-.141-.016-.09-.045-.15c-.029-.12-.074-.24-.119-.36-.029-.091-.061-.165-.105-.239l-.029-.076-.135-.27-.031-.045c-.061-.135-.135-.27-.225-.391l-.045-.074h-.201l-.064-.091c-.055-.089-.114-.165-.18-.239l-.125-.15-.015-.016-.046-.057-.035-.045-.075-.074-.015-.03-.07-.06-.045-.046-.083-.075-.04-.037-.046-.045-.015-.016c-.016-.015-.045-.045-.075-.06l-.076-.062-.03-.015-.061-.046-.074-.06-.045-.036-.03-.016-.06-.053c0-.016-.016-.016-.031-.016l-.029-.029-.015-.016v-.013l-.03-.014-.061-.037-.044-.031-.075-.045-.06-.045-.029-.016-.032-.013h-.09l-.019-.016-.065-.035-.009-.014-.03-.016-.045-.021h-.012l-.045-.016-.025-.015-.045-.015-.01-.011-.03-.016-.053-.029-.03-.015-.09-.03-.074-.029-.137-.016-.044-.029c-.015-.01-.03-.016-.046-.016l-.029-.015c-.029-.011-.045-.016-.075-.03l-.03-.016h-.029l-.061-.029-.029-.016-.045-.015h-.092c-.008 0-.019-.005-.03-.007h-.09l-.045-.016h-.015l-.045-.016h-.041c-.025-.014-.045-.014-.07-.014l-.01-.016-.06-.015c-.03-.016-.056-.016-.084-.016l-.045-.015-.05-.016-.045-.014-.061-.016h-.061l-.179-.022h-.09l-.116-.015h-.076l-.068-.008h-.03l-.054-.016h-.285l-.01-.015h-.061c-.03 0-.064-.015-.09-.03-.03-.016-.061-.029-.081-.06l-.03-.046c-.029-.029-.029-.06-.045-.09-.014-.028-.014-.059-.014-.089s0-.06.015-.09c.016-.029.029-.06.061-.075.015-.03.044-.044.074-.06.029-.016.061-.03.09-.03h.061l.015.066zm.554 1.574l.037.003.061.006c.008 0 .018 0 .029.003.022 0 .045.004.075.006l.06.008.024.016.045.015.048.015.045.016h.03l.042.015.07.015.056.016.026.014h.073l.119.028.046.015.045.015.045.016s.015 0 .015.015l.046.015.044.016.045.016c.015 0 .03.014.046.014.007 0 .014.016.025.016l.064.03h.029l.09.03.05.029.046.03.108.045.06.015.031.031c.045.014.09.044.135.059l.048.03.048.03.049.029c.045.03.082.046.121.076l.029.014.041.031.022.015.075.045.037.03.065.043.029.015.03.015.046.03.06.046c.015.014.022.014.034.029.01.015.016.015.025.03l.033.03.036.029.03.03.046.046.029.03.016.016.09.089.016.016c0 .015.015.03.029.03l.016.013.045.046.029.045.03.03.045.06.046.046.09.119.014.029.061.076.016.029.015.031.015.029.016.03c.016.015.016.03.029.06l.043.076.016.015.029.061.031.044c.014.015.014.029.029.045l.03.045.03.061.029.059.016.046c.015.044.045.075.06.12 0 .015.015.029.015.045l.045.119.061.195c0 .016.015.045.015.061l.046.135.044.18.046.24c.014.074.014.135.029.211.016.119.03.238.03.359l.015.21v.165c0 .016 0 .029-.015.045l-.044.043c-.029.023-.045.045-.074.061-.03.015-.061.029-.09.04-.031.016-.075.016-.105.016-.029 0-.061-.016-.09-.03-.016 0-.03-.016-.045-.021-.031-.014-.061-.039-.075-.065-.03-.03-.046-.06-.046-.091l-.014-.044v-.313c0-.133-.016-.256-.031-.385-.015-.135-.044-.285-.074-.42-.029-.09-.045-.18-.075-.26l-.03-.091-.029-.075-.016-.03-.045-.12-.045-.09-.075-.149-.069-.12v-.019l-.029-.047-.03-.038-.045-.075-.046-.061-.089-.119c-.046-.061-.09-.12-.142-.178-.014-.015-.029-.029-.029-.045l-.03-.029-.017-.016-.03-.014-.03-.027v-.146l-.119-.113-.075-.068v-.014l-.03-.031-.038-.029-.015-.016c0-.015-.016-.015-.029-.015l-.046-.016-.015-.015-.061-.045-.014-.016-.016-.015c-.012-.015-.023-.015-.03-.015l-.06-.045-.016-.016-.06-.029-.011-.016-.045-.029-.03-.016-.03-.029-.029-.031h-.016c-.029-.029-.06-.044-.105-.06l-.044-.03-.03-.014-.016-.016-.045-.03-.044-.015-.06-.03-.046-.015-.015-.016-.056-.014v-.012l-.091-.03-.06-.03-.03-.015h-.06c-.03-.015-.045-.015-.075-.03H13.2l-.045-.016h-.044l-.046-.014-.029-.016h-.061l-.061-.015-.029-.016h-.165l-.069-.015H12.3l-.046-.016c-.029-.014-.06-.029-.09-.06-.014-.03-.045-.06-.06-.089-.015-.031-.03-.061-.03-.091v-.09c.006-.046.016-.075.03-.105.008-.015.015-.03.03-.045.018-.03.045-.06.075-.075.015-.015.03-.015.044-.029.031-.016.061-.016.091-.016h.06l-.014.055zm.454 1.629c.015 0 .03 0 .044.004.016 0 .031 0 .046.002l.052.005c.104.009.213.024.318.046l.104.023.026.008.114.029.059.02.046.016c.045.014.091.045.135.06l.016.015.06.03.09.046.029.014c.016.016.031.016.046.03.015.016.045.03.06.045.061.03.105.075.15.105l.105.09.09.091.061.074.029.029.03.031.044.06.091.135.075.135.06.12.046.105c.044.104.06.195.09.299.029.091.045.196.06.285l.015.15.016.136V9.8c0 .045-.016.075-.03.105-.015.029-.046.074-.075.09-.03.029-.061.045-.105.061-.029.014-.06.014-.09.014-.029 0-.06 0-.09-.014l-.104-.046c-.03-.03-.06-.045-.091-.091-.015-.029-.029-.06-.045-.104v-.166l-.015-.105-.015-.119-.016-.105-.016-.06c0-.015-.014-.045-.014-.06-.03-.121-.09-.24-.15-.36l-.061-.06-.047-.06-.045-.045-.015-.03-.075-.06-.061-.061-.059-.045c-.016-.015-.03-.015-.061-.029l-.09-.061-.061-.03-.029-.015h-.016l-.076-.031-.09-.03-.09-.015h-.075l-.044-.015-.035-.007h-.045l-.06-.016h-.255l-.015-.075h-.039c-.03-.004-.055-.015-.08-.029-.035-.021-.064-.045-.09-.08-.018-.029-.034-.061-.045-.09-.008-.029-.012-.06-.012-.09 0-.037 0-.075.015-.113.015-.039.03-.07.06-.1l.061-.045c.029-.016.061-.03.09-.03l.062-.075h.032z"/></svg> </span>
758
  $arrButtonsCode[] = '<button onclick="javascript:window.open(this.dataset.href, \'_self\' );return false;" class="simplesocial-viber-share" data-href="viber://forward?text=' . $permalink . '"><span class="simplesocialtxt">Viber</span></button>';
759
  }
760
  break;
761
+ case 'fblike':
762
  $_html = '<div class="fb-like ssb-fb-like" data-href="' . $permalink . '" data-layout="button_count" data-action="like" data-size="small" data-show-faces="false" data-share="false"></div>';
763
 
764
  $arrButtonsCode[] = $_html;
765
 
766
  break;
767
+ case 'messenger':
768
+ $link = urlencode( $permalink );
 
769
  $messenger_share_url = $this->is_mobile() ? "fb-messenger://share/?link=$link?app_id=$this->fb_app_id" : "http://www.facebook.com/dialog/send?app_id=$this->fb_app_id&redirect_uri=$link&link=$link&display=popup";
770
 
771
+ if ( $this->selected_theme == 'simple-icons' ) {
772
+ $arrButtonsCode[] = '<button onclick="javascript:window.open(this.dataset.href, \'_blank\', \'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600\' );return false;" class="simplesocial-viber-share ssb_msng-icon" data-href=' . $messenger_share_url . '>
773
  <span class="icon"> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="18px" height="19px" viewBox="-889.5 1161 18 19" enable-background="new -889.5 1161 18 19" xml:space="preserve">
774
  <path opacity="0.99" fill="#FFFFFF" enable-background="new " d="M-880.5,1161c-5,0-9,3.8-9,8.5c0,2.4,1,4.5,2.7,6v4.5l3.8-2.3 c0.8,0.2,1.6,0.3,2.5,0.3c5,0,9-3.8,9-8.5S-875.5,1161-880.5,1161z M-879.6,1172.2l-2.4-2.4l-4.3,2.4l4.7-5.2l2.4,2.4l4.2-2.4 L-879.6,1172.2z"/>
775
  </svg> </span>
776
  <span class="simplesocialtxt">Messenger</span>
777
  </button>';
778
+ } else {
779
 
780
+ $arrButtonsCode[] = '<button class="simplesocial-msng-share" onclick="javascript:window.open( this.dataset.href, \'_blank\', \'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600\' );return false;" data-href="' . $messenger_share_url . '" ><span class="simplesocialtxt">Messenger</span></button> ';
781
+ }
782
+ break;
783
+ case 'email':
784
+ if ( $this->selected_theme == 'simple-icons' ) {
785
+ $arrButtonsCode[] = ' <button onclick="javascript:window.location.href = this.dataset.href;return false;" class="ssb_email-icon simplesocial-email-share" data-href="mailto:?subject=' . $title . '&body=' . $permalink . '">
786
  <span class="icon"> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="16px" height="11.9px" viewBox="-1214.1 1563.9 16 11.9" enable-background="new -1214.1 1563.9 16 11.9" xml:space="preserve">
787
  <path d="M-1214.1,1565.2v1l8,4l8-4v-1c0-0.7-0.6-1.3-1.3-1.3h-13.4C-1213.5,1563.9-1214.1,1564.4-1214.1,1565.2z M-1214.1,1567.4v7.1c0,0.7,0.6,1.3,1.3,1.3h13.4c0.7,0,1.3-0.6,1.3-1.3v-7.1l-8,4L-1214.1,1567.4z"/> </svg> </span>
788
  <span class="simplesocialtxt">Email</span>
789
  </button>';
790
+ } else {
791
+
792
+ $arrButtonsCode[] = '<button onclick="javascript:window.location.href = this.dataset.href;return false;" class="simplesocial-email-share" data-href="mailto:?subject=' . $title . '&body=' . $permalink . '"><span class="simplesocialtxt">Email</span></button>';
793
+ }
794
+ break;
795
+ case 'print':
796
+ if ( $this->selected_theme == 'simple-icons' ) {
797
+ $arrButtonsCode[] = ' <button onclick="javascript:window.print();return false;" class=" ssb_print-icon simplesocial-email-share" >
798
  <span class="icon"> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Layer_1" x="0px" y="0px" width="16px" height="13.7px" viewBox="-1296.9 1876.4 16 13.7" enable-background="new -1296.9 1876.4 16 13.7" xml:space="preserve"><g>
799
  <path fill="#FFFFFF" d="M-1288.9,1879.7c2.3,0,4.6,0,6.9,0c0.4,0,0.7,0.1,0.9,0.5c0.1,0.2,0.1,0.4,0.1,0.6c0,1.7,0,3.4,0,5.1 c0,0.7-0.4,1.1-1.1,1c-0.6,0-1.2,0-1.8,0c-0.1,0-0.2,0-0.2,0.2c0,0.7,0,1.4,0,2c0,0.6-0.4,1-1,1c-0.1,0-0.3,0-0.4,0 c-2.5,0-4.9,0-7.4,0c-0.3,0-0.5,0-0.8-0.1c-0.3-0.2-0.5-0.5-0.5-0.9c0-0.7,0-1.4,0-2c0-0.2-0.1-0.2-0.2-0.2c-0.6,0-1.2,0-1.7,0 c-0.7,0-1-0.4-1-1c0-1.7,0-3.4,0-5.1c0-0.4,0.2-0.8,0.6-0.9c0.2-0.1,0.3-0.1,0.5-0.1C-1293.5,1879.7-1291.2,1879.7-1288.9,1879.7z M-1288.9,1884.9C-1288.9,1884.9-1288.9,1884.9-1288.9,1884.9c-1.4,0-2.8,0-4.2,0c-0.1,0-0.2,0-0.2,0.2c0,0.3,0,0.7,0,1 c0,1,0,2,0,3c0,0.3,0.1,0.4,0.4,0.4c2.5,0,5.1,0,7.6,0c0.1,0,0.3,0,0.4,0c0.2,0,0.3-0.2,0.3-0.3c0-1.3,0-2.7,0-4 c0-0.2,0-0.2-0.2-0.2C-1286.1,1884.9-1287.5,1884.9-1288.9,1884.9z M-1284.2,1882.4c0.4,0,0.7-0.3,0.7-0.7c0-0.4-0.3-0.7-0.8-0.7 c-0.4,0-0.7,0.3-0.7,0.7C-1284.9,1882.1-1284.6,1882.4-1284.2,1882.4z"/>
800
  <path fill="#FFFFFF" d="M-1283.9,1879c-0.2,0-0.4,0-0.5,0c-3.1,0-6.2,0-9.3,0c-0.1,0-0.2,0-0.2-0.2c0-0.5,0-1,0-1.5 c0-0.5,0.4-1,0.9-1c0.1,0,0.2,0,0.3,0c2.6,0,5.2,0,7.8,0c0.6,0,1,0.4,1,1c0,0.5,0,0.9,0,1.4 C-1283.9,1878.9-1283.9,1879-1283.9,1879z"/>
803
  </g></svg></span>
804
  <span class="simplesocialtxt">Print</span>
805
  </button>';
806
+ } else {
807
 
808
+ $arrButtonsCode[] = '<button onclick="javascript:window.print();return false;" class="simplesocial-print-share" ><span class="simplesocialtxt">Print</span></button>';
809
+ }
810
+ break;
811
  }
812
  }
813
 
818
  $ssb_buttonscode .= '</div>' . "\n";
819
 
820
  }
821
+ return $ssb_buttonscode;
822
  }
823
 
824
  /**
977
 
978
 
979
  /**
980
+ * short code content
981
+ *
982
+ * @param $atts
983
+ *
984
+ * @since 2.0.2
985
+ * @return string
986
+ */
987
  function short_code_content( $atts ) {
988
 
989
  /*
 
990
  counter = true,false
991
  align = left ,right,centered,
992
  order = googleplus,twitter,pinterest,fbshare,linkedin,reddit,whatsapp,viber,fblike,messenger,email
1001
  Official = simple-icons
1002
  */
1003
 
1004
+ $selected_theme = shortcode_atts(
1005
+ array(
1006
+ 'theme' => '',
1007
+ 'order' => null,
1008
+ 'align' => '',
1009
+ 'counter' => 'false',
1010
+ ), $atts
1011
+ );
1012
 
1013
  $themes = array(
1014
+ 'theme1' => 'sm-round',
1015
+ 'theme2' => 'simple-round',
1016
+ 'theme3' => 'round-txt',
1017
+ 'theme4' => 'round-btm-border',
1018
+ 'Flat' => 'flat-button-border',
1019
+ 'Circle' => 'round-icon',
1020
  'Official' => 'simple-icons',
1021
  );
1022
 
 
1023
  if ( key_exists( $selected_theme['theme'], $themes ) ) {
1024
  foreach ( $themes as $key => $value ) {
1025
 
1029
  }
1030
  }
1031
  } else {
1032
+ $theme = $this->selected_theme;
1033
  }
1034
  if ( null !== $selected_theme['order'] ) {
1035
  $selected_theme['order'] = array_flip( array_merge( array( 0 ), explode( ',', $selected_theme['order'] ) ) );
1054
 
1055
  // if ( $this->inline['share_counts'] ) {
1056
  if ( $selected_theme['counter'] == 'true' ) {
1057
+ $show_count = true;
1058
  $extra_class .= ' ssb_counter-activate';
1059
  } else {
1060
  $show_count = false;
1061
  }
1062
 
 
1063
  $extra_class .= ' simplesocialbuttons-inline-' . $this->_get_settings( 'inline', 'animation', 'no-animation' );
1064
 
1065
  $ssb_buttons_code = $this->generate_buttons_short_code( $theme, $selected_theme['order'], $this->selected_networks, $show_count, $show_total, $extra_class );
1066
 
 
1067
  }
1068
 
1069
  return $ssb_buttons_code;
1071
  }
1072
 
1073
  /**
1074
+ * Generate buttons html code with specified order for short code
1075
+ *
1076
+ * @since 2.0.2
1077
+ *
1078
+ * @param mixed $order - order of social buttons
1079
+ */
1080
  function generate_buttons_short_code( $short_code_theme, $short_code_order, $order = null, $show_count = false, $show_total = false, $extra_class = '' ) {
1081
 
1082
+ // googleplus,fbshare,twitter,pinterest,whatsapp,viber,reddit,linkedin,messenger,email,print
 
1083
  // define empty buttons code to use
1084
  $ssb_buttonscode = '';
1085
 
1088
  $title = urlencode( get_the_title() );
1089
  $post_id = get_the_id();
1090
 
1091
+ if ( false == $permalink ) {
1092
  $permalink = get_site_url();
1093
  $title = get_bloginfo( 'name' );
1094
  $post_id = 0;
1095
  }
1096
 
 
1097
  // Sorting the buttons
1098
  $arrButtons = array();
1099
  if ( $short_code_order == null ) {
1104
  $arrButtons[ $button_name ] = $order[ $button_name ];
1105
  }
1106
  }
 
1107
  } else {
1108
 
1109
  foreach ( $this->arrKnownButtons as $button_name ) {
1111
  $arrButtons[ $button_name ] = $short_code_order[ $button_name ];
1112
  }
1113
  }
 
1114
  }
1115
  // echo '<pre>'; print_r( $arrButtons ); echo '</pre>';
1116
  @asort( $arrButtons );
1122
 
1123
  $non_exist_post_record = false;
1124
  // special case if post id not exist for example short code run on widget out side the loop in archive page and old counts not exsist
1125
+ if ( 0 == $post_id ) {
1126
  $non_exist_post_record = get_option( 'ssb_not_exist_post_old_counts' );
1127
  }
1128
 
1129
  // Reset the cache timestamp if needed
1130
  // if false fetch the new share counts.
1131
+ if ( ( isset( $this->settings['cache'] ) && $this->settings['cache'] == 'off' ) || ( ! $non_exist_post_record ) ) {
1132
 
1133
+ $_share_links = array();
1134
  $_alt_share_links = array();
1135
  foreach ( $arrButtons as $social_name => $priority ) {
1136
+ if ( 'totalshare' == $social_name || 'viber' == $social_name || 'fblike' == $social_name || 'whatsapp' == $social_name || 'print' == $social_name || 'email' == $social_name || 'messenger' == $social_name ) {
1137
  continue;
1138
  }
1139
  $_share_links[ $social_name ] = call_user_func( 'ssb_' . $social_name . '_generate_link', $permalink );
1140
+ $url = $this->http_or_https_resolve_url( $permalink );
1141
+ // get alt hurl to cover http or https issue
1142
  $_alt_share_links[ $social_name ] = call_user_func( 'ssb_' . $social_name . '_generate_link', $url );
1143
  }
1144
 
1161
  <span class="icon"><svg version="1.1" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMid meet" width="30px" height="18px" viewBox="-10 -6 60 36" class="ozWidgetRioButtonSvg_ ozWidgetRioButtonPlusOne_"><path d="M30 7h-3v4h-4v3h4v4h3v-4h4v-3h-4V7z"></path><path d="M11 9.9v4h5.4C16 16.3 14 18 11 18c-3.3 0-5.9-2.8-5.9-6S7.7 6 11 6c1.5 0 2.8.5 3.8 1.5l2.9-2.9C15.9 3 13.7 2 11 2 5.5 2 1 6.5 1 12s4.5 10 10 10c5.8 0 9.6-4.1 9.6-9.8 0-.7-.1-1.5-.2-2.2H11z"></path></svg></span>
1162
  <span class="simplesocialtxt">Google Plus </span>';
1163
  if ( $show_count ) {
1164
+ $_html .= '<span class="ssb_counter">' . $googleplus_share . '</span>';
1165
  }
1166
  $_html .= '</button>';
1167
  } else {
1186
  <span class="simplesocialtxt">Share </span>';
1187
 
1188
  if ( $show_count ) {
1189
+ $_html .= ' <span class="ssb_counter">' . $fbshare_share . '</span>';
1190
+
1191
  }
1192
 
1193
  $_html .= ' </button>';
1194
+ } else {
1195
 
1196
+ $_html = '<button class="simplesocial-fb-share" target="_blank" data-href="https://www.facebook.com/sharer/sharer.php?u=' . $permalink . '" onclick="javascript:window.open(this.dataset.href, \'\', \'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600\');return false;"><span class="simplesocialtxt">Facebook </span> ';
1197
 
1198
  if ( $show_count ) {
1199
  $_html .= '<span class="ssb_counter ssb_fbshare_counter">' . $fbshare_share . '</span>';
1214
  <span class="icon"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 72 72"><path fill="none" d="M0 0h72v72H0z"/><path class="icon" fill="#fff" d="M68.812 15.14c-2.348 1.04-4.87 1.744-7.52 2.06 2.704-1.62 4.78-4.186 5.757-7.243-2.53 1.5-5.33 2.592-8.314 3.176C56.35 10.59 52.948 9 49.182 9c-7.23 0-13.092 5.86-13.092 13.093 0 1.026.118 2.02.338 2.98C25.543 24.527 15.9 19.318 9.44 11.396c-1.125 1.936-1.77 4.184-1.77 6.58 0 4.543 2.312 8.552 5.824 10.9-2.146-.07-4.165-.658-5.93-1.64-.002.056-.002.11-.002.163 0 6.345 4.513 11.638 10.504 12.84-1.1.298-2.256.457-3.45.457-.845 0-1.666-.078-2.464-.23 1.667 5.2 6.5 8.985 12.23 9.09-4.482 3.51-10.13 5.605-16.26 5.605-1.055 0-2.096-.06-3.122-.184 5.794 3.717 12.676 5.882 20.067 5.882 24.083 0 37.25-19.95 37.25-37.25 0-.565-.013-1.133-.038-1.693 2.558-1.847 4.778-4.15 6.532-6.774z"/></svg></span>';
1215
 
1216
  if ( $show_count ) {
1217
+ $_html .= '<span class="simplesocialtxt">Tweet ' . $twitter_share . '</span>';
1218
+ } else {
1219
  $_html .= '<span class="simplesocialtxt">Tweet </span>';
1220
 
1221
  }
1222
 
1223
+ $_html .= '</button>';
 
1224
 
1225
  } else {
1226
 
1246
  <span class="simplesocialtxt">Share</span>';
1247
 
1248
  if ( $show_count ) {
1249
+ $_html .= ' <span class="ssb_counter">' . $linkedin_share . '</span>';
1250
  }
1251
  $_html .= ' </button>';
1252
  } else {
1271
  <span class="icon"> <svg xmlns="http://www.w3.org/2000/svg" height="30px" width="30px" viewBox="-1 -1 31 31"><g><path d="M29.449,14.662 C29.449,22.722 22.868,29.256 14.75,29.256 C6.632,29.256 0.051,22.722 0.051,14.662 C0.051,6.601 6.632,0.067 14.75,0.067 C22.868,0.067 29.449,6.601 29.449,14.662" fill="#fff" stroke="#fff" stroke-width="1"></path><path d="M14.733,1.686 C7.516,1.686 1.665,7.495 1.665,14.662 C1.665,20.159 5.109,24.854 9.97,26.744 C9.856,25.718 9.753,24.143 10.016,23.022 C10.253,22.01 11.548,16.572 11.548,16.572 C11.548,16.572 11.157,15.795 11.157,14.646 C11.157,12.842 12.211,11.495 13.522,11.495 C14.637,11.495 15.175,12.326 15.175,13.323 C15.175,14.436 14.462,16.1 14.093,17.643 C13.785,18.935 14.745,19.988 16.028,19.988 C18.351,19.988 20.136,17.556 20.136,14.046 C20.136,10.939 17.888,8.767 14.678,8.767 C10.959,8.767 8.777,11.536 8.777,14.398 C8.777,15.513 9.21,16.709 9.749,17.359 C9.856,17.488 9.872,17.6 9.84,17.731 C9.741,18.141 9.52,19.023 9.477,19.203 C9.42,19.44 9.288,19.491 9.04,19.376 C7.408,18.622 6.387,16.252 6.387,14.349 C6.387,10.256 9.383,6.497 15.022,6.497 C19.555,6.497 23.078,9.705 23.078,13.991 C23.078,18.463 20.239,22.062 16.297,22.062 C14.973,22.062 13.728,21.379 13.302,20.572 C13.302,20.572 12.647,23.05 12.488,23.657 C12.193,24.784 11.396,26.196 10.863,27.058 C12.086,27.434 13.386,27.637 14.733,27.637 C21.95,27.637 27.801,21.828 27.801,14.662 C27.801,7.495 21.95,1.686 14.733,1.686" fill="#bd081c"></path></g></svg> </span>
1272
  <span class="simplesocialtxt">Save</span>';
1273
  if ( $show_count ) {
1274
+ $_html .= '<span class="ssb_counter">' . $pinterest_share . '</span>';
1275
  }
1276
  $_html .= ' </button>';
1277
  } else {
1302
  xml:space="preserve"> <g> <path id="reddit" d="M307.523,231.062c1.11,2.838,1.614,5.769,1.614,8.681c0,5.862-2.025,11.556-5.423,16.204 c-3.36,4.593-8.121,8.158-13.722,9.727h0.01c-0.047,0.019-0.094,0.019-0.117,0.037c-0.023,0-0.061,0.019-0.079,0.019 c-2.623,0.896-5.312,1.316-7.98,1.316c-6.254,0-12.396-2.254-17.306-6.096c-4.872-3.826-8.56-9.324-9.717-15.845h-0.01 c0-0.019,0-0.042-0.009-0.069c0-0.019,0-0.038-0.019-0.065h0.019c-0.364-1.681-0.551-3.36-0.551-5.021 c0-5.647,1.923-11.07,5.097-15.551c3.164-4.453,7.626-7.99,12.848-9.811c0.019,0,0.038-0.01,0.038-0.01 c0.027,0,0.027-0.027,0.051-0.027c2.954-1.092,6.072-1.639,9.157-1.639c5.619,0,11.154,1.704,15.821,4.821 c4.611,3.066,8.354,7.561,10.23,13.143c0.019,0.037,0.019,0.07,0.037,0.103c0,0.037,0.019,0.057,0.037,0.084H307.523z M290.329,300.349c-2.202-1.428-4.751-2.291-7.448-2.291c-2.175,0-4.434,0.621-6.445,1.955l0,0 c-19.004,11.342-41.355,17.558-63.547,17.558c-16.65,0-33.199-3.514-48.192-10.879l-0.077-0.037l-0.075-0.028 c-2.261-0.924-4.837-2.889-7.647-4.76c-1.428-0.925-2.919-1.844-4.574-2.521c-1.633-0.695-3.447-1.181-5.386-1.181 c-1.605,0-3.292,0.359-4.957,1.115c-0.086,0.033-0.168,0.065-0.252,0.098h0.009c-2.616,0.999-4.66,2.829-5.974,4.994 c-1.372,2.23-2.046,4.826-2.046,7.411c0,2.334,0.551,4.667,1.691,6.786c1.085,2.007,2.754,3.762,4.938,4.938 c21.429,14.454,46.662,21.002,71.992,20.979c22.838,0,45.814-5.287,66.27-14.911l0.107-0.065l0.103-0.056 c2.697-1.597,6.282-3.029,9.661-5.115c1.671-1.064,3.304-2.296,4.704-3.897c1.4-1.591,2.525-3.551,3.16-5.875v-0.01 c0.266-1.026,0.392-2.025,0.392-3.024c0-1.899-0.467-3.701-1.241-5.32C294.361,303.775,292.504,301.778,290.329,300.349z M139.875,265.589c0.037,0,0.086,0.014,0.128,0.037c2.735,0.999,5.554,1.493,8.345,1.493c6.963,0,13.73-2.852,18.853-7.5 c5.115-4.662,8.618-11.257,8.618-18.775c0-0.196,0-0.392-0.009-0.625c0.019-0.336,0.028-0.705,0.028-1.083 c0-7.458-3.456-14.08-8.522-18.762c-5.085-4.686-11.836-7.551-18.825-7.551c-1.867,0-3.769,0.219-5.628,0.653 c-0.028,0-0.049,0.009-0.077,0.009c0,0-0.019,0-0.028,0c-9.252,1.937-17.373,8.803-20.37,18.248l0,0v0.01 c0,0.019-0.009,0.037-0.009,0.037c-0.861,2.586-1.262,5.255-1.262,7.896c0,5.787,1.913,11.426,5.211,16.064 c3.269,4.56,7.894,8.145,13.448,9.819C139.816,265.561,139.835,265.571,139.875,265.589z M430.033,198.094v0.038 c0.066,0.94,0.084,1.878,0.084,2.81c0,10.447-3.351,20.493-8.941,29.016c-5.218,7.976-12.414,14.649-20.703,19.177 c0.532,4.158,0.84,8.349,0.84,12.526c-0.01,22.495-7.766,44.607-21.272,62.329v0.009h-0.028 c-24.969,33.216-63.313,52.804-102.031,62.684h-0.01l-0.027,0.023c-20.647,5.013-41.938,7.574-63.223,7.574 c-31.729,0-63.433-5.722-93.018-17.585l-0.009-0.028h-0.028c-30.672-12.643-59.897-32.739-77.819-62.184 c-9.642-15.71-14.935-34.141-14.935-52.659c0-4.19,0.283-8.387,0.843-12.536c-8.072-4.545-15.063-10.99-20.255-18.687 c-5.542-8.266-9.056-17.95-9.5-28.187v-0.04v-0.037v-0.082c0.009-14.337,6.237-27.918,15.915-37.932 c9.677-10.011,22.896-16.554,37.075-16.554c0.196,0,0.392,0,0.588,0c1.487-0.101,2.987-0.159,4.488-0.159 c7.122,0,14.26,1.153,21.039,3.752l0.037,0.028l0.038,0.012c5.787,2.437,11.537,5.377,16.662,9.449 c1.661-0.871,3.472-1.851,5.504-2.625c31.064-18.395,67.171-25.491,102.358-27.538c0.306-17.431,2.448-35.68,10.949-51.65 c7.08-13.269,19.369-23.599,34-27.179l0.061-0.03l0.079-0.009c5.573-1.078,11.192-1.575,16.774-1.575 c14.869,0,29.561,3.521,43.31,9.017c6.086-9.185,14.776-16.354,24.97-20.375l0.098-0.056l0.098-0.037 c5.983-1.864,12.303-2.954,18.646-2.954c6.692,0,13.437,1.223,19.756,4.046v-0.023c0.009,0.023,0.019,0.023,0.019,0.023 c0.047,0.016,0.084,0.044,0.116,0.044c9.059,3.489,16.727,9.937,22.164,17.95c5.442,8.048,8.644,17.688,8.644,27.599 c0,1.827-0.103,3.657-0.317,5.489l-0.019,0.037c0,0.028,0,0.068-0.01,0.096c-1.063,12.809-7.551,24.047-16.736,32.063 c-9.24,8.048-21.207,12.909-33.49,12.909c-1.97,0-3.958-0.11-5.937-0.374c-12.182-0.931-23.541-6.826-31.886-15.595 c-8.373-8.755-13.768-20.453-13.768-33.08c0-0.611,0.056-1.237,0.074-1.843c-11.435-5.092-23.578-9.316-35.646-9.306 c-1.746,0-3.491,0.096-5.237,0.273h-0.019c-9.035,0.871-17.436,6.566-21.506,14.757v0.009v0.028 c-6.179,12.034-7.411,26.101-7.598,40.064c34.639,2.259,69.483,10.571,100.043,28.138h0.047l0.438,0.259 c0.579,0.343,1.652,0.931,2.623,1.449c2.101-1.704,4.322-3.456,6.856-4.966c9.264-6.17,20.241-9.238,31.223-9.238 c4.872,0,9.749,0.621,14.481,1.834h0.019l0.196,0.058c0.07,0.01,0.121,0.033,0.178,0.033v0.009 c11.183,2.845,21.3,9.267,28.917,17.927c7.612,8.674,12.731,19.648,13.73,31.561v0.025H430.033z M328.002,84.733 c0,0.469,0.01,0.95,0.057,1.44v0.028v0.056c0.224,6.018,3.065,11.619,7.383,15.756c4.34,4.14,10.1,6.702,15.942,6.725h0.08h0.079 c0.42,0.033,0.85,0.033,1.26,0.033c5.899,0.009,11.752-2.532,16.148-6.655c4.405-4.144,7.309-9.78,7.542-15.849l0.009-0.028v-0.037 c0.038-0.464,0.057-0.903,0.057-1.377c0-6.247-2.922-12.202-7.496-16.612c-4.555-4.406-10.688-7.136-16.735-7.12 c-1.951,0-3.884,0.266-5.778,0.854l-0.065,0.005l-0.056,0.023c-4.984,1.295-9.656,4.368-13.012,8.449 C330.046,74.486,328.002,79.508,328.002,84.733z M72.312,177.578c-4.63-2.156-9.418-3.696-14.15-3.676 c-0.794,0-1.597,0.047-2.39,0.133h-0.11l-0.11,0.014c-6.795,0.187-13.653,3.15-18.801,7.899 c-5.152,4.732-8.559,11.122-8.821,18.167v0.065l-0.012,0.058c-0.046,0.57-0.065,1.137-0.065,1.683 c0,4.345,1.333,8.545,3.593,12.368c1.673,2.847,3.867,5.441,6.348,7.701C45.735,204.602,58.142,189.845,72.312,177.578z M374.066,262.635c0-15.5-5.592-31.069-14.646-43.604c-18.053-25.119-46.055-41.502-75.187-50.636l-0.205-0.072 c-5.592-1.715-11.238-3.234-16.933-4.534c-17.025-3.876-34.48-5.806-51.917-5.806c-23.414,0-46.827,3.465-69.245,10.379 c-29.125,9.243-57.221,25.51-75.233,50.71v0.019c-9.129,12.587-14.475,28.208-14.475,43.763c0,5.727,0.716,11.453,2.23,17.025 l0.019,0.01c3.278,12.508,9.689,23.671,17.989,33.393c8.295,9.745,18.472,18.058,29.176,24.839c2.371,1.47,4.751,2.87,7.187,4.237 c31.094,17.356,66.898,24.964,102.445,24.964c6.012,0,12.06-0.214,18.033-0.644c35.797-2.959,71.742-13.525,100.8-35.115 l0.01-0.023c9.25-6.837,17.818-15.112,24.595-24.525c6.805-9.418,11.789-19.947,14.002-31.382V275.6l0.009-0.01 C373.627,271.32,374.066,266.985,374.066,262.635z M402.32,200.95c-0.009-3.762-0.868-7.507-2.753-11l-0.047-0.044l-0.019-0.056 c-2.521-5.19-6.479-9.11-11.248-11.782c-4.77-2.69-10.352-4.056-15.952-4.056c-5.063,0-10.1,1.132-14.57,3.379 c14.216,12.344,26.687,27.179,34.746,44.636c2.595-2.259,4.808-5.018,6.464-8.084C401.098,209.92,402.32,205.405,402.32,200.95z"/></svg></span>
1303
  <span class="simplesocialtxt">reddit </span>';
1304
  if ( $show_count ) {
1305
+ $_html .= '<span class="ssb_counter">' . $reddit_score . '</span>';
1306
  }
1307
 
1308
+ $_html .= '</button>';
1309
  } else {
1310
+ $_html = '<button class="simplesocial-reddit-share" data-href="https://reddit.com/submit?url=' . $permalink . '&title=' . $title . '" onclick="javascript:window.open(this.dataset.href, \'\', \'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600\');return false;" ><span class="simplesocialtxt">Reddit</span> ';
1311
 
1312
  if ( $show_count ) {
1313
  $_html .= '<span class="ssb_counter ssb_reddit_counter">' . $reddit_score . '</span>';
1349
 
1350
  break;
1351
 
1352
+ case 'messenger':
1353
+ $link = urlencode( $permalink );
1354
+ $messenger_share_url = $this->is_mobile() ? "fb-messenger://share/?link=$link?app_id=$this->fb_app_id" : "http://www.facebook.com/dialog/send?app_id=$this->fb_app_id&redirect_uri=$link&link=$link&display=popup";
1355
 
1356
+ if ( $this->selected_theme == 'simple-icons' ) {
1357
+ $arrButtonsCode[] = '<button onclick="javascript:window.open(this.dataset.href, \'_blank\', \'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600\' );return false;" class="simplesocial-viber-share ssb_msng-icon" data-href=' . $messenger_share_url . '>
1358
  <span class="icon"> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="18px" height="19px" viewBox="-889.5 1161 18 19" enable-background="new -889.5 1161 18 19" xml:space="preserve">
1359
  <path opacity="0.99" fill="#FFFFFF" enable-background="new " d="M-880.5,1161c-5,0-9,3.8-9,8.5c0,2.4,1,4.5,2.7,6v4.5l3.8-2.3 c0.8,0.2,1.6,0.3,2.5,0.3c5,0,9-3.8,9-8.5S-875.5,1161-880.5,1161z M-879.6,1172.2l-2.4-2.4l-4.3,2.4l4.7-5.2l2.4,2.4l4.2-2.4 L-879.6,1172.2z"/>
1360
  </svg> </span>
1361
  <span class="simplesocialtxt">Messenger</span>
1362
  </button>';
1363
+ } else {
1364
 
1365
+ $arrButtonsCode[] = '<button class="simplesocial-msng-share" onclick="javascript:window.open( this.dataset.href, \'_blank\', \'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600\' );return false;" data-href="' . $messenger_share_url . '" ><span class="simplesocialtxt">Messenger</span></button> ';
1366
+ }
1367
 
1368
+ break;
1369
+ case 'email':
1370
+ if ( $this->selected_theme == 'simple-icons' ) {
1371
+ $arrButtonsCode[] = ' <button onclick="javascript:window.location.href = this.dataset.href;return false;" class="ssb_email-icon simplesocial-email-share" data-href="mailto:?subject=' . $title . '&body=' . $permalink . '"><span class="simplesocialtxt">
1372
  <span class="icon"> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="16px" height="11.9px" viewBox="-1214.1 1563.9 16 11.9" enable-background="new -1214.1 1563.9 16 11.9" xml:space="preserve">
1373
  <path d="M-1214.1,1565.2v1l8,4l8-4v-1c0-0.7-0.6-1.3-1.3-1.3h-13.4C-1213.5,1563.9-1214.1,1564.4-1214.1,1565.2z M-1214.1,1567.4v7.1c0,0.7,0.6,1.3,1.3,1.3h13.4c0.7,0,1.3-0.6,1.3-1.3v-7.1l-8,4L-1214.1,1567.4z"/> </svg> </span>
1374
  <span class="simplesocialtxt">Email</span>
1375
  </button>';
1376
+ } else {
1377
+
1378
+ $arrButtonsCode[] = '<button onclick="javascript:window.location.href = this.dataset.href;return false;" class="simplesocial-email-share" data-href="mailto:?subject=' . $title . '&body=' . $permalink . '"><span class="simplesocialtxt">Email</span></button>';
1379
+ }
1380
+ break;
1381
+ case 'print':
1382
+ if ( $this->selected_theme == 'simple-icons' ) {
1383
+ $arrButtonsCode[] = ' <button onclick="javascript:window.print();return false;" class="ssb_print-icon simplesocial-email-share" ><span class="simplesocialtxt">
1384
  <span class="icon"> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Layer_1" x="0px" y="0px" width="16px" height="13.7px" viewBox="-1296.9 1876.4 16 13.7" enable-background="new -1296.9 1876.4 16 13.7" xml:space="preserve"><g>
1385
  <path fill="#FFFFFF" d="M-1288.9,1879.7c2.3,0,4.6,0,6.9,0c0.4,0,0.7,0.1,0.9,0.5c0.1,0.2,0.1,0.4,0.1,0.6c0,1.7,0,3.4,0,5.1 c0,0.7-0.4,1.1-1.1,1c-0.6,0-1.2,0-1.8,0c-0.1,0-0.2,0-0.2,0.2c0,0.7,0,1.4,0,2c0,0.6-0.4,1-1,1c-0.1,0-0.3,0-0.4,0 c-2.5,0-4.9,0-7.4,0c-0.3,0-0.5,0-0.8-0.1c-0.3-0.2-0.5-0.5-0.5-0.9c0-0.7,0-1.4,0-2c0-0.2-0.1-0.2-0.2-0.2c-0.6,0-1.2,0-1.7,0 c-0.7,0-1-0.4-1-1c0-1.7,0-3.4,0-5.1c0-0.4,0.2-0.8,0.6-0.9c0.2-0.1,0.3-0.1,0.5-0.1C-1293.5,1879.7-1291.2,1879.7-1288.9,1879.7z M-1288.9,1884.9C-1288.9,1884.9-1288.9,1884.9-1288.9,1884.9c-1.4,0-2.8,0-4.2,0c-0.1,0-0.2,0-0.2,0.2c0,0.3,0,0.7,0,1 c0,1,0,2,0,3c0,0.3,0.1,0.4,0.4,0.4c2.5,0,5.1,0,7.6,0c0.1,0,0.3,0,0.4,0c0.2,0,0.3-0.2,0.3-0.3c0-1.3,0-2.7,0-4 c0-0.2,0-0.2-0.2-0.2C-1286.1,1884.9-1287.5,1884.9-1288.9,1884.9z M-1284.2,1882.4c0.4,0,0.7-0.3,0.7-0.7c0-0.4-0.3-0.7-0.8-0.7 c-0.4,0-0.7,0.3-0.7,0.7C-1284.9,1882.1-1284.6,1882.4-1284.2,1882.4z"/>
1386
  <path fill="#FFFFFF" d="M-1283.9,1879c-0.2,0-0.4,0-0.5,0c-3.1,0-6.2,0-9.3,0c-0.1,0-0.2,0-0.2-0.2c0-0.5,0-1,0-1.5 c0-0.5,0.4-1,0.9-1c0.1,0,0.2,0,0.3,0c2.6,0,5.2,0,7.8,0c0.6,0,1,0.4,1,1c0,0.5,0,0.9,0,1.4 C-1283.9,1878.9-1283.9,1879-1283.9,1879z"/>
1389
  </g></svg></span>
1390
  <span class="simplesocialtxt">Print</span>
1391
  </button>';
1392
+ } else {
1393
 
1394
+ $arrButtonsCode[] = '<button onclick="javascript:window.print();return false;" class="simplesocial-print-share" ><span class="simplesocialtxt">Print</span></button>';
1395
+ }
1396
+ break;
1397
  }
1398
  }
1399
 
1410
 
1411
 
1412
  /**
1413
+ * Add Meta Tags
1414
+ *
1415
+ * @param int $post_id
1416
+ * @since 2.0.9
1417
+ * @return string
1418
+ */
1419
  function add_meta_tags() {
1420
 
1421
  if ( class_exists( 'Jetpack' ) ) { // Check jetpack active.
1422
  return;
1423
+ } elseif ( defined( 'WPSEO_VERSION' ) ) { // Check Yoast active.
1424
  return;
1425
  }
1426
+ $og_tag = '';
1427
+ $og_tag .= PHP_EOL . '<!-- Open Graph Meta Tags generated by Simple Social Buttons ' . $this->pluginVersion . ' -->' . PHP_EOL;
1428
+ if ( $this->og_get_title() ) {
1429
+ $og_tag .= '<meta property="og:title" content="' . get_the_title() . ' - ' . get_bloginfo( 'name' ) . '" />' . PHP_EOL;
1430
  }
1431
 
1432
  if ( $this->og_get_description() ) {
1433
+ $og_tag .= '<meta property="og:description" content="' . $this->og_get_description() . '" />' . PHP_EOL;
1434
  }
1435
+ $og_tag .= '<meta property="og:url" content="' . get_permalink() . '" />' . PHP_EOL;
1436
  if ( $this->og_get_blog() ) {
1437
+ $og_tag .= '<meta property="og:site_name" content="' . $this->og_get_blog() . '" />' . PHP_EOL;
1438
  }
1439
  $og_tag .= $this->get_og_image();
1440
 
1441
  $og_tag .= '<meta name="twitter:card" content="summary_large_image" />' . PHP_EOL;
1442
  if ( $this->og_get_description() ) {
1443
+ $og_tag .= '<meta name="twitter:description" content="' . $this->get_excerpt_by_id( get_the_id() ) . '" />' . PHP_EOL;
1444
  }
1445
 
1446
  if ( $this->og_get_title() ) {
1447
+ $og_tag .= '<meta name="twitter:title" content="' . get_the_title() . ' - ' . get_bloginfo( 'name' ) . '" />' . PHP_EOL;
1448
  }
1449
  $og_tag .= $this->generate_twitter_image();
1450
 
1451
+ echo apply_filters( 'ssb_og_tag', $og_tag );
1452
+ }
1453
 
1454
 
1455
  function og_get_title() {
1456
+ return get_the_title() . ' - ' . get_bloginfo( 'name' );
1457
  }
1458
 
1459
  function og_get_description() {
1461
  }
1462
 
1463
  function og_get_blog() {
1464
+ return get_bloginfo( 'name' );
1465
  }
1466
 
1467
 
1468
  /**
1469
+ * Get the excerpt
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1470
  *
1471
+ * @param int $post_id
1472
+ * @since 2.0.9
1473
+ * @return string
1474
  */
1475
+ function get_excerpt_by_id( $post_id ) {
1476
 
1477
+ if ( ! $post_id ) {
1478
+ return;
1479
+ }
1480
+ // Check if the post has an excerpt
1481
+ if ( has_excerpt() ) {
1482
+ $excerpt_length = apply_filters( 'excerpt_length', 35 );
1483
+ return trim( get_the_excerpt() );
1484
+ }
1485
 
1486
+ $the_post = get_post( $post_id ); // Gets post ID
1487
+ $the_excerpt = $the_post->post_content; // Gets post_content to be used as a basis for the excerpt
1488
+ $excerpt_length = 60; // Sets excerpt length by words
1489
+ $the_excerpt = strip_tags( strip_shortcodes( $the_excerpt ) ); // Strips tags and images
1490
+ $words = explode( ' ', $the_excerpt, $excerpt_length + 1 );
1491
+ if ( count( $words ) > $excerpt_length ) {
1492
+ array_pop( $words );
1493
+ $the_excerpt = implode( ' ', $words );
1494
+ }
 
 
1495
 
1496
+ return trim( wp_strip_all_tags( $the_excerpt ) );
1497
+ }
1498
 
1499
  /**
1500
+ * Get Image from content.
1501
+ *
1502
+ * @since 2.0.10
1503
+ */
1504
+ public function get_content_images( $post ) {
 
1505
 
1506
+ if ( ! $post ) {
1507
+ return;
1508
+ }
1509
+
1510
+ $content = $post->post_content;
1511
+ $images = '';
1512
+ if ( preg_match_all( '`<img [^>]+>`', $content, $matches ) ) {
1513
+ foreach ( $matches[0] as $img ) {
1514
+ if ( preg_match( '`src=(["\'])(.*?)\1`', $img, $match ) ) {
1515
+ $images .= '<meta property="og:image" content="' . $match[2] . '" />' . PHP_EOL;
1516
+ }
1517
+ }
1518
+ }
1519
+ return $images;
1520
+ }
1521
 
 
 
1522
 
1523
  /**
1524
+ * Get the featured image.
1525
+ *
1526
+ * @since 2.0.10
1527
+ */
1528
+ public function generate_og_image() {
1529
+ $_post_id = get_the_ID();
1530
+
1531
+ if ( has_post_thumbnail( $_post_id ) ) {
1532
+ return '<meta property="og:image" content="' . wp_get_attachment_url( get_post_thumbnail_id( get_the_ID() ) ) . '" />' . PHP_EOL;
1533
+ }
1534
 
1535
+ return $this->get_content_images( get_post( $_post_id ) );
1536
+ }
 
 
1537
 
1538
  /**
1539
+ * Get Open Graph image.
1540
+ *
1541
+ * @since 2.0.10
1542
+ */
1543
+ public function get_og_image() {
1544
+ $image = $this->generate_og_image();
1545
+
1546
+ if ( $image ) {
1547
+ return $image;
1548
+ }
1549
+ }
1550
 
1551
+ /**
1552
+ * Get the featured image for Twitter.
1553
+ *
1554
+ * @since 2.0.10
1555
+ */
1556
+ public function generate_twitter_image() {
1557
+ $_post_id = get_the_ID();
1558
+
1559
+ if ( has_post_thumbnail( $_post_id ) ) {
1560
+ return '<meta property="twitter:image" content="' . wp_get_attachment_url( get_post_thumbnail_id( get_the_ID() ) ) . '" />' . PHP_EOL;
1561
+ }
1562
 
1563
+ return $this->get_twitter_content_images( get_post( $_post_id ) );
1564
+ }
1565
 
1566
  /**
1567
+ * Get Image from content for Twitter.
1568
+ *
1569
+ * @since 2.0.10
1570
+ */
1571
+ public function get_twitter_content_images( $post ) {
1572
+
1573
+ if ( ! $post ) {
1574
+ return;
1575
+ }
1576
+
1577
+ $content = $post->post_content;
1578
+ $images = '';
1579
+ if ( preg_match_all( '`<img [^>]+>`', $content, $matches ) ) {
1580
+ foreach ( $matches[0] as $img ) {
1581
+ if ( preg_match( '`src=(["\'])(.*?)\1`', $img, $match ) ) {
1582
+ $images .= '<meta property="twitter:image" content="' . $match[2] . '" />' . PHP_EOL;
1583
+ }
1584
+ }
1585
+ }
1586
+ return $images;
1587
+ }
1588
 
1589
  /**
1590
+ * User to convert http to https or vice versa
1591
+ *
1592
+ * @since 2.0.12
1593
+ * @param $url
1594
+ * @return url
1595
+ */
1596
+ public function http_or_https_resolve_url( $url ) {
1597
+
1598
+ $arr_parsed_url = parse_url( $url );
1599
+ if ( ! empty( $arr_parsed_url['scheme'] ) ) {
1600
+ if ( 'http' === $arr_parsed_url['scheme'] ) {
1601
+ return $url = str_replace( 'http', 'https', $url );
1602
+ } elseif ( 'https' === $arr_parsed_url['scheme'] ) {
1603
+ return $url = str_replace( 'https', 'http', $url );
 
1604
  }
1605
  }
1606
  }
1610
  *
1611
  * @since 2.0.13
1612
  */
1613
+ public function is_mobile() {
1614
 
1615
+ $useragent = isset( $_SERVER['HTTP_USER_AGENT'] ) ? $_SERVER['HTTP_USER_AGENT'] : 'none';
1616
+
1617
+ if ( preg_match( '/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i', $useragent ) || preg_match( '/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i', substr( $useragent, 0, 4 ) ) ) {
1618
  return true;
1619
  } else {
1620
  return false;
1622
  }
1623
 
1624
  /**
1625
+ * convert url http to https or vice versa
1626
+ *
1627
  * @param $permalink
1628
  * @since 2.0.14
1629
  * @return mixed
1630
  */
1631
+ function http_or_https_link_generate( $permalink ) {
1632
+
1633
+ foreach ( $this->arrKnownButtons as $social_name ) {
1634
+ if ( 'totalshare' == $social_name || 'viber' == $social_name || 'fblike' == $social_name || 'whatsapp' == $social_name || 'print' == $social_name || 'email' == $social_name || 'messenger' == $social_name ) {
1635
+ continue; }
1636
+ $url = $this->http_or_https_resolve_url( $permalink );
1637
+ // get alt hurl to cover http or https issue
1638
+ $_alt_share_links[ $social_name ] = call_user_func( 'ssb_' . $social_name . '_generate_link', $url );
1639
  }
1640
+ return $_alt_share_links;
1641
  }
1642
 
1643
  } // end class