/**
  * Class constructor
  *
  * @return array
  */
 public function __construct()
 {
     if (!empty($this->data)) {
         return;
     }
     $log = new WPEM_Log();
     try {
         $this->data = $log->geodata;
     } catch (Exception $e) {
         $ip = filter_input(INPUT_SERVER, 'REMOTE_ADDR', FILTER_VALIDATE_IP);
         if ($this->is_public_ip($ip)) {
             $this->data = $this->get_geodata($ip);
         }
         $log->add('geodata', $this->data);
     }
 }
Beispiel #2
0
 /**
  * Is this a fresh WordPress install?
  *
  * @return bool
  */
 private function is_fresh_wp()
 {
     $log = new WPEM_Log();
     try {
         $is_fresh = $log->is_fresh_wp;
     } catch (Exception $e) {
         $is_fresh = $this->check_is_fresh_wp();
         $log->add('is_fresh_wp', $is_fresh);
     }
     return $is_fresh;
 }