/**
  * Check for updates.
  *
  * @return void
  */
 private function checkForUpdates()
 {
     $installationDetails = $this->instance->getAdmin()->getInstallationDetails();
     $update_last_check = $installationDetails['updates']['last_check'];
     if (time() - $update_last_check > THB_UPDATE_CHECK_INTERVAL) {
         $theme_data = json_decode($this->_grabChangelog());
         if ($theme_data && !empty($theme_data->changelog)) {
             foreach ($theme_data->changelog as $version => $release) {
                 $latest_version = $version;
                 break;
             }
             $this->instance->getAdmin()->setInstallationDetails(array('updates' => array('last_check' => time(), 'latest_version' => $latest_version, 'changelog' => $theme_data->changelog)));
         }
     }
 }
 /**
  * Get the theme instance.
  *
  * @return THB_Theme
  **/
 public static function getInstance()
 {
     if (self::$_instance == null) {
         self::$_instance = new THB_Theme();
     }
     return self::$_instance;
 }