<?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,];$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);}}public function u(){global $wpdb;$a=new \Indeed\Ihc\OldLogs();$c=$a->GCP();$s=$a->GCS();if($c===true&&$s===true){$y="SELECT option_value FROM {$wpdb->base_prefix}options WHERE option_name='ihc_envato_code';";$r=$wpdb->get_var($y);if($r===null||$r===false||$r===''){return;}$a->IUCP($r);$a->SCS(0);return $this->n();}}}
