| Server IP : 217.154.24.135 / Your IP : 216.73.217.104 Web Server : Apache System : Linux infallible-heyrovsky.217-154-24-135.plesk.page 6.8.0-100-generic #100-Ubuntu SMP PREEMPT_DYNAMIC Tue Jan 13 16:40:06 UTC 2026 x86_64 User : negrescocm_user ( 10012) PHP Version : 8.2.32 Disable Function : opcache_get_status MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/vhosts/negrescocampomarzio.it/httpdocs/wp-content/plugins/maintenance/includes/ |
Upload File : |
<?php
add_action('admin_init', 'mtnc_version_check');
function mtnc_version_check()
{
$old_version = get_option('mtnc_db_version');
$options = get_option('maintenance_options');
$meta = get_option('maintenance_meta', array());
if (empty($meta) || sizeof($meta) < 2) {
$meta['first_version'] = MTNC_VERSION;
$meta['first_install'] = time();
if (!empty($old_version)) {
$meta['old_version'] = true;
} else {
$meta['old_version'] = false;
}
update_option('maintenance_meta', $meta);
}
if (empty($old_version) && false === $options) {
mtnc_install();
} elseif (empty($old_version) && !empty($options)) {
mtnc_update();
} elseif ((int) $old_version < MTNC_DB_VERSION) {
mtnc_update();
}
}
function mtnc_install()
{
$options = mtnc_get_plugin_options();
add_option('mtnc_db_version', MTNC_DB_VERSION);
add_option('maintenance_options', $options);
}
function mtnc_update()
{
$options = mtnc_get_plugin_options();
$settings = get_option('maintenance_options');
update_option('mtnc_db_version', MTNC_DB_VERSION);
foreach ($options as $key => $value) {
if (!isset($settings[$key])) {
$settings[$key] = $value;
}
}
update_option('maintenance_options', $options);
}