options = $options; } /** * Supported Social sharing networks * * @since 1.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%', 'MeWe' => '', 'facebook' => '', 'gettr' => '', 'parler' => '', 'gab' => '', 'twitter' => '', 'linkedin' => '', 'print' => '', 'email' => '', 'reddit' => '', 'mastodon' => '', 'digg' => '', 'float_it' => '', 'tumblr' => '', 'vkontakte' => '', 'pinterest' => '', 'xing' => '', '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' => '', 'Comment' => '', 'Copy_Link' => '', 'Diary.Ru' => '', 'Diaspora' => '', 'Diigo' => '', 'Draugiem' => '', 'Douban' => '', 'Evernote' => '', 'Fark' => '', 'Fintel' => '', 'Flipboard' => '', 'Folkd' => '', 'GentleReader' => '', 'Google_Classroom' => '', 'Google_Gmail' => '', 'Hacker_News' => '', 'Hatena' => '', 'Instapaper' => '', 'Jamespot' => '', 'Kakao' => '', 'Kik' => '', 'Kindle_It' => '', 'Known' => '', 'LiveJournal' => '', 'Mail.Ru' => '', 'Mendeley' => '', 'Meneame' => '', 'mix' => '', 'Mixi' => '', 'MySpace' => '', 'Netvouz' => '', 'NewsVine' => '', 'Odnoklassniki' => '', 'Outlook.com' => '', 'Papaly' => '', 'Pinboard' => '', 'Plurk' => '', 'Pocket' => '', 'PrintFriendly' => '', 'Protopage_Bookmarks' => '', 'Pusha' => '', 'Qzone' => '', 'Rediff MyPage' => '', 'Refind' => '', 'Renren' => '', 'Sina Weibo' => '', 'SiteJot' => '', 'Skype' => '', 'Slashdot' => '', 'SMS' => '', 'StockTwits' => '', 'Svejo' => '', 'Symbaloo_Feeds' => '', 'Telegram' => '', 'Threema' => '', 'Trello' => '', 'Tuenti' => '', 'Twiddla' => '', 'TypePad_Post' => '', 'Viadeo' => '', 'Viber' => '', 'Wykop' => '', 'Yahoo_Mail' => '', 'youtube' => '', 'rutube' => '', 'Google_Translate' => '', 'X' => '', 'teams' => '', 'threads' => '', 'raindrop.io' => '', 'micro.blog' => '', 'bluesky' => '', 'ChatGPT' => '', 'perplexity' => '', 'grok' => '', 'Google_AI' => '', 'claude' => '', ); /** * 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' => '', 'Copy_Link' => '', 'print' => '', 'facebook' => '', 'gettr' => '', 'twitter' => '', 'linkedin' => '', 'parler' => '', 'gab' => '', 'email' => '', 'reddit' => '', 'digg' => '', 'float_it' => '', 'tumblr' => '', 'vkontakte' => '', 'gab' => '', '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' => '', 'Comment' => '', 'Diary.Ru' => '', 'Diaspora' => '', 'Diigo' => '', 'Draugiem' => '', 'Douban' => '', 'Evernote' => '', 'Fark' => '', 'Fintel' => '', 'Flipboard' => '', 'Folkd' => '', 'GentleReader' => '', 'Google_Classroom' => '', 'Google_Gmail' => '', 'Hacker_News' => '', 'Hatena' => '', 'Instapaper' => '', 'Jamespot' => '', 'Kakao' => '', 'Kik' => '', 'Kindle_It' => '', 'Known' => '', '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' => '', 'Wykop' => '', 'Yahoo_Mail' => '', 'Yahoo_Messenger' => '', 'YouMob' => '', 'youtube' => '', 'rutube' => '', 'Google_Translate' => '', 'X' => '', 'teams' => '', 'bluesky' => '', 'threads' => '', 'raindrop.io' => '', 'micro.blog' => '', 'ChatGPT' => '', 'perplexity' => '', 'grok' => '', 'Google_AI' => '', 'claude' => '', ); /** * Fetch social share networks * * @since 1.0 */ public function fetch_sharing_networks( $sharing_type ) { $inner_style = isset( $this->options['save_share_count'] ) ? '%inner_style%' : 'display:block'; $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['Google_News'] = ''; $this->sharing_networks['rss'] = ''; $this->sharing_networks['rutube'] = str_replace( '%rutube_username%', $this->options['rutube_username'] != '' ? $this->options['rutube_username'] : $this->options['vertical_rutube_username'], $this->sharing_networks['rutube'] ); $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['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'; $this->sharing_networks['Facebook_Messenger'] = ''; $this->sharing_networks['Line'] = ''; $this->sharing_networks['whatsapp'] = ''; $this->sharing_networks['WordPress'] = ''; return $this->sharing_networks; } /** * Fetch social share networks to display for AMP * * @since 3.1.7 */ public function fetch_amp_sharing_networks() { $pinterest_share_url = ''; if ( ( isset( $this->options['horizontal_re_providers'] ) && is_array( $this->options['horizontal_re_providers'] ) && in_array( 'pinterest', $this->options['horizontal_re_providers'] ) ) || ( isset( $this->options['vertical_re_providers'] ) && is_array( $this->options['vertical_re_providers'] ) && in_array( 'pinterest', $this->options['vertical_re_providers'] ) ) ) { global $post; $pinterest_image_url = ''; if ( is_object( $post ) && has_post_thumbnail( $post->ID ) ) { $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'single-post-thumbnail' ); if ( isset( $image[0] ) && $image[0] ) { $pinterest_image_url = $image[0]; } } if ( $pinterest_image_url ) { $pinterest_share_url = 'http://pinterest.com/pin/create/link/?url=%encoded_post_url%&media=' . $pinterest_image_url . '&description=%post_title%'; } else { $pinterest_share_url = 'http://pinterest.com/pin/create/link/?url=%encoded_post_url%'; } } $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['Google_News'] = ''; $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['rutube'] = str_replace( '%rutube_username%', $this->options['rutube_username'] != '' ? $this->options['rutube_username'] : $this->options['vertical_rutube_username'], $this->amp_sharing_networks['rutube'] ); $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'; $this->amp_sharing_networks['Facebook_Messenger'] = ''; $this->amp_sharing_networks['pinterest'] = ''; $this->amp_sharing_networks['WordPress'] = ''; $this->amp_sharing_networks['rss'] = ''; $this->amp_sharing_networks['mastodon'] = ''; $this->amp_sharing_networks['Line'] = ''; return $this->amp_sharing_networks; } /** * Check if webpage is being visited in a mobile device * * @since 3.3.9 */ private function check_if_mobile() { 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 it's a mobile if ( $iphone || $android || $palmpre || $ipod || $berry == true ) { return true; } } return false; } }