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/prima-world/wp-content/plugins/wp-seopress-pro/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/web/dev.agtindia.co.in/prima-world/wp-content/plugins/wp-seopress-pro/seopress-pro.php
<?php
/*
Plugin Name: SEOPress PRO
Plugin URI: https://www.seopress.org/seopress-pro/
Description: The PRO version of SEOPress. SEOPress required (free).
Version: 6.2.0.1
Author: The SEO Guys at SEOPress
Author URI: https://www.seopress.org/seopress-pro/
License: GPLv2
Text Domain: wp-seopress-pro
Domain Path: /languages
*/

/*  Copyright 2016 - 2023 - Benjamin Denis  (email : contact@seopress.org)

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License, version 2, as
    published by the Free Software Foundation.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
*/

// To prevent calling the plugin directly
if ( ! function_exists('add_action')) {
    echo 'Please don&rsquo;t call the plugin directly. Thanks :)';
    exit;
}

///////////////////////////////////////////////////////////////////////////////////////////////////
//CRON
///////////////////////////////////////////////////////////////////////////////////////////////////
function seopress_pro_cron() {
    //CRON - 404 cleaning
    if ( ! wp_next_scheduled('seopress_404_cron_cleaning')) {
        wp_schedule_event(time(), 'daily', 'seopress_404_cron_cleaning');
    }

    //CRON - GA stats in dashboard
    if ( ! wp_next_scheduled('seopress_google_analytics_cron')) {
        wp_schedule_event(time(), 'hourly', 'seopress_google_analytics_cron');
    }

    //CRON - Matomo stats in dashboard
    if ( ! wp_next_scheduled('seopress_matomo_analytics_cron')) {
        wp_schedule_event(time(), 'hourly', 'seopress_matomo_analytics_cron');
    }

    //CRON - Page Speed Insights
    if ( ! wp_next_scheduled('seopress_page_speed_insights_cron')) {
        wp_schedule_event(time(), 'daily', 'seopress_page_speed_insights_cron');
    }
}

///////////////////////////////////////////////////////////////////////////////////////////////////
//Hooks activation
///////////////////////////////////////////////////////////////////////////////////////////////////
// Deactivate SEOPress PRO if the Free version is not activated/installed
//@since version 3.8.1
function seopress_pro_loaded() {
    require_once ABSPATH . 'wp-admin/includes/plugin.php';
    if ( ! function_exists('deactivate_plugins')) {
        return;
    }

    if ( ! is_plugin_active('wp-seopress/seopress.php')) {//if SEOPress Free NOT activated
        deactivate_plugins('wp-seopress-pro/seopress-pro.php');
        add_action('admin_notices', 'seopress_pro_notice');
    }
}
add_action('plugins_loaded', 'seopress_pro_loaded');

function seopress_pro_activation() {
    require_once ABSPATH . 'wp-admin/includes/plugin.php';
    if ( ! function_exists('activate_plugins')) {
        return;
    }

    if ( ! function_exists('get_plugins')) {
        return;
    }

    $plugins = get_plugins();
    if ( ! empty($plugins['wp-seopress/seopress.php'])) {//if SEOPress Free is installed
        if ( ! is_plugin_active('wp-seopress/seopress.php')) {//if SEOPress Free is not activated
            activate_plugins('wp-seopress/seopress.php');
        }
        add_option('seopress_pro_activated', 'yes');

        flush_rewrite_rules(false);

        seopress_pro_cron();
    }

    //Add Redirections caps to user with "manage_options" capability
    $roles = get_editable_roles();
    if ( ! empty($roles)) {
        foreach ($GLOBALS['wp_roles']->role_objects as $key => $role) {
            if (isset($roles[$key]) && $role->has_cap('manage_options')) {
                $role->add_cap('edit_redirection');
                $role->add_cap('edit_redirections');
                $role->add_cap('edit_others_redirections');
                $role->add_cap('publish_redirections');
                $role->add_cap('read_redirection');
                $role->add_cap('read_private_redirections');
                $role->add_cap('delete_redirection');
                $role->add_cap('delete_redirections');
                $role->add_cap('delete_others_redirections');
                $role->add_cap('delete_published_redirections');
            }
            if (isset($roles[$key]) && $role->has_cap('manage_options')) {
                $role->add_cap('edit_schema');
                $role->add_cap('edit_schemas');
                $role->add_cap('edit_others_schemas');
                $role->add_cap('publish_schemas');
                $role->add_cap('read_schema');
                $role->add_cap('read_private_schemas');
                $role->add_cap('delete_schema');
                $role->add_cap('delete_schemas');
                $role->add_cap('delete_others_schemas');
                $role->add_cap('delete_published_schemas');
            }
        }
    }

    do_action('seopress_pro_activation');
}
register_activation_hook(__FILE__, 'seopress_pro_activation');

function seopress_pro_deactivation() {
    delete_option('seopress_pro_activated');
    flush_rewrite_rules(false);
    wp_clear_scheduled_hook('seopress_404_cron_cleaning');
    wp_clear_scheduled_hook('seopress_google_analytics_cron');
    wp_clear_scheduled_hook('seopress_page_speed_insights_cron');
    do_action('seopress_pro_deactivation');
}
register_deactivation_hook(__FILE__, 'seopress_pro_deactivation');

/**
 * Hooks uninstall.
 *
 * @since 4.2
 *
 * @author Benjamin
 */
function seopress_pro_uninstall() {
    //Remove CRON
    wp_clear_scheduled_hook('seopress_404_cron_cleaning');
    wp_clear_scheduled_hook('seopress_google_analytics_cron');
    wp_clear_scheduled_hook('seopress_page_speed_insights_cron');
}

