first commit

This commit is contained in:
2026-04-20 13:11:14 +02:00
commit e0b63ca5f9
7793 changed files with 1844488 additions and 0 deletions

View File

@@ -0,0 +1,195 @@
<?php
/**
* @package Duplicator
*/
use Duplicator\Addons\ProBase\License\License;
use Duplicator\Controllers\SettingsPageController;
use Duplicator\Core\CapMng;
use Duplicator\Core\Controllers\ControllersManager;
use Duplicator\Core\Views\TplMng;
defined("ABSPATH") or die("");
/**
* Variables
*
* @var Duplicator\Core\Controllers\ControllersManager $ctrlMng
* @var Duplicator\Core\Views\TplMng $tplMng
* @var array<string, mixed> $tplData
*/
?>
<form id="dup-capabilites-form" action="<?php echo esc_url(ControllersManager::getCurrentLink()); ?>" method="post" data-parsley-validate>
<?php $tplData['actions'][SettingsPageController::ACTION_CAPABILITIES_SAVE]->getActionNonceFileds(); ?>
<div class="dup-capabilities-selector-wrapper" >
<h3 class="title">
<?php esc_html_e('Roles and Permissions', 'duplicator-pro') ?>
</h3>
<hr size="1" />
<?php $tplMng->render('admin_pages/settings/capabilities/no_license_message'); ?>
<p>
<?php
esc_html_e(
'Select the user roles and/or users that are allowed to manage different aspects of Duplicator.',
'duplicator-pro'
); ?><br>
<?php
esc_html_e(
'By default, all permissions are provided only to administrator users.',
'duplicator-pro'
); ?><br>
<?php
esc_html_e(
'Some capabilities depend on others so if you select for example storage capability automatically the package read and package edit capabilities are assigned.', // phpcs:ignore Generic.Files.LineLength
'duplicator-pro'
);
?><br>
<b>
<?php esc_html_e('It is not possible to self remove the manage settings capabilities.', 'duplicator-pro'); ?>
</b>
</p>
<table class="form-table">
<tbody>
<?php
$capList = CapMng::getCapsInfo();
foreach ($capList as $cap => $capInfo) {
if ($cap === CapMng::CAP_LICENSE && !CapMng::can(CapMng::CAP_LICENSE, false)) {
continue;
}
$inputName = TplMng::getInputName('cap', $cap) . '[]';
$inputId = TplMng::getInputId('cap', $cap);
$tCont = $tplMng->render(
'admin_pages/settings/capabilities/capabilites_info_tooltip',
[
'info' => $capInfo,
'pLabel' => (strlen($capInfo['parent']) > 0 ? $capList[$capInfo['parent']]['label'] : ''),
],
false
);
$nParents = 0;
$pCeck = $capInfo;
while (strlen($pCeck['parent']) > 0) {
$nParents++;
$pCeck = $capList[$pCeck['parent']];
}
?>
<tr>
<th scope="row">
<label for="<?php echo esc_attr($inputId); ?>" >
<?php echo esc_html(str_repeat('-&nbsp;&nbsp;', $nParents)); ?>
<?php echo esc_html($capInfo['label']); ?>
</label>&nbsp;
<i
class="fas fa-question-circle fa-sm"
data-tooltip-title="<?php echo esc_attr($capInfo['label']); ?>"
data-tooltip="<?php echo esc_attr($tCont); ?>"
data-tooltip-width="600"
>
</i>
</th>
<td>
<select
id="<?php echo esc_attr($inputId); ?>"
name="<?php echo esc_attr($inputName); ?>"
multiple
<?php disabled(License::can(License::CAPABILITY_CAPABILITIES_MNG), false); ?>
>
<?php
foreach (CapMng::getSelectableRoles() as $role => $roleName) {
if (!in_array($role, CapMng::getInstance()->getCapRoles($cap))) {
continue;
}
?>
<option
value="<?php echo esc_attr($role); ?>"
<?php selected(true); ?>
>
<?php echo esc_html($roleName); ?>
</option>
<?php
}
foreach (CapMng::getInstance()->getCapUsers($cap) as $userId) {
if (($user = get_user_by('id', $userId) ) == false) {
continue;
}
?>
<option
value="<?php echo (int) $user->ID; ?>"
<?php selected(true); ?>
>
<?php echo esc_html($user->user_email); ?>
</option>
<?php } ?>
</select>
</td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
<p>
<input
type="submit" name="submit" id="submit"
class="button-primary"
value="<?php esc_attr_e('Update Capabilities', 'duplicator-pro') ?>"
<?php disabled(License::can(License::CAPABILITY_CAPABILITIES_MNG), false); ?>
>
&nbsp;
<button
id="dup-capabilities-reset"
class="button-secondary"
>
<?php esc_html_e('Reset to Default', 'duplicator-pro'); ?>
</button>
</p>
</form>
<?php
//Delete Dialog
$dlgDelete = new DUP_PRO_UI_Dialog();
$dlgDelete->title = __('Are you sure do you want to reset the capabilities to default?', 'duplicator-pro');
$dlgDelete->message = '<p>' . __('This action will reassign all the capabilities of the Administrator role.', 'duplicator-pro') . '<p>';
$dlgDelete->jsCallback = 'DupPro.Settings.CapabilitesReset()';
$dlgDelete->initConfirm();
?>
<script>
jQuery(document).ready(function($) {
DupPro.Settings.CapabilitesReset = function () {
window.location.href = <?php echo json_encode($tplData['actions'][SettingsPageController::ACTION_CAPABILITIES_RESET]->getUrl()); ?>;
};
$('.dup-capabilities-selector-wrapper select').select2({
width: 'resolve',
ajax: {
type: "POST",
url: ajaxurl,
dataType: 'json',
delay: 250,
data: function (params) {
let query = {
search: params.term,
page: params.page || 1,
action: 'duplicator_settings_cap_users_list',
nonce: '<?php echo esc_js(wp_create_nonce('duplicator_settings_cap_users_list')); ?>'
}
return query;
},
processResults: function (data) {
return data.data.funcData;
},
cache: true
},
placeholder: <?php echo json_encode(__('Search roles or users', 'duplicator-pro')); ?>,
minimumInputLength: <?php echo (License::can(License::CAPABILITY_CAPABILITIES_MNG_PLUS) ? 2 : 0); ?>
});
$('#dup-capabilities-reset').on('click', function(e) {
e.preventDefault();
<?php $dlgDelete->showConfirm(); ?>
});
});
</script>

View File

@@ -0,0 +1,27 @@
<?php
/**
* @package Duplicator
*/
use Duplicator\Core\CapMng;
defined("ABSPATH") or die("");
/**
* Variables
*
* @var Duplicator\Core\Controllers\ControllersManager $ctrlMng
* @var Duplicator\Core\Views\TplMng $tplMng
* @var array<string, mixed> $tplData
*/
$info = $tplData['info'];
?>
<p>
<?php echo esc_html($info['desc']); ?>
</p>
<?php if (strlen($info['parent']) > 0) { ?>
<br>
<?php esc_html_e('Parent', 'duplicator-pro'); ?>: <b><?php echo esc_html($tplData['pLabel']); ?></b>
<?php } ?>

View File

@@ -0,0 +1,65 @@
<?php
/**
* @package Duplicator
*/
use Duplicator\Addons\ProBase\License\License;
use Duplicator\Addons\ProBase\Models\LicenseData;
defined("ABSPATH") or die("");
/**
* Variables
*
* @var Duplicator\Core\Controllers\ControllersManager $ctrlMng
* @var Duplicator\Core\Views\TplMng $tplMng
* @var array<string, mixed> $tplData
*/
if (License::can(License::CAPABILITY_CAPABILITIES_MNG)) {
return;
}
?>
<p id="dup-no-license-message" class="dup-border-left-red-notice" >
<b>
<?php
esc_html_e(
'The current license does not allow to manage the capabilities. ',
'duplicator-pro'
);
?>
</b>
<br>
<?php
if (License::getLicenseStatus() === LicenseData::STATUS_VALID) {
printf(
esc_html_x(
'If you want to manage the capabilities please %1$supgrade your license%2$s.',
'1: <a> tag, 2: </a> tag',
'duplicator-pro'
),
'<a href="' . esc_url(License::getUpsellURL()) . '" target="_blank">',
'</a>'
);
} else {
printf(
esc_html_x(
'If you want to manage the capabilities please %1$srenew your license%2$s.',
'1: <a> tag, 2: </a> tag',
'duplicator-pro'
),
'<a href="' . esc_url(License::getUpsellURL()) . '" target="_blank">',
'</a>'
);
}
?>
<br><br>
<?php
esc_html_e(
'It\'s possible to reset the capabilities to the default values with "Reset to default" button.',
'duplicator-pro'
);
?>
</p>

View File

@@ -0,0 +1,377 @@
<?php
/**
* @package Duplicator
*/
use Duplicator\Addons\ProBase\License\License;
use Duplicator\Core\Controllers\ControllersManager;
use Duplicator\Core\Views\TplMng;
use Duplicator\Libs\Snap\SnapJson;
use Duplicator\Utils\ExpireOptions;
use Duplicator\Controllers\SettingsPageController;
use Duplicator\Core\Controllers\PageAction;
defined("ABSPATH") or die("");
/**
* Variables
*
* @var Duplicator\Core\Controllers\ControllersManager $ctrlMng
* @var Duplicator\Core\Views\TplMng $tplMng
* @var array<string, mixed> $tplData
*/
$global = DUP_PRO_Global_Entity::getInstance();
/** @var PageAction */
$resetAction = $tplData['actions'][SettingsPageController::ACTION_RESET_SETTINGS];
$trace_log_enabled = (bool) get_option('duplicator_pro_trace_log_enabled');
$send_trace_to_error_log = (bool) get_option('duplicator_pro_send_trace_to_error_log');
if ($trace_log_enabled) {
$logging_mode = ($send_trace_to_error_log) ? 'enhanced' : 'on';
} else {
$logging_mode = 'off';
}
?>
<form id="dup-settings-form" action="<?php echo esc_url(ControllersManager::getCurrentLink()); ?>" method="post" data-parsley-validate>
<?php $tplData['actions'][SettingsPageController::ACTION_GENERAL_SAVE]->getActionNonceFileds(); ?>
<!-- =============================== PLUG-IN SETTINGS -->
<h3 class="title"><?php esc_html_e("Plugin", 'duplicator-pro') ?> </h3>
<hr size="1" />
<table class="form-table">
<tr valign="top">
<th scope="row">
<label>
<?php
esc_html_e("Version", 'duplicator-pro');
?>
</label>
</th>
<td>
<?php
echo esc_html(DUPLICATOR_PRO_VERSION);
?>
</td>
</tr>
<tr valign="top">
<th scope="row"><label><?php esc_html_e("Uninstall", 'duplicator-pro'); ?></label></th>
<td>
<input
type="checkbox"
name="uninstall_settings"
id="uninstall_settings"
value="1"
<?php checked($global->uninstall_settings); ?>
>
<label for="uninstall_settings"><?php esc_html_e("Delete plugin settings", 'duplicator-pro'); ?> </label><br />
<input
type="checkbox"
name="uninstall_packages"
id="uninstall_packages"
value="1"
<?php checked($global->uninstall_packages); ?>
>
<label for="uninstall_packages"><?php esc_html_e("Delete entire storage directory", 'duplicator-pro'); ?></label><br />
</td>
</tr>
<tr valign="top">
<th scope="row"><label><?php esc_html_e("Encrypt Settings", 'duplicator-pro'); ?></label></th>
<td>
<input
type="checkbox"
name="crypt"
id="crypt"
value="1"
<?php checked($global->crypt); ?>
>
<label for="crypt"><?php esc_html_e("Enable settings encryption", 'duplicator-pro'); ?> </label><br />
<p class="description">
<?php esc_html_e("Only uncheck if machine doesn't support PCrypt.", 'duplicator-pro'); ?>
</p>
</td>
</tr>
<tr valign="top">
<th scope="row"><label><?php esc_html_e("Usage statistics", 'duplicator-pro'); ?></label></th>
<td>
<?php if (DUPLICATOR_USTATS_DISALLOW) { // @phpstan-ignore-line ?>
<span class="maroon">
<?php esc_html_e('Usage statistics are hardcoded disallowed.', 'duplicator-pro'); ?>
</span>
<?php } else { ?>
<input
type="checkbox"
name="usage_tracking"
id="usage_tracking"
value="1"
<?php checked($global->getUsageTracking()); ?>
>
<label for="usage_tracking"><?php esc_html_e("Enable usage tracking", 'duplicator-pro'); ?> </label>
<i
class="fas fa-question-circle fa-sm"
data-tooltip-title="<?php esc_attr_e("Usage Tracking", 'duplicator-pro'); ?>"
data-tooltip="<?php echo esc_attr($tplMng->render('admin_pages/settings/general/usage_tracking_tooltip', [], false)); ?>"
data-tooltip-width="600"
>
</i>
<?php } ?>
</td>
</tr>
<tr valign="top">
<th scope="row"><label><?php esc_html_e("Hide Announcements", 'duplicator-pro'); ?></label></th>
<td>
<input
type="checkbox"
name="dup_am_notices"
id="dup_am_notices"
value="1"
<?php checked(!$global->isAmNoticesEnabled()); ?>
>
<label for="dup_am_notices">
<?php esc_html_e("Check this option to hide plugin announcements and update details.", 'duplicator-pro'); ?>
</label>
</td>
</tr>
</table><br />
<?php TplMng::getInstance()->render('parts/settings/email_summary', []); ?>
<!-- ===============================
DEBUG SETTINGS -->
<h3 class="title"><?php esc_html_e('Debug', 'duplicator-pro') ?> </h3>
<hr size="1" />
<table class="form-table">
<tr>
<th scope="row"><label><?php esc_html_e("Trace Log", 'duplicator-pro'); ?></label></th>
<td>
<select name="_logging_mode">
<option value="off" <?php selected($logging_mode, 'off'); ?>>
<?php esc_html_e('Off', 'duplicator-pro'); ?>
</option>
<option value="on" <?php selected($logging_mode, 'on'); ?>>
<?php esc_html_e('On', 'duplicator-pro'); ?>
</option>
<option value="enhanced" <?php selected($logging_mode, 'enhanced'); ?>>
<?php esc_html_e('On (Enhanced)', 'duplicator-pro'); ?>
</option>
</select>
<p class="description">
<?php
esc_html_e("Turning on log initially clears it out. The enhanced setting writes to both trace and PHP error logs.", 'duplicator-pro');
echo "<br/>";
esc_html_e("WARNING: Only turn on this setting when asked to by support as tracing will impact performance.", 'duplicator-pro');
?>
</p><br />
<button class="button" <?php disabled(DUP_PRO_Log::traceFileExists(), false); ?> onclick="DupPro.Pack.DownloadTraceLog(); return false">
<i class="fa fa-download"></i>
<?php echo esc_html__('Download Trace Log', 'duplicator-pro') . ' (' . esc_html(DUP_PRO_Log::getTraceStatus()) . ')'; ?>
</button>
</td>
</tr>
</table><br />
<!-- ===============================
ADVANCED SETTINGS -->
<h3 class="title"><?php esc_html_e('Advanced', 'duplicator-pro') ?> </h3>
<hr size="1" />
<table class="form-table">
<tr>
<th scope="row"><label><?php esc_html_e("Settings", 'duplicator-pro'); ?></label></th>
<td>
<button id="dup-pro-reset-all" class="button" onclick="DupPro.Pack.ConfirmResetAll(); return false">
<i class="fas fa-redo fa-sm"></i> <?php esc_html_e('Reset All Settings', 'duplicator-pro'); ?>
</button>
<p class="description">
<?php
esc_html_e("Reset all settings to their defaults.", 'duplicator-pro');
$tContent = __(
'Resets standard settings to defaults. Does not affect capabilities, license key, storage or schedules.',
'duplicator-pro'
);
?>
<i
class="fas fa-question-circle fa-sm"
data-tooltip-title="<?php esc_attr_e("Reset Settings", 'duplicator-pro'); ?>"
data-tooltip="<?php echo esc_attr($tContent); ?>"
>
</i>
</p>
</td>
</tr>
<tr>
<th scope="row"><label><?php esc_html_e("Packages", 'duplicator-pro'); ?></label></th>
<td>
<button class="button" onclick="DupPro.Pack.ConfirmResetPackages(); return false;">
<i class="fas fa-redo fa-sm"></i> <?php esc_attr_e('Reset Incomplete Packages', 'duplicator-pro'); ?>
</button>
<p class="description">
<?php esc_html_e("Reset all packages.", 'duplicator-pro'); ?>
<i
class="fas fa-question-circle fa-sm"
data-tooltip-title="<?php esc_attr_e("Reset packages", 'duplicator-pro'); ?>"
data-tooltip="<?php esc_attr_e('Delete all unfinished packages. So those with error and being created.', 'duplicator-pro'); ?>"
>
</i>
</p>
</td>
</tr>
<tr>
<th scope="row"><label><?php esc_html_e("Foreign JavaScript", 'duplicator-pro'); ?></label></th>
<td>
<input
type="checkbox"
name="_unhook_third_party_js"
id="_unhook_third_party_js"
value="1"
<?php checked($global->unhook_third_party_js); ?>
>
<label for="_unhook_third_party_js"><?php esc_html_e("Disable", 'duplicator-pro'); ?></label> <br />
<p class="description">
<?php
esc_html_e("Check this option if JavaScript from the theme or other plugins conflicts with Duplicator Pro pages.", 'duplicator-pro');
?>
<br>
<?php
esc_html_e("Do not modify this setting unless you know the expected result or have talked to support.", 'duplicator-pro');
?>
</p>
</td>
</tr>
<tr>
<th scope="row"><label><?php esc_html_e("Foreign CSS", 'duplicator-pro'); ?></label></th>
<td>
<input
type="checkbox"
name="_unhook_third_party_css"
id="unhook_third_party_css"
value="1"
<?php checked($global->unhook_third_party_css); ?>
>
<label for="unhook_third_party_css"><?php esc_html_e("Disable", 'duplicator-pro'); ?></label> <br />
<p class="description">
<?php
esc_html_e("Check this option if CSS from the theme or other plugins conflicts with Duplicator Pro pages.", 'duplicator-pro');
?>
<br>
<?php
esc_html_e("Do not modify this setting unless you know the expected result or have talked to support.", 'duplicator-pro');
?>
</p>
</td>
</tr>
</table>
<p>
<input
type="submit" name="submit" id="submit"
class="button-primary"
value="<?php esc_attr_e('Save General Settings', 'duplicator-pro') ?>"
>
</p>
</form>
<?php
$resetSettingsDialog = new DUP_PRO_UI_Dialog();
$resetSettingsDialog->title = __('Reset Settings?', 'duplicator-pro');
$resetSettingsDialog->message = __('Are you sure you want to reset settings to defaults?', 'duplicator-pro');
$resetSettingsDialog->progressText = __('Resetting settings, Please Wait...', 'duplicator-pro');
$resetSettingsDialog->jsCallback = 'DupPro.Pack.ResetAll()';
$resetSettingsDialog->progressOn = false;
$resetSettingsDialog->okText = __('Yes', 'duplicator-pro');
$resetSettingsDialog->cancelText = __('No', 'duplicator-pro');
$resetSettingsDialog->closeOnConfirm = true;
$resetSettingsDialog->initConfirm();
$resetPackagesDialog = new DUP_PRO_UI_Dialog();
$resetPackagesDialog->title = __('Reset Packages ?', 'duplicator-pro');
$resetPackagesDialog->message = __('This will clear and reset all of the current temporary packages. Would you like to continue?', 'duplicator-pro');
$resetPackagesDialog->progressText = __('Resetting settings, Please Wait...', 'duplicator-pro');
$resetPackagesDialog->jsCallback = 'DupPro.Pack.ResetPackages()';
$resetPackagesDialog->progressOn = false;
$resetPackagesDialog->okText = __('Yes', 'duplicator-pro');
$resetPackagesDialog->cancelText = __('No', 'duplicator-pro');
$resetPackagesDialog->closeOnConfirm = true;
$resetPackagesDialog->initConfirm();
$msg_ajax_error = new DUP_PRO_UI_Messages(
__('AJAX ERROR!', 'duplicator-pro') . '<br>' . __('Ajax request error', 'duplicator-pro'),
DUP_PRO_UI_Messages::ERROR
);
$msg_ajax_error->hide_on_init = true;
$msg_ajax_error->is_dismissible = true;
$msg_ajax_error->initMessage();
$msg_response_error = new DUP_PRO_UI_Messages(__('RESPONSE ERROR!', 'duplicator-pro'), DUP_PRO_UI_Messages::ERROR);
$msg_response_error->hide_on_init = true;
$msg_response_error->is_dismissible = true;
$msg_response_error->initMessage();
$msg_response_success = new DUP_PRO_UI_Messages('', DUP_PRO_UI_Messages::NOTICE);
$msg_response_success->hide_on_init = true;
$msg_response_success->is_dismissible = true;
$msg_response_success->initMessage();
?>
<script>
jQuery(document).ready(function($) {
// which: 0=installer, 1=archive, 2=sql file, 3=log
DupPro.Pack.DownloadTraceLog = function() {
var actionLocation = ajaxurl + '?action=duplicator_pro_get_trace_log&nonce='
+ '<?php echo esc_js(wp_create_nonce('duplicator_pro_get_trace_log')); ?>';
location.href = actionLocation;
};
DupPro.Pack.ConfirmResetAll = function() {
<?php $resetSettingsDialog->showConfirm(); ?>
};
DupPro.Pack.ConfirmResetPackages = function() {
<?php $resetPackagesDialog->showConfirm(); ?>
};
DupPro.Pack.ResetAll = function() {
let resetUrl = <?php echo SnapJson::jsonEncode($resetAction->getUrl()); ?>;
location.href = resetUrl;
};
DupPro.Pack.ResetPackages = function() {
$.ajax({
type: "POST",
url: ajaxurl,
dataType: "json",
data: {
action: 'duplicator_pro_reset_packages',
nonce: '<?php echo esc_js(wp_create_nonce('duplicator_pro_reset_packages')); ?>'
},
success: function(result) {
if (result.success) {
var message = '<?php esc_html_e('Packages successfully reset', 'duplicator-pro'); ?>';
<?php
$msg_response_success->updateMessage('message');
$msg_response_success->showMessage();
?>
} else {
var message = '<?php esc_html_e('RESPONSE ERROR!', 'duplicator-pro'); ?>' + '<br><br>' + result.data.message;
<?php
$msg_response_error->updateMessage('message');
$msg_response_error->showMessage();
?>
}
},
error: function(result) {
<?php $msg_ajax_error->showMessage(); ?>
}
});
};
//Init
$("#_trace_log_enabled").click(function() {
$('#_send_trace_to_error_log').attr('disabled', !$(this).is(':checked'));
});
});
</script>

View File

@@ -0,0 +1,187 @@
<?php
/**
* @package Duplicator
* @copyright (c) 2022, Snap Creek LLC
*/
defined("ABSPATH") || exit;
/**
* Variables
*
* @var \Duplicator\Core\Controllers\ControllersManager $ctrlMng
* @var \Duplicator\Core\Views\TplMng $tplMng
* @var array<string, mixed> $tplData
*/
?>
<div>
<b>
<?php esc_html_e('All information sent to the server is anonymous except the license key and email.', 'duplicator-pro'); ?><br>
<?php esc_html_e('No information about storage or package\'s content are sent.', 'duplicator-pro'); ?>
</b>
</div>
<br>
<div>
<?php
esc_html_e(
'Usage tracking for Duplicator helps us better understand our users and their website needs by looking
at a range of server and website environments.',
'duplicator-pro'
);
?>
<b>
<?php esc_html_e('This allows us to continuously improve our product as well as our Q&A / testing process.', 'duplicator-pro'); ?>
</b>
<?php esc_html_e('Below is the list of information that Duplicator collects as part of the usage tracking:', 'duplicator-pro'); ?>
</div>
<ul>
<li>
<?php
printf(
esc_html_x(
'%1$sPHP Version:%2$s so we know which PHP versions we have to test against (no one likes whitescreens or log files full of errors).',
'%1$s and %2$s are are opening and closing bold (<b></b>) tags',
'duplicator-pro'
),
'<b>',
'</b>'
);
?>
</li>
<li>
<?php
printf(
esc_html_x(
'%1$sWordPress Version:%2$s so we know which WordPress versions to support and test against.',
'%1$s and %2$s are are opening and closing bold (<b></b>) tags',
'duplicator-pro'
),
'<b>',
'</b>'
);
?>
</li>
<li>
<?php
printf(
esc_html_x(
'%1$sMySQL Version:%2$s so we know which versions of MySQL to support and test against for our custom tables.',
'%1$s and %2$s are are opening and closing bold (<b></b>) tags',
'duplicator-pro'
),
'<b>',
'</b>'
);
?>
</li>
<li>
<?php
printf(
esc_html_x(
'%1$sDuplicator Version:%2$s so we know which versions of Duplicator are potentially responsible for issues when we get bug reports,
allowing us to identify issues and release solutions much faster.',
'%1$s and %2$s are are opening and closing bold (<b></b>) tags',
'duplicator-pro'
),
'<b>',
'</b>'
);
?>
</li>
<li>
<?php
printf(
esc_html_x(
'%1$sPlugins and Themes infos:%2$s so we can figure out which ones I can generate compatibility errors with Duplicator.',
'%1$s and %2$s are are opening and closing bold (<b></b>) tags',
'duplicator-pro'
),
'<b>',
'</b>'
);
?>
</li>
<li>
<?php
printf(
esc_html_x(
'%1$sSite info:%2$s General information about the site such as database, file size, number of users, and sites in case it is a multisite.
This is useful for us to understand the critical issues of package creation.',
'%1$s and %2$s are are opening and closing bold (<b></b>) tags',
'duplicator-pro'
),
'<b>',
'</b>'
);
?>
</li>
<li>
<?php
printf(
esc_html_x(
'%1$sPackages infos:%2$s Information about the packages created and the type of components included.',
'%1$s and %2$s are are opening and closing bold (<b></b>) tags',
'duplicator-pro'
),
'<b>',
'</b>'
);
?>
</li>
<li>
<?php
printf(
esc_html_x(
'%1$sStoragesd infos:%2$s Information about the type of storage used,
this data is useful for us to understand how to improve our support for external storages.(Only anonymized data is sent).',
'%1$s and %2$s are are opening and closing bold (<b></b>) tags',
'duplicator-pro'
),
'<b>',
'</b>'
);
?>
</li>
<li>
<?php
printf(
esc_html_x(
'%1$sTemplates infos:%2$s Information about the template components.',
'%1$s and %2$s are are opening and closing bold (<b></b>) tags',
'duplicator-pro'
),
'<b>',
'</b>'
);
?>
</li>
<li>
<?php
printf(
esc_html_x(
'%1$sSchedules infos:%2$s Information on how schedules are used.',
'%1$s and %2$s are are opening and closing bold (<b></b>) tags',
'duplicator-pro'
),
'<b>',
'</b>'
);
?>
</li>
<li>
<?php
printf(
esc_html_x(
'%1$sLicense key and email and url:%2$s If you\'re an Duplicator customer, then we use this to determine if there\'s an issue
with your specific license key, and to link the profile of your site with the configuration of authentication to allow us to
determine if there\'s issues with your Duplicator authentication.',
'%1$s and %2$s are are opening and closing bold (<b></b>) tags',
'duplicator-pro'
),
'<b>',
'</b>'
);
?>
</li>
</ul>

View File

@@ -0,0 +1,128 @@
<?php
/**
* @package Duplicator
*/
defined("ABSPATH") or die("");
/**
* Variables
*
* @var Duplicator\Core\Controllers\ControllersManager $ctrlMng
* @var Duplicator\Core\Views\TplMng $tplMng
* @var array<string, mixed> $tplData
*/
use Duplicator\Controllers\ImportPageController;
use Duplicator\Controllers\SettingsPageController;
use Duplicator\Core\Controllers\ControllersManager;
$global = DUP_PRO_Global_Entity::getInstance();
?>
<form id="dup-settings-form" action="<?php echo esc_url(ControllersManager::getCurrentLink()); ?>" method="post" data-parsley-validate>
<?php $tplData['actions'][SettingsPageController::ACTION_IMPORT_SAVE_SETTINGS]->getActionNonceFileds(); ?>
<h3 id="duplicator-pro-import-settings" class="title"><?php esc_html_e("Import Settings", 'duplicator-pro'); ?></h3>
<hr size="1" />
<table class="form-table margin-top-1">
<tr>
<th scope="row">
<label for="input_import_chunk_size" ><?php esc_html_e("Upload Chunk Size", 'duplicator-pro'); ?></label>
</th>
<td >
<select name="import_chunk_size" id="input_import_chunk_size" class="postform">
<?php foreach (ImportPageController::getChunkSizes() as $size => $label) { ?>
<option value="<?php echo esc_attr($size); ?>" <?php selected($global->import_chunk_size, $size); ?>>
<?php echo esc_html($label); ?>
</option>
<?php } ?>
</select>
<p class="description">
<?php
esc_html_e(
"If you have issue uploading a package start with a lower size. The connection size is from slowest to fastest.",
'duplicator-pro'
);
?><br/>
<small>
<?php
esc_html_e("Note: This setting only applies to the 'Import File' option.", 'duplicator-pro');
?>
</small>
</p>
</td>
</tr>
<tr>
<th scope="row">
<label for="import_custom_path" ><?php esc_html_e("Import custom path", 'duplicator-pro'); ?></label>
</th>
<td >
<input
class="large"
type="text"
name="import_custom_path"
id="input_import_custom_path"
value="<?php echo esc_attr($global->import_custom_path); ?>"
placeholder=""
>
<p class="description">
<?php
esc_html_e(
"Setting a custom path does not change the folder where packages are uploaded but adds a folder to check for packages list.",
'duplicator-pro'
);
?>
<br>
<?php
esc_html_e(
"This can be useful when you want to manually upload packages to another location which can also be a local storage of current or other site.", // phpcs:ignore Generic.Files.LineLength
'duplicator-pro'
);
?>
</p>
</td>
</tr>
</table>
<h3 class="title"><?php esc_html_e('Recovery', 'duplicator-pro') ?> </h3>
<hr size="1" />
<table class="form-table margin-top-1">
<tr>
<th scope="row">
<label for="input_recovery_custom_path" ><?php esc_html_e("Recovery custom path", 'duplicator-pro'); ?></label>
</th>
<td>
<input
class="large"
type="text"
name="recovery_custom_path"
id="input_recovery_custom_path"
value="<?php echo esc_attr($global->getRecoveryCustomPath()); ?>"
placeholder=""
>
<p class="description">
<?php
esc_html_e(
"Setting a custom path changes the location the recovery points are generated.",
'duplicator-pro'
);
?>
</p>
</td>
</tr>
</table>
<p class="submit dpro-save-submit">
<input
type="submit"
name="submit"
id="submit"
class="button-primary"
value="<?php esc_attr_e('Save Import Settings', 'duplicator-pro') ?>"
style="display: inline-block;"
>
</p>
</form>

View File

@@ -0,0 +1,360 @@
<?php
/**
* @package Duplicator
*/
defined("ABSPATH") or die("");
/**
* Variables
*
* @var Duplicator\Core\Controllers\ControllersManager $ctrlMng
* @var Duplicator\Core\Views\TplMng $tplMng
* @var array<string, mixed> $tplData
*/
use Duplicator\Controllers\SettingsPageController;
use Duplicator\Libs\Snap\SnapIO;
$global = DUP_PRO_Global_Entity::getInstance();
$sglobal = DUP_PRO_Secure_Global_Entity::getInstance();
$max_execution_time = ini_get("max_execution_time");
$max_execution_time = empty($max_execution_time) ? 30 : $max_execution_time;
$max_worker_cap_in_sec = (int) (0.7 * (float) $max_execution_time);
if ($max_worker_cap_in_sec > 180) {
$max_worker_cap_in_sec = 180;
}
?>
<!-- ===============================
ADVANCED SETTINGS -->
<form id="dup-settings-form"
action="<?php echo esc_url(Duplicator\Core\Controllers\ControllersManager::getCurrentLink()); ?>"
method="post" data-parsley-validate
>
<?php $tplData['actions'][SettingsPageController::ACTION_PACKAGE_ADVANCED_SAVE]->getActionNonceFileds(); ?>
<p class="description" style="color:maroon">
<i class="fas fa-exclamation-circle"></i>
<?php esc_html_e("Do not modify advanced settings unless you know the expected result or have talked to support.", 'duplicator-pro'); ?>
</p>
<table class="form-table">
<tr>
<th scope="row"><label><?php esc_html_e("Thread Lock", 'duplicator-pro'); ?></label></th>
<td>
<input
type="radio" name="lock_mode" id="lock_mode_flock" value="<?php echo (int) DUP_PRO_Thread_Lock_Mode::Flock; ?>"
<?php checked($global->lock_mode, DUP_PRO_Thread_Lock_Mode::Flock); ?>
>
<label for="lock_mode_flock"><?php esc_html_e("File", 'duplicator-pro'); ?></label> &nbsp;
<input
type="radio" name="lock_mode" id="lock_mode_sql" value="<?php echo (int) DUP_PRO_Thread_Lock_Mode::SQL_Lock; ?>"
<?php checked($global->lock_mode, DUP_PRO_Thread_Lock_Mode::SQL_Lock); ?>
>
<label for="lock_mode_sql"><?php esc_html_e("SQL", 'duplicator-pro'); ?></label> &nbsp;
</td>
</tr>
<tr valign="top">
<th scope="row"><label><?php esc_html_e("Max Worker Time", 'duplicator-pro'); ?></label></th>
<td>
<input
style="float:left;display:block;margin-right:6px;"
data-parsley-required data-parsley-errors-container="#php_max_worker_time_in_sec_error_container"
data-parsley-min="10" data-parsley-type="number" class="dup-narrow-input"
type="text" name="php_max_worker_time_in_sec"
id="php_max_worker_time_in_sec"
value="<?php echo (int) $global->php_max_worker_time_in_sec; ?>"
>
<p style="margin-left:4px;"><?php esc_html_e('Seconds', 'duplicator-pro'); ?></p>
<div id="php_max_worker_time_in_sec_error_container" class="duplicator-error-container"></div>
<p class="description">
<?php
printf(
esc_html__('Lower is more reliable but slower. Recommended max is %1$s sec based on PHP setting %2$s.', 'duplicator-pro'),
(int) $max_worker_cap_in_sec,
esc_html($max_execution_time)
);
?><br/>
<?php esc_html_e("Try a low value (30 seconds or lower) if the build fails with the recommended setting.", 'duplicator-pro'); ?>
</p>
</td>
</tr>
<tr valign="top">
<th scope="row"><label><?php esc_html_e('Chunk Size', 'duplicator-pro'); ?></label></th>
<td>
<input type="number" name="_chunk_size" id="_chunk_size" value="<?php echo (int) $global->chunk_size; ?>" minlength="4" min="1024"
data-parsley-required
data-parsley-minlength="10"
data-parsley-errors-container="#chunk_size_error_container" />
<div id="chunk_size_error_container" class="duplicator-error-container"></div>
<p class="description">
<?php esc_html_e('Archive upload chunk size', 'duplicator-pro'); ?>
</p>
</td>
</tr>
<tr>
<th scope="row"><label><?php esc_html_e("Ajax", 'duplicator-pro'); ?></label></th>
<td>
<input
type="radio" id="ajax_protocol_1" name="ajax_protocol" class="ajax_protocol" value="admin"
<?php checked($global->ajax_protocol, 'admin'); ?> />
<label for="ajax_protocol_1"><?php esc_html_e("Auto", 'duplicator-pro'); ?></label> &nbsp;
<input
type="radio" id="ajax_protocol_2" name="ajax_protocol" class="ajax_protocol"
value="http" <?php checked($global->ajax_protocol == 'http'); ?> />
<label for="ajax_protocol_2"><?php esc_html_e("HTTP", 'duplicator-pro'); ?></label> &nbsp;
<input
type="radio" id="ajax_protocol_3" name="ajax_protocol" class="ajax_protocol" value="https"
<?php checked($global->ajax_protocol == 'https'); ?> />
<label for="ajax_protocol_3"><?php esc_html_e("HTTPS", 'duplicator-pro'); ?></label> &nbsp;
<input
type="radio" id="ajax_protocol_4" name="ajax_protocol" class="ajax_protocol" value="custom"
<?php checked($global->ajax_protocol, 'custom'); ?> />
<label for="ajax_protocol_4"><?php esc_html_e("Custom URL", 'duplicator-pro'); ?></label> <br/>
<input
style="width:600px"
type="<?php echo ($global->ajax_protocol == 'custom' ? 'text' : 'hidden'); ?>"
id="custom_ajax_url" name="custom_ajax_url"
placeholder="<?php esc_attr_e('Consult support before changing.', 'duplicator-pro'); ?>"
value="<?php echo esc_url($global->custom_ajax_url); ?>"
>
<span id="custom_ajax_url_error" style="color: maroon; text-weight: bold; display: none"><?php esc_html_e("Bad URL!", 'duplicator-pro'); ?>
</span>
<p class="description">
<?php esc_html_e("Used to kick off build worker. Only change if packages get stuck at the start of a build.", 'duplicator-pro'); ?>
</p>
</td>
</tr>
<tr valign="top">
<th scope="row">
<label>Root path</label>
</th>
<td>
<input
type="checkbox" name="homepath_as_abspath" id="homepath_as_abspath"
<?php disabled(DUP_PRO_Archive::isAbspathHomepathEquivalent()); ?>
<?php checked($global->homepath_as_abspath); ?> value="1"
>
<label for="homepath_as_abspath">
<?php
printf(
esc_html_x(
'Use ABSPATH %s as root path.',
'%s represents the ABSPATH surrounded with bold (<b>) tags',
'duplicator-pro'
),
'<b>' . esc_html(DUP_PRO_Archive::getArchiveListPaths('abs')) . '</b>'
);
?>
<br>
</label>
<p class="description">
<?php
if (DUP_PRO_Archive::isAbspathHomepathEquivalent()) {
esc_html_e('Abspath and home path are equivalent so this option is disabled', 'duplicator-pro');
} else {
?>
<?php
printf(
esc_html_x(
'In this installation the default root path is %s.',
'%s represents the root path surrounded with bold (<b>) tags',
'duplicator-pro'
),
'<b>' . esc_html(SnapIO::safePathUntrailingslashit(get_home_path(), true)) . '</b>'
); ?><br>
<?php
esc_html_e(
'The path of the WordPress core is different. Activate this option if you want to consider ABSPATH as root path.',
'duplicator-pro'
);
}
?>
</p>
</td>
</tr>
<tr valign="top">
<th scope="row"><label><?php esc_html_e('Scan File Checks', 'duplicator-pro'); ?></label></th>
<td>
<input
type="checkbox" name="_skip_archive_scan" id="_skip_archive_scan"
<?php checked($global->skip_archive_scan); ?>
>
<label for="_skip_archive_scan"><?php esc_html_e("Skip", 'duplicator-pro') ?> </label><br/>
<p class="description">
<?php
esc_html_e(
'If enabled all files check on scan will be skipped before package creation.
In some cases, this option can be beneficial if the scan process is having issues running or returning errors.',
'duplicator-pro'
);
?>
</p>
</td>
</tr>
<tr valign="top">
<th scope="row"><label><?php esc_html_e('Client-side Kickoff', 'duplicator-pro'); ?></label></th>
<td>
<input type="checkbox" name="_clientside_kickoff" id="_clientside_kickoff" <?php checked($global->clientside_kickoff); ?> />
<label for="_clientside_kickoff"><?php esc_html_e("Enabled", 'duplicator-pro') ?> </label><br/>
<p class="description">
<?php esc_html_e('Initiate package build from client. Only check this if instructed to by Duplicator support.', 'duplicator-pro'); ?>
</p>
</td>
</tr>
<tr valign="top">
<th scope="row"><label><?php esc_html_e("Basic Auth", 'duplicator-pro'); ?></label></th>
<td>
<input
type="checkbox"
name="_basic_auth_enabled"
id="_basic_auth_enabled"
value="1"
<?php checked($global->basic_auth_enabled); ?>
>
<label for="_basic_auth_enabled"><?php esc_html_e("Enabled", 'duplicator-pro') ?> </label><br/>
<input
style="margin-top:8px;width:200px;"
class="dup-wide-input" autocomplete="off"
placeholder="<?php esc_attr_e('User', 'duplicator-pro'); ?>"
type="text" name="basic_auth_user"
id="basic_auth_user"
value="<?php echo esc_attr($global->basic_auth_user); ?>"
>
<input
id='auth_password'
autocomplete="off"
style="width:200px;"
class="dup-wide-input"
placeholder="<?php esc_attr_e('Password', 'duplicator-pro'); ?>"
type="password"
name="basic_auth_password"
id="basic_auth_password"
value="<?php echo esc_attr($sglobal->basic_auth_password); ?>"
>
<label for="auth_password">
<i class="dpro-edit-info">
<input type="checkbox" onclick="DupPro.UI.TogglePasswordDisplay(this.checked, 'auth_password');" >&nbsp;
<?php esc_html_e('Show Password', 'duplicator-pro') ?>
</i>
</label>
</td>
</tr>
<tr valign="top">
<th scope="row"><label><?php esc_html_e('Local Installer Name', 'duplicator-pro'); ?></label></th>
<td>
<input type="text" name="_installer_base_name" id="_installer_base_name" value="<?php echo esc_attr($global->installer_base_name); ?>"
data-parsley-required
data-parsley-minlength="10"
data-parsley-errors-container="#installer_base_name_error_container" />
<div id="installer_base_name_error_container" class="duplicator-error-container"></div>
<p class="description">
<?php esc_html_e('The base name of the installer file. Only change if host prevents using installer.php', 'duplicator-pro'); ?>
</p>
</td>
</tr>
</table>
<p class="submit dpro-save-submit">
<input
type="submit" name="submit" id="submit" class="button-primary"
value="<?php esc_attr_e('Save Advanced Package Settings', 'duplicator-pro') ?>" style="display: inline-block;"
>
</p>
</form>
<script>
(function ($) {
var url_error = $('#custom_ajax_url_error');
// Check URL is valid
$.urlExists = function (url) {
var http = new XMLHttpRequest();
try {
http.open('HEAD', url, false);
http.send();
} catch (err) {
$('#custom_ajax_url_error').html(err.message);
return false;
}
return http.status != 404;
};
var debounce;
$('#custom_ajax_url').on('input keyup keydown change paste focus', function (e) {
clearTimeout(debounce);
var $this = $(this);
debounce = setTimeout(function () {
$this.css({'border': ''});
url_error.hide();
if (!$.urlExists($this.val()))
{
$this.css({'border': 'maroon 1px solid'});
url_error.show();
}
}, 500);
});
(function ($this) {
$this.css({'border': ''});
url_error.hide();
setTimeout(function () {
var isCustomAjaxUrl = $('#ajax_protocol_4').is(':checked');
if (isCustomAjaxUrl && !$.urlExists($this.val()))
{
$this.css({'border': 'maroon 1px solid'});
url_error.show();
}
if (isCustomAjaxUrl) {
$('#custom_ajax_url').attr('data-parsley-required', 'true');
} else {
$('#custom_ajax_url').removeAttr('data-parsley-required');
}
}, 0);
}($('#custom_ajax_url')))
/*
* DISPLAY OR HIDE CUSTOM_AJAX_URL
*/
$('.ajax_protocol').on('input click change select touchstart', function (e) {
// Setup and collect value
var $this = $(this),
value = $this.val(),
hideField = $('#custom_ajax_url'),
hideFieldState = hideField.attr('type'),
offset = 200;
url_error.hide();
if (value == 'custom')
{
// Display hidden field
if (hideFieldState == 'hidden')
{
hideField.hide().attr('type', 'text').fadeIn(offset).attr('data-parsley-required', 'true');
hideField.css({'border': ''});
url_error.hide();
if (!$.urlExists(hideField.val()))
{
hideField.css({'border': 'maroon 1px solid'});
url_error.show();
}
}
} else
{
// Hide field but keep it active for POST reading
if (hideFieldState == 'text')
{
var parsleyId = $('#custom_ajax_url').data('parsley-id');
var errorUlId = '#parsley-id-' + parsleyId;
if ($(errorUlId).length)
$(errorUlId).remove();
hideField.fadeOut(Math.round(offset / 2), function () {
$(this).attr('type', 'hidden').show();
}).removeAttr('data-parsley-required');
;
}
}
});
}(window.jQuery || jQuery))
</script>

View File

@@ -0,0 +1,712 @@
<?php
/**
* @package Duplicator
*/
defined("ABSPATH") or die("");
/**
* Variables
*
* @var Duplicator\Core\Controllers\ControllersManager $ctrlMng
* @var Duplicator\Core\Views\TplMng $tplMng
* @var array<string, mixed> $tplData
*/
use Duplicator\Controllers\SettingsPageController;
use Duplicator\Core\Controllers\ControllersManager;
use Duplicator\Core\Views\TplMng;
use Duplicator\Libs\Shell\Shell;
use Duplicator\Libs\Snap\SnapIO;
use Duplicator\Libs\Snap\SnapUtil;
use Duplicator\Utils\ZipArchiveExtended;
$global = DUP_PRO_Global_Entity::getInstance();
$action_updated = null;
$action_response = __("Package Settings Saved", 'duplicator-pro');
$isZipArchiveAvailable = ZipArchiveExtended::isPhpZipAvailable();
$isShellZipAvailable = (DUP_PRO_Zip_U::getShellExecZipPath() != null);
$is_shellexec_on = Shell::test();
if (isset($_REQUEST['_package_mysqldump_path'])) {
$mysqldump_exe_file = SnapUtil::sanitizeNSCharsNewlineTrim($_REQUEST['_package_mysqldump_path']);
$mysqldump_exe_file = preg_match('/^([A-Za-z]\:)?[\/\\\\]/', $mysqldump_exe_file) ? $mysqldump_exe_file : '';
$mysqldump_exe_file = preg_replace('/[\'";]/m', '', $mysqldump_exe_file);
$_REQUEST['_package_mysqldump_path'] = SnapIO::safePathUntrailingslashit($mysqldump_exe_file);
}
$mysqlDumpPath = DUP_PRO_DB::getMySqlDumpPath();
$mysqlDumpFound = ($mysqlDumpPath) ? true : false;
$installerNameMode = $global->installer_name_mode;
?>
<form
id="dup-settings-form" class="dup-settings-pack-basic"
action="<?php echo esc_url(ControllersManager::getCurrentLink()); ?>"
method="post" data-parsley-validate
>
<?php $tplData['actions'][SettingsPageController::ACTION_PACKAGE_BASIC_SAVE]->getActionNonceFileds(); ?>
<!-- ===============================
DATABASE -->
<h3 class="title"><?php esc_html_e("Database", 'duplicator-pro') ?> </h3>
<hr size="1" />
<table class="form-table">
<tr>
<th scope="row"><label><?php esc_html_e("SQL Mode", 'duplicator-pro'); ?></label></th>
<td>
<div class="engine-radio <?php echo ($is_shellexec_on) ? '' : 'engine-radio-disabled'; ?>">
<input
type="radio" name="_package_dbmode" value="mysql" id="package_mysqldump"
<?php checked($global->package_mysqldump); ?> onclick="DupPro.UI.SetDBEngineMode();"
>
<label for="package_mysqldump"><?php esc_html_e("Mysqldump", 'duplicator-pro'); ?> </label> &nbsp; &nbsp; &nbsp;
</div>
<div class="engine-radio">
<input
type="radio" name="_package_dbmode" id="package_phpdump" value="php"
<?php checked(!$global->package_mysqldump); ?> onclick="DupPro.UI.SetDBEngineMode();"
>
<label for="package_phpdump"><?php esc_html_e("PHP Code", 'duplicator-pro'); ?></label>
</div>
<br style="clear:both"/><br/>
<!-- SHELL EXEC -->
<div class="engine-sub-opts" id="dbengine-details-1" style="display:none">
<!-- MYSQLDUMP IN-ACTIVE -->
<?php if (!$is_shellexec_on) :
?>
<div class="dup-feature-notfound">
<?php
esc_html_e(
'In order to use Mysqldump, one of the PHP functions has to be enabled: popen/pclose, exec or shell_exec.',
'duplicator-pro'
);
echo ' ';
esc_html_e('Please contact your host or server admin to enable one or more these functions.', 'duplicator-pro');
echo ' ';
printf(
esc_html_x(
'For a list of approved providers that support these functions, %1$sclick here%2$s.',
'%1$s and %2$s are the opening and closing tags of a link.',
'duplicator-pro'
),
'<a href="' . esc_url(DUPLICATOR_PRO_DUPLICATOR_DOCS_URL . 'what-host-providers-are-recommended-for-duplicator/')
. '" target="_blank">',
'</a>'
);
echo ' ';
esc_html_e('The "PHP Code" setting will be used until this issue is resolved by your hosting provider.', 'duplicator-pro');
?>
<p>
<?php
esc_html_e('Below is a list of possible functions to activate to solve the problem.', 'duplicator-pro');
echo ' ';
esc_html_e('If the problem persists, look at the log for a more thorough analysis.', 'duplicator-pro');
?>
</p>
<br/>
<b><?php esc_html_e('Disabled Functions:', 'duplicator-pro'); ?></b>
<code class="display-block margin-bottom-1">
<?php
foreach (['escapeshellarg', 'escapeshellcmd', 'extension_loaded', 'exec', 'popen', 'pclose', 'shell_exec'] as $func) {
if (Shell::hasDisabledFunctions($func)) {
echo esc_html($func);
echo '<br>';
}
}
?>
</code>
<?php
printf(
esc_html_x(
'FAQ: %1$sHow to enable disabled PHP functions.%2$s',
'%1$s and %2$s are the opening and closing tags of a link.',
'duplicator-pro'
),
'<a href="' . esc_url(DUPLICATOR_PRO_DUPLICATOR_DOCS_URL . 'how-to-resolve-dependency-checks') . '" target="_blank">',
'</a>'
);
?>
</div>
<!-- MYSQLDUMP ACTIVE -->
<?php
else :
$tipContent = esc_attr__(
'Add a custom path if the path to mysqldump is not properly detected.
For all paths use a forward slash as the path seperator.
On Linux systems use mysqldump for Windows systems use mysqldump.exe.
If the path tried does not work please contact your hosting provider for details on the correct path.',
'duplicator-pro'
);
?>
<label><?php esc_html_e("Current Path:", 'duplicator-pro'); ?></label>
<?php
SettingsPageController::getMySQLDumpMessage(
$mysqlDumpFound,
(!empty($mysqlDumpPath) ? $mysqlDumpPath : $global->package_mysqldump_path)
); ?><br>
<label><?php esc_html_e("Custom Path:", 'duplicator-pro'); ?></label>
<input
class="dup-wide-input"
type="text"
name="_package_mysqldump_path"
id="_package_mysqldump_path"
value="<?php echo esc_attr($global->package_mysqldump_path); ?>"
placeholder="<?php esc_attr_e("/usr/bin/mypath/mysqldump", 'duplicator-pro'); ?>"
>&nbsp;
<i class="fas fa-question-circle fa-sm"
data-tooltip-title="<?php esc_attr_e("mysqldump", 'duplicator-pro'); ?>"
data-tooltip="<?php echo esc_attr($tipContent); ?>">
</i><br>
<label><?php esc_html_e("Switch-Options:", 'duplicator-pro'); ?></label>
<div class="dup-group-option-wrapper">
<?php
$mysqldumpOptions = $global->getMysqldumpOptions();
foreach ($mysqldumpOptions as $key => $option) {
?>
<div
class="dup-group-option-item"><input type="checkbox" name="<?php echo esc_attr($option->getInputName()); ?>"
id="<?php echo esc_attr($option->getInputName()); ?>"
<?php checked($option->getEnabled()); ?>
>
--<?php echo esc_html($option->getOptionName()); ?></div>
<?php } ?>
</div>
<?php
endif; ?>
</div>
<!-- PHP OPTION -->
<div class="engine-sub-opts" id="dbengine-details-2" style="display:none; line-height: 35px; margin-top:-5px">
<label><?php esc_html_e("Process Mode", 'duplicator-pro'); ?></label>
<select name="_phpdump_mode">
<option
<?php selected($global->package_phpdump_mode, DUP_PRO_DB::PHPDUMP_MODE_MULTI); ?>
value="<?php echo (int) DUP_PRO_DB::PHPDUMP_MODE_MULTI; ?>"
>
<?php esc_html_e("Multi-Threaded", 'duplicator-pro'); ?>
</option>
<option
<?php selected($global->package_phpdump_mode, DUP_PRO_DB::PHPDUMP_MODE_SINGLE); ?>
value="<?php echo (int) DUP_PRO_DB::PHPDUMP_MODE_SINGLE; ?>"
>
<?php esc_html_e("Single-Threaded", 'duplicator-pro'); ?>
</option>
</select>&nbsp;
<i style="margin-right:7px;" class="fas fa-question-circle fa-sm"
data-tooltip-title="<?php esc_attr_e("PHP Code Mode", 'duplicator-pro'); ?>"
data-tooltip="<?php
esc_attr_e(
'Single-Threaded mode attempts to create the entire database script in one request.
Multi-Threaded mode allows the database script to be chunked over multiple requests.
Multi-Threaded mode is typically slower but much more reliable especially for larger databases.',
'duplicator-pro'
);
?>"></i>
</div>
</td>
</tr>
<tr>
<th scope="row"><label for="_package_mysqldump_qrylimit"><?php esc_html_e("Query Size", 'duplicator-pro'); ?></label></th>
<td>
<select name="_package_mysqldump_qrylimit" id="_package_mysqldump_qrylimit" style="width:70px">
<?php
foreach (DUP_PRO_Constants::getMysqlDumpChunkSizes() as $value => $label) {
echo '<option ' . selected($global->package_mysqldump_qrylimit, $value, false) . ' value="' . (int) $value . '">'
. esc_html($label) . '</option>';
}
?>
</select>&nbsp;
<?php $tipContent = __(
'A higher limit size will speed up the database build time, however it will use more memory.
If your host has memory caps start off low.',
'duplicator-pro'
); ?>
<i style="margin-right:7px" class="fas fa-question-circle fa-sm"
data-tooltip-title="<?php esc_attr_e("MYSQL Query Limit Size", 'duplicator-pro'); ?>"
data-tooltip="<?php echo esc_attr($tipContent); ?>">
</i>
</td>
</tr>
</table>
<!-- ===========================
ARCHIVE -->
<h3 class="title"><?php esc_html_e("Archive", 'duplicator-pro') ?> </h3>
<hr size="1" />
<!-- ===========================
ARCHIVE ENGINE -->
<table class="form-table" id="archive-build-manual">
<tr>
<th scope="row">
<label><?php esc_html_e("Compression", 'duplicator-pro'); ?></label>
</th>
<td>
<input type="radio" name="archive_compression" id="archive_compression_off" value="0"
<?php checked($global->archive_compression, false); ?> />
<label for="archive_compression_off"><?php esc_html_e("Off", 'duplicator-pro'); ?></label> &nbsp;
<input type="radio" name="archive_compression" id="archive_compression_on" value="1"
<?php checked($global->archive_compression); ?> />
<label for="archive_compression_on"><?php esc_html_e("On", 'duplicator-pro'); ?></label>
<?php $tipContent = __(
'This setting controls archive compression. The setting apply to all Archive Engine formats.
For ZipArchive this setting only works on PHP 7.0 or higher.',
'duplicator-pro'
); ?>&nbsp;
<i style="margin-right:7px;" class="fas fa-question-circle fa-sm"
data-tooltip-title="<?php esc_attr_e("Archive Compression", 'duplicator-pro'); ?>"
data-tooltip="<?php echo esc_attr($tipContent); ?>">
</i>
</td>
</tr>
<tr>
<th scope="row"><label><?php esc_html_e("Archive Engine", 'duplicator-pro'); ?></label></th>
<td>
<div class="engine-radio">
<input
onclick="DupPro.UI.SetArchiveOptionStates();"
type="radio"
name="archive_build_mode" id="archive_build_mode3"
value="<?php echo (int) DUP_PRO_Archive_Build_Mode::DupArchive; ?>"
<?php checked($global->getBuildMode() == DUP_PRO_Archive_Build_Mode::DupArchive); ?>
<?php disabled(!$global->isBuildModeAvailable(DUP_PRO_Archive_Build_Mode::DupArchive)) ?>
>
<label for="archive_build_mode3"><?php esc_html_e("DupArchive", 'duplicator-pro'); ?></label> &nbsp; &nbsp;
</div>
<div class="engine-radio <?php echo ($isShellZipAvailable) ? '' : 'engine-radio-disabled'; ?>">
<input
onclick="DupPro.UI.SetArchiveOptionStates();"
type="radio"
name="archive_build_mode"
id="archive_build_mode1"
value="<?php echo (int) DUP_PRO_Archive_Build_Mode::Shell_Exec; ?>"
<?php checked($global->getBuildMode() == DUP_PRO_Archive_Build_Mode::Shell_Exec); ?>
<?php disabled(!$global->isBuildModeAvailable(DUP_PRO_Archive_Build_Mode::Shell_Exec)) ?>
>
<label for="archive_build_mode1"><?php esc_html_e("Shell Zip", 'duplicator-pro'); ?></label>
</div>
<div class="engine-radio">
<input
onclick="DupPro.UI.SetArchiveOptionStates();"
type="radio"
name="archive_build_mode"
id="archive_build_mode2"
value="<?php echo (int) DUP_PRO_Archive_Build_Mode::ZipArchive; ?>"
<?php checked($global->getBuildMode() == DUP_PRO_Archive_Build_Mode::ZipArchive); ?>
<?php disabled(!$global->isBuildModeAvailable(DUP_PRO_Archive_Build_Mode::ZipArchive)) ?>
>
<label for="archive_build_mode2"><?php esc_html_e("ZipArchive", 'duplicator-pro'); ?></label>
</div>
<br style="clear:both"/>
<!-- DUPARCHIVE -->
<div class="engine-sub-opts" id="engine-details-3" style="display:none">
<?php
esc_html_e('This option creates a custom Duplicator Archive Format (.daf) archive file.', 'duplicator-pro');
echo '<br/> ';
esc_html_e('This option is fully multi-threaded and recommended for large sites or throttled servers.', 'duplicator-pro');
echo '<br/> ';
printf(
'%s <a href="' . esc_url(DUPLICATOR_PRO_DUPLICATOR_DOCS_URL . 'how-to-work-with-daf-files-and-the-duparchive-extraction-tool')
. '" target="_blank">%s</a> ',
esc_html__('For details on how to use and manually extract the DAF format please see the ', 'duplicator-pro'),
esc_html__('online documentation.', 'duplicator-pro')
);
?>
</div>
<!-- SHELL EXEC -->
<div class="engine-sub-opts" id="engine-details-1" style="display:none">
<?php
TplMng::getInstance()->render(
'parts/settings/shellZipMessage',
['hasShellZip' => $isShellZipAvailable]
);
?>
</div>
<!-- ZIP ARCHIVE -->
<div class="engine-sub-opts" id="engine-details-2" style="display:none;">
<label><?php esc_html_e("Process Mode", 'duplicator-pro'); ?></label>
<select name="ziparchive_mode" id="ziparchive_mode" onchange="DupPro.UI.setZipArchiveMode();">
<option <?php selected($global->ziparchive_mode, DUP_PRO_ZipArchive_Mode::Multithreaded); ?>
value="<?php echo (int) DUP_PRO_ZipArchive_Mode::Multithreaded ?>">
<?php esc_html_e("Multi-Threaded", 'duplicator-pro'); ?>
</option>
<option <?php selected($global->ziparchive_mode == DUP_PRO_ZipArchive_Mode::SingleThread); ?>
value="<?php echo (int) DUP_PRO_ZipArchive_Mode::SingleThread ?>">
<?php esc_html_e("Single-Threaded", 'duplicator-pro'); ?>
</option>
</select>&nbsp;
<i style="margin-right:7px;" class="fas fa-question-circle fa-sm"
data-tooltip-title="<?php esc_attr_e("PHP ZipArchive Mode", 'duplicator-pro'); ?>"
data-tooltip="<?php
esc_attr_e(
'Single-Threaded mode attempts to create the entire archive in one request.
Multi-Threaded mode allows the archive to be chunked over multiple requests.
Multi-Threaded mode is typically slower but much more reliable especially for larger sites.',
'duplicator-pro'
);
?>"></i>
<div id="dpro-ziparchive-mode-st">
<input type="checkbox" id="ziparchive_validation" name="ziparchive_validation"
<?php checked($global->ziparchive_validation); ?>
>
<label for="ziparchive_validation">Enable file validation</label>
</div>
<div id="dpro-ziparchive-mode-mt">
<label><?php esc_html_e("Buffer Size", 'duplicator-pro'); ?></label>
<input style="width:84px;" maxlength="4"
data-parsley-required data-parsley-errors-container="#ziparchive_chunk_size_error_container"
data-parsley-min="5" data-parsley-type="number"
type="text" name="ziparchive_chunk_size_in_mb" id="ziparchive_chunk_size_in_mb"
value="<?php echo (int) $global->ziparchive_chunk_size_in_mb; ?>"
>
<?php esc_html_e('MB', 'duplicator-pro'); ?>
<?php
$toolTipContent = __(
'Buffer size only applies to multi-threaded requests and indicates how large an archive will get before a close is registered.
Higher values are faster but can be more unstable based on the hosts max_execution time.',
'duplicator-pro'
);
?>
<i style="margin-right:7px" class="fas fa-question-circle fa-sm"
data-tooltip-title="<?php esc_attr_e("PHP ZipArchive Buffer", 'duplicator-pro'); ?>"
data-tooltip="<?php echo esc_attr($toolTipContent); ?>"
>
</i>
<div id="ziparchive_chunk_size_error_container" class="duplicator-error-container"></div>
</div>
</div>
</td>
</tr>
</table>
<!-- ===============================
PROCESSING -->
<h3 class="title"><?php esc_html_e("Processing", 'duplicator-pro') ?> </h3>
<hr size="1" />
<table class="form-table">
<tr>
<th scope="row"><label><?php esc_html_e("Server Throttle", 'duplicator-pro'); ?></label></th>
<td>
<input
type="radio" name="server_load_reduction" id="server_load_reduction_off"
value="<?php echo (int) DUP_PRO_Email_Build_Mode::No_Emails; ?>"
<?php checked($global->server_load_reduction, DUP_PRO_Server_Load_Reduction::None); ?>
>
<label for="server_load_reduction_off"><?php esc_html_e("Off", 'duplicator-pro'); ?></label> &nbsp;
<input
type="radio" name="server_load_reduction" id="server_load_reduction_low"
value="<?php echo (int) DUP_PRO_Server_Load_Reduction::A_Bit; ?>"
<?php checked($global->server_load_reduction, DUP_PRO_Server_Load_Reduction::A_Bit); ?> >
<label for="server_load_reduction_low"><?php esc_html_e("Low", 'duplicator-pro'); ?></label> &nbsp;
<input
type="radio" name="server_load_reduction" id="server_load_reduction_medium"
value="<?php echo (int) DUP_PRO_Server_Load_Reduction::More; ?>"
<?php checked($global->server_load_reduction, DUP_PRO_Server_Load_Reduction::More); ?>
>
<label for="server_load_reduction_medium"><?php esc_html_e("Medium", 'duplicator-pro'); ?></label> &nbsp;
<input
type="radio" name="server_load_reduction" id="server_load_reduction_high"
value="<?php echo (int) DUP_PRO_Server_Load_Reduction::A_Lot ?>"
<?php checked($global->server_load_reduction, DUP_PRO_Server_Load_Reduction::A_Lot); ?>
>
<label for="server_load_reduction_high"><?php esc_html_e("High", 'duplicator-pro'); ?></label> &nbsp;
<p class="description">
<?php esc_html_e(
"Throttle to prevent resource complaints on budget hosts. The higher the value the slower the backup.",
'duplicator-pro'
); ?>
</p>
</td>
</tr>
<tr valign="top">
<th scope="row"><label><?php esc_html_e("Max Build Time", 'duplicator-pro'); ?></label></th>
<td>
<input
style="float:left;display:block;margin-right:6px;"
data-parsley-required data-parsley-errors-container="#max_package_runtime_in_min_error_container"
data-parsley-min="0"
data-parsley-type="number"
class="dup-narrow-input"
type="text"
name="max_package_runtime_in_min"
id="max_package_runtime_in_min"
value="<?php echo (int) $global->max_package_runtime_in_min; ?>"
>
<p style="margin-left:4px;"><?php esc_html_e('Minutes', 'duplicator-pro'); ?></p>
<div id="max_package_runtime_in_min_error_container" class="duplicator-error-container"></div>
<p class="description">
<?php esc_html_e('Max build and storage time until package is auto-cancelled. Set to 0 for no limit.', 'duplicator-pro'); ?>
</p>
</td>
</tr>
</table>
<!-- ===============================
INSTALLER SETTINGS -->
<h3 id="duplicator-pro-installer-settings" class="title"><?php esc_html_e("Installer Settings", 'duplicator-pro'); ?></h3>
<hr size="1" />
<table class="form-table">
<tr>
<th scope="row"><label><?php esc_html_e("Name", 'duplicator-pro'); ?></label></th>
<td id="installer-name-mode-option" >
<b><?php esc_html_e("Default 'Save as' name:", 'duplicator-pro'); ?></b> <br/>
<label>
<i class='fas fa-lock lock-info fa-fw'></i>
<input type="radio" name="installer_name_mode"
value="<?php echo esc_attr(DUP_PRO_Global_Entity::INSTALLER_NAME_MODE_WITH_HASH); ?>"
<?php checked($installerNameMode === DUP_PRO_Global_Entity::INSTALLER_NAME_MODE_WITH_HASH); ?> />
[name]_[hash]_[date]_installer.php <i>(<?php esc_html_e("recommended", 'duplicator-pro'); ?>)</i>
</label><br>
<label>
<i class='fas fa-lock-open lock-info fa-fw'></i>
<input type="radio" name="installer_name_mode"
value="<?php echo esc_attr(DUP_PRO_Global_Entity::INSTALLER_NAME_MODE_SIMPLE); ?>"
<?php checked($installerNameMode === DUP_PRO_Global_Entity::INSTALLER_NAME_MODE_SIMPLE); ?> />
<?php echo esc_html(DUP_PRO_Installer::DEFAULT_INSTALLER_FILE_NAME_WITHOUT_HASH); ?>
</label>
<p class="description">
<?php esc_html_e("To understand the importance and usage of the installer name, please", 'duplicator-pro') ?>
<a href="javascript:void(0)" onclick="jQuery('#dup-pro-inst-mode-details').toggle()">
<?php esc_html_e("read this section", 'duplicator-pro') ?>
</a>.
</p>
<div id="dup-pro-inst-mode-details">
<p>
<i>
<?php esc_html_e(
'Using the full hashed format provides a higher level of security by helping to prevent the discovery of the installer file.',
'duplicator-pro'
); ?>
</i> <br/>
<b><?php esc_html_e('Hashed example', 'duplicator-pro'); ?>:</b> my-name_64fc6df76c17f2023225_19990101010101_installer.php
</p>
<p>
<?php
esc_html_e(
'The Installer \'Name\' setting specifies the name of the installer used at download-time.
It\'s recommended you choose the hashed name to better protect the installer file.
Independent of the value of this setting, you can always change the name in the \'Save as\' file dialog at download-time.
If you choose to use a custom name, use a filename that is known only to you. Installer filenames must end in \'.php\'.',
'duplicator-pro'
);
?>
</p>
<p>
<?php
esc_html_e(
'It\'s important not to leave the installer files on the destination server longer than necessary.
After installing the migrated or restored site, just logon as a WordPress administrator and
follow the prompts to have the plugin remove the files.
Alternatively, you can remove them manually.',
'duplicator-pro'
);
?>
</p>
<p>
<i class="fas fa-info-circle"></i>
<?php
esc_html_e(
'Tip: Each row on the packages screen includes a copy button that copies the installer name to the clipboard.
After clicking this button, paste the installer name into the URL you\'re using to install the destination site.
This feature is handy when using the hashed installer name.',
'duplicator-pro'
);
?>
</p>
</div>
</td>
</tr>
</table>
<!-- ===============================
Installer Cleanup -->
<h3 class="title"><?php esc_html_e("Installer Cleanup", 'duplicator-pro') ?> </h3>
<hr size="1" />
<table class="form-table">
<tr>
<th scope="row"><label><?php esc_html_e("Mode", 'duplicator-pro'); ?></label></th>
<td>
<input
type="radio"
name="cleanup_mode"
id="cleanup_mode_Cleanup_Off"
value="<?php echo (int) DUP_PRO_Global_Entity::CLEANUP_MODE_OFF; ?>"
<?php checked($global->cleanup_mode, DUP_PRO_Global_Entity::CLEANUP_MODE_OFF); ?>
>
<label for="cleanup_mode_Cleanup_Off"><?php esc_html_e("Off", 'duplicator-pro'); ?></label> &nbsp;
<input
type="radio"
name="cleanup_mode"
id="cleanup_mode_Email_Notice"
value="<?php echo (int) DUP_PRO_Global_Entity::CLEANUP_MODE_MAIL; ?>"
<?php checked($global->cleanup_mode, DUP_PRO_Global_Entity::CLEANUP_MODE_MAIL); ?>
>
<label for="cleanup_mode_Email_Notice"><?php esc_html_e("Email Notice", 'duplicator-pro'); ?></label> &nbsp;
<input
type="radio"
name="cleanup_mode"
id="cleanup_mode_Auto_Cleanup"
value="<?php echo (int) DUP_PRO_Global_Entity::CLEANUP_MODE_AUTO; ?>"
<?php checked($global->cleanup_mode, DUP_PRO_Global_Entity::CLEANUP_MODE_AUTO); ?>
>
<label for="cleanup_mode_Auto_Cleanup"><?php esc_html_e("Auto Cleanup", 'duplicator-pro'); ?></label> &nbsp;
<p class="description">
<?php esc_html_e("Email Notice: An email will be sent daily until the installer files are removed.", 'duplicator-pro'); ?>
</p>
<p class="description">
<?php esc_html_e("Auto Cleanup: Installer files will be cleaned up automatically based on setting below.", 'duplicator-pro'); ?>
</p>
</td>
</tr>
<tr valign="top">
<th scope="row"><label><?php esc_html_e("Auto Cleanup", 'duplicator-pro'); ?></label></th>
<td>
<input
data-parsley-required
data-parsley-errors-container="#auto_cleanup_hours_error_container"
data-parsley-min="1"
data-parsley-type="number"
class="dup-narrow-input"
type="text"
name="auto_cleanup_hours" id="auto_cleanup_hours"
value="<?php echo (int) $global->auto_cleanup_hours; ?>"
size="7"/>
<?php esc_html_e('Hours', 'duplicator-pro'); ?>
<div id="auto_cleanup_hours_error_container" class="duplicator-error-container"></div>
<p class="description"> <?php esc_html_e('Auto cleanup will run every N hours based on value above.', 'duplicator-pro'); ?> </p>
</td>
</tr>
<tr valign="top">
<th scope="row"><label><?php esc_html_e("Email Address", 'duplicator-pro'); ?></label></th>
<td>
<input
data-parsley-errors-container="#cleanup_email_error_container"
data-parsley-type="email"
type="email"
name="cleanup_email"
id="cleanup_email"
value="<?php echo esc_attr($global->cleanup_email); ?>"
size="75" />
<p class="description"><?php esc_html_e('WordPress administration email address will be used if empty.', 'duplicator-pro'); ?></p>
<div id="cleanup_email_error_container" class="duplicator-error-container"></div>
</td>
</tr>
</table>
<p class="submit dpro-save-submit">
<input
type="submit" name="submit" id="submit" class="button-primary"
value="<?php esc_attr_e('Save Basic Package Settings', 'duplicator-pro') ?>" style="display: inline-block;"
>
</p>
</form>
<script>
jQuery(document).ready(function ($)
{
DupPro.UI.SetDBEngineMode = function ()
{
var isMysqlDump = $('#package_mysqldump').is(':checked');
var isPHPMode = $('#package_phpdump').is(':checked');
var isPHPChunkMode = $('#package_phpchunkingdump').is(':checked');
$('#dbengine-details-1, #dbengine-details-2').hide();
switch (true) {
case isMysqlDump :
$('#dbengine-details-1').show();
break;
case isPHPMode :
case isPHPChunkMode :
$('#dbengine-details-2').show();
break;
}
}
DupPro.UI.setZipArchiveMode = function ()
{
$('#dpro-ziparchive-mode-st, #dpro-ziparchive-mode-mt').hide();
if ($('#ziparchive_mode').val() == 0) {
$('#dpro-ziparchive-mode-mt').show();
} else {
$('#dpro-ziparchive-mode-st').show();
}
}
DupPro.UI.SetArchiveOptionStates = function ()
{
var php70 = <?php echo (version_compare(PHP_VERSION, '7', '>=') ? 'true' : 'false'); ?>;
var isShellZipSelected = $('#archive_build_mode1').is(':checked');
var isZipArchiveSelected = $('#archive_build_mode2').is(':checked');
var isDupArchiveSelected = $('#archive_build_mode3').is(':checked');
if (isShellZipSelected || isDupArchiveSelected) {
$("[name='archive_compression']").prop('disabled', false);
$("[name='ziparchive_mode']").prop('disabled', true);
} else {
$("[name='ziparchive_mode']").prop('disabled', false);
if (php70) {
$("[name='archive_compression']").prop('disabled', false);
} else {
$('#archive_compression_on').prop('checked', true);
$("[name='archive_compression']").prop('disabled', true);
}
}
$('#engine-details-1, #engine-details-2, #engine-details-3').hide();
switch (true) {
case isShellZipSelected :
$('#engine-details-1').show();
break;
case isZipArchiveSelected :
$('#engine-details-2').show();
break;
case isDupArchiveSelected :
$('#engine-details-3').show();
break;
}
DupPro.UI.setZipArchiveMode();
}
//INIT
DupPro.UI.SetArchiveOptionStates();
DupPro.UI.SetDBEngineMode();
DupPro.UI.cleanupModeRadioSwitched = function() {
if ($('#cleanup_mode_Cleanup_Off').is(":checked")){
$('#auto_cleanup_hours').attr('readonly','readonly');
$('#cleanup_email').attr('readonly','readonly');
} else if ($('#cleanup_mode_Email_Notice').is(":checked")) {
$('#auto_cleanup_hours').attr('readonly','readonly');
$("#cleanup_email").removeAttr('readonly');
} else if ($('#cleanup_mode_Auto_Cleanup').is(":checked")) {
$("#auto_cleanup_hours").removeAttr('readonly');
$("#cleanup_email").removeAttr('readonly');
}
}
$('input[type=radio][name=cleanup_mode]').change(function () {
DupPro.UI.cleanupModeRadioSwitched();
});
// We must call this also once in the beginning, after UI is loaded
DupPro.UI.cleanupModeRadioSwitched();
});
</script>

View File

@@ -0,0 +1,81 @@
<?php
/**
* @package Duplicator
*/
defined("ABSPATH") or die("");
use Duplicator\Controllers\SettingsPageController;
use Duplicator\Libs\Snap\SnapIO;
/**
* Variables
*
* @var Duplicator\Core\Controllers\ControllersManager $ctrlMng
* @var Duplicator\Core\Views\TplMng $tplMng
* @var array<string, mixed> $tplData
*/
$global = DUP_PRO_Global_Entity::getInstance();
?>
<form
id="dup-settings-form"
action="<?php echo $ctrlMng->getCurrentLink(); ?>"
method="post"
data-parsley-validate
>
<?php $tplData['actions'][SettingsPageController::ACTION_SAVE_STORAGE_GENERAL]->getActionNonceFileds(); ?>
<table class="form-table">
<tr valign="top">
<th scope="row"><label><?php esc_html_e("Storage", 'duplicator-pro'); ?></label></th>
<td>
<?php esc_html_e("Full Path", 'duplicator-pro'); ?>:
<?php echo SnapIO::safePath(DUPLICATOR_PRO_SSDIR_PATH); ?><br/><br/>
<input
type="checkbox"
name="_storage_htaccess_off"
id="_storage_htaccess_off"
value="1"
<?php checked($global->storage_htaccess_off); ?>
>
<label for="_storage_htaccess_off">
<?php esc_html_e("Disable .htaccess File In Storage Directory", 'duplicator-pro') ?>
</label>
<p class="description">
<?php esc_html_e("Disable if issues occur when downloading installer/archive files.", 'duplicator-pro'); ?>
</p>
</td>
</tr>
<tr valign="top">
<th scope="row"><label><?php esc_html_e("Max Retries", 'duplicator-pro'); ?></label></th>
<td>
<input
class="dup-narrow-input"
type="text"
name="max_storage_retries"
id="max_storage_retries"
data-parsley-required data-parsley-min="0"
data-parsley-type="number"
data-parsley-errors-container="#max_storage_retries_error_container"
value="<?php echo $global->max_storage_retries; ?>"
>
<div id="max_storage_retries_error_container" class="duplicator-error-container"></div>
<p class="description">
<?php esc_html_e('Max upload/copy retries to attempt after failure encountered.', 'duplicator-pro'); ?>
</p>
</td>
</tr>
</table>
<p class="submit dpro-save-submit">
<input
type="submit"
name="submit"
id="submit"
class="button-primary"
value="<?php esc_attr_e('Save Storage Settings', 'duplicator-pro') ?>"
style="display: inline-block;"
>
</p>
</form>

View File

@@ -0,0 +1,102 @@
<?php
/**
* @package Duplicator
*/
defined("ABSPATH") or die("");
use Duplicator\Controllers\SettingsPageController;
/**
* Variables
*
* @var Duplicator\Core\Controllers\ControllersManager $ctrlMng
* @var Duplicator\Core\Views\TplMng $tplMng
* @var array<string, mixed> $tplData
*/
$global = DUP_PRO_Global_Entity::getInstance();
?>
<form
id="dup-settings-form"
action="<?php echo $ctrlMng->getCurrentLink(); ?>"
method="post"
data-parsley-validate
>
<?php $tplData['actions'][SettingsPageController::ACTION_SAVE_STORAGE_SSL]->getActionNonceFileds(); ?>
<p class="description" style="color:maroon">
<?php esc_html_e("Do not modify SSL settings unless you know the expected result or have talked to support.", 'duplicator-pro'); ?>
</p>
<table class="form-table">
<tr valign="top">
<th scope="row"><label><?php esc_html_e("Use server's SSL certificates", 'duplicator-pro'); ?></label></th>
<td>
<input
type="checkbox"
name="ssl_useservercerts"
id="ssl_useservercerts"
value="1"
<?php checked($global->ssl_useservercerts); ?>
>
<p class="description">
<?php
esc_html_e(
"To use server's SSL certificates please enble it.
By default Duplicator Pro uses By default uses its own store of SSL certificates to verify the identity of remote storage sites.",
'duplicator-pro'
);
?>
</p>
</td>
</tr>
<tr valign="top">
<th scope="row"><label><?php esc_html_e("Disable verification of SSL certificates", 'duplicator-pro'); ?></label></th>
<td>
<input
type="checkbox"
name="ssl_disableverify"
id="ssl_disableverify"
value="1"
<?php checked($global->ssl_disableverify); ?>
>
<p class="description">
<?php
esc_html_e("To disable verification of a host and the peer's SSL certificate.", 'duplicator-pro');
?>
</p>
</td>
</tr>
<tr valign="top">
<th scope="row"><label><?php esc_html_e("Use IPv4 only", 'duplicator-pro'); ?></label></th>
<td>
<input
type="checkbox"
name="ipv4_only"
id="ipv4_only"
value="1"
<?php checked($global->ipv4_only); ?>
>
<p class="description">
<?php
esc_html_e(
"To use IPv4 only, which can help if your host has a broken IPv6 setup (currently only supported by Google Drive)",
'duplicator-pro'
);
?>
</p>
</td>
</tr>
</table>
<p class="submit dpro-save-submit">
<input
type="submit"
name="submit"
id="submit"
class="button-primary"
value="<?php esc_attr_e('Save Storage Settings', 'duplicator-pro') ?>"
style="display: inline-block;"
>
</p>
</form>

View File

@@ -0,0 +1,41 @@
<?php
/**
* @package Duplicator
*/
defined("ABSPATH") or die("");
use Duplicator\Controllers\SettingsPageController;
use Duplicator\Models\Storages\StoragesUtil;
/**
* Variables
*
* @var Duplicator\Core\Controllers\ControllersManager $ctrlMng
* @var Duplicator\Core\Views\TplMng $tplMng
* @var array<string, mixed> $tplData
*/
?>
<form
id="dup-settings-form"
action="<?php echo $ctrlMng::getCurrentLink(); ?>"
method="post" data-parsley-validate
>
<?php
$tplData['actions'][SettingsPageController::ACTION_SAVE_STORAGE_OPTIONS]->getActionNonceFileds();
StoragesUtil::renderGlobalOptions();
?>
<p class="submit dpro-save-submit">
<input
type="submit"
name="submit"
id="submit"
class="button-primary"
value="<?php esc_attr_e('Save Storage Settings', 'duplicator-pro') ?>"
style="display: inline-block;"
>
</p>
</form>