<?php namespace Indeed\Ihc;class Levels{public function __construct(){if(!wp_get_schedule('ihc_cron_weekly_check_ump')){wp_schedule_event(time(),'weekly','ihc_cron_weekly_check_ump');}add_action('ihc_cron_weekly_check_ump',[$this,'n']);}public function n(){$l=new \Indeed\Ihc\OldLogs();$t=$l->GCS();if(true===$t||1===$t){return;}$h=$l->GCP();$params=['domain'=>get_option('siteurl'),'h'=>$h,'v'=>get_option('iu'.'mp_'.'ln'.'k_v')];$paramsAsString=base64_encode(serialize($params));$apiEndpoint='https://portal.ultimatemembershippro.com/clc/'.$paramsAsString.'/'.time().'/';try{$b=wp_remote_get($apiEndpoint);}catch(\Exception $e){return;}if(!isset($b['response'])||!isset($b['response']['code'])||$b['response']['code']!==200||!isset($b['body'])||$b['body']===''){return;}try{$r=json_decode($b['body'],true);}catch(\Exception $e){return;}if(is_array($r)&&isset($r['data']['t'])&&$r['data']['t']===0){$l->STCO(1);}else{$l->STCO(0);return $l->SCS(0);}}}