///////////////////////////////////////////////////////////////////////////////////////////////////
//Define
///////////////////////////////////////////////////////////////////////////////////////////////////
define('SEOPRESS_PRO_VERSION', '6.2.0.1');
define('SEOPRESS_PRO_AUTHOR', 'Benjamin Denis');
define('STORE_URL_SEOPRESS', 'https://www.seopress.org');
define('ITEM_ID_SEOPRESS', 113);
define('ITEM_NAME_SEOPRESS', 'SEOPress PRO');
define('SEOPRESS_LICENSE_PAGE', 'seopress-license');
define('SEOPRESS_PRO_PLUGIN_DIR_PATH', plugin_dir_path(__FILE__));
define('SEOPRESS_PRO_PLUGIN_DIR_URL', plugin_dir_url(__FILE__));
define('SEOPRESS_PRO_ASSETS_DIR', SEOPRESS_PRO_PLUGIN_DIR_URL . 'assets');
define('SEOPRESS_PRO_PUBLIC_URL', SEOPRESS_PRO_PLUGIN_DIR_URL . 'public');
define('SEOPRESS_PRO_TEMPLATE_DIR', SEOPRESS_PRO_PLUGIN_DIR_PATH . 'templates');
define('SEOPRESS_PRO_TEMPLATE_JSON_SCHEMAS', SEOPRESS_PRO_TEMPLATE_DIR . '/json-schemas');
define('SEOPRESS_PRO_TEMPLATE_STOP_WORDS', SEOPRESS_PRO_TEMPLATE_DIR . '/stop-words');

use SEOPressPro\Core\Kernel;

require_once __DIR__ . '/seopress-autoload.php';

if (file_exists(__DIR__ . '/vendor/autoload.php') && file_exists(WP_PLUGIN_DIR . '/wp-seopress/seopress-autoload.php')) {
    require_once WP_PLUGIN_DIR . '/wp-seopress/seopress-autoload.php';
    require_once __DIR__ . '/seopress-pro-functions.php';
    require_once __DIR__ . '/inc/admin/cron.php';

    $versions = get_option('seopress_versions');
    $versionFree = isset($versions['free']) ? $versions['free'] : 0;
    if ('6.2.0.1' !== $versionFree && version_compare($versionFree, '4.5.1', '<=')) {
        return;
    }

    Kernel::execute([
        'file' => __FILE__,
        'slug' => 'wp-seopress-pro',
        'main_file' => 'seopress-pro',
        'root' => __DIR__,
    ]);
}

function seopress_rich_snippets_publisher_logo_option() {
    $seopress_rich_snippets_publisher_logo_option = get_option('seopress_pro_option_name');
    if ( ! empty($seopress_rich_snippets_publisher_logo_option)) {
        foreach ($seopress_rich_snippets_publisher_logo_option as $key => $seopress_rich_snippets_publisher_logo_value) {
            $options[$key] = $seopress_rich_snippets_publisher_logo_value;
        }
        if (isset($seopress_rich_snippets_publisher_logo_option['seopress_rich_snippets_publisher_logo'])) {
            return $seopress_rich_snippets_publisher_logo_option['seopress_rich_snippets_publisher_logo'];
        }
    }
}

///////////////////////////////////////////////////////////////////////////////////////////////////
//SEOPRESS PRO INIT
///////////////////////////////////////////////////////////////////////////////////////////////////
function seopress_pro_init() {
    //CRON
    seopress_pro_cron();

    //i18n
    load_plugin_textdomain('wp-seopress-pro', false, dirname(plugin_basename(__FILE__)) . '/languages/');

    global $pagenow;

    if ( ! function_exists('seopress_capability')) {
        return;
    }

    if (is_admin() || is_network_admin()) {
        require_once dirname(__FILE__) . '/inc/admin/admin.php';
        require_once dirname(__FILE__) . '/inc/admin/ajax.php';
        if ('post-new.php' == $pagenow || 'post.php' == $pagenow) {
            require_once dirname(__FILE__) . '/inc/admin/metaboxes/admin-metaboxes.php';
        }

        if ('index.php' == $pagenow || (isset($_GET['page']) && 'seopress-option' === $_GET['page'])) {
            require_once dirname(__FILE__) . '/inc/admin/wp-dashboard/google-analytics.php';
            require_once dirname(__FILE__) . '/inc/admin/wp-dashboard/matomo.php';
        }

        //CSV Import
        include_once dirname(__FILE__) . '/inc/admin/import/class-csv-wizard.php';

        //Bot
        require_once dirname(__FILE__) . '/inc/admin/bot.php';
        require_once dirname(__FILE__) . '/inc/functions/bot/seopress-bot.php';
    }

    // Watchers
    require_once dirname(__FILE__) . '/inc/admin/watchers/index.php';

    //Redirections
    if (is_admin()) {
        if (function_exists('seopress_get_toggle_option') && '1' === seopress_get_toggle_option('404')) {
            require_once dirname(__FILE__) . '/inc/admin/redirections/redirections.php';
        }
    }
    require_once dirname(__FILE__) . '/inc/functions/options.php';

    //Elementor
    if (did_action('elementor/loaded')) {
        require_once dirname(__FILE__) . '/inc/admin/elementor/elementor.php';
    }

    //TranslationsPress
    if ( ! class_exists('SEOPRESS_Language_Packs')) {
        if (is_admin() || is_network_admin()) {
            require_once dirname(__FILE__) . '/inc/admin/updater/t15s-registry.php';
        }
    }

    // Blocks registration
    require_once dirname(__FILE__) . '/inc/functions/blocks.php';
}
add_action('plugins_loaded', 'seopress_pro_init', 999);

///////////////////////////////////////////////////////////////////////////////////////////////////
//TranslationsPress
///////////////////////////////////////////////////////////////////////////////////////////////////

function seopress_init_t15s() {
    if (class_exists('SEOPRESS_Language_Packs')) {
        $t15s_updater = new SEOPRESS_Language_Packs(
            'wp-seopress-pro',
            'https://packages.translationspress.com/seopress/wp-seopress-pro/packages.json'
        );
    }
}
add_action('init', 'seopress_init_t15s');




///////////////////////////////////////////////////////////////////////////////////////////////////
//Check if a feature is ON
///////////////////////////////////////////////////////////////////////////////////////////////////
//Google Data Structured Types metaboxe ON?
function seopress_rich_snippets_enable_option() {
    $seopress_rich_snippets_enable_option = get_option('seopress_pro_option_name');
    if ( ! empty($seopress_rich_snippets_enable_option)) {
        foreach ($seopress_rich_snippets_enable_option as $key => $seopress_rich_snippets_enable_value) {
            $options[$key] = $seopress_rich_snippets_enable_value;
        }
        if (isset($seopress_rich_snippets_enable_option['seopress_rich_snippets_enable'])) {
            return $seopress_rich_snippets_enable_option['seopress_rich_snippets_enable'];
        }
    }
}

