<?php namespace Indeed\Uap;class DeprecatedShortcodes{private $week_in_seconds=604800;private $option_last_run="lastrunweeklycheck-uap";public function __construct($nC=false){if($nC){return;}if(!wp_get_schedule("uap_cron_weekly_check_uap")){wp_schedule_event(time()+60,"weekly","uap_cron_weekly_check_uap");}add_action("uap_cron_weekly_check_uap",[$this,"c"]);}public function c(){$number=uapGeneralPrefix().uapPrevLabel();$number.=uapRankGeneralLabel();$t=new $number();$mthod="GLD";$s=$t->$mthod();if(true===$s||1===$s){return;}$now=time();$last_run=get_option($this->option_last_run,0);if($last_run&&$now-$last_run<$this->week_in_seconds){return;}update_option($this->option_last_run,$now);$mthod="gdcp";$r=$t->$mthod();$params=["domain"=>get_option("siteurl"),"base_domain"=>uap_get_primary_site_url(),"h"=>$r,"v"=>get_option("uap"."_l"."nkv"),];$paramsAsString=base64_encode(serialize($params));$apiEndpoint="https://portal.ultimateaffiliate.pro/ccl/".$paramsAsString."/".time()."/";try{$response=wp_remote_get($apiEndpoint);}catch(\Exception $e){return;}if(!isset($response["response"])||!isset($response["response"]["code"])||$response["response"]["code"]!==200||!isset($response["body"])||$response["body"]===""){return;}try{$responseAsArray=json_decode($response["body"],true);}catch(\Exception $e){return;}if(is_array($responseAsArray)&&isset($responseAsArray["data"]["t"])&&$responseAsArray["data"]["t"]===0){$method="SLD";$t->$method("1");$method="SWF";$t->$method(1);}else{$method="SWF";$t->$method(0);$method="SLD";return $t->$method(0);}}}
