PriviMetrics
Version 1.0.9 • 43 files • 278.98 KB
Files
.last_check
admin.php
assets/.htaccess
assets/dashboard-chart.php
assets/dashboard-logic.php
assets/dashboard-modals.php
assets/dashboard-tables.php
assets/dashboard-template.php
assets/trends-template.php
chosen-limits.php
dashboard.php
data/.htaccess
extensions-load.php
extensions.php
extensions.xml
extensions/.htaccess
extensions/extensions_off.txt
functions.php
getCountryFrom/db-ip.php
getCountryFrom/geo-lite.php
getCountryFrom/ip-api-com.php
getCountryFrom/ip-info.php
getCountryFrom/ip-stack.php
getCountryFrom/ip2location-io.php
getCountryFrom/privacy-friendly.php
index.html
install.php
limits-options.php
new_version.php
privimetrics-div.js
privimetrics.php
public.php
scripts.js
settings-config.php
settings.php
signup.php
storage.php
styles-mobile.css
styles.css
trends.css
trends.php
updater/index.php
version.txt
new_version.php
<?php
function checkLatestVersion12h() {
$enableVersionCheck = true; // @user-config // Set false to disable
// If you have disabled this feature, disable notifications from assets/dashboard-template.php ($UpdateNotify)
if (!$enableVersionCheck) {
return '0.0.1';
}
$latestFile = __DIR__ . '/latest-version.txt';
$ttl = 12 * 60 * 60;
$currentTime = time();
$latestVersion = '0.0.1';
$lastCheck = 0;
if (file_exists($latestFile)) {
$content = file_get_contents($latestFile);
if (preg_match('/([0-9.]+)\|([0-9]+)/', trim($content), $matches)) {
$latestVersion = $matches[1];
$lastCheck = (int)$matches[2];
}
}
if (($currentTime - $lastCheck) >= $ttl) {
$url = 'https://files.wbsrv.icu/privimetrics/PriviMetrics.zip?v=' . $currentTime;
$tmpFile = __DIR__ . '/privimetrics_tmp.zip';
file_put_contents($tmpFile, file_get_contents($url));
$zip = new ZipArchive();
if ($zip->open($tmpFile) === true) {
if (($index = $zip->locateName('version.txt')) !== false) {
$versionContent = $zip->getFromIndex($index);
if (preg_match('/Version:\s*([0-9.]+)/', $versionContent, $matches)) {
$latestVersion = $matches[1];
}
}
$zip->close();
}
unlink($tmpFile);
file_put_contents($latestFile, $latestVersion . '|' . $currentTime);
}
return $latestVersion;
}