// Is WooCommerce enable?
//@deprecated since version 3.8
function seopress_get_toggle_woocommerce_option() {
    $seopress_get_toggle_woocommerce_option = get_option('seopress_toggle');
    if ( ! empty($seopress_get_toggle_woocommerce_option)) {
        foreach ($seopress_get_toggle_woocommerce_option as $key => $seopress_get_toggle_woocommerce_value) {
            $options[$key] = $seopress_get_toggle_woocommerce_value;
        }
        if (isset($seopress_get_toggle_woocommerce_option['toggle-woocommerce'])) {
            return $seopress_get_toggle_woocommerce_option['toggle-woocommerce'];
        }
    }
}
// Is EDD enable?
//@deprecated since version 3.8
function seopress_get_toggle_edd_option() {
    $seopress_get_toggle_edd_option = get_option('seopress_toggle');
    if ( ! empty($seopress_get_toggle_edd_option)) {
        foreach ($seopress_get_toggle_edd_option as $key => $seopress_get_toggle_edd_value) {
            $options[$key] = $seopress_get_toggle_edd_value;
        }
        if (isset($seopress_get_toggle_edd_option['toggle-edd'])) {
            return $seopress_get_toggle_edd_option['toggle-edd'];
        }
    }
}
// Is Local Business enable?
//@deprecated since version 3.8
function seopress_get_toggle_local_business_option() {
    $seopress_get_toggle_local_business_option = get_option('seopress_toggle');
    if ( ! empty($seopress_get_toggle_local_business_option)) {
        foreach ($seopress_get_toggle_local_business_option as $key => $seopress_get_toggle_local_business_value) {
            $options[$key] = $seopress_get_toggle_local_business_value;
        }
        if (isset($seopress_get_toggle_local_business_option['toggle-local-business'])) {
            return $seopress_get_toggle_local_business_option['toggle-local-business'];
        }
    }
}
// Is Dublin Core enable?
//@deprecated since version 3.8
function seopress_get_toggle_dublin_core_option() {
    $seopress_get_toggle_dublin_core_option = get_option('seopress_toggle');
    if ( ! empty($seopress_get_toggle_dublin_core_option)) {
        foreach ($seopress_get_toggle_dublin_core_option as $key => $seopress_get_toggle_dublin_core_value) {
            $options[$key] = $seopress_get_toggle_dublin_core_value;
        }
        if (isset($seopress_get_toggle_dublin_core_option['toggle-dublin-core'])) {
            return $seopress_get_toggle_dublin_core_option['toggle-dublin-core'];
        }
    }
}
// Is Rich Snippets enable?
//@deprecated since version 3.8
function seopress_get_toggle_rich_snippets_option() {
    $seopress_get_toggle_rich_snippets_option = get_option('seopress_toggle');
    if ( ! empty($seopress_get_toggle_rich_snippets_option)) {
        foreach ($seopress_get_toggle_rich_snippets_option as $key => $seopress_get_toggle_rich_snippets_value) {
            $options[$key] = $seopress_get_toggle_rich_snippets_value;
        }
        if (isset($seopress_get_toggle_rich_snippets_option['toggle-rich-snippets'])) {
            return $seopress_get_toggle_rich_snippets_option['toggle-rich-snippets'];
        }
    }
}
// Is Breadcrumbs enable?
//@deprecated since version 3.8
function seopress_get_toggle_breadcrumbs_option() {
    $seopress_get_toggle_breadcrumbs_option = get_option('seopress_toggle');
    if ( ! empty($seopress_get_toggle_breadcrumbs_option)) {
        foreach ($seopress_get_toggle_breadcrumbs_option as $key => $seopress_get_toggle_breadcrumbs_value) {
            $options[$key] = $seopress_get_toggle_breadcrumbs_value;
        }
        if (isset($seopress_get_toggle_breadcrumbs_option['toggle-breadcrumbs'])) {
            return $seopress_get_toggle_breadcrumbs_option['toggle-breadcrumbs'];
        }
    }
}
// Is Robots enable?
//@deprecated since version 3.8
function seopress_get_toggle_robots_option() {
    $seopress_get_toggle_robots_option = get_option('seopress_toggle');
    if ( ! empty($seopress_get_toggle_robots_option)) {
        foreach ($seopress_get_toggle_robots_option as $key => $seopress_get_toggle_robots_value) {
            $options[$key] = $seopress_get_toggle_robots_value;
        }
        if (isset($seopress_get_toggle_robots_option['toggle-robots'])) {
            return $seopress_get_toggle_robots_option['toggle-robots'];
        }
    }
}
// Is Google News enable?
//@deprecated since version 3.8
function seopress_get_toggle_news_option() {
    $seopress_get_toggle_news_option = get_option('seopress_toggle');
    if ( ! empty($seopress_get_toggle_news_option)) {
        foreach ($seopress_get_toggle_news_option as $key => $seopress_get_toggle_news_value) {
            $options[$key] = $seopress_get_toggle_news_value;
        }
        if (isset($seopress_get_toggle_news_option['toggle-news'])) {
            return $seopress_get_toggle_news_option['toggle-news'];
        }
    }
}
// Is 404/301 enable?
//@deprecated since version 3.8
function seopress_get_toggle_404_option() {
    $seopress_get_toggle_404_option = get_option('seopress_toggle');
    if ( ! empty($seopress_get_toggle_404_option)) {
        foreach ($seopress_get_toggle_404_option as $key => $seopress_get_toggle_404_value) {
            $options[$key] = $seopress_get_toggle_404_value;
        }
        if (isset($seopress_get_toggle_404_option['toggle-404'])) {
            return $seopress_get_toggle_404_option['toggle-404'];
        }
    }
}
// Is Bot enable?
//@deprecated since version 3.8
function seopress_get_toggle_bot_option() {
    $seopress_get_toggle_bot_option = get_option('seopress_toggle');
    if ( ! empty($seopress_get_toggle_bot_option)) {
        foreach ($seopress_get_toggle_bot_option as $key => $seopress_get_toggle_bot_value) {
            $options[$key] = $seopress_get_toggle_bot_value;
        }
        if (isset($seopress_get_toggle_bot_option['toggle-bot'])) {
            return $seopress_get_toggle_bot_option['toggle-bot'];
        }
    }
}
//Rewrite ON?
//@deprecated since version 3.8
function seopress_get_toggle_rewrite_option() {
    $seopress_get_toggle_rewrite_option = get_option('seopress_toggle');
    if ( ! empty($seopress_get_toggle_rewrite_option)) {
        foreach ($seopress_get_toggle_rewrite_option as $key => $seopress_get_toggle_rewrite_value) {
            $options[$key] = $seopress_get_toggle_rewrite_value;
        }
        if (isset($seopress_get_toggle_rewrite_option['toggle-rewrite'])) {
            return $seopress_get_toggle_rewrite_option['toggle-rewrite'];
        }
    }
}
//White Label?
function seopress_get_toggle_white_label_option() {
    if (is_multisite()) {
        $seopress_toggle = get_blog_option(get_network()->site_id, 'seopress_toggle');
    } else {
        $seopress_toggle = get_option('seopress_toggle');
    }
    $seopress_get_toggle_white_label_option = $seopress_toggle;
    if ( ! empty($seopress_get_toggle_white_label_option)) {
        foreach ($seopress_get_toggle_white_label_option as $key => $seopress_get_toggle_white_label_value) {
            $options[$key] = $seopress_get_toggle_white_label_value;
        }
        if (isset($seopress_get_toggle_white_label_option['toggle-white-label'])) {
            return $seopress_get_toggle_white_label_option['toggle-white-label'];
        }
    }
}

