options = $options; } /** * Supported Social sharing networks * * @since 1.0.0 */ private $sharing_networks = array( 'facebook_share' => '
  • %like_count_container%
  • ', 'facebook_like' => '
  • %like_count_container%
  • ', 'facebook_recommend' => '
  • %like_count_container%
  • ', 'twitter_tweet' => '
  • %like_count_container%Tweet
  • ', 'linkedin_share' => '
  • %like_count_container%
  • ', 'pinterest_pin' => '
  • %like_count_container%
  • ', 'buffer_share' => '
  • %like_count_container%
  • ', 'xing_share' => '
  • %like_count_container%
  • ', 'yummly_share' => '
  • %like_count_container%Yum
  • ', 'reddit_badge' => '
  • %like_count_container%
  • ', 'facebook' => '
  • ', 'twitter' => '
  • ', 'linkedin' => '
  • ', 'print' => '
  • ', 'email' => '
  • ', 'reddit' => '
  • ', 'digg' => '
  • ', 'float_it' => '
  • ', 'tumblr' => '
  • ', 'vkontakte' => '
  • ', 'pinterest' => '
  • ', 'xing' => '
  • ', 'whatsapp' => '
  • ', 'instagram' => '
  • ', 'yummly' => '
  • ', 'buffer' => '
  • ', 'AIM' => '
  • ', 'Amazon_Wish_List' => '
  • ', 'AOL_Mail' => '
  • ', 'App.net' => '
  • ', 'Balatarin' => '
  • ', 'BibSonomy' => '
  • ', 'Bitty_Browser' => '
  • ', 'Blinklist' => '
  • ', 'Blogger_Post' => '
  • ', 'BlogMarks' => '
  • ', 'Bookmarks.fr' => '
  • ', 'Box.net' => '
  • ', 'BuddyMarks' => '
  • ', 'Care2_News' => '
  • ', 'CiteULike' => '
  • ', 'Comment' => '
  • ', 'Copy_Link' => '
  • ', 'Diary.Ru' => '
  • ', 'Diaspora' => '
  • ', 'Diigo' => '
  • ', 'Draugiem' => '
  • ', 'Douban' => '
  • ', 'DZone' => '
  • ', 'Evernote' => '
  • ', 'Fark' => '
  • ', 'Fintel' => '
  • ', 'Flipboard' => '
  • ', 'Folkd' => '
  • ', 'GentleReader' => '
  • ', 'Google_Bookmarks' => '
  • ', 'Google_Classroom' => '
  • ', 'Google_Gmail' => '
  • ', 'Hacker_News' => '
  • ', 'Hatena' => '
  • ', 'Instapaper' => '
  • ', 'Jamespot' => '
  • ', 'Kakao' => '
  • ', 'Kik' => '
  • ', 'Kindle_It' => '
  • ', 'Known' => '
  • ', 'Line' => '
  • ', 'LiveJournal' => '
  • ', 'Mail.Ru' => '
  • ', 'Mendeley' => '
  • ', 'Meneame' => '
  • ', 'MeWe' => '
  • ', 'mix' => '
  • ', 'Mixi' => '
  • ', 'MySpace' => '
  • ', 'Netvouz' => '
  • ', 'NewsVine' => '
  • ', 'NUjij' => '
  • ', 'Odnoklassniki' => '
  • ', 'Outlook.com' => '
  • ', 'Papaly' => '
  • ', 'Pinboard' => '
  • ', 'Plurk' => '
  • ', 'Pocket' => '
  • ', 'PrintFriendly' => '
  • ', 'Protopage_Bookmarks' => '
  • ', 'Pusha' => '
  • ', 'Qzone' => '
  • ', 'Rediff MyPage' => '
  • ', 'Refind' => '
  • ', 'Renren' => '
  • ', 'Segnalo' => '
  • ', 'Sina Weibo' => '
  • ', 'SiteJot' => '
  • ', 'Skype' => '
  • ', 'Slashdot' => '
  • ', 'SMS' => '
  • ', 'StockTwits' => '
  • ', 'Stumpedia' => '
  • ', 'Svejo' => '
  • ', 'Symbaloo_Feeds' => '
  • ', 'Telegram' => '
  • ', 'Threema' => '
  • ', 'Trello' => '
  • ', 'Tuenti' => '
  • ', 'Twiddla' => '
  • ', 'TypePad_Post' => '
  • ', 'Viadeo' => '
  • ', 'Viber' => '
  • ', 'Wanelo' => '
  • ', 'Webnews' => '
  • ', 'WordPress' => '
  • ', 'Wykop' => '
  • ', 'Yahoo_Mail' => '
  • ', 'Yoolink' => '
  • ', 'YouMob' => '
  • ', 'youtube' => '
  • ' ); /** * Social sharing networks for AMP * * @since 3.1.7 */ private $amp_sharing_networks = array( 'facebook_share' => '', 'facebook_like' => '', 'facebook_recommend' => '', 'twitter_tweet' => '', 'linkedin_share' => '', 'pinterest_pin' => '', 'buffer_share' => '', 'xing_share' => '', 'yummly_share' => '', 'facebook' => '', 'twitter' => '', 'linkedin' => '', 'print' => '', 'email' => '', 'reddit' => '', 'digg' => '', 'float_it' => '', 'tumblr' => '', 'vkontakte' => '', 'pinterest' => '', 'xing' => '', 'whatsapp' => '', 'instagram' => '', 'yummly' => '', 'buffer' => '', 'AIM' => '', 'Amazon_Wish_List' => '', 'AOL_Mail' => '', 'App.net' => '', 'Balatarin' => '', 'BibSonomy' => '', 'Bitty_Browser' => '', 'Blinklist' => '', 'Blogger_Post' => '', 'BlogMarks' => '', 'Bookmarks.fr' => '', 'Box.net' => '', 'BuddyMarks' => '', 'Care2_News' => '', 'CiteULike' => '', 'Comment' => '', 'Diary.Ru' => '', 'Diaspora' => '', 'Diigo' => '', 'Draugiem' => '', 'Douban' => '', 'DZone' => '', 'Evernote' => '', 'Fark' => '', 'Fintel' => '', 'Flipboard' => '', 'Folkd' => '', 'GentleReader' => '', 'Google_Bookmarks' => '', 'Google_Classroom' => '', 'Google_Gmail' => '', 'Hacker_News' => '', 'Hatena' => '', 'Instapaper' => '', 'Jamespot' => '', 'Kakao' => '', 'Kik' => '', 'Kindle_It' => '', 'Known' => '', 'Line' => '', 'LiveJournal' => '', 'Mail.Ru' => '', 'Mendeley' => '', 'Meneame' => '', 'MeWe' => '', 'mix' => '', 'Mixi' => '', 'MySpace' => '', 'Netvouz' => '', 'NewsVine' => '', 'NUjij' => '', 'Odnoklassniki' => '', 'Outlook.com' => '', 'Papaly' => '', 'Pinboard' => '', 'Plurk' => '', 'Pocket' => '', 'PrintFriendly' => '', 'Protopage_Bookmarks' => '', 'Pusha' => '', 'Qzone' => '', 'Rediff MyPage' => '', 'Refind' => '', 'Renren' => '', 'Segnalo' => '', 'Sina Weibo' => '', 'SiteJot' => '', 'Skype' => '', 'Slashdot' => '', 'SMS' => '', 'StockTwits' => '', 'Stumpedia' => '', 'Svejo' => '', 'Symbaloo_Feeds' => '', 'Telegram' => '', 'Threema' => '', 'Trello' => '', 'Tuenti' => '', 'Twiddla' => '', 'TypePad_Post' => '', 'Viadeo' => '', 'Viber' => '', 'Wanelo' => '', 'Webnews' => '', 'WordPress' => '', 'Wykop' => '', 'Yahoo_Mail' => '', 'Yahoo_Messenger' => '', 'Yoolink' => '', 'YouMob' => '', 'youtube' => '' ); /** * Fetch social share networks * * @since 1.0.0 */ public function fetch_sharing_networks( $sharing_type ) { $this->sharing_networks['instagram'] = str_replace( '%instagram_username%', $this->options['instagram_username'] != '' ? $this->options['instagram_username'] : $this->options['vertical_instagram_username'], $this->sharing_networks['instagram'] ); $this->sharing_networks['youtube'] = str_replace( '%youtube_username%', $this->options['youtube_username'] != '' ? $this->options['youtube_username'] : $this->options['vertical_youtube_username'], $this->sharing_networks['youtube'] ); $this->sharing_networks['Comment'] = str_replace( '%comment_container_id%', $this->options['comment_container_id'] != '' ? $this->options['comment_container_id'] : $this->options['vertical_comment_container_id'], $this->sharing_networks['Comment'] ); $this->sharing_networks['facebook_share'] = '
  • %like_count_container%
  • '; $this->sharing_networks['facebook_like'] = '
  • %like_count_container%
  • '; $this->sharing_networks['facebook_recommend'] = '
  • %like_count_container%
  • '; $this->sharing_networks['xing_share'] = '
  • %like_count_container%
    options[$sharing_type . '_counts'] ) ? 'data-counter="right" ' : '' ) . 'data-url="%post_url%" data-lang="%language%">
  • '; $fb_key = '1904103319867886'; if ( $this->options['fb_key'] != '' ) { $fb_key = $this->options['fb_key']; } $this->sharing_networks['Facebook_Messenger'] = '
  • '; $whatsapp_share_url = $this->whatsapp_share_api(); $this->sharing_networks['whatsapp'] = '
  • '; return $this->sharing_networks; } /** * Fetch social share networks to display for AMP * * @since 3.1.7 */ public function fetch_amp_sharing_networks() { $this->amp_sharing_networks['instagram'] = str_replace( '%instagram_username%', $this->options['instagram_username'] != '' ? $this->options['instagram_username'] : $this->options['vertical_instagram_username'], $this->amp_sharing_networks['instagram'] ); $this->amp_sharing_networks['youtube'] = str_replace( '%youtube_username%', $this->options['youtube_username'] != '' ? $this->options['youtube_username'] : $this->options['vertical_youtube_username'], $this->amp_sharing_networks['youtube'] ); $this->amp_sharing_networks['Comment'] = str_replace( '%comment_container_id%', $this->options['comment_container_id'] != '' ? $this->options['comment_container_id'] : $this->options['vertical_comment_container_id'], $this->amp_sharing_networks['Comment'] ); $fb_key = '1904103319867886'; if ( $this->options['fb_key'] ) { $fb_key = $this->options['fb_key']; } $this->amp_sharing_networks['Facebook_Messenger'] = ''; return $this->amp_sharing_networks; } /** * Determine which Whatsapp share url to use * * @since 3.2.13 */ private function whatsapp_share_api() { if ( isset( $_SERVER['HTTP_USER_AGENT'] ) ) { // detect the device for Whatsapp share API $iphone = strpos( $_SERVER['HTTP_USER_AGENT'], "iPhone" ); $android = strpos( $_SERVER['HTTP_USER_AGENT'], "Android" ); $palmpre = strpos( $_SERVER['HTTP_USER_AGENT'], "webOS" ); $berry = strpos( $_SERVER['HTTP_USER_AGENT'], "BlackBerry" ); $ipod = strpos( $_SERVER['HTTP_USER_AGENT'], "iPod" ); // check if is a mobile if ( $iphone || $android || $palmpre || $ipod || $berry == true ) { return 'api'; } else { return 'web'; } } return 'api'; } }