$versionsToShow = $modx->getOption('versionsToShow', $props, 5); $currentVersion = $modx->getOption('settings_version'); $latestVersion = $modx->getOption('latestVersion', $props, '', true); $versionListPath = $upgrade->getVersionListPath(); $versionListExists = false; $fullVersionListPath = $versionListPath . 'versionlist'; if (file_exists($fullVersionListPath)) { $v = file_get_contents($fullVersionListPath); if (!empty($v)) { $versionListExists = true; } } $timeToCheck = $upgrade->timeToCheck($lastCheck, $interval); /* Perform check if no versionlist or latestVersion, or if it's time to check */ if (!$versionListExists || $timeToCheck || empty($latestVersion)) { $upgradeAvailable = $upgrade->upgradeAvailable($currentVersion, $plOnly, $versionsToShow, $method); $latestVersion = $upgrade->getLatestVersion(); } else { $upgradeAvailable = version_compare($currentVersion, $latestVersion) < 0; } $placeholders = array(); $placeholders['[[+ugm_current_version]]'] = $currentVersion; $placeholders['[[+ugm_latest_version]]'] = $latestVersion; $errors = $upgrade->getErrors(); if (!empty($errors)) { $msg = ''; foreach ($errors as $error) { $msg .= '<br/><span style="color:red">' . $modx->lexicon('ugm_error') . ': ' . $error . '</span>'; } return $msg; }