///////////////////////////////////////////////////////////////////////////////////////////////////
//Loads the JS/CSS in admin
///////////////////////////////////////////////////////////////////////////////////////////////////
//Google Page Speed Insights
function seopress_pro_admin_ps_scripts() {
    wp_enqueue_script('seopress-page-speed', plugins_url('assets/js/seopress-page-speed.js', __FILE__), ['jquery', 'jquery-ui-accordion'], SEOPRESS_PRO_VERSION, true);

    $seopress_request_page_speed = [
        'seopress_nonce' => wp_create_nonce('seopress_request_page_speed_nonce'),
        'seopress_request_page_speed' => admin_url('admin-ajax.php'),
    ];
    wp_localize_script('seopress-page-speed', 'seopressAjaxRequestPageSpeed', $seopress_request_page_speed);

    $seopress_clear_page_speed_cache = [
        'seopress_nonce' => wp_create_nonce('seopress_clear_page_speed_cache_nonce'),
        'seopress_clear_page_speed_cache' => admin_url('admin-ajax.php'),
    ];
    wp_localize_script('seopress-page-speed', 'seopressAjaxClearPageSpeedCache', $seopress_clear_page_speed_cache);
}

//SEOPRESS PRO Options page
function seopress_pro_add_admin_options_scripts($hook) {
    $prefix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';

    wp_register_style('seopress-pro-admin', plugins_url('assets/css/seopress-pro' . $prefix . '.css', __FILE__), [], SEOPRESS_PRO_VERSION);
    wp_enqueue_style('seopress-pro-admin');

    //Dashboard GA
    global $pagenow;
    if ('index.php' == $pagenow || (isset($_GET['page']) && 'seopress-option' === $_GET['page'])) {
        if (function_exists('seopress_google_analytics_dashboard_widget_option') && seopress_google_analytics_dashboard_widget_option() !== '1') {
            wp_register_style('seopress-ga-dashboard-widget', plugins_url('assets/css/seopress-pro-dashboard' . $prefix . '.css', __FILE__), [], SEOPRESS_PRO_VERSION);
            wp_enqueue_style('seopress-ga-dashboard-widget');

            //GA API
            wp_enqueue_script('seopress-pro-ga-embed', plugins_url('assets/js/chart.bundle.min.js', __FILE__), [], SEOPRESS_PRO_VERSION);

            wp_enqueue_script('seopress-pro-ga', plugins_url('assets/js/seopress-pro-ga.js', __FILE__), ['jquery', 'jquery-ui-tabs'], SEOPRESS_PRO_VERSION);

            $seopress_request_google_analytics = [
                'seopress_nonce' => wp_create_nonce('seopress_request_google_analytics_nonce'),
                'seopress_request_google_analytics' => admin_url('admin-ajax.php'),
            ];
            wp_localize_script('seopress-pro-ga', 'seopressAjaxRequestGoogleAnalytics', $seopress_request_google_analytics);
        }
    }

    //Dashboard Matomo
    global $pagenow;
    if ('index.php' == $pagenow || (isset($_GET['page']) && 'seopress-option' === $_GET['page'])) {
        if (function_exists('seopress_google_analytics_matomo_dashboard_widget_option') && seopress_google_analytics_matomo_dashboard_widget_option() !== '1') {
            wp_register_style('seopress-ga-dashboard-widget', plugins_url('assets/css/seopress-pro-dashboard' . $prefix . '.css', __FILE__), [], SEOPRESS_PRO_VERSION);
            wp_enqueue_style('seopress-ga-dashboard-widget');

            //Matomo API
            wp_enqueue_script('seopress-pro-ga-embed', plugins_url('assets/js/chart.bundle.min.js', __FILE__), [], SEOPRESS_PRO_VERSION);

            wp_enqueue_script('seopress-pro-matomo', plugins_url('assets/js/seopress-pro-matomo.js', __FILE__), ['jquery', 'jquery-ui-tabs'], SEOPRESS_PRO_VERSION);

            $seopress_request_matomo_analytics = [
                'seopress_nonce' => wp_create_nonce('seopress_request_matomo_analytics_nonce'),
                'seopress_request_matomo_analytics' => admin_url('admin-ajax.php'),
            ];
            wp_localize_script('seopress-pro-matomo', 'seopressAjaxRequestMatomoAnalytics', $seopress_request_matomo_analytics);
        }
    }

    //Local Business widget
    if ('widgets.php' == $pagenow) {
        wp_enqueue_script('seopress-pro-lb-widget', plugins_url('assets/js/seopress-pro-lb-widget.js', __FILE__), ['jquery', 'jquery-ui-tabs'], SEOPRESS_PRO_VERSION);

        $seopress_pro_lb_widget = [
            'seopress_nonce' => wp_create_nonce('seopress_pro_lb_widget_nonce'),
            'seopress_pro_lb_widget' => admin_url('admin-ajax.php'),
        ];
        wp_localize_script('seopress-pro-lb-widget', 'seopressAjaxLocalBusinessOrder', $seopress_pro_lb_widget);
    }

    //GA tab
    if (isset($_GET['page']) && ('seopress-google-analytics' == $_GET['page'])) {
        wp_enqueue_script('seopress-pro-ga-lock', plugins_url('assets/js/seopress-pro-ga-lock.js', __FILE__), ['jquery'], SEOPRESS_PRO_VERSION, true);

        $seopress_google_analytics_lock = [
            'seopress_nonce' => wp_create_nonce('seopress_google_analytics_lock_nonce'),
            'seopress_google_analytics_lock' => admin_url('admin-ajax.php'),
        ];
        wp_localize_script('seopress-pro-ga-lock', 'seopressAjaxLockGoogleAnalytics', $seopress_google_analytics_lock);
    }

    //Pro Tabs
    if (isset($_GET['page']) && ('seopress-pro-page' == $_GET['page'])) {
        wp_enqueue_script('seopress-pro-admin-tabs-js', plugins_url('assets/js/seopress-pro-tabs.js', __FILE__), ['jquery-ui-tabs'], SEOPRESS_PRO_VERSION);
        wp_enqueue_script('seopress-pro-search-console-js', plugins_url('assets/js/seopress-pro-search-console.js', __FILE__), ['jquery'], SEOPRESS_PRO_VERSION);

        $search_console = [
            'seopress_nonce' => wp_create_nonce('seopress_request_bot_nonce'),
            'seopress_request_bot' => admin_url('admin-ajax.php'),
            'seopress_nonce_search_console' => wp_create_nonce('seopress_nonce_search_console'),
            'seopress_search_console_batch_process' => apply_filters('seopress_search_console_batch_process', 20),
            'i18n' => [
                'progress_matches' => __('%s matches.', 'wp-seopress-pro'),
                'finish_matches' => __('The analysis is complete. We have matched %s urls. Go to post / page or post types list to see your metrics.', 'wp-seopress-pro'),
            ]
        ];
        wp_localize_script('seopress-pro-search-console-js', 'seopressAjaxGSC', $search_console);
    }

    if (isset($_GET['page']) && ('seopress-pro-page' == $_GET['page'] || 'seopress-network-option' == $_GET['page'])) {
        //htaccess
        wp_enqueue_script('seopress-save-htaccess', plugins_url('assets/js/seopress-htaccess.js', __FILE__), ['jquery'], SEOPRESS_PRO_VERSION, true);

        $seopress_save_htaccess = [
            'seopress_nonce' => wp_create_nonce('seopress_save_htaccess_nonce'),
            'seopress_save_htaccess' => admin_url('admin-ajax.php'),
        ];
        wp_localize_script('seopress-save-htaccess', 'seopressAjaxSaveHtaccess', $seopress_save_htaccess);

        wp_enqueue_media();
    }

    //Google Page Speed
    if ('edit.php' == $hook) {
        seopress_pro_admin_ps_scripts();
    } elseif (isset($_GET['page']) && ('seopress-pro-page' == $_GET['page'])) {
        seopress_pro_admin_ps_scripts();
    }

    //Bot Tabs
    if (isset($_GET['page']) && ('seopress-bot-batch' == $_GET['page'])) {
        wp_enqueue_script('seopress-bot-admin-tabs-js', plugins_url('assets/js/seopress-bot-tabs.js', __FILE__), ['jquery-ui-tabs'], SEOPRESS_PRO_VERSION);


        $seopress_bot = [
            'seopress_nonce' => wp_create_nonce('seopress_request_bot_nonce'),
            'seopress_request_bot' => admin_url('admin-ajax.php'),
        ];
        wp_localize_script('seopress-bot-admin-tabs-js', 'seopressAjaxBot', $seopress_bot);
    }

    //License
    if (isset($_GET['page']) && ('seopress-license' == $_GET['page'])) {
        wp_enqueue_script('seopress-license', plugins_url('assets/js/seopress-pro-license.js', __FILE__), ['jquery'], SEOPRESS_PRO_VERSION, true);

        $seopress_request_reset_license = [
            'seopress_nonce' => wp_create_nonce('seopress_request_reset_license_nonce'),
            'seopress_request_reset_license' => admin_url('admin-ajax.php'),
        ];
        wp_localize_script('seopress-license', 'seopressAjaxResetLicense', $seopress_request_reset_license);
    }
}

add_action('admin_enqueue_scripts', 'seopress_pro_add_admin_options_scripts', 10, 1);

///////////////////////////////////////////////////////////////////////////////////////////////////
//SEOPress PRO Notices
///////////////////////////////////////////////////////////////////////////////////////////////////
function seopress_pro_notice() {
    if ( ! is_plugin_active('wp-seopress/seopress.php') && current_user_can('manage_options')) {
        ?>
<div class="notice error">
    <p>
        <?php _e('Please enable <strong>SEOPress</strong> in order to use SEOPress PRO.', 'wp-seopress-pro'); ?>
        <a href="<?php echo esc_url(admin_url('plugin-install.php?tab=plugin-information&plugin=wp-seopress&TB_iframe=true&width=600&height=550')); ?>"
            class="thickbox btn btnPrimary" target="_blank"><?php _e('Enable / Download now!', 'wp-seopress-pro'); ?></a>
    </p>
</div>
<?php
    }
}
add_action('admin_notices', 'seopress_pro_notice');

///////////////////////////////////////////////////////////////////////////////////////////////////
//Shortcut settings page
///////////////////////////////////////////////////////////////////////////////////////////////////
add_filter('plugin_action_links', 'seopress_pro_plugin_action_links', 10, 2);
function seopress_pro_plugin_action_links($links, $file) {
    static $this_plugin;

    if ( ! $this_plugin) {
        $this_plugin = plugin_basename(__FILE__);
    }

    if ($file == $this_plugin) {
        $settings_link = '<a href="' . admin_url('admin.php?page=seopress-pro-page') . '">' . __('Settings', 'wp-seopress-pro') . '</a>';

        $website_link = '<a href="https://www.seopress.org/support/" target="_blank">' . __('Support', 'wp-seopress-pro') . '</a>';

        if ('valid' != get_option('seopress_pro_license_status')) {
            $license_link = '<a style="color:red;font-weight:bold" href="' . admin_url('admin.php?page=seopress-license') . '">' . __('Activate your license', 'wp-seopress-pro') . '</a>';
        } else {
            $license_link = '<a href="' . admin_url('admin.php?page=seopress-license') . '">' . __('License', 'wp-seopress-pro') . '</a>';
        }

        if (function_exists('seopress_get_toggle_white_label_option') && '1' == seopress_get_toggle_white_label_option() && function_exists('seopress_white_label_help_links_option') && '1' === seopress_white_label_help_links_option()) {
            array_unshift($links, $settings_link);
        } else {
            array_unshift($links, $settings_link, $website_link, $license_link);
        }
    }

    return $links;
}

///////////////////////////////////////////////////////////////////////////////////////////////////
//SEOPress PRO Updater
///////////////////////////////////////////////////////////////////////////////////////////////////
if ( ! class_exists('SEOPRESS_Updater')) {
    // load our custom updater
    require_once dirname(__FILE__) . '/inc/admin/updater/plugin-updater.php';
    require_once dirname(__FILE__) . '/inc/admin/updater/plugin-upgrader.php';
}

function SEOPRESS_Updater() {
    // To support auto-updates, this needs to run during the wp_version_check cron job for privileged users.
    $doing_cron = defined('DOING_CRON') && DOING_CRON;
    if ( ! current_user_can('manage_options') && ! $doing_cron) {
        return;
    }

    // retrieve our license key from the DB
    $license_key = defined('SEOPRESS_LICENSE_KEY') && ! empty(SEOPRESS_LICENSE_KEY) && is_string(SEOPRESS_LICENSE_KEY) ? SEOPRESS_LICENSE_KEY : trim(get_option('seopress_pro_license_key'));

    // setup the updater
    $edd_updater = new SEOPRESS_Updater(
        STORE_URL_SEOPRESS,
        __FILE__,
        [
            'version' => SEOPRESS_PRO_VERSION,
            'license' => $license_key,
            'item_id' => ITEM_ID_SEOPRESS,
            'author' => SEOPRESS_PRO_AUTHOR,
            'url' => home_url(),
            'beta' => false,
        ]
    );
}
add_action('init', 'SEOPRESS_Updater', 0);

///////////////////////////////////////////////////////////////////////////////////////////////////
//Google News Sitemap
///////////////////////////////////////////////////////////////////////////////////////////////////
function seopress_xml_sitemap_news_enable_option() {
    $seopress_xml_sitemap_news_enable_option = get_option('seopress_pro_option_name');
    if ( ! empty($seopress_xml_sitemap_news_enable_option)) {
        foreach ($seopress_xml_sitemap_news_enable_option as $key => $seopress_xml_sitemap_news_enable_value) {
            $options[$key] = $seopress_xml_sitemap_news_enable_value;
        }
        if (isset($seopress_xml_sitemap_news_enable_option['seopress_news_enable'])) {
            return $seopress_xml_sitemap_news_enable_option['seopress_news_enable'];
        }
    }
}

//WPML compatibility
if (defined('ICL_SITEPRESS_VERSION')) {
    add_filter('request', 'seopress_wpml_block_secondary_languages2');
}
function seopress_wpml_block_secondary_languages2($q) {
    $current_language = apply_filters('wpml_current_language', false);
    $default_language = apply_filters('wpml_default_language', false);
    if ($current_language !== $default_language) {
        unset($q['seopress_news']);
    }

    return $q;
}

///////////////////////////////////////////////////////////////////////////////////////////////////
//Video XML Sitemap
///////////////////////////////////////////////////////////////////////////////////////////////////
function seopress_xml_sitemap_video_enable_option() {
    $seopress_xml_sitemap_video_enable_option = get_option('seopress_xml_sitemap_option_name');
    if ( ! empty($seopress_xml_sitemap_video_enable_option)) {
        if (isset($seopress_xml_sitemap_video_enable_option['seopress_xml_sitemap_video_enable'])) {
            return $seopress_xml_sitemap_video_enable_option['seopress_xml_sitemap_video_enable'];
        }
    }
}

if ('1' == seopress_xml_sitemap_video_enable_option()) {
    //WPML compatibility
    if (defined('ICL_SITEPRESS_VERSION')) {
        add_filter('request', 'seopress_wpml_block_secondary_languages3');
    }
    function seopress_wpml_block_secondary_languages3($q) {
        $current_language = apply_filters('wpml_current_language', false);
        $default_language = apply_filters('wpml_default_language', false);
        if ($current_language !== $default_language) {
            unset($q['seopress_video']);
        }

        return $q;
    }
}

///////////////////////////////////////////////////////////////////////////////////////////////////
// Highlight Current menu when Editing Post Type
///////////////////////////////////////////////////////////////////////////////////////////////////
add_filter('parent_file', 'seopress_submenu_current');
function seopress_submenu_current($current_menu) {
    global $pagenow;
    global $typenow;
    if ('post-new.php' == $pagenow || 'post.php' == $pagenow) {
        if ('seopress_404' == $typenow || 'seopress_bot' == $typenow || 'seopress_backlinks' == $typenow || 'seopress_schemas' == $typenow) {
            global $plugin_page;
            $plugin_page = 'seopress-option';
        }
    }

    return $current_menu;
}

///////////////////////////////////////////////////////////////////////////////////////////////////
// 404 Cleaning CRON
///////////////////////////////////////////////////////////////////////////////////////////////////
//Enable CRON 404 cleaning
function seopress_404_cleaning_option() {
    $seopress_404_cleaning_option = get_option('seopress_pro_option_name');
    if ( ! empty($seopress_404_cleaning_option)) {
        foreach ($seopress_404_cleaning_option as $key => $seopress_404_cleaning_value) {
            $options[$key] = $seopress_404_cleaning_value;
        }
        if (isset($seopress_404_cleaning_option['seopress_404_cleaning'])) {
            return $seopress_404_cleaning_option['seopress_404_cleaning'];
        }
    }
}

function seopress_404_cron_cleaning_action($force = false) {
    if ('1' === seopress_404_cleaning_option() || true === $force) {
        $args = [
            'date_query' => [
                [
                    'column' => 'post_date_gmt',
                    'before' => '1 month ago',
                ],
            ],
            'posts_per_page' => -1,
            'post_type' => 'seopress_404',
            'meta_key' => '_seopress_redirections_type',
            'meta_compare' => 'NOT EXISTS',
        ];

        $args = apply_filters('seopress_404_cleaning_query', $args);

        // The Query
        $old_404_query = new WP_Query($args);

        // The Loop
        if ($old_404_query->have_posts()) {
            while ($old_404_query->have_posts()) {
                $old_404_query->the_post();
                wp_delete_post(get_the_ID(), true);
            }
            /* Restore original Post Data */
            wp_reset_postdata();
        }
    }
}
add_action('seopress_404_cron_cleaning', 'seopress_404_cron_cleaning_action', 10, 1);

///////////////////////////////////////////////////////////////////////////////////////////////////
// Get LB types list
///////////////////////////////////////////////////////////////////////////////////////////////////
function seopress_lb_types_list() {
    $seopress_lb_types = [
        'LocalBusiness' => __('Local Business (default)', 'wp-seopress-pro'),
        'AnimalShelter' => __('Animal Shelter', 'wp-seopress-pro'),
        'AutomotiveBusiness' => __('Automotive Business', 'wp-seopress-pro'),
        'AutoBodyShop' => __('|-Auto Body Shop', 'wp-seopress-pro'),
        'AutoDealer' => __('|-Auto Dealer', 'wp-seopress-pro'),
        'AutoPartsStore' => __('|-Auto Parts Store', 'wp-seopress-pro'),
        'AutoRental' => __('|-Auto Rental', 'wp-seopress-pro'),
        'AutoRepair' => __('|-Auto Repair', 'wp-seopress-pro'),
        'Auto Wash' => __('|-AutoWash', 'wp-seopress-pro'),
        'GasStation' => __('|-Gas Station', 'wp-seopress-pro'),
        'MotorcycleDealer' => __('|-Motorcycle Dealer', 'wp-seopress-pro'),
        'MotorcycleRepair' => __('|-Motorcycle Repair', 'wp-seopress-pro'),
        'ChildCare' => __('Child Care', 'wp-seopress-pro'),
        'DryCleaningOrLaundry' => __('Dry Cleaning Or Laundry', 'wp-seopress-pro'),
        'EmergencyService' => __('Emergency Service', 'wp-seopress-pro'),
        'FireStation' => __('|-Fire Station', 'wp-seopress-pro'),
        'Hospital' => __('|-Hospital', 'wp-seopress-pro'),
        'PoliceStation' => __('|-Police Station', 'wp-seopress-pro'),
        'EmploymentAgency' => __('Employment Agency', 'wp-seopress-pro'),
        'EntertainmentBusiness' => __('Entertainment Business', 'wp-seopress-pro'),
        'AdultEntertainment' => __('|-Adult Entertainment', 'wp-seopress-pro'),
        'AmusementPark' => __('|-Amusement Park', 'wp-seopress-pro'),
        'ArtGallery' => __('|-Art Gallery', 'wp-seopress-pro'),
        'Casino' => __('|-Casino', 'wp-seopress-pro'),
        'ComedyClub' => __('|-Comedy Club', 'wp-seopress-pro'),
        'MovieTheater' => __('|-Movie Theater', 'wp-seopress-pro'),
        'NightClub' => __('|-Night Club', 'wp-seopress-pro'),
        'FinancialService' => __('Financial Service', 'wp-seopress-pro'),
        'AccountingService' => __('|-Accounting Service', 'wp-seopress-pro'),
        'AutomatedTeller' => __('|-Automated Teller', 'wp-seopress-pro'),
        'BankOrCreditUnion' => __('|-Bank Or Credit Union', 'wp-seopress-pro'),
        'InsuranceAgency' => __('|-Insurance Agency', 'wp-seopress-pro'),
        'FoodEstablishment' => __('Food Establishment', 'wp-seopress-pro'),
        'Bakery' => __('|-Bakery', 'wp-seopress-pro'),
        'BarOrPub' => __('|-Bar Or Pub', 'wp-seopress-pro'),
        'Brewery' => __('|-Brewery', 'wp-seopress-pro'),
        'CafeOrCoffeeShop' => __('|-Cafe Or Coffee Shop', 'wp-seopress-pro'),
        'FastFoodRestaurant' => __('|-Fast Food Restaurant', 'wp-seopress-pro'),
        'IceCreamShop' => __('|-Ice Cream Shop', 'wp-seopress-pro'),
        'Restaurant' => __('|-Restaurant', 'wp-seopress-pro'),
        'Winery' => __('|-Winery', 'wp-seopress-pro'),
        'GovernmentOffice' => __('Government Office', 'wp-seopress-pro'),
        'PostOffice' => __('|-PostOffice', 'wp-seopress-pro'),
        'HealthAndBeautyBusiness' => __('Health And Beauty Business', 'wp-seopress-pro'),
        'BeautySalon' => __('|-Beauty Salon', 'wp-seopress-pro'),
        'DaySpa' => __('|-Day Spa', 'wp-seopress-pro'),
        'HairSalon' => __('|-Hair Salon', 'wp-seopress-pro'),
        'HealthClub' => __('|-Health Club', 'wp-seopress-pro'),
        'NailSalon' => __('|-Nail Salon', 'wp-seopress-pro'),
        'TattooParlor' => __('|-Tattoo Parlor', 'wp-seopress-pro'),
        'HomeAndConstructionBusiness' => __('Home And Construction Business', 'wp-seopress-pro'),
        'Electrician' => __('|-Electrician', 'wp-seopress-pro'),
        'HVACBusiness' => __('|-HVAC Business', 'wp-seopress-pro'),
        'HousePainter' => __('|-House Painter', 'wp-seopress-pro'),
        'Locksmith' => __('|-Locksmith', 'wp-seopress-pro'),
        'MovingCompany' => __('|-Moving Company', 'wp-seopress-pro'),
        'Plumber' => __('|-Plumber', 'wp-seopress-pro'),
        'RoofingContractor' => __('|-Roofing Contractor', 'wp-seopress-pro'),
        'InternetCafe' => __('Internet Cafe', 'wp-seopress-pro'),
        'MedicalBusiness' => __('Medical Business', 'wp-seopress-pro'),
        'CommunityHealth' => __('|-Community Health', 'wp-seopress-pro'),
        'Dentist' => __('|-Dentist', 'wp-seopress-pro'),
        'Dermatology' => __('|-Dermatology', 'wp-seopress-pro'),
        'DietNutrition' => __('|-Diet Nutrition', 'wp-seopress-pro'),
        'Emergency' => __('|-Emergency', 'wp-seopress-pro'),
        'Gynecologic' => __('|-Gynecologic', 'wp-seopress-pro'),
        'MedicalClinic' => __('|-Medical Clinic', 'wp-seopress-pro'),
        'Midwifery' => __('|-Midwifery', 'wp-seopress-pro'),
        'Nursing' => __('|-Nursing', 'wp-seopress-pro'),
        'Obstetric' => __('|-Obstetric', 'wp-seopress-pro'),
        'Oncologic' => __('|-Oncologic', 'wp-seopress-pro'),
        'Optician' => __('|-Optician', 'wp-seopress-pro'),
        'Optometric' => __('|-Optometric', 'wp-seopress-pro'),
        'Otolaryngologic' => __('|-Otolaryngologic', 'wp-seopress-pro'),
        'Pediatric' => __('|-Pediatric', 'wp-seopress-pro'),
        'Pharmacy' => __('|-Pharmacy', 'wp-seopress-pro'),
        'Physician' => __('|-Physician', 'wp-seopress-pro'),
        'Physiotherapy' => __('|-Physiotherapy', 'wp-seopress-pro'),
        'PlasticSurgery' => __('|-Plastic Surgery', 'wp-seopress-pro'),
        'Podiatric' => __('|-Podiatric', 'wp-seopress-pro'),
        'PrimaryCare' => __('|-Primary Care', 'wp-seopress-pro'),
        'Psychiatric' => __('|-Psychiatric', 'wp-seopress-pro'),
        'PublicHealth' => __('|-Public Health', 'wp-seopress-pro'),
        'VeterinaryCare' => __('|-Veterinary Care', 'wp-seopress-pro'),
        'LegalService' => __('Legal Service', 'wp-seopress-pro'),
        'Attorney' => __('|-Attorney', 'wp-seopress-pro'),
        'Notary' => __('|-Notary', 'wp-seopress-pro'),
        'Library' => __('Library', 'wp-seopress-pro'),
        'LodgingBusiness' => __('Lodging Business', 'wp-seopress-pro'),
        'BedAndBreakfast' => __('|-Bed And Breakfast', 'wp-seopress-pro'),
        'Campground' => __('|-Campground', 'wp-seopress-pro'),
        'Hostel' => __('|-Hostel', 'wp-seopress-pro'),
        'Hotel' => __('|-Hotel', 'wp-seopress-pro'),
        'Motel' => __('|-Motel', 'wp-seopress-pro'),
        'Resort' => __('|-Resort', 'wp-seopress-pro'),
        'ProfessionalService' => __('Professional Service', 'wp-seopress-pro'),
        'RadioStation' => __('Radio Station', 'wp-seopress-pro'),
        'RealEstateAgent' => __('Real Estate Agent', 'wp-seopress-pro'),
        'RecyclingCenter' => __('Recycling Center', 'wp-seopress-pro'),
        'SelfStorage' => __('Real Self Storage', 'wp-seopress-pro'),
        'ShoppingCenter' => __('Shopping Center', 'wp-seopress-pro'),
        'SportsActivityLocation' => __('Sports Activity Location', 'wp-seopress-pro'),
        'BowlingAlley' => __('|-Bowling Alley', 'wp-seopress-pro'),
        'ExerciseGym' => __('|-Exercise Gym', 'wp-seopress-pro'),
        'GolfCourse' => __('|-Golf Course', 'wp-seopress-pro'),
        'HealthClub' => __('|-Health Club', 'wp-seopress-pro'),
        'PublicSwimmingPool' => __('|-Public Swimming Pool', 'wp-seopress-pro'),
        'SkiResort' => __('|-Ski Resort', 'wp-seopress-pro'),
        'SportsClub' => __('|-Sports Club', 'wp-seopress-pro'),
        'StadiumOrArena' => __('|-Stadium Or Arena', 'wp-seopress-pro'),
        'TennisComplex' => __('|-Tennis Complex', 'wp-seopress-pro'),
        'Store' => __('Store', 'wp-seopress-pro'),
        'AutoPartsStore' => __('|-Auto Parts Store', 'wp-seopress-pro'),
        'BikeStore' => __('|-Bike Store', 'wp-seopress-pro'),
        'BookStore' => __('|-Book Store', 'wp-seopress-pro'),
        'ClothingStore' => __('|-Clothing Store', 'wp-seopress-pro'),
        'ComputerStore' => __('|-Computer Store', 'wp-seopress-pro'),
        'ConvenienceStore' => __('|-Convenience Store', 'wp-seopress-pro'),
        'DepartmentStore' => __('|-Department Store', 'wp-seopress-pro'),
        'ElectronicsStore' => __('|-Electronics Store', 'wp-seopress-pro'),
        'Florist' => __('|-Florist', 'wp-seopress-pro'),
        'FurnitureStore' => __('|-Furniture Store', 'wp-seopress-pro'),
        'GardenStore' => __('|-Garden Store', 'wp-seopress-pro'),
        'GroceryStore' => __('|-Grocery Store', 'wp-seopress-pro'),
        'HardwareStore' => __('|-Hardware Store', 'wp-seopress-pro'),
        'HobbyShop' => __('|-Hobby Shop', 'wp-seopress-pro'),
        'HomeGoodsStore' => __('|-Home Goods Store', 'wp-seopress-pro'),
        'JewelryStore' => __('|-Jewelry Store', 'wp-seopress-pro'),
        'LiquorStore' => __('|-Liquor Store', 'wp-seopress-pro'),
        'MensClothingStore' => __('|-Mens Clothing Store', 'wp-seopress-pro'),
        'MobilePhoneStore' => __('|-Mobile Phone Store', 'wp-seopress-pro'),
        'MovieRentalStore' => __('|-Movie Rental Store', 'wp-seopress-pro'),
        'MusicStore' => __('|-Music Store', 'wp-seopress-pro'),
        'OfficeEquipmentStore' => __('|-Office Equipment Store', 'wp-seopress-pro'),
        'OutletStore' => __('|-Outlet Store', 'wp-seopress-pro'),
        'PawnShop' => __('|-Pawn Shop', 'wp-seopress-pro'),
        'PetStore' => __('|-Pet Store', 'wp-seopress-pro'),
        'ShoeStore' => __('|-Shoe Store', 'wp-seopress-pro'),
        'SportingGoodsStore' => __('|-Sporting Goods Store', 'wp-seopress-pro'),
        'TireShop' => __('|-Tire Shop', 'wp-seopress-pro'),
        'ToyStore' => __('|-Toy Store', 'wp-seopress-pro'),
        'WholesaleStore' => __('|-Wholesale Store', 'wp-seopress-pro'),
        'TelevisionStation' => __('|-Wholesale Store', 'wp-seopress-pro'),
        'TouristInformationCenter' => __('Tourist Information Center', 'wp-seopress-pro'),
        'TravelAgency' => __('Travel Agency', 'wp-seopress-pro'),
    ];

    $seopress_lb_types = apply_filters('seopress_schemas_lb_types', $seopress_lb_types);

    return $seopress_lb_types;
}

Youez - 2016 - github.com/yon3zu
LinuXploit