first commit

This commit is contained in:
Roman Pyrih
2026-04-03 10:22:35 +02:00
commit 5de35e358d
8424 changed files with 2907254 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
<?php
//silent

View File

@@ -0,0 +1,3 @@
<?php
//silent

View File

@@ -0,0 +1,168 @@
<?php
/**
*
* @package Duplicator
* @copyright (c) 2022, Snap Creek LLC
*/
defined('ABSPATH') || defined('DUPXABSPATH') || exit;
use Duplicator\Controllers\ToolsPageController;
use Duplicator\Core\CapMng;
use Duplicator\Core\Views\TplMng;
use Duplicator\Core\Views\Notifications;
use Duplicator\Models\SystemGlobalEntity;
use Duplicator\Views\PackagesHelper;
require_once(DUPLICATOR____PATH . '/classes/class.package.pagination.php');
require_once(DUPLICATOR____PATH . '/classes/ui/class.ui.dialog.php');
global $packagesViewData;
$tplMng = TplMng::getInstance();
if (isset($_REQUEST['create_from_temp'])) {
//Takes temporary package and inserts it into the package table
$package = DUP_PRO_Package::get_temporary_package(false);
if ($package != null) {
$package->save();
}
unset($_REQUEST['create_from_temp']);
unset($package);
}
$system_global = SystemGlobalEntity::getInstance();
if (!empty($_REQUEST['action'])) {
if (CapMng::can(CapMng::CAP_CREATE, false) && $_REQUEST['action'] == 'stop-build') {
$package_id = (int) $_REQUEST['action-parameter'];
DUP_PRO_Log::trace("stop build of $package_id");
$action_package = DUP_PRO_Package::get_by_id($package_id);
if ($action_package != null) {
DUP_PRO_Log::trace("set $action_package->ID for cancel");
$action_package->set_for_cancel();
} else {
DUP_PRO_Log::trace(
"could not find package so attempting hard delete. "
. "Old files may end up sticking around although chances are there isnt much if we couldnt nicely cancel it."
);
$result = DUP_PRO_Package::force_delete($package_id);
($result) ? DUP_PRO_Log::trace("Hard delete success") : DUP_PRO_Log::trace("Hard delete failure");
}
unset($action_package);
} elseif ($_REQUEST['action'] == 'clear-messages') {
$system_global->clearFixes();
$system_global->save();
}
}
$packagesViewData = array(
'pending_cancelled_package_ids' => DUP_PRO_Package::get_pending_cancellations(),
'rowCount' => 0,
);
$totalElements = DUP_PRO_Package::getNumPackages();
$statusActive = DUP_PRO_Package::isPackageRunning();
$pager = new DUP_PRO_Package_Pagination();
$perPage = $pager->get_per_page();
$currentPage = ($statusActive >= 1) ? 1 : $pager->get_pagenum();
$offset = ($currentPage - 1) * $perPage;
$global = DUP_PRO_Global_Entity::getInstance();
$orphan_info = DUP_PRO_Server::getOrphanedPackageInfo();
$orphan_display_msg = $orphan_info['count'];
if ($orphan_display_msg) {
$toolOrpahnPurgeURL = ToolsPageController::getInstance()->getMenuLink(
ToolsPageController::L2_SLUG_DISAGNOSTIC,
null,
['orphanpurge' => 1 ] // Tools section opened
)
?>
<div id='dpro-error-orphans' class="error">
<p>
<?php
$orphan_msg = __(
'There are currently (%1$s) orphaned package files taking up %2$s of space.
These package files are no longer visible in the packages list below and are safe to remove.',
'duplicator-pro'
) . '<br/>';
$orphan_msg .= __('Go to: Tools > General > Information > Stored Data > look for the [Delete Package Orphans] button for more details.', 'duplicator-pro') . '<br/>';
$orphan_msg .= '<a href=' . esc_url($toolOrpahnPurgeURL) . '>' .
__('Take me there now!', 'duplicator-pro') .
'</a>';
printf($orphan_msg, $orphan_info['count'], DUP_PRO_U::byteSize($orphan_info['size']));
?>
<br />
</p>
</div>
<?php } ?>
<?php do_action(Notifications::DUPLICATOR_PRO_BEFORE_PACKAGES_HOOK); ?>
<form id="form-duplicator" method="post">
<?php wp_nonce_field('dpro_package_form_nonce'); ?>
<?php $tplMng->render('admin_pages/packages/toolbar'); ?>
<table class="widefat dup-packtbl striped" aria-label="Packages List">
<?php
$tplMng->render(
'admin_pages/packages/packages_table_head',
array('totalElements' => $totalElements)
);
if ($totalElements == 0) {
$tplMng->render('admin_pages/packages/no_elements_row');
} else {
DUP_PRO_Package::by_status_callback(
array(
PackagesHelper::class,
'tablePackageRow',
),
array(),
$perPage,
$offset,
'`id` DESC'
);
}
$tplMng->render(
'admin_pages/packages/packages_table_foot',
array('totalElements' => $totalElements)
); ?>
</table>
</form>
<?php if ($totalElements > $perPage) { ?>
<form id="form-duplicator-nav" method="post">
<?php wp_nonce_field('dpro_package_form_nonce'); ?>
<div class="dup-paged-nav tablenav">
<?php if ($statusActive > 0) : ?>
<div id="dpro-paged-progress" style="padding-right: 10px">
<i class="fas fa-circle-notch fa-spin fa-lg fa-fw"></i>
<i><?php esc_html_e('Paging disabled during build...', 'duplicator-pro'); ?></i>
</div>
<?php else : ?>
<div id="dpro-paged-buttons">
<?php $pager->display_pagination($totalElements, $perPage); ?>
</div>
<?php endif; ?>
</div>
</form>
<?php } else { ?>
<div style="float:right; padding:10px 5px">
<?php echo $totalElements . '&nbsp;' . __("items", 'duplicator-pro'); ?>
</div>
<?php
}
$tplMng->render(
'admin_pages/packages/packages_scripts',
[
'perPage' => $perPage,
'offset' => $offset,
'currentPage' => $currentPage,
]
);

View File

@@ -0,0 +1,424 @@
<?php
defined("ABSPATH") or die("");
use Duplicator\Controllers\PackagesPageController;
use Duplicator\Controllers\ToolsPageController;
use Duplicator\Core\Views\TplMng;
use Duplicator\Libs\Snap\SnapJson;
use Duplicator\Libs\Snap\SnapWP;
global $wpdb;
//POST BACK
$action_updated = null;
if (!empty($_POST['action'])) {
switch ($_POST['action']) {
case 'duplicator_pro_package_active':
$action_response = __('Package settings have been reset.', 'duplicator-pro');
break;
}
}
$manual_template = DUP_PRO_Package_Template_Entity::get_manual_template();
$dup_tests = DUP_PRO_Server::getRequirments();
if ($dup_tests['Success'] != true) {
DUP_PRO_Log::traceObject('Requirements', $dup_tests);
}
$templates = DUP_PRO_Package_Template_Entity::getAll();
$default_name1 = DUP_PRO_Package::get_default_name();
$default_name2 = DUP_PRO_Package::get_default_name(false);
$default_notes = $manual_template->notes;
$dbbuild_mode = DUP_PRO_DB::getBuildMode();
/** @var bool */
$blur = TplMng::getInstance()->getGlobalValue('blurCreate');
$templatesUrl = ToolsPageController::getInstance()->getMenuLink(ToolsPageController::L2_SLUG_TEMPLATE);
$templateEditBaseUrl = ToolsPageController::getTemplateEditURL();
?>
<style>
/* -----------------------------
PACKAGE OPTS*/
form#dup-form-opts {margin-top:10px; font-size:14px}
form#dup-form-opts textarea, input[type="text"], input[type="password"] {width:100%}
input#package-name {padding:4px; height: 2em; line-height: 100%; width: 100%; margin: 0 0 3px;}
select#template_id {padding: 2px; height:2em; line-height: 130%; width: 100%; }
textarea#package-notes {height:75px;}
div.dup-notes-add {float:right; margin:0;}
div#dup-notes-area {display:none;}
select#template_id {width:100%; max-width: none; margin-bottom:4px}
div.dpro-general-area {line-height:27px; margin:0 0 5px 0}
div#dpro-template-specific-area table td:first-child {width:100px; font-weight: bold}
div.dup-box {margin:20px 0 0 0}
div#dpro-da-notice {padding:10px; line-height:20px; font-size: 14px}
div#dpro-da-notice-info {display:none; padding: 5px}
</style>
<!-- ====================
TOOL-BAR -->
<table class="dpro-edit-toolbar <?php echo ($blur ? 'dup-mock-blur' : ''); ?>">
<tr>
<td>
<div id="dup-wiz">
<div id="dup-wiz-steps">
<div class="active-step"><a>1 <?php esc_html_e('Setup', 'duplicator-pro'); ?></a></div>
<div><a>2 <?php esc_html_e('Scan', 'duplicator-pro'); ?> </a></div>
<div><a>3 <?php esc_html_e('Build', 'duplicator-pro'); ?> </a></div>
</div>
<div id="dup-wiz-title" style="white-space: nowrap">
<?php esc_html_e('Step 1: Package Setup', 'duplicator-pro'); ?>
</div>
</div>
</td>
</tr>
</table>
<hr class="dpro-edit-toolbar-divider"/>
<?php if (! empty($action_response)) : ?>
<div id="message" class="notice notice-success"><p><?php echo $action_response; ?></p></div>
<?php
endif;
require_once(DUPLICATOR____PATH . '/views/packages/main/s1.setup1.reqs.php');
$form_action_url = PackagesPageController::getInstance()->getPackageBuildS2Url();
?>
<form
id="dup-form-opts"
class="<?php echo ($blur ? 'dup-mock-blur' : ''); ?>"
method="post"
action="<?php echo $form_action_url;?>"
data-parsley-validate data-parsley-ui-enabled="true"
>
<input type="hidden" id="dup-form-opts-action" name="action" value="">
<div class="dpro-general-area">
<div>
<label for="package-name" class="lbl-larger"><span class="screen-reader-text"><?php esc_html_e('Package', 'duplicator-pro') ?></span>&nbsp;<?php esc_html_e('Name', 'duplicator-pro') ?>:</label>
<a href="javascript:void(0)" onClick="DupPro.Pack.ResetName()" title="<?php esc_attr_e('Toggle a default name', 'duplicator-pro') ?>"><i class="fas fa-random"></i></a>
<div class="dup-notes-add">
<button type="button" onClick="jQuery('#dup-notes-area').toggle()" class="dup-btn-borderless" title="<?php esc_attr_e('Add Notes', 'duplicator-pro') ?>">
<i class="far fa-edit"></i>
</button>
</div>
</div>
<div>
<input id="package-name" name="package-name" type="text" maxlength="40" required="true" data-regexp="^[0-9A-Za-z|_]+$" />
<div id="dup-notes-area">
<label class="lbl-larger">&nbsp;<?php esc_html_e('Notes', 'duplicator-pro') ?>:</label><br/>
<textarea id="package-notes" name="package-notes" maxlength="300" /></textarea>
</div>
</div>
<div>
<label for="template_id" class="lbl-larger">&nbsp;<?php esc_html_e('Template', 'duplicator-pro') ?>:</label>
<i class="fas fa-question-circle fa-sm"
data-tooltip-title="<?php esc_attr_e("Apply Template", 'duplicator-pro'); ?>"
data-tooltip="<?php esc_attr_e('An optional template configuration that can be applied to this package setup. An [Unassigned] template will retain the settings from the last scan/build.', 'duplicator-pro'); ?>"></i>
<div style="float:right">
<a href="<?php echo esc_url($templatesUrl); ?>" class="dup-btn-borderless" title="<?php esc_attr_e("List All Templates", 'duplicator-pro') ?>">
<i class="far fa-clone"></i>
</a>
<button type="button" onclick="DupPro.Pack.EditTemplate()" class="dup-btn-borderless" title="<?php esc_attr_e("Edit Selected Template", 'duplicator-pro') ?>">
<i class="far fa-edit"></i>
</button>
</div>
</div>
<div>
<select data-parsley-ui-enabled="false" onChange="DupPro.Pack.EnableTemplate();" name="template_id" id="template_id" aria-label="Prefill option with selected template">
<option value="<?php echo intval($manual_template->getId()); ?>"><?php echo '[' . esc_html__('Unassigned', 'duplicator-pro') . ']' ?></option>
<?php
if (count($templates) == 0) {
$no_templates = __('No Templates', 'duplicator-pro');
echo "<option value='-1'>$no_templates</option>";
} else {
foreach ($templates as $template) {
if ($template->is_manual) {
continue;
}
echo "<option value='{$template->getId()}'>" . esc_html($template->name) . "</option>";
}
}
?>
</select>
</div>
</div>
<?php
require_once(DUPLICATOR____PATH . '/views/packages/main/s1.setup2.store.php');
require_once(DUPLICATOR____PATH . '/views/packages/main/s1.setup3.archive.php');
require_once(DUPLICATOR____PATH . '/views/packages/main/s1.setup4.install.php');
?>
<div class="dup-button-footer">
<input type="button" value="<?php esc_attr_e("Reset", 'duplicator-pro') ?>" class="button button-large" <?php echo ($dup_tests['Success']) ? '' : 'disabled="disabled"'; ?> onClick="DupPro.Pack.ResetSettings()" />
<input
id="button-next"
type="submit"
value="<?php esc_attr_e("Next", 'duplicator-pro') ?> &#9654;"
class="button button-primary button-large" <?php echo ($dup_tests['Success']) ? '' : 'disabled="disabled"'; ?>
>
</div>
</form>
<!-- CACHE PROTECTION: If the back-button is used from the scanner page then we need to
refresh page in-case any filters where set while on the scanner page -->
<form id="cache_detection">
<input type="hidden" id="cache_state" name="cache_state" value="" />
</form>
<?php
$confirm1 = new DUP_PRO_UI_Dialog();
$confirm1->title = __('Would you like to continue', 'duplicator-pro');
$confirm1->message = __('This will clear all of the current package settings.', 'duplicator-pro');
$confirm1->progressText = __('Please Wait...', 'duplicator-pro');
$confirm1->jsCallback = 'DupPro.Pack.ResetSettingsRun()';
$confirm1->initConfirm();
?>
<script>
jQuery(function($)
{
var packageTemplates = <?php echo DUP_PRO_Package_Template_Entity::getTemplatesFrontendListData(); ?>
DupPro.Pack.BeforeSubmit = function(e){
$('#mu-exclude option').each(function(){
$(this).prop('selected', true);
});
DupPro.Pack.FillExcludeTablesList();
return true;
};
$('#dup-form-opts').submit(function () {
return DupPro.Pack.BeforeSubmit();
})
// Template-specific Functions
DupPro.Pack.GetTemplateById = function (templateId)
{
for (var i = 0; i < packageTemplates.length; i++) {
var currentTemplate = packageTemplates[i];
if (currentTemplate.id == templateId) {
return currentTemplate;
}
}
return null;
};
$.fn.selectOption = function(val){
this.val(val)
.find('option')
.prop('selected', false)
.parent()
.find('option[value="'+ val +'"]')
.prop('selected', true)
.parent()
.trigger('change');
return this;
};
DupPro.Pack.PopulateCurrentTemplate = function ()
{
var selectedId = $('#template_id').val();
var selectedTemplate = DupPro.Pack.GetTemplateById(selectedId);
if (selectedTemplate != null)
{
var name = selectedTemplate.name;
if(selectedTemplate.is_manual) {
name = "<?php echo DUP_PRO_Package::get_default_name(); ?>";
}
$("#package-name").val(name);
$("#package-notes").val(selectedTemplate.notes);
$("#filter-on").prop("checked", selectedTemplate.archive_filter_on);
$("#filter-names").prop("checked", selectedTemplate.archive_filter_names);
//Add trailing slash to directories to differentiate between files and directories
let filterDirs = selectedTemplate.archive_filter_dirs.split(';').join(";\n");
let filterFiles = selectedTemplate.archive_filter_files.split(';').join(";\n")
let separator = filterDirs.length > 0 && filterFiles.length > 0 ? ";\n" : '';
$("#filter-paths").val(filterDirs + separator + filterFiles);
$("#filter-exts").val(selectedTemplate.archive_filter_exts);
$("#dbfilter-on").prop("checked", selectedTemplate.database_filter_on);
$("#db-prefix-filter").prop("checked", selectedTemplate.databasePrefixFilter);
$("#db-prefix-sub-filter").prop("checked", selectedTemplate.databasePrefixSubFilter);
$(".dup-components-checkbox").each(function (i, component) {
$(component).prop("checked", false);
});
selectedTemplate.components.forEach(function (component) {
$("#"+component).prop("checked", true);
});
DupPro.Pack.ToggleDBOnly()
DupPro.Pack.SetComponentsSelect();
if (typeof selectedTemplate.filter_sites != 'undefined' && selectedTemplate.filter_sites.length > 0) {
for(var i=0; i < selectedTemplate.filter_sites.length;i++){
var site_id = selectedTemplate.filter_sites[i];
var exclude_option = $('#mu-include').find("option[value="+site_id+"]").first();
console.log(exclude_option.html());
$("#mu-exclude").append(exclude_option.clone());
exclude_option.remove();
}
}
//-- cPanel
$("#cpnl-enable").prop("checked", selectedTemplate.installer_opts_cpnl_enable);
$("#cpnl-host").val(selectedTemplate.installer_opts_cpnl_host);
$("#cpnl-user").val(selectedTemplate.installer_opts_cpnl_user);
$('.secure-on-input-wrapper input').prop("checked", false);
$('.secure-on-input-wrapper input[value=' + selectedTemplate.installer_opts_secure_on + ']:enabled').prop("checked", true);
$("#skipscan").prop("checked", selectedTemplate.installer_opts_skip_scan);
$("#secure-pass").val(selectedTemplate.installerPassowrd);
$("#cpnl-dbaction").selectOption(selectedTemplate.installer_opts_cpnl_db_action);
$("#cpnl-dbhost").val(selectedTemplate.installer_opts_cpnl_db_host);
$("#cpnl-dbname").val(selectedTemplate.installer_opts_cpnl_db_name);
$("#cpnl-dbuser").val(selectedTemplate.installer_opts_cpnl_db_user);
//-- Brand
let installer_opts_brand = selectedTemplate.installer_opts_brand;
installer_opts_brand_id = [];
x = 0;
// most tricky thing - setup proper brand on emplate change
if (typeof selectedTemplate.installer_opts_brand != 'undefined') {
if(selectedTemplate.installer_opts_brand <= 0) {
installer_opts_brand = -1;
} else if(selectedTemplate.installer_opts_brand > 0) {
installer_opts_brand = Number(selectedTemplate.installer_opts_brand);
}
}
// find, fix deleted brands and setup default
for (var i = 0; i < packageTemplates.length; i++) {
if(
typeof packageTemplates[i].installer_opts_brand != 'undefined'
&& null != packageTemplates[i].installer_opts_brand
&& packageTemplates[i].installer_opts_brand != 0
) {
installer_opts_brand_id[x]=Number(packageTemplates[i].installer_opts_brand);
x++;
}
}
$("#brand").selectOption(installer_opts_brand);
//-- Database
if (selectedTemplate.database_filter_tables.length) {
let databaseFilterTables = selectedTemplate.database_filter_tables.split(",");
let tablesToExclude = $("#dup-db-tables-exclude");
tablesToExclude.find(".dup-pseudo-checkbox").each(function () {
let node = $(this);
if (databaseFilterTables.includes(node.data('value'))) {
node.addClass('checked');
} else {
node.removeClass('checked');
}
});
}
$("#dbhost").val(selectedTemplate.installer_opts_db_host);
$("#dbname").val(selectedTemplate.installer_opts_db_name);
$("#dbuser").val(selectedTemplate.installer_opts_db_user);
} else {
console.log("Template ID doesn't exist?? " + selectedId);
}
//Default to Installer cPanel tab if used
$('#cpnl-enable').is(":checked") ? $('#dpro-cpnl-tab-lbl').trigger("click") : $('#dpro-bsc-tab-lbl').trigger("click");
};
DupPro.Pack.ResetSettings = function ()
{
<?php $confirm1->showConfirm(); ?>
};
DupPro.Pack.ResetSettingsRun = function(){
$('#dup-form-opts')[0].reset();
setTimeout(function(){tb_remove();}, 800);
}
DupPro.Pack.EditTemplate = function ()
{
var manualTemplateID = <?php echo $manual_template->getId(); ?>;
var templateID = $('#template_id').val();
var url;
if (templateID <= 0 || templateID == manualTemplateID) {
url = <?php echo SnapJson::jsonEncode($templatesUrl); ?>
} else {
url = <?php echo SnapJson::jsonEncode($templateEditBaseUrl); ?> + '&package_template_id=' + templateID;
}
window.open(url, 'edit-template');
};
});
//INIT
jQuery(document).ready(function ($) {
var DPRO_NAME_LAST;
var DPRO_NAME_DEFAULT1 = '<?php echo esc_js($default_name1); ?>';
var DPRO_NAME_DEFAULT2 = '<?php echo esc_js($default_name2); ?>';
DupPro.Pack.checkPageCache = function()
{
var $state = $('#cache_state');
if( $state.val() == "" ) {
$state.val("fresh-load");
} else {
$state.val("cached");
<?php $redirect = PackagesPageController::getInstance()->getPackageBuildS1Url(); ?>
window.location.href = <?php echo SnapJson::jsonEncode($redirect); ?>;
}
}
DupPro.Pack.EnableTemplate = function ()
{
$("#dup-form-opts-action").val('template-create');
$('#dpro-template-specific-area').show(0);
DupPro.Pack.PopulateCurrentTemplate();
//DupPro.Pack.ToggleInstallerPassword();
DupPro.EnableInstallerPassword();
DupPro.Pack.ToggleFileFilters();
DupPro.Pack.ToggleDBFilters();
DupPro.Pack.ToggleActiveThemes();
DupPro.Pack.ToggleActivePlugins();
DupPro.Pack.ToggleDBExcluded();
DupPro.Pack.ToggleNoPrefixTables(false);
DupPro.Pack.ToggleNoSubsiteExistsTables(false);
}
DupPro.Pack.ResetName = function ()
{
var current = $('#package-name').val();
switch (current) {
case DPRO_NAME_LAST : $('#package-name').val(DPRO_NAME_DEFAULT2); break;
case DPRO_NAME_DEFAULT1 : $('#package-name').val(DPRO_NAME_LAST); break;
case DPRO_NAME_DEFAULT2 : $('#package-name').val(DPRO_NAME_DEFAULT1); break;
default: $('#package-name').val(DPRO_NAME_LAST);
}
};
DupPro.Pack.checkPageCache();
DupPro.Pack.EnableTemplate();
DPRO_NAME_LAST = $('#package-name').val();
$('input#package-name').focus().select();
});
</script>

View File

@@ -0,0 +1,245 @@
<?php
defined("ABSPATH") or die("");
use Duplicator\Controllers\ToolsPageController;
use Duplicator\Core\MigrationMng;
use Duplicator\Libs\Snap\FunctionalityCheck;
$global = DUP_PRO_Global_Entity::getInstance();
$dup_tests = DUP_PRO_Server::getRequirments();
?>
<style>
/* -----------------------------
REQUIREMENTS*/
div.dup-sys-section {margin:1px 0px 5px 0px}
div.dup-sys-title {display:inline-block; width:250px; padding:1px; }
div.dup-sys-title div {display:inline-block;}
div.dup-sys-info {display:none; max-width: 98%; margin:4px 4px 12px 4px}
div.dup-sys-pass {display:inline-block; color:green;}
div.dup-sys-fail {display:inline-block; color:#AF0000;}
div.dup-sys-contact {padding:5px 0px 0px 10px; font-size:11px; font-style:italic}
span.dup-toggle {float:left; margin:0 2px 2px 0; }
table.dup-sys-info-results td:first-child {width:200px}
</style>
<!-- =========================================
SYSTEM REQUIREMENTS -->
<?php if (!$dup_tests['Success']) : ?>
<div class="dup-box">
<div class="dup-box-title">
<i class="far fa-check-circle"></i>
<?php esc_html_e("Requirements:", 'duplicator-pro'); ?> <div class="dup-sys-fail">Fail</div>
<button class="dup-box-arrow">
<span class="screen-reader-text"><?php esc_html_e('Toggle panel:', 'duplicator-pro') ?> <?php esc_html_e('Requirements:', 'duplicator-pro') ?></span>
</button>
</div>
<div class="dup-box-panel">
<div class="dup-sys-section">
<i><?php esc_html_e("System requirements must pass for the Duplicator to work properly. Click each link for details.", 'duplicator-pro'); ?></i>
</div>
<!-- PHP SUPPORT -->
<div class='dup-sys-req'>
<div class='dup-sys-title'>
<a><?php esc_html_e('PHP Support', 'duplicator-pro'); ?></a>
<div><?php echo $dup_tests['PHP']['ALL']; ?></div>
</div>
<div class="dup-sys-info dup-info-box">
<table class="dup-sys-info-results">
<tr>
<td><?php printf("%s [%s]", __("PHP Version", 'duplicator-pro'), phpversion()); ?></td>
<td><?php echo $dup_tests['PHP']['VERSION'] ?></td>
</tr>
<?php foreach (DUP_PRO_Server::getFunctionalitiesCheckList() as $func) { ?>
<tr>
<td>
<?php
switch ($func->getType()) {
case FunctionalityCheck::TYPE_FUNCTION:
esc_html_e('Function', 'duplicator-pro');
break;
case FunctionalityCheck::TYPE_CLASS:
esc_html_e('Class', 'duplicator-pro');
break;
default:
throw new Exception('Invalid item type');
}
?>
<a href="<?php echo esc_url($func->link); ?>" target="_blank">
<?php echo esc_html($func->getItemKey()); ?>
</a>
</td>
<td>
<?php
if ($func->check()) {
echo esc_html_e('Pass', 'duplicator-pro');
} elseif ($func->isRequired()) {
echo esc_html_e('Fail', 'duplicator-pro');
} else {
echo esc_html_e('Warning', 'duplicator-pro');
}
if (strlen($func->troubleshoot) > 0) {
echo ' &nbsp; ' . $func->troubleshoot;
}
?>
</td>
</tr>
<?php } ?>
</table>
<small>
<?php
printf(
esc_html__(
"PHP versions %s+ including the listed functions are required for the plugin to create a package.
For additional information see our online technical FAQs.",
'duplicator-pro'
),
DUPLICATOR_PRO_PHP_MINIMUM_VERSION
);
?>
</small>
</div>
</div>
<!-- PERMISSIONS -->
<div class='dup-sys-req'>
<div class='dup-sys-title'>
<a><?php esc_html_e('Permissions', 'duplicator-pro'); ?></a> <div><?php echo esc_html($dup_tests['IO']['ALL']); ?></div>
</div>
<div class="dup-sys-info dup-info-box">
<b><?php esc_html_e("Required Paths", 'duplicator-pro'); ?></b>
<div style="padding:3px 0px 0px 15px">
<?php
printf("<b>%s</b> &nbsp; [%s] <br/>", esc_html($dup_tests['IO']['WPROOT']), esc_html(DUP_PRO_Archive::getArchiveListPaths('home')));
printf("<b>%s</b> &nbsp; [%s] <br/>", esc_html($dup_tests['IO']['SSDIR']), esc_html(DUPLICATOR_PRO_SSDIR_PATH));
printf("<b>%s</b> &nbsp; [%s] <br/>", esc_html($dup_tests['IO']['SSTMP']), esc_html(DUPLICATOR_PRO_SSDIR_PATH_TMP));
?>
</div>
<small>
<?php
esc_html_e(
"Permissions can be difficult to resolve on some systems. If the plugin can not read the above paths here
are a few things to try. 1) Set the above paths to have permissions of 755 for directories and 644 for files.
You can temporarily try 777 however, be sure you dont leave them this way. 2) Check the owner/group settings for both files and directories.
The PHP script owner and the process owner are different. The script owner owns the PHP script but the process owner
is the user the script is running as, thus determining its capabilities/privileges in the file system.
For more details contact your host or server administrator or visit the 'Help' menu under Duplicator for additional online resources.",
'duplicator-pro'
);
?>
</small>
</div>
</div>
<!-- SERVER SUPPORT -->
<div class='dup-sys-req'>
<div class='dup-sys-title'>
<a><?php esc_html_e('Server Support', 'duplicator-pro'); ?></a>
<div><?php echo $dup_tests['SRV']['ALL']; ?></div>
</div>
<div class="dup-sys-info dup-info-box">
<table class="dup-sys-info-results">
<tr>
<td><?php printf("%s [%s]", esc_html__("MySQL Version", 'duplicator-pro'), esc_html(DUP_PRO_DB::getVersion())); ?></td>
<td><?php echo esc_html($dup_tests['SRV']['MYSQL_VER']); ?></td>
</tr>
</table>
<small>
<?php esc_html_e(
"MySQL version 5.0+ or better is required. Contact your server administrator and request MySQL Server 5.0+ be installed.",
'duplicator-pro'
); ?>
</small>
<hr>
<table class="dup-sys-info-results">
<tr>
<td><a href="https://www.php.net/manual/en/mysqli.real-escape-string.php" target="_blank">mysqli_real_escape_string</a></td>
<td><?php echo esc_html($dup_tests['SRV']['MYSQL_ESC']); ?></td>
</tr>
</table>
<small>
<?php esc_html_e(
"The function mysqli_real_escape_string is not working properly.
Please consult host support and ask them to switch to a different PHP version or configuration.",
'duplicator-pro'
); ?>
</small>
</div>
</div>
<!-- INSTALLATION FILES -->
<div class='dup-sys-req'>
<div class='dup-sys-title'>
<a><?php esc_html_e('Installation Files', 'duplicator-pro'); ?></a> <div><?php echo esc_html($dup_tests['RES']['INSTALL']); ?></div>
</div>
<div class="dup-sys-info dup-info-box">
<?php
if ($dup_tests['RES']['INSTALL'] == 'Pass') :
esc_html_e("No reserved installation files where found from a previous install. You are clear to create a new package.", 'duplicator-pro');
else :
?>
<form method="post" action="<?php echo esc_url(ToolsPageController::getInstance()->getCleanFilesAcrtionUrl()); ?>">
<?php
esc_html_e(
"An installer file(s) was found in the WordPress root directory.
To archive your data correctly please remove any of these files and try creating your package again.",
'duplicator-pro'
);
?><br/>
<b><?php _e('Installer file names include', 'duplicator-pro'); ?></b>
<ul>
<?php foreach (MigrationMng::checkInstallerFilesList() as $filePath) { ?>
<li>
<?php echo esc_html($filePath); ?>
</li>
<?php } ?>
</ul>
<input type='submit' class='button action' value='<?php esc_attr_e('Remove Files Now', 'duplicator-pro') ?>' style='font-size:10px; margin-top:5px;' />
</form>
<?php endif; ?>
</div>
</div>
<!-- ONLINE SUPPORT -->
<div class="dup-sys-contact">
<?php
printf(
"<i class='fa fa-question-circle'></i> %s <a href='" . DUPLICATOR_PRO_TECH_FAQ_URL . "' target='_blank'>[%s]</a>",
__("For additional help please see the ", 'duplicator-pro'),
__("online FAQs", 'duplicator-pro')
);
?>
</div>
</div>
</div>
<?php endif; ?>
<script>
//INIT
jQuery(document).ready(function ($)
{
DupPro.Pack.ToggleSystemDetails = function (anchor)
{
$(anchor).parent().siblings('.dup-sys-info').toggle();
}
//Init: Toogle for system requirment detial links
$('.dup-sys-title a').each(function () {
$(this).attr('href', 'javascript:void(0)');
$(this).click(function () {
DupPro.Pack.ToggleSystemDetails(this);
});
$(this).prepend("<span class='ui-icon ui-icon-triangle-1-e dup-toggle' />");
});
//Init: Color code Pass/Fail/Warn items
$('.dup-sys-title div').each(function () {
$(this).addClass(($(this).text() == 'Pass') ? 'dup-sys-pass' : 'dup-sys-fail');
});
});
</script>

View File

@@ -0,0 +1,140 @@
<?php
use Duplicator\Controllers\StoragePageController;
use Duplicator\Core\CapMng;
use Duplicator\Models\Storages\AbstractStorageEntity;
use Duplicator\Models\Storages\StoragesUtil;
defined("ABSPATH") or die("");
$global = DUP_PRO_Global_Entity::getInstance();
$storage_list = AbstractStorageEntity::getAll(0, 0, [StoragesUtil::class, 'sortByPriority']);
$langLocalDefaultMsg = __('Recovery Point Capable', 'duplicator-pro');
$ui_css_storage = (DUP_PRO_UI_ViewState::getValue('dup-pack-storage-panel') ? 'display:block' : 'display:none');
$newStorageUrl = StoragePageController::getEditUrl();
?>
<!-- ===================
META-BOX: STORAGE -->
<div class="dup-box" id="dup-pack-storage-panel-area">
<div class="dup-box-title" id="dpro-store-title">
<i class="fas fa-server fa-sm"></i> <?php esc_html_e('Storage', 'duplicator-pro') ?> <sup id="dpro-storage-title-count" class="dup-box-title-badge"></sup>
<button class="dup-box-arrow">
<span class="screen-reader-text"><?php esc_html_e('Toggle panel:', 'duplicator-pro') ?> <?php esc_html_e('Storage Options', 'duplicator-pro') ?></span>
</button>
</div>
<div class="dup-box-panel" id="dup-pack-storage-panel" style="<?php echo esc_attr($ui_css_storage); ?>">
<div style="padding:0 0 4px 0">
<?php esc_html_e('Choose the storage location(s) where the archive and installer files will be saved.', 'duplicator-pro') ?>
</div>
<table class="widefat pack-store-tbl">
<thead>
<tr>
<th style='white-space: nowrap; width:10px;'></th>
<th style='width:175px'><?php esc_html_e('Type', 'duplicator-pro') ?></th>
<th style='width:275px'><?php esc_html_e('Name', 'duplicator-pro') ?></th>
<th style="white-space: nowrap"><?php esc_html_e('Location', 'duplicator-pro') ?></th>
</tr>
</thead>
<tbody>
<?php
$i = 0;
$selectedStorageIds = $global->getManualModeStorageIds();
foreach ($storage_list as $storage) {
try {
if (!$storage->isSupported()) {
continue;
}
$i++;
$is_valid = $storage->isValid();
$is_checked = in_array($storage->getId(), $selectedStorageIds) && $is_valid;
$mincheck = ($i == 1) ? 'data-parsley-mincheck="1" data-parsley-required="true"' : '';
$row_style = ($i % 2) ? 'alternate' : '';
$row_style .= ($is_valid) ? '' : ' storage-missing';
$row_chkid = "dup-chkbox-{$storage->getId()}";
$storageEditUrl = StoragePageController::getEditUrl($storage);
?>
<tr class="package-row <?php echo esc_attr($row_style); ?>">
<td>
<input name="edit_id" type="hidden" value="<?php echo intval($i); ?>" />
<input
class="duppro-storage-input"
id="<?php echo $row_chkid; ?>"
name="_storage_ids[]"
onclick="DupPro.Pack.UpdateStorageCount(); return true;"
data-parsley-errors-container="#storage_error_container" <?php echo $mincheck; ?>
type="checkbox"
value="<?php echo $storage->getId(); ?>"
<?php disabled($is_valid == false); ?>
<?php checked($is_checked); ?>
>
</td>
<td>
<label for="<?php echo $row_chkid; ?>" class="dup-store-lbl">
<?php
echo $storage->getStypeIcon() . '&nbsp;' . esc_html($storage->getStypeName());
echo ($storage->isLocal())
? "<sup title='{$langLocalDefaultMsg}'><i class='fas fa-house-fire fa-fw fa-sm'></i></sup>"
: '';
?>
</label>
</td>
<td>
<a href="<?php echo $storageEditUrl; ?>" target="_blank">
<?php
echo ($is_valid == false) ? '<i class="fa fa-exclamation-triangle fa-sm"></i> ' : '';
echo esc_html($storage->getName());
?>
</a>
</td>
<td>
<?php echo $storage->getHtmlLocationLink();?>
</td>
</tr>
<?php
} catch (Exception $e) {
echo "<tr><td colspan='5'><i>"
. __('Unable to load storage type. Please validate the setup.', 'duplicator-pro')
. "</i></td></tr>";
}
}
?>
</tbody>
</table>
<div style="text-align: right; margin:4px 4px -4px 0; padding:0; width: 100%">
<?php if (CapMng::can(CapMng::CAP_STORAGE, false)) { ?>
<a href="<?php echo esc_url($newStorageUrl); ?>" target="_blank">
[<?php esc_html_e('Add Storage', 'duplicator-pro') ?>]
</a>
<?php } else { ?>
&nbsp;
<?php } ?>
</div>
</div>
</div>
<div id="storage_error_container" class="duplicator-error-container"></div>
<script>
jQuery(function ($)
{
DupPro.Pack.UpdateStorageCount = function ()
{
var store_count = $('#dup-pack-storage-panel input[name="_storage_ids[]"]:checked').length;
$('#dpro-storage-title-count').html('(' + store_count + ')');
(store_count == 0)
? $('#dpro-storage-title-count').css({'color': 'red', 'font-weight': 'bold'})
: $('#dpro-storage-title-count').css({'color': '#444', 'font-weight': 'normal'});
}
});
//INIT
jQuery(document).ready(function ($)
{
DupPro.Pack.UpdateStorageCount();
});
</script>

View File

@@ -0,0 +1,118 @@
<?php
/**
*
* @package Duplicator
* @copyright (c) 2022, Snap Creek LLC
*/
defined('ABSPATH') || defined('DUPXABSPATH') || exit;
use Duplicator\Core\Views\TplMng;
$tplMng = TplMng::getInstance();
$global = DUP_PRO_Global_Entity::getInstance();
$ui_css_archive = (DUP_PRO_UI_ViewState::getValue('dup-pack-archive-panel') ? 'display:block' : 'display:none');
$multisite_css = is_multisite() ? '' : 'display:none';
$archive_format = ($global->getBuildMode() == DUP_PRO_Archive_Build_Mode::DupArchive ? 'daf' : 'zip');
?>
<!-- ===================
META-BOX: ARCHIVE -->
<div class="dup-box dup-archive-filters-wrapper">
<div class="dup-box-title" >
<i class="far fa-file-archive fa-sm"></i> <?php esc_html_e('Archive', 'duplicator-pro') ?>
<sup class="dup-box-title-badge">
<?php echo esc_html($archive_format); ?>
</sup> &nbsp; &nbsp;
<span class="dup-archive-filters-icons">
<span id="dup-archive-filter-file" title="<?php esc_attr_e('Folder/File Filter Enabled', 'duplicator-pro') ?>">
<span class="btn-separator"></span>
<i class="fas fa-folder-open fa-fw"></i>
<sup><i class="fas fa-filter fa-xs"></i></sup>
</span>
<span id="dup-archive-filter-db" title="<?php esc_attr_e('Database Table Filter Enabled', 'duplicator-pro') ?>">
<span class="btn-separator"></span>
<i class="fas fa-table fa-fw"></i>
<sup><i class="fas fa-filter fa-xs"></i></sup>
</span>
<span id="dup-archive-db-only" title="<?php esc_attr_e('Archive Only the Database', 'duplicator-pro') ?>">
<span class="btn-separator"></span>
<i class="fas fa-database fa-fw"></i>
<?php esc_html_e('Database Only', 'duplicator-pro') ?>
</span>
<span id="dup-archive-media-only" title="<?php esc_attr_e('Archive Only Media files', 'duplicator-pro') ?>">
<span class="btn-separator"></span>
<i class="fas fa-file-image fa-fw"></i>
<?php esc_html_e('Media Only', 'duplicator-pro') ?>
</span>
<span id="dpro-install-secure-lock" title="<?php esc_attr_e('Archive password protection is on', 'duplicator-pro') ?>">
<span class="btn-separator"></span>
<i class="fas fa-lock fa-fw"></i>
<?php esc_html_e('Requires Password', 'duplicator-pro') ?>
</span>
</span>
<button class="dup-box-arrow">
<span class="screen-reader-text"><?php esc_html_e('Toggle panel:', 'duplicator-pro') ?> <?php esc_html_e('Archive Settings', 'duplicator-pro') ?></span>
</button>
</div>
<div class="dup-box-panel" id="dup-pack-archive-panel" style="<?php echo esc_attr($ui_css_archive); ?>">
<input type="hidden" name="archive-format" value="ZIP" />
<!-- ===================
NESTED TABS -->
<div data-dpro-tabs="true">
<ul>
<li class="filter-files-tab"><?php esc_html_e('Files', 'duplicator-pro') ?></li>
<li class="filter-db-tab"><?php esc_html_e('Database', 'duplicator-pro') ?></li>
<?php if (is_multisite()) { ?>
<li class="filter-mu-tab" style="<?php echo $multisite_css ?>"><?php esc_html_e('Multisite', 'duplicator-pro') ?></li>
<?php } ?>
<li class="archive-setup-tab"><?php esc_html_e('Security', 'duplicator-pro') ?></li>
</ul>
<?php
$tplMng->render('admin_pages/packages/setup/archive-filter-files-tab');
$tplMng->render('admin_pages/packages/setup/archive-filter-db-tab');
if (is_multisite()) {
$tplMng->render('admin_pages/packages/setup/archive-filter-mu-tab');
}
$tplMng->render('admin_pages/packages/setup/archive-setup-tab');
?>
</div>
</div>
</div>
<div class="duplicator-error-container"></div>
<?php
$alert1 = new DUP_PRO_UI_Dialog();
$alert1->title = __('ERROR!', 'duplicator-pro');
$alert1->message = __('You can\'t exclude all sites.', 'duplicator-pro');
$alert1->initAlert();
?>
<script>
//INIT
jQuery(document).ready(function($)
{
//MU-Transfer buttons
$('#mu-include-btn').click(function() {
return !$('#mu-exclude option:selected').remove().appendTo('#mu-include');
});
$('#mu-exclude-btn').click(function() {
var include_all_count = $('#mu-include option').length;
var include_selected_count = $('#mu-include option:selected').length;
if(include_all_count > include_selected_count) {
return !$('#mu-include option:selected').remove().appendTo('#mu-exclude');
} else {
<?php $alert1->showAlert(); ?>
}
});
});
</script>

View File

@@ -0,0 +1,312 @@
<?php
use Duplicator\Addons\ProBase\License\License;
use Duplicator\Controllers\SettingsPageController;
use Duplicator\Core\Controllers\ControllersManager;
use Duplicator\Models\BrandEntity;
defined("ABSPATH") or die("");
$ui_css_installer = (DUP_PRO_UI_ViewState::getValue('dpro-pack-installer-panel') ? 'display:block' : 'display:none');
?>
<style>
/*INSTALLER: Area */
label.chk-labels {display:inline-block; margin-top:1px}
table.dpro-install-tbl {width:98%;}
table.dpro-install-tbl td{padding:4px}
table.dpro-install-setup {width:100%}
table.dpro-install-setup tr{vertical-align: top}
div#dpro-pack-installer-panel div.tabs-panel{min-height:150px}
div.dpro-panel-optional-txt {color:maroon}
.disabled .dpro-panel-optional-txt:not(.maroon) {color:#777;}
.maroon {color:maroon;}
</style>
<!-- ===================
INSTALLER -->
<div class="dup-box">
<div class="dup-box-title">
<i class="fa fa-bolt fa-sm"></i> <?php esc_html_e('Installer', 'duplicator-pro') ?>
<button class="dup-box-arrow">
<span class="screen-reader-text"><?php esc_html_e('Toggle panel:', 'duplicator-pro') ?> <?php esc_html_e('Installer Settings', 'duplicator-pro') ?></span>
</button>
</div>
<div class="dup-box-panel" id="dpro-pack-installer-panel" style="<?php echo esc_attr($ui_css_installer); ?>">
<div class="dpro-panel-optional-txt">
<b><?php esc_html_e('All values in this section are', 'duplicator-pro'); ?> <u><?php esc_html_e('optional', 'duplicator-pro'); ?></u></b>
<i class="fas fa-question-circle fa-sm"
data-tooltip-title="<?php esc_attr_e("Setup/Prefills", 'duplicator-pro'); ?>"
data-tooltip="<?php
esc_attr_e(
'All values in this section are OPTIONAL! If you know ahead of time the database input fields the installer will use,
then you can optionally enter them here and they will be prefilled at install time.
Otherwise you can just enter them in at install time and ignore all these options in the Installer section.',
'duplicator-pro'
);
?>"></i>
</div>
<table class="dpro-install-setup" style="margin-top:-10px">
<tr>
<td colspan="2"><div class="dup-package-hdr-1"><?php esc_html_e("Setup", 'duplicator-pro') ?></div></td>
</tr>
<tr>
<td style="width:130px"><b><?php esc_html_e("Branding", 'duplicator-pro') ?>:</b></td>
<td>
<?php
if (License::can(License::CAPABILITY_BRAND)) :
$brands = BrandEntity::getAllWithDefault();
$active_brand_id = DUP_PRO_Package_Template_Entity::get_manual_template()->installer_opts_brand;
if ($active_brand_id < 0) {
$active_brand_id = -1; // for old brand version
}
?>
<select name="brand" id="brand">
<?php foreach ($brands as $i => $brand) { ?>
<option
value="<?php echo $brand->getId(); ?>"
title="<?php echo esc_attr($brand->notes); ?>"
<?php selected($brand->getId(), $active_brand_id); ?>
>
<?php echo esc_html($brand->name); ?>
</option>
<?php } ?>
</select>
<?php
if ($active_brand_id > 0) {
$preview_url = ControllersManager::getMenuLink(
ControllersManager::SETTINGS_SUBMENU_SLUG,
SettingsPageController::L2_SLUG_PACKAGE,
SettingsPageController::L3_SLUG_PACKAGE_BRAND,
[
'view' => 'edit',
'action' => 'edit',
'id' => intval($active_brand_id),
]
);
} else {
$preview_url = ControllersManager::getMenuLink(
ControllersManager::SETTINGS_SUBMENU_SLUG,
SettingsPageController::L2_SLUG_PACKAGE,
SettingsPageController::L3_SLUG_PACKAGE_BRAND,
[
'view' => 'edit',
'action' => 'default',
]
);
}
?>
<a href="<?php echo esc_url($preview_url); ?>" target="_blank" class="button" id="brand-preview">
<?php esc_html_e("Preview", 'duplicator-pro'); ?>
</a> &nbsp;
<i class="fas fa-question-circle fa-sm"
data-tooltip-title="<?php esc_attr_e("Choose Brand", 'duplicator-pro'); ?>"
data-tooltip="<?php esc_attr_e('This option changes the branding of the installer file. Click the preview button to see the selected style.', 'duplicator-pro'); ?>"
>
</i>
<?php else :
$link = ControllersManager::getMenuLink(
ControllersManager::SETTINGS_SUBMENU_SLUG,
SettingsPageController::L2_SLUG_PACKAGE,
SettingsPageController::L3_SLUG_PACKAGE_BRAND
);
?>
<a href="<?php echo esc_url($link); ?>"><?php esc_html_e("Enable Branding", 'duplicator-pro'); ?></a>
<?php endif; ?>
<br/><br/>
</td>
</tr>
</table>
<br/>
<table style="width:100%">
<tr>
<td colspan="2"><div class="dup-package-hdr-1"><?php esc_html_e("Prefills", 'duplicator-pro') ?></div></td>
</tr>
</table>
<!-- ===================
BASIC/CPANEL TABS -->
<div data-dpro-tabs="true">
<ul>
<li id="dpro-bsc-tab-lbl"><?php esc_html_e('Basic', 'duplicator-pro') ?></li>
<li id="dpro-cpnl-tab-lbl"><?php esc_html_e('cPanel', 'duplicator-pro') ?></li>
</ul>
<!-- ===================
TAB1: Basic -->
<div>
<div class="dup-package-hdr-2">
<?php esc_html_e("MySQL Server", 'duplicator-pro') ?>
<div class="dup-package-hdr-usecurrent">
<a href="javascript:void(0)" onclick="DupPro.Pack.ApplyDataCurrent('s1-installer-dbbasic')">[use current]</a>
</div>
</div>
<table class="dpro-install-tbl" id="s1-installer-dbbasic">
<tr>
<td style="width:130px"><b><?php esc_html_e("Host", 'duplicator-pro') ?>:</b></td>
<td><input type="text" name="dbhost" id="dbhost" maxlength="200" placeholder="<?php esc_html_e("example: localhost (value is optional)", 'duplicator-pro') ?>" data-current="<?php echo DB_HOST ?>"/></td>
</tr>
<tr>
<td><b><?php esc_html_e("Database", 'duplicator-pro') ?>:</b></td>
<td><input type="text" name="dbname" id="dbname" maxlength="100" placeholder="<?php esc_attr_e("example: DatabaseName (value is optional)", 'duplicator-pro') ?>" data-current="<?php echo DB_NAME ?>" /></td>
</tr>
<tr>
<td><b><?php esc_html_e("User", 'duplicator-pro') ?>:</b></td>
<td><input type="text" name="dbuser" id="dbuser" maxlength="100" placeholder="<?php esc_attr_e("example: DatabaseUser (value is optional)", 'duplicator-pro') ?>" data-current="<?php echo DB_USER ?>"/></td>
</tr>
</table>
</div>
<!-- ===================
TAB2: cPanel -->
<div>
<table class="dpro-install-tbl">
<tr>
<td colspan="2"><div class="dup-package-hdr-2"><?php esc_html_e("cPanel Login", 'duplicator-pro') ?></div></td>
</tr>
<tr>
<td style="width:130px"><b><?php esc_html_e("Automation", 'duplicator-pro') ?>:</b></td>
<td>
<input type="checkbox" name="cpnl-enable" id="cpnl-enable" value="1" >
<label for="cpnl-enable"><?php esc_html_e("Auto Select cPanel", 'duplicator-pro') ?></label>
<i class="fas fa-question-circle fa-sm"
data-tooltip-title="<?php esc_attr_e("Auto Select cPanel", 'duplicator-pro'); ?>"
data-tooltip="<?php esc_attr_e('Enabling this options will automatically select the cPanel tab when step one of the installer is shown.', 'duplicator-pro'); ?>">
</i>
</td>
</tr>
<tr>
<td><b><?php esc_html_e("Host", 'duplicator-pro') ?>:</b></td>
<td><input type="text" name="cpnl-host" id="cpnl-host" maxlength="200" placeholder="<?php esc_attr_e("example: cpanelHost (value is optional)", 'duplicator-pro') ?>"/></td>
</tr>
<tr>
<td><b><?php esc_html_e("User", 'duplicator-pro') ?>:</b></td>
<td><input type="text" name="cpnl-user" id="cpnl-user" maxlength="200" placeholder="<?php esc_attr_e("example: cpanelUser (value is optional)", 'duplicator-pro') ?>"/></td>
</tr>
</table><br/>
<div class="dup-package-hdr-2">
<?php esc_html_e("MySQL Server", 'duplicator-pro') ?>
<div class="dup-package-hdr-usecurrent">
<a href="javascript:void(0)" onclick="DupPro.Pack.ApplyDataCurrent('s1-installer-dbcpanel')">[use current]</a>
</div>
</div>
<table class="dpro-install-tbl" id="s1-installer-dbcpanel">
<tr>
<td style="width:130px"><b><?php esc_html_e("Action", 'duplicator-pro') ?>:</b></td>
<td>
<select name="cpnl-dbaction" id="cpnl-dbaction">
<option value=""><?php _e('Default', 'duplicator-pro'); ?></option>
<option value="create"><?php _e('Create A New Database', 'duplicator-pro'); ?></option>
<option value="empty"><?php _e('Connect and Delete Any Existing Data', 'duplicator-pro'); ?></option>
<option value="rename"><?php _e('Connect and Backup Any Existing Data', 'duplicator-pro'); ?></option>
<option value="manual"><?php _e('Skip Database Extraction', 'duplicator-pro'); ?></option>
</select>
</td>
</tr>
<tr>
<td style="width:130px"><b><?php esc_html_e("Host", 'duplicator-pro') ?>:</b></td>
<td><input type="text" name="cpnl-dbhost" id="cpnl-dbhost" maxlength="200" placeholder="<?php esc_attr_e("example: localhost (value is optional)", 'duplicator-pro') ?>" data-current="<?php echo esc_html(DB_HOST); ?>"/></td>
</tr>
<tr>
<td><b><?php esc_html_e("Database", 'duplicator-pro') ?>:</b></td>
<td>
<input
type="text"
name="cpnl-dbname"
id="cpnl-dbname"
data-parsley-pattern="/^[a-zA-Z0-9-_]+$/"
maxlength="100"
placeholder="<?php esc_attr_e("example: DatabaseName (value is optional)", 'duplicator-pro') ?>"
data-current="<?php echo esc_html(DB_NAME); ?>"
>
</td>
</tr>
<tr>
<td><b><?php esc_html_e("User", 'duplicator-pro') ?>:</b></td>
<td>
<input
type="text"
name="cpnl-dbuser"
id="cpnl-dbuser"
data-parsley-pattern="/^[a-zA-Z0-9-_]+$/"
maxlength="100"
placeholder="<?php esc_attr_e("example: DatabaseUserName (value is optional)", 'duplicator-pro') ?>"
data-current="<?php echo esc_html(DB_USER); ?>"
>
</td>
</tr>
</table>
</div>
</div><br/>
<small><?php esc_html_e("Additional inputs can be entered at install time.", 'duplicator-pro') ?></small>
<br/><br/>
</div>
</div><br/>
<script>
(function ($) {
DupPro.Pack.ApplyDataCurrent = function (id)
{
$('#' + id + ' input').each(function ()
{
var attr = $(this).attr('data-current');
if (typeof attr !== typeof undefined && attr !== false) {
$(this).val($(this).attr('data-current'));
}
});
};
<?php if (License::can(License::CAPABILITY_BRAND)) : ?>
// brand-preview
var $brand = $("#brand"),
brandCheck = function (e) {
var $this = $(this) || $brand;
var $id = $this.val();
<?php
$prewURLs = [
ControllersManager::getMenuLink(
ControllersManager::SETTINGS_SUBMENU_SLUG,
SettingsPageController::L2_SLUG_PACKAGE,
SettingsPageController::L3_SLUG_PACKAGE_BRAND,
[
'view' => 'edit',
'action' => 'default',
]
),
ControllersManager::getMenuLink(
ControllersManager::SETTINGS_SUBMENU_SLUG,
SettingsPageController::L2_SLUG_PACKAGE,
SettingsPageController::L3_SLUG_PACKAGE_BRAND,
[
'view' => 'edit',
'action' => 'edit',
]
),
];
?>
var $url = <?php echo json_encode($prewURLs); ?>;
$url[1] += "&id=" + $id;
$("#brand-preview").attr('href', $url[ $id > 0 ? 1 : 0 ]);
$this.find('option[value="' + $id + '"]')
.prop('selected', true)
.parent();
};
$brand.on('select change', brandCheck);
<?php endif; ?>
}(window.jQuery));
</script>

View File

@@ -0,0 +1,681 @@
<?php
defined("ABSPATH") or die("");
use Duplicator\Controllers\PackagesPageController;
use Duplicator\Core\Controllers\ControllersManager;
use Duplicator\Core\Views\TplMng;
use Duplicator\Libs\Snap\SnapJson;
require_once(DUPLICATOR____PATH . '/classes/package/class.pack.php');
wp_enqueue_script('dup-pro-handlebars');
if (empty($_POST)) {
// Refresh 'fix'
$redirect = PackagesPageController::getInstance()->getPackageBuildS1Url();
ob_start();
?>
<script>
window.location.href = <?php echo SnapJson::jsonEncode($redirect); ?>;
</script>
<?php
$html = (string) ob_get_clean();
die($html);
}
$global = DUP_PRO_Global_Entity::getInstance();
//echo '<pre>', var_export($_REQUEST, true), '</pre>';
if (!empty($_REQUEST['action']) && $_REQUEST['action'] === 'template-create') {
$storage_ids = isset($_REQUEST['_storage_ids']) ? $_REQUEST['_storage_ids'] : array();
$template_id = (int) $_REQUEST['template_id'];
$template = DUP_PRO_Package_Template_Entity::getById($template_id);
// always set the manual template since it represents the last thing that was run
DUP_PRO_Package::set_manual_template_from_post($_REQUEST);
$global->setManualModeStorageIds($storage_ids);
$global->save();
$name_chars = array(
".",
"-",
);
$name = ( isset($_REQUEST['package-name']) && !empty($_REQUEST['package-name'])) ? $_REQUEST['package-name'] : DUP_PRO_Package::get_default_name();
$name = substr(sanitize_file_name($name), 0, 40);
$name = str_replace($name_chars, '', $name);
DUP_PRO_Package::set_temporary_package_from_template_and_storages($template_id, $storage_ids, $name);
}
$Package = DUP_PRO_Package::get_temporary_package();
$package_list_url = ControllersManager::getMenuLink(ControllersManager::PACKAGES_SUBMENU_SLUG);
$archive_export_onlydb = $Package->isDBOnly();
$messageText = TplMng::getInstance()->render('admin_pages/packages/scan/error_message', [], false);
/** @var bool */
$blur = TplMng::getInstance()->getGlobalValue('blurCreate');
?>
<style>
/*PROGRESS-BAR - RESULTS - ERROR */
form#form-duplicator {text-align:center; max-width:825px; min-height:200px; margin:0px auto 0px auto; padding:0px;}
div.dup-progress-title {font-size:22px; padding:5px 0 20px 0; font-weight:bold}
div#dup-msg-success {padding:0 5px 5px 5px; text-align:left}
div#dup-msg-success div.details {padding:10px 15px 10px 15px; margin:5px 0 15px 0; background:#fff; border-radius:4px; border:1px solid #ddd;box-shadow:0 8px 6px -6px #999; }
div#dup-msg-success div.details-title {font-size:20px; border-bottom:1px solid #dfdfdf; padding:5px; margin:0 0 10px 0; font-weight:bold}
div#dup-msg-success-subtitle {color:#999; margin:0; font-size:11px}
div.dup-scan-filter-status {display:inline; font-size:11px; margin-right:10px; color:#630f0f;}
div#dup-msg-error {color:#A62426; padding:5px; max-width:790px;}
div#dup-msg-error-response-text { max-height:500px; overflow-y:scroll; border:1px solid silver; border-radius:2px; padding:10px;background:#fff}
div.dup-hdr-error-details {text-align:left; margin:20px 0}
i[data-tooltip].fa-question-circle {color:#555}
/*SCAN ITEMS: Sections */
sup.dup-small-ext-type {font-size:11px; font-weight: normal; font-style: italic}
div.scan-header { font-size:16px; padding:7px 5px 7px 7px; font-weight:bold; background-color:#E0E0E0; border-bottom:0px solid #C0C0C0 }
div.scan-header-details {float:right; margin-top:-5px}
div.scan-item {border:1px solid #E0E0E0; border-top:none;}
div.scan-item-first {border-top:1px solid #E0E0E0}
div.scan-item div.title {background-color:#F1F1F1; width:100%; padding:4px 0 4px 0; cursor:pointer; height:20px;}
@media screen and (min-width: 1280px) {
div.scan-item div.title {padding:10px 0 10px 0;}
}
div.scan-item div.title:hover {background-color:#ECECEC;}
div.scan-item div.text {font-weight:bold; font-size:14px; float:left; position:relative; left:10px}
div.scan-item div.info {display:none; padding:10px; background:#fff}
div.scan-good {display:inline-block; color:green;font-weight:bold;}
div.scan-warn {display:inline-block; color:#630f0f;font-weight:bold;}
div.dup-more-details {float:right; font-size:14px}
div.dup-more-details:hover {color:#777; cursor:pointer}
div.dup-more-details a {color:#222}
div.dup-more-details a:hover {color:#777}
i.scan-warn {color:#630f0f;}
div#scan-unreadable-items div.directory {font-size:11px}
div.subsite-filter-info {margin-left: 15px;}
div.subsite-filter-info ol {margin-top: 0px;}
/*DIALOG WINDOWS*/
div#arc-details-dlg {font-size:12px}
div#arc-details-dlg h2 {margin:0; padding:0 0 5px 0; border-bottom:1px solid #dfdfdf;}
div#arc-details-dlg hr {margin:3px 0 10px 0}
div#arc-details-dlg div.filter-area {height:230px; overflow-y:scroll; border:1px solid #dfdfdf; padding:8px; margin:2px 0}
div#arc-details-dlg div.file-info {padding:0 0 10px 15px; width:500px; white-space:nowrap;}
div#arc-details-dlg div.info{line-height:18px}
div#arc-details-dlg div.info label{font-size:12px !important; font-weight: bold; display: inline-block; min-width: 100px}
div#arc-paths-dlg textarea.path-dirs,
textarea.path-files {font-size:12px; border: 1px solid silver; padding: 10px; background: #fff; margin:5px; height:125px; width:100%; white-space:pre}
div#arc-paths-dlg div.copy-button {float:right;}
div#arc-paths-dlg div.copy-button button {font-size:12px}
/*FILES */
div#data-arc-size1 {display:inline-block; font-size:11px; margin-right:1px;}
i.data-size-help { font-size:12px; display:inline-block; margin:0; padding:0}
div.dup-data-size-uncompressed {font-size:10px; text-align: right; padding:0; margin:-7px 0 0 0; font-style: italic; font-weight: normal; border:0px solid red; clear:both}
div.hb-files-style > div.container {border:1px solid #E0E0E0; border-radius:2px; margin:5px 0 10px 0}
div.hb-files-style > div.container b {font-weight:bold}
div.hb-files-style > div.container div.divider {margin-bottom:2px; font-weight:bold}
div.hb-files-style div.data {line-height:21px; min-height:100px; max-height:70vh; overflow-y:scroll; }
div.hb-files-style div.data-padded {padding:10px }
div.hb-files-style div.hdrs {background:#fff; padding:2px 4px 4px 6px; border-bottom:1px solid #E0E0E0; font-weight:bold}
div.hb-files-style div.hdrs sup i.fa {font-size:11px}
div.hb-files-style div.hdrs-up-down {float:right; margin:2px 12px 0 0}
div.hb-files-style i.dup-nav-toggle:hover {cursor:pointer; color:#999}
div.hb-files-style div.directory {margin-left:12px; white-space: nowrap;}
div.hb-files-style div.directory i.size {font-size:11px; font-style:normal; display:inline-block; min-width:50px}
div.hb-files-style div.directory i.count {font-size:11px; font-style:normal; display:inline-block; min-width:20px}
div.hb-files-style div.directory i.empty {width:15px; display:inline-block}
div.hb-files-style div.directory i.dup-nav {cursor:pointer}
div.hb-files-style div.directory i.fa {width:8px}
div.hb-files-style div.directory i.chk-off {width:20px; color:#777; cursor: help; margin:0; font-size:1.25em}
div.hb-files-style div.directory label {font-weight:bold; cursor:pointer; vertical-align:top;}
div.hb-files-style div.directory label:hover {color:#025d02}
div.hb-files-style div.files {padding:2px 0 0 35px; font-size:12px; display:none; line-height:18px}
div.hb-files-style div.files i.size {font-style:normal; display:inline-block; min-width:50px}
div.hb-files-style div.files label {font-weight: normal; font-size:11px; vertical-align:top;display:inline-block;width:450px; white-space: nowrap; overflow:hidden; text-overflow:ellipsis;}
div.hb-files-style div.files label:hover {color:#025d02; cursor: pointer}
div.hb-files-style div.apply-btn {text-align:right; margin: 1px 0 10px 0}
div.hb-files-style div.apply-warn {float:left; font-size:11px; color:maroon; margin-top:-7px; font-style: italic}
div#size-more-details {display:none; margin:5px 0 20px 0; border:1px solid #dfdfdf; padding:8px; border-radius:2px; background-color: #F1F1F1}
div#size-more-details ul {list-style-type:circle; padding-left:20px; margin:0}
div#size-more-details li {margin:0}
/* SERVER-CHECKS */
div.dup-scan-title {display:inline-block; padding:1px; font-weight: bold;}
div.dup-scan-title a {display:inline-block; min-width:200px; padding:3px; }
div.dup-scan-title a:focus {outline: 1px solid #fff; box-shadow: none}
div.dup-scan-title div {display:inline-block; }
div.dup-scan-info {display:none;}
div.dup-scan-good {display:inline-block; color:green;font-weight: bold;}
div.dup-scan-warn {display:inline-block; color:#F0AC00;font-weight: bold;}
span.dup-toggle {float:left; margin:0 2px 2px 0; }
div.dup-scan-files-migrae-status {max-height:250px; overflow-y:scroll; border:1px solid silver; padding:0 4px 0 4px; background: #efefef; border-radius:2px}
/*DATABASE*/
table.dup-scan-db-details {line-height: 14px; margin:5px 0px 0px 20px; width:98%}
table.dup-scan-db-details td {padding:2px;}
table.dup-scan-db-details td:first-child {font-weight: bold; white-space: nowrap; width:105px}
div#dup-scan-db-info {margin-top:5px}
div#data-db-tablelist {max-height:250px; overflow-y:scroll; border:1px solid silver; padding:8px; background: #efefef; border-radius:2px}
div#data-db-tablelist td{padding:0 5px 3px 20px; min-width:100px}
div#data-db-size1 {display: inline-block; font-size:11px; margin-right:1px;}
/*WARNING-CONTINUE*/
div#dpro-scan-warning-continue {display:none; text-align:center; padding:0 0 15px 0}
div#dpro-scan-warning-continue div.msg2 {padding:2px; line-height:13px; font-size:11px !important;}
/*FILES */
div#dpro-confirm-area {color:maroon; display:none; font-size:14px; line-height:24px; font-weight: bold; margin: -5px 0 10px 0}
div#dpro-confirm-area label {font-size:14px !important}
/*Footer*/
div.dup-button-footer {text-align:center; margin:0}
/** JSTREE **/
.jstree .root-node > .jstree-anchor { font-weight: bold; }
.jstree .info-node > .jstree-anchor { font-weight: bold; }
.jstree .info-node > .jstree-anchor .jstree-checkbox {display: none;}
.jstree .warning-node > .jstree-anchor {color: red;}
.jstree .filtered-node .jstree-anchor {opacity: 0.3; text-decoration: line-through; }
.jstree .jstree-checkbox-disabled {opacity: 0.3;}
.dup-tree-section {
position: relative;
}
.tree-nav-bar {
line-height: 30px;
background-color: #EFEFEF;
border-bottom: 1px solid darkgray;
}
.tree-nav-bar .container {
padding: 3px 30px 3px 5px;
}
.dup-tree-section .tree-loader {
position: absolute;
width: 100%;
height: 100%;
background: rgba(0,0,0,.3);
top: 0;
left: 0;
z-index: 9999;
}
.dup-tree-section .tree-loader .container-wrapper {
position: absolute;
top: 50%;
left: 0;
transform: translateY(-50%);
color: white;
width: 100%;
text-align: center;
font-size: 14px;
}
.jstree .jstree-node > .jstree-anchor {
display: inline-block;
width: calc(100% - 30px);
}
.tree-nav-bar .size,
.tree-nav-bar .nodes,
.jstree-anchor .size,
.jstree-anchor .nodes {
float: right;
text-align: right;
display: block;
min-width: 90px;
border-left: 1px solid black;
padding-left: 5px;
margin-left: 5px;
box-sizing: border-box;
}
.tree-nav-bar .size,
.tree-nav-bar .nodes {
border: none;
}
.warning-node > .jstree-anchor .size,
.warning-node > .jstree-anchor .nodes {
color: #9f2a2a;
font-weight: bold;
}
</style>
<?php
$validator = $Package->validateInputs();
if (!$validator->isSuccess()) {
?>
<form id="form-duplicator" method="post" action="<?php echo $package_list_url ?>">
<!-- ERROR MESSAGE -->
<div id="dup-msg-error">
<div class="dup-hdr-error"><i class="fa fa-exclamation-circle"></i> <?php esc_html_e('Input fields not valid', 'duplicator-pro'); ?></div>
<i><?php esc_html_e('Please try again!', 'duplicator-pro'); ?></i><br/>
<div style="text-align:left">
<b><?php esc_html_e("Server Status:", 'duplicator-pro'); ?></b> &nbsp;
<div id="dup-msg-error-response-status" style="display:inline-block"></div><br/>
<b><?php esc_html_e("Error Message:", 'duplicator-pro'); ?></b>
<div id="dup-msg-error-response-text">
<ul>
<?php
$validator->getErrorsFormat("<li>%s</li>");
?>
</ul>
</div>
</div>
</div>
<input
type="button"
value="&#9664; <?php esc_html_e("Back", 'duplicator-pro') ?>"
class="button button-large dup-go-back-to-new1"
>
</form>
<?php
return;
}
?>
<!-- ====================
TOOL-BAR -->
<table class="dpro-edit-toolbar <?php echo ($blur ? 'dup-mock-blur' : ''); ?>">
<tr>
<td>
<div id="dup-wiz">
<div id="dup-wiz-steps">
<div class="completed-step"><a>1 <?php esc_html_e('Setup', 'duplicator-pro'); ?></a></div>
<div class="active-step"><a>2 <?php esc_html_e('Scan', 'duplicator-pro'); ?> </a></div>
<div><a>3 <?php esc_html_e('Build', 'duplicator-pro'); ?> </a></div>
</div>
<div id="dup-wiz-title" style="white-space: nowrap">
<?php esc_html_e('Step 2: System Scan', 'duplicator-pro'); ?>
</div>
</div>
</td>
</tr>
</table>
<hr class="dpro-edit-toolbar-divider"/>
<form
id="form-duplicator"
class="<?php echo ($blur ? 'dup-mock-blur' : ''); ?>"
method="post"
action="<?php echo $package_list_url ?>"
>
<input type="hidden" name="create_from_temp" value="1" />
<div id="dup-progress-area">
<!-- PROGRESS BAR -->
<div id="dup-progress-bar-area">
<div class="dup-pro-title" >
<i class="fa fa-circle-notch fa-spin"></i> <?php esc_html_e('Scanning Site', 'duplicator-pro'); ?>
</div>
<div class="dup-pro-meter-wrapper" >
<div class="dup-pro-meter blue dup-pro-fullsize">
<span></span>
</div>
<span class="text"></span>
</div>
<b><?php esc_html_e('Please Wait...', 'duplicator-pro'); ?></b><br/><br/>
<i><?php esc_html_e('Keep this window open during the scan process.', 'duplicator-pro'); ?></i><br/>
<i><?php esc_html_e('This can take several minutes.', 'duplicator-pro'); ?></i><br/>
</div>
<!-- SCAN DETAILS REPORT -->
<div id="dup-msg-success" style="display:none">
<div style="text-align:center">
<div class="dup-hdr-success"><i class="far fa-check-square"></i> <?php esc_html_e('Scan Complete', 'duplicator-pro'); ?></div>
<div id="dup-msg-success-subtitle">
<?php esc_html_e("Process Time:", 'duplicator-pro'); ?> <span id="data-rpt-scantime"></span>
</div>
</div>
<div class="details">
<?php
include(DUPLICATOR____PATH . '/views/packages/main/s2.scan2.server.php');
echo '<br/>';
include(DUPLICATOR____PATH . '/views/packages/main/s2.scan3.archive.php');
?>
</div>
</div>
<!-- ERROR MESSAGE -->
<div id="dup-msg-error" style="display:none">
<div class="dup-hdr-error"><i class="fa fa-exclamation-circle"></i> <?php esc_html_e('Scan Error', 'duplicator-pro'); ?></div>
<i><?php esc_html_e('Please try again!', 'duplicator-pro'); ?></i><br/>
<div style="text-align:left">
<b><?php esc_html_e("Server Status:", 'duplicator-pro'); ?></b> &nbsp;
<div id="dup-msg-error-response-status" style="display:inline-block"></div><br/>
<b><?php esc_html_e("Error Message:", 'duplicator-pro'); ?></b>
<div id="dup-msg-error-response-text"></div>
</div>
</div>
</div>
<!-- WARNING CONTINUE -->
<div id="dpro-scan-warning-continue">
<div class="msg2">
<?php
_e("Scan checks are not required to pass, however they could cause issues on some systems.", 'duplicator-pro');
echo '<br/>';
_e("Please review the details for each section by clicking on the detail title.", 'duplicator-pro');
?>
</div>
</div>
<div id="dpro-confirm-area">
<label for="dpro-confirm-check"><?php
esc_html_e('Do you want to continue?', 'duplicator-pro');
echo '<br/> ';
esc_html_e('At least one or more checkboxes were checked in "Quick Filters".', 'duplicator-pro')
?><br/>
<i style="font-weight:normal"><?php esc_html_e('To apply a "Quick Filter" click the "Add Filters & Rescan" button', 'duplicator-pro') ?></i><br/>
<input type="checkbox" id="dpro-confirm-check" onclick="jQuery('#dup-build-button').removeAttr('disabled');">
<?php esc_html_e('Yes. Continue without applying any file filters.', 'duplicator-pro') ?></label><br/>
</div>
<div class="dup-button-footer" style="display:none">
<input
type="button"
value="&#9664; <?php esc_html_e("Back", 'duplicator-pro') ?>"
class="button button-large dup-go-back-to-new1"
>
<input type="button" value="<?php esc_attr_e("Rescan", 'duplicator-pro') ?>" onclick=" DupPro.Pack.reRunScanner()" class="button button-large" />
<input type="button" onclick="DupPro.Pack.startBuild();" class="button button-primary button-large" id="dup-build-button" value='<?php esc_attr_e("Build", 'duplicator-pro') ?> &#9654'/>
</div>
</form>
<script>
jQuery(document).ready(function ($)
{
let errorMessage = <?php echo SnapJson::jsonEncode($messageText); ?>;
DupPro.Pack.WebServiceStatus = {
Pass: 1,
Warn: 2,
Error: 3,
Incomplete: 4,
ScheduleRunning: 5
}
DupPro.Pack.runScanner = function (callbackOnSuccess) {
$.ajax({
type: "POST",
cache: false,
dataType: "text",
url: ajaxurl,
timeout: 10000000,
data: {
action: 'duplicator_pro_package_scan',
nonce: '<?php echo wp_create_nonce('duplicator_pro_package_scan'); ?>'
},
complete: function () {},
success: function (respData, textStatus, xHr) {
try {
var data = DupPro.parseJSON(respData);
} catch (err) {
console.error(err);
console.error('JSON parse failed for response data: ' + respData);
var status = xHr.status + ' -' + xHr.statusText;
$('#dup-progress-bar-area, #dup-build-button').hide();
$('#dup-msg-error-response-status').html(status)
$('#dup-msg-error-response-text').html(xHr.responseText);
$('#dup-msg-error, .dup-button-footer').show();
console.log(data);
return false;
}
var data = data || new Object();
if (data.ScanStatus !== undefined && data.ScanStatus == 'running') {
DupPro.Pack.runScanner();
} else {
var status = data.Status || 3;
var message = data.Message || "Unable to read JSON from service. <br/> See: /wp-admin/admin-ajax.php?action=duplicator_pro_package_scan";
console.log(data);
if (status == DupPro.Pack.WebServiceStatus.Pass) {
DupPro.Pack.loadScanData(data);
if (typeof callbackOnSuccess === "function") {
callbackOnSuccess(data);
}
$('.dup-button-footer').show();
} else if (status == DupPro.Pack.WebServiceStatus.ScheduleRunning) {
// as long as its just saying that someone blocked us keep trying
console.log('retrying scan in 300 ms...');
setTimeout(DupPro.Pack.runScanner, 300);
} else {
$('#dup-progress-bar-area, #dup-build-button').hide();
$('#dup-msg-error-response-status').html(status);
$('#dup-msg-error-response-text').html(message + errorMessage);
$('#dup-msg-error').show();
$('.dup-button-footer').show();
}
}
},
error: function (data) {
var status = data.status + ' -' + data.statusText;
$('#dup-progress-bar-area, #dup-build-button').hide();
$('#dup-msg-error-response-status').html(status)
$('#dup-msg-error-response-text').html(data.responseText + errorMessage);
$('#dup-msg-error, .dup-button-footer').show();
console.log(data);
}
});
}
DupPro.Pack.reRunScanner = function (callbackOnSuccess)
{
$('#dup-msg-success,#dup-msg-error,.dup-button-footer,#dpro-confirm-area').hide();
$('#dpro-confirm-check').prop('checked', false);
$('#dup-progress-bar-area').show();
$('#dpro-scan-warning-continue').hide();
DupPro.Pack.runScanner(callbackOnSuccess);
}
DupPro.Pack.loadScanData = function (data)
{
try {
var errMsg = "unable to read";
$('#dup-progress-bar-area').hide();
//****************
// BRAND
// #data-srv-brand-check
// #data-srv-brand-name
// #data-srv-brand-note
$("#data-srv-brand-name").text(data.SRV.Brand.Name);
if (data.SRV.Brand.LogoImageExists)
$("#data-srv-brand-note").html(data.SRV.Brand.Notes);
else
$("#data-srv-brand-note")
.html("<?php
esc_html_e(
"WARNING! Logo images no longer can be found inside brand. Please edit this brand and place new images. After that you can build your package with this brand.",
'duplicator-pro'
); ?>"
);
$("#data-srv-brand-check").html(DupPro.Pack.setScanStatus(data.SRV.Brand.LogoImageExists));
//****************
//REPORT
var base = $('#data-rpt-scanfile').attr('href');
$('#data-rpt-scanfile').attr('href', base + '&scanfile=' + data.RPT.ScanFile);
$('#data-rpt-scantime').text(data.RPT.ScanTime || 0);
DupPro.Pack.intServerData(data);
DupPro.Pack.initArchiveFilesData(data);
//Addon Sites
$('#data-arc-status-addonsites').html(DupPro.Pack.setScanStatus(data.ARC.Status.AddonSites));
if (data.ARC.FilterInfo.Dirs.AddonSites !== undefined && data.ARC.FilterInfo.Dirs.AddonSites.length > 0) {
$("#addonsites-block").show();
}
$('#dup-msg-success').show();
//****************
//DATABASE
var html = "";
var DB_TableRowMax = <?php echo DUPLICATOR_PRO_SCAN_DB_TBL_ROWS; ?>;
var DB_TableSizeMax = <?php echo DUPLICATOR_PRO_SCAN_DB_TBL_SIZE; ?>;
if (data.DB.DBExcluded && data.DB.Status.Success) {
$('#data-db-status-size1').html(DupPro.Pack.setScanStatus(data.DB.Status.Excluded));
$('#data-db-size1').text(data.DB.Size || errMsg);
} else if (data.DB.Status.Success) {
$('#data-db-status-size1').html(DupPro.Pack.setScanStatus(data.DB.Status.Size));
$('#data-db-size1').text(data.DB.Size || errMsg);
$('#data-db-size2').text(data.DB.Size || errMsg);
$('#data-db-rows').text(data.DB.Rows || errMsg);
$('#data-db-tablecount').text(data.DB.TableCount || errMsg);
//Table Details
if (data.DB.TableList == undefined || data.DB.TableList.length == 0) {
html = '<?php esc_html_e("Unable to report on any tables", 'duplicator-pro') ?>';
} else {
$.each(data.DB.TableList, function (i) {
html += '<b>' + i + '</b><br/>';
html += '<table><tr>';
$.each(data.DB.TableList[i], function (key, val) {
switch (key) {
case 'Case':
color = (val == 1) ? 'maroon' : 'black';
html += '<td style="color:' + color + '">Uppercase: ' + val + '</td>';
break;
case 'Rows':
color = (val > DB_TableRowMax) ? 'red' : 'black';
html += '<td style="color:' + color + '">Rows: ' + val + '</td>';
break;
case 'USize':
color = (parseInt(val) > DB_TableSizeMax) ? 'red' : 'black';
html += '<td style="color:' + color + '">Size: ' + data.DB.TableList[i]['Size'] + '</td>';
break;
}
});
html += '</tr></table>';
});
}
$('#data-db-tablelist').html(html);
} else {
html = '<?php esc_html_e("Unable to report on database stats", 'duplicator-pro') ?>';
$('#dup-scan-db').html(html);
}
var isWarn = false;
for (key in data.ARC.Status) {
if ('Big' != key && 'Warn' == data.ARC.Status[key]) {
isWarn = true;
}
}
if (!isWarn) {
if ('Warn' == data.DB.Status.Size) {
isWarn = true;
}
}
if (!isWarn && 'Warn' == data.DB.Status.Rows) {
isWarn = true;
}
if (!isWarn && 'Warn' == data.SRV.PHP.ALL) {
isWarn = true;
}
if (!isWarn && (data.SRV.WP.version == false || data.SRV.WP.core == false)) {
isWarn = true;
}
if (isWarn) {
$('#dpro-scan-warning-continue').show();
} else {
$('#dpro-scan-warning-continue').hide();
$('#dup-build-button').prop("disabled", false).addClass('button-primary');
}
} catch (err) {
err += '<br/> Please try again!'
$('#dup-msg-error-response-status').html("n/a")
$('#dup-msg-error-response-text').html(err);
$('#dup-msg-error, .dup-button-footer').show();
$('#dup-build-button').hide();
}
}
//Starts the build process
DupPro.Pack.startBuild = function ()
{
// disable to prevent double click
$('#dup-build-button').prop('disabled', true);
if ($('#dpro-confirm-check').is(":checked")) {
$('#form-duplicator').submit();
}
var sizeChecks = $('#hb-files-large-jstree').length ? $('#hb-files-large-jstree').jstree(true).get_checked() : 0;
var addonChecks = $('#hb-addon-sites-result input:checked');
var utf8Checks = $('#hb-files-utf8-jstree').length ? $('#hb-files-utf8-jstree').jstree(true).get_checked() : 0;
if (sizeChecks.length > 0 || addonChecks.length > 0 || utf8Checks.length > 0) {
$('#dpro-confirm-area').show();
} else {
$('#form-duplicator').submit();
}
}
//Toggles each scan item to hide/show details
DupPro.Pack.toggleScanItem = function (item)
{
var $info = $(item).parents('div.scan-item').children('div.info');
var $text = $(item).find('div.text i.fa');
if ($info.is(":hidden")) {
$text.addClass('fa-caret-down').removeClass('fa-caret-right');
$info.show();
} else {
$text.addClass('fa-caret-right').removeClass('fa-caret-down');
$info.hide(250);
}
}
//Set Good/Warn Badges and checkboxes
DupPro.Pack.setScanStatus = function (status)
{
var result;
switch (status) {
case false :
result = '<div class="scan-warn"><i class="fa fa-exclamation-triangle fa-sm"></i></div>';
break;
case 'Warn' :
result = '<div class="badge badge-warn">Notice</div>';
break;
case true :
result = '<div class="scan-good"><i class="fa fa-check"></i></div>';
break;
case 'Good' :
result = '<div class="badge badge-pass">Good</div>';
break;
default :
result = 'unable to read';
}
return result;
}
//Allows user to continue with build if warnings found
DupPro.Pack.warningContinue = function (checkbox)
{
($(checkbox).is(':checked'))
? $('#dup-build-button').prop('disabled', false).addClass('button-primary')
: $('#dup-build-button').prop('disabled', true).removeClass('button-primary');
}
//Page Init:
DupPro.Pack.runScanner();
$('.dup-go-back-to-new1').click(function (event) {
event.preventDefault();
window.location.href = <?php echo SnapJson::jsonEncode(PackagesPageController::getInstance()->getPackageBuildS1Url()); ?>;
});
});
</script>

View File

@@ -0,0 +1,429 @@
<?php
/**
*
* @package Duplicator
* @copyright (c) 2022, Snap Creek LLC
*/
defined('ABSPATH') || defined('DUPXABSPATH') || exit;
use Duplicator\Addons\DropboxAddon\Models\DropboxStorage;
use Duplicator\Addons\ProBase\License\License;
use Duplicator\Controllers\ToolsPageController;
use Duplicator\Libs\Snap\SnapUtil;
use Duplicator\Models\DynamicGlobalEntity;
/**
* Variables
*
* @var ?DUP_PRO_Package $Package
* @var bool $archive_export_onlydb
*/
$global = DUP_PRO_Global_Entity::getInstance();
global $wp_version;
$diagnosticUrl = ToolsPageController::getInstance()->getMenuLink(ToolsPageController::L2_SLUG_DISAGNOSTIC);
?>
<!-- ================================================================
SETUP
================================================================ -->
<div class="details-title">
<i class="fas fa-tasks fa-sm fa-fw"></i> <?php esc_html_e("Setup", 'duplicator-pro'); ?>
<div class="dup-more-details">
<a href="<?php echo esc_url($diagnosticUrl); ?>" target="_blank" title="<?php esc_attr_e('Show Diagnostics', 'duplicator-pro'); ?>">
<i class="fa fa-microchip"></i>
</a>&nbsp;
<a href="site-health.php" target="_blank" title="<?php esc_attr_e('Site Health', 'duplicator-pro'); ?>"><i class="fas fa-file-medical-alt"></i></a>
</div>
</div>
<!-- ==========================
SYSTEM SETTINGS -->
<div class="scan-item scan-item-first">
<div class='title' onclick="DupPro.Pack.toggleScanItem(this);">
<div class="text"><i class="fa fa-caret-right"></i> <?php esc_html_e('System', 'duplicator-pro'); ?></div>
<div id="data-srv-php-all"></div>
</div>
<div class="info">
<?php
//DIVIDER
echo "<div class='scan-system-divider'><i class='fa fa-list'></i>&nbsp;" . __('General Checks', 'duplicator-pro') . "</div>";
if (License::can(License::CAPABILITY_BRAND)) :
?>
<span id="data-srv-brand-check"></span>&nbsp;<b><?php esc_html_e('Brand', 'duplicator-pro'); ?>: </b>&nbsp;<span id="data-srv-brand-name"><?php esc_html_e('Default', 'duplicator-pro'); ?></span><br />
<div class="scan-system-subnote" id="data-srv-brand-note"><?php esc_html_e('The default content used when a brand is not defined.', 'duplicator-pro'); ?></div>
<hr size="1" />
<?php
endif;
//WEB SERVER
$web_servers = implode(', ', $GLOBALS['DUPLICATOR_PRO_SERVER_LIST']);
echo '<span id="data-srv-php-websrv"></span>&nbsp;<b>' . __('Web Server', 'duplicator-pro') . ":</b>&nbsp; '{$_SERVER['SERVER_SOFTWARE']}' <br/>";
echo '<div class="scan-system-subnote">';
esc_html_e("Supported Web Servers:", 'duplicator-pro');
echo "&nbsp;{$web_servers}";
echo '</div>';
//MYSQLI
echo '<hr size="1" /><span id="data-srv-php-mysqli"></span>&nbsp;<b>' . __('MySQLi', 'duplicator-pro') . "</b> <br/>";
echo '<div class="scan-system-subnote">';
esc_html_e('Creating the package does not require the mysqli module. However the installer file requires that the PHP module mysqli be installed on the server it is deployed on.', 'duplicator-pro');
echo "&nbsp;<i><a href='http://php.net/manual/en/mysqli.installation.php' target='_blank'>[" . __('details', 'duplicator-pro') . "]</a></i>";
echo '</div>';
//DROPBOX ONLY
if ($Package->contains_storage_type(DropboxStorage::getSType())) {
$transferMode = DynamicGlobalEntity::getInstance()->getVal('dropbox_transfer_mode');
//OPENSSL
echo '<hr size="1" /><span id="data-srv-php-openssl"></span>&nbsp;<b>' . __('Open SSL - Dropbox', 'duplicator-pro') . '</b>';
echo '<div class="scan-system-subnote">';
esc_html_e('Dropbox storage requires an HTTPS connection. On windows systems enable "extension=php_openssl.dll" in the php.ini configuration file. ', 'duplicator-pro');
esc_html_e('On Linux based systems check for the --with-openssl[=DIR] flag.', 'duplicator-pro');
echo "&nbsp;<i><a href='http://php.net/manual/en/openssl.installation.php' target='_blank'>[" . __('details', 'duplicator-pro') . "]</a></i>";
echo '</div>';
if ($transferMode == DUP_PRO_Dropbox_Transfer_Mode::FOpen_URL) {
//FOpen
$test = DUP_PRO_Server::isURLFopenEnabled();
echo '<hr size="1" /><span id="data-srv-php-allowurlfopen"></span>&nbsp;<b>' . __('Allow URL Fopen', 'duplicator-pro') . ":</b>&nbsp; '{$test}'<br/>";
echo '<div class="scan-system-subnote">';
esc_html_e('Dropbox communications requires that [allow_url_fopen] be set to 1 in the php.ini file.', 'duplicator-pro');
echo "&nbsp;<i><a href='http://php.net/manual/en/filesystem.configuration.php#ini.allow-url-fopen' target='_blank'>[" . __('details', 'duplicator-pro') . "]</a></i><br/>";
echo '</div>';
} elseif ($transferMode == DUP_PRO_Dropbox_Transfer_Mode::cURL) {
//FOpen
$test = SnapUtil::isCurlEnabled() ? __('True', 'duplicator-pro') : __('False', 'duplicator-pro');
echo '<hr size="1" /><span id="data-srv-php-curlavailable"></span>&nbsp;<b>' . __('cURL - Dropbox', 'duplicator-pro') . ":</b>&nbsp; '{$test}'<br/>";
echo '<div class="scan-system-subnote">';
esc_html_e('Dropbox communications requires that extension=php_curl.dll be present in the php.ini file.', 'duplicator-pro');
echo "&nbsp;<i><a href='http://php.net/manual/en/curl.installation.php' target='_blank'>[" . __('details', 'duplicator-pro') . "]</a></i><br/>";
echo '</div>';
}
}
//DIVIDER
echo "<div class='scan-system-divider margin-top-1'><i class='fa fa-list'></i>&nbsp;" . __('PHP Checks', 'duplicator-pro') . "</div>";
//PHP VERSION
echo '<span id="data-srv-php-version"></span>&nbsp;<b>' . __('PHP Version: ', 'duplicator-pro') . "</b>" . PHP_VERSION . " <br/>";
echo '<div class="scan-system-subnote">';
printf(
esc_html__(
'The minimum PHP version supported by Duplicator is %1$s, however it is highly recommended to use PHP %2$s or higher for improved stability.',
'duplicator-pro'
),
DUPLICATOR_PRO_PHP_MINIMUM_VERSION,
DUPLICATOR_PRO_PHP_SUGGESTED_VERSION
);
echo "&nbsp;<i><a href='http://php.net/ChangeLog-5.php' target='_blank'>[" . __('details', 'duplicator-pro') . "]</a></i>";
echo '</div>';
//OPEN_BASEDIR
$openBaseDir = ini_get("open_basedir");
$test = empty($openBaseDir) ? 'off' : 'on';
echo '<hr size="1" /><span id="data-srv-php-openbase"></span>&nbsp;<b>' . __('PHP Open Base Dir', 'duplicator-pro') . ":</b>&nbsp; '{$test}' <br/>";
echo '<div class="scan-system-subnote">';
esc_html_e('Issues might occur when [open_basedir] is enabled. Work with your server admin or hosting provider to disable this value in the php.ini file if youre having issues building a package.', 'duplicator-pro');
echo "&nbsp;<i><a href='http://php.net/manual/en/ini.core.php#ini.open-basedir' target='_blank'>[" . __('details', 'duplicator-pro') . "]</a></i><br/>";
echo '</div>';
//MAX_EXECUTION_TIME
$test = (set_time_limit(0)) ? 0 : ini_get("max_execution_time");
echo '<hr size="1" /><span id="data-srv-php-maxtime"></span>&nbsp;<b>' . __('PHP Max Execution Time', 'duplicator-pro') . ":</b>&nbsp; '{$test}' <br/>";
echo '<div class="scan-system-subnote">';
printf(
__(
'Issues might occur for larger packages when the [max_execution_time] value in the php.ini is too low.
The minimum recommended timeout is "%1$s" seconds or higher.
An attempt is made to override this value if the server allows it. A value of 0 (recommended) indicates that PHP has no time limits.',
'duplicator-pro'
),
DUPLICATOR_PRO_SCAN_TIMEOUT
);
echo "&nbsp;<i><a href='http://www.php.net/manual/en/info.configuration.php#ini.max-execution-time' target='_blank'>[" . __('details', 'duplicator-pro') . "]</a></i>";
echo '</div>';
//MEMORY_LIMIT
$test = @ini_get("memory_limit");
echo '<hr size="1" /><span id="data-srv-php-minmemory"></span>&nbsp;<b>' . __('PHP Memory Limit', 'duplicator-pro') . ":</b>&nbsp; '{$test}' <br/>";
echo '<div class="scan-system-subnote">';
printf(
__(
'Issues might occur for larger packages when the [memory_limit] value in the php.ini is too low.
The minimum recommended memory limit is "%1$s" or higher. An attempt is made to override this value if the server allows it.
To manually increase the memory limit have a look at this %2$s[FAQ item]%3$s',
'duplicator-pro'
),
DUPLICATOR_PRO_MIN_MEMORY_LIMIT,
"<i><a href='" . DUPLICATOR_PRO_DUPLICATOR_DOCS_URL . "how-to-manage-server-resources-cpu-memory-disk' target='_blank'>",
"</a></i>"
);
echo '</div>';
//PHP 32-bit
$test = SnapUtil::getArchitectureString();
echo '<hr size="1" /><span id="data-srv-php-arch64bit"></span>&nbsp;<b>' . __('PHP 64 Bit Architecture', 'duplicator-pro') . ":</b>&nbsp; '{$test}' <br/>";
echo '<div class="scan-system-subnote">';
printf(
__(
'Servers that run a PHP 32-bit architecture are not capable of creating packages larger than 2GB.
If you need to create a package that is larger than 2GB in size talk with your host or server admin to change your version of PHP to 64-bit. %1$s[FAQ item]%2$s',
'duplicator-pro'
),
"<i><a href='" . DUPLICATOR_PRO_DUPLICATOR_DOCS_URL . "how-to-resolve-file-io-related-build-issues' target='_blank'>",
"</a></i>"
);
echo '</div>';
?><br/>
</div>
</div>
<!-- ======================
WP SETTINGS -->
<div class="scan-item">
<?php
if (!$archive_export_onlydb && isset($_POST['filter-on'])) {
$file_filter_data = array(
'filter-dir' => DUP_PRO_Archive::parsePathFilter(SnapUtil::sanitizeNSChars($_POST['filter-paths'])),
'filter-files' => DUP_PRO_Archive::parsePathFilter(SnapUtil::sanitizeNSChars($_POST['filter-paths'])),
);
$_SESSION['filter_data'] = $file_filter_data;
} else {
if (isset($_SESSION['filter_data'])) {
unset($_SESSION['filter_data']);
}
}
//TODO Login Need to go here
$core_dir_included = array();
$core_files_included = array();
//by default fault
$core_dir_notice = false;
$core_file_notice = false;
if (!$archive_export_onlydb && isset($_POST['filter-on']) && isset($_POST['filter-paths'])) {
//findout matched core directories
$filter_dirs = DUP_PRO_Archive::parsePathFilter(SnapUtil::sanitizeNSChars($_POST['filter-paths']), true);
// clean possible blank spaces before and after the paths
for ($i = 0; $i < count($filter_dirs); $i++) {
$filter_dirs[$i] = trim($filter_dirs[$i]);
$filter_dirs[$i] = (substr($filter_dirs[$i], -1) == "/") ? substr($filter_dirs[$i], 0, strlen($filter_dirs[$i]) - 1) : $filter_dirs[$i];
}
$core_dir_included = array_intersect($filter_dirs, DUP_PRO_U::getWPCoreDirs());
$core_dir_notice = !empty($core_dir_included);
//find out core files
$filter_files = DUP_PRO_Archive::parsePathFilter(SnapUtil::sanitizeNSChars($_POST['filter-paths']), true);
// clean possible blank spaces before and after the paths
for ($i = 0; $i < count($filter_files); $i++) {
$filter_files[$i] = trim($filter_files[$i]);
}
$core_files_included = array_intersect($filter_files, DUP_PRO_U::getWPCoreFiles());
$core_file_notice = !empty($core_files_included);
}
?>
<div class='title' onclick="DupPro.Pack.toggleScanItem(this);">
<div class="text"><i class="fa fa-caret-right"></i> <?php esc_html_e('WordPress', 'duplicator-pro'); ?></div>
<div id="data-srv-wp-all"></div>
</div>
<div class="info">
<?php
//VERSION CHECK
echo '<span id="data-srv-wp-version"></span>&nbsp;<b>' . __('WordPress Version', 'duplicator-pro') . ":</b>&nbsp; '{$wp_version}' <br/>";
echo '<div class="scan-system-subnote">';
printf(
__(
'It is recommended to have a version of WordPress that is greater than %1$s.
Older version of WordPress can lead to migration issues and are a security risk.
If possible please update your WordPress site to the latest version.',
'duplicator-pro'
),
DUPLICATOR_PRO_SCAN_MIN_WP
);
echo '</div>';
//CORE FILES
echo '<hr size="1" /><span id="data-srv-wp-core"></span>&nbsp;<b>' . __('Core Files', 'duplicator-pro') . "</b> <br/>";
$filter_text = "";
if ($core_dir_notice) {
echo '<div id="data-srv-wp-core-missing-dirs">';
echo wp_kses(__("The core WordPress paths below will <u>not</u> be included in the archive. These paths are required for WordPress to function!", 'duplicator-pro'), array('u' => array()));
echo "<br/>";
foreach ($core_dir_included as $core_dir) {
echo '&nbsp; &nbsp; <b><i class="fa fa-exclamation-circle scan-warn"></i>&nbsp;' . $core_dir . '</b><br/>';
}
echo '</small><br/>';
echo '</div>';
$filter_text = "directories";
}
if ($core_file_notice) {
echo '<div id="data-srv-wp-core-missing-dirs">';
echo wp_kses(__("The core WordPress file below will <u>not</u> be included in the archive. This file is required for WordPress to function!", 'duplicator-pro'), array('u' => array()));
echo "<br/>";
foreach ($core_files_included as $core_file) {
echo '&nbsp; &nbsp; <b><i class="fa fa-exclamation-circle scan-warn"></i>&nbsp;' . $core_file . '</b><br/>';
}
echo '</div><br/>';
$filter_text .= (strlen($filter_text) > 0) ? " and file" : "files";
}
if (strlen($filter_text) > 0) {
echo '<div class="scan-system-subnote">';
printf(
__(
'Note: Please change the %1$s filters if you wish to include the WordPress core files
otherwise the data will have to be manually copied to the new location for the site to function properly.',
'duplicator-pro'
),
$filter_text
);
echo '</div>';
}
if (!$core_dir_notice && !$core_file_notice) {
echo '<div class="scan-system-subnote">';
esc_html_e(
"If the scanner is unable to locate the wp-config.php file in the root directory, then you will need to manually copy it to its new location.
This check will also look for core WordPress paths that should be included in the archive for WordPress to work correctly.",
'duplicator-pro'
);
echo '</div>';
}
if (!is_multisite()) {
//Normal Site
echo '<hr size="1" /><span><div class="dup-scan-good"><i class="fa fa-check"></i></div></span>&nbsp;<b>' . __('Multisite: N/A', 'duplicator-pro') . "</b> <br/>";
echo '<div class="scan-system-subnote">';
esc_html_e('Multisite was not detected on this site. It is currently configured as a standard WordPress site.', 'duplicator-pro');
echo "&nbsp;<i><a href='https://codex.wordpress.org/Create_A_Network' target='_blank'>[" . __('details', 'duplicator-pro') . "]</a></i>";
echo '</div>';
} elseif (License::can(License::CAPABILITY_MULTISITE_PLUS)) {
//MU Gold
echo '<hr size="1" /><span><div class="dup-scan-good"><i class="fa fa-check"></i></div></span>&nbsp;<b>' . __('Multisite: Detected', 'duplicator-pro') . "</b> <br/>";
echo '<div class="scan-system-subnote">';
esc_html_e('This license level has full access to all Multisite Plus+ features.', 'duplicator-pro');
echo '</div>';
} else {
//MU Personal, Freelancer
echo '<hr size="1" /><span><div class="dup-scan-warn"><i class="fa fa-exclamation-triangle fa-sm"></i></div></span>&nbsp;';
echo '<b>' . __('Multisite: Detected', 'duplicator-pro') . "</b> <br/>";
echo '<div class="scan-system-subnote">';
printf(
esc_html__(
'Duplicator Pro is at the %1$s license level which allows for backups and migrations of an entire Multisite network.&nbsp;',
'duplicator-pro'
),
License::getLicenseToString()
);
echo '<br>';
_e("To unlock all <b>Multisite Plus</b> features please upgrade the license before building a package.", 'duplicator-pro');
echo '<br/>';
echo "<a href='" . esc_url(License::getUpsellURL()) . "' target='_blank'>" . __('Upgrade Here', 'duplicator-pro') . "</a>&nbsp;|&nbsp;";
echo "&nbsp;<a href='" . DUPLICATOR_PRO_DUPLICATOR_DOCS_URL . "how-does-duplicator-handle-multisite-support' target='_blank'>"
. __('Multisite Plus Feature Overview', 'duplicator-pro') . "</a>";
echo '</div>';
}
?>
</div>
</div>
<!-- ======================
Restore only package -->
<div id="migration-status-scan-item" class="scan-item">
<div class='title' onclick="DupPro.Pack.toggleScanItem(this);">
<div class="text"><i class="fa fa-caret-right"></i> <?php esc_html_e('Import Status', 'duplicator-pro');?></div>
<div id="data-arc-status-migratepackage"></div>
</div>
<div class="info">
<script id="hb-migrate-package-result" type="text/x-handlebars-template">
<div class="container">
<div class="data">
{{#if ARC.Status.PackageIsNotImportable}}
<hr>
<p>
<span class="maroon">
<?php esc_html_e("This package is not be compatible with", 'duplicator-pro'); ?>
<i data-tooltip-title="<?php esc_attr_e("Drag and Drop Import", 'duplicator-pro'); ?>"
data-tooltip="<?php esc_html_e('The Drag and Drop import method is a new way to migrate packages you can find under Duplicator Pro > Tools > Import.', 'duplicator-pro'); ?>">
<u><?php esc_html_e("Drag and Drop import", 'duplicator-pro'); ?></u>.&nbsp;
</i>
<?php esc_html_e("However it can still be used it to perform a database migration.", 'duplicator-pro'); ?>
</span>
{{#if ARC.Status.IsDBOnly}}
<?php
esc_attr_e(
"Database only packages can only be installed via the installer.php file.
The Drag and Drop interface only processes packages that have all WordPress core directories and all database tables.",
'duplicator-pro'
);
?>
{{else}}
<?php esc_attr_e("To make the package compatible with Drag and Drop import don't filter any tables or core directories.", 'duplicator-pro'); ?>
{{/if}}
</p>
{{#if ARC.Status.HasFilteredCoreFolders}}
<p>
<b><?php esc_attr_e("FILTERED CORE DIRS:", 'duplicator-pro'); ?></b>
</p>
<ol>
{{#each ARC.FilteredCoreDirs as |dir|}}
<li>{{dir}} </li>
{{/each}}
</ol>
{{/if}}
{{#if ARC.Status.HasFilteredSiteTables}}
<b><?php esc_attr_e("FILTERED SITE TABLES:", 'duplicator-pro'); ?></b>
<div class="dup-scan-files-migrae-status">
<ol>
{{#each DB.FilteredTables as |table|}}
<li>{{table}} </li>
{{/each}}
</ol>
</div>
{{/if}}
{{else}}
<?php esc_html_e("The package you are about to create is compatible with Drag and Drop import.", 'duplicator-pro'); ?>
{{/if}}
</div>
</div>
</script>
<div id="migrate-package-result"></div>
</div>
</div>
<script>
(function ($)
{
//Ints the various server data responses from the scan results
DupPro.Pack.intServerData = function(data)
{
$('#data-srv-php-websrv').html(DupPro.Pack.setScanStatus(data.SRV.PHP.websrv));
$('#data-srv-php-openbase').html(DupPro.Pack.setScanStatus(data.SRV.PHP.openbase));
$('#data-srv-php-maxtime').html(DupPro.Pack.setScanStatus(data.SRV.PHP.maxtime));
$('#data-srv-php-minmemory').html(DupPro.Pack.setScanStatus(data.SRV.PHP.minMemory));
$('#data-srv-php-arch64bit').html(DupPro.Pack.setScanStatus(data.SRV.PHP.arch64bit));
$('#data-srv-php-mysqli').html(DupPro.Pack.setScanStatus(data.SRV.PHP.mysqli));
$('#data-srv-php-openssl').html(DupPro.Pack.setScanStatus(data.SRV.PHP.openssl));
$('#data-srv-php-allowurlfopen').html(DupPro.Pack.setScanStatus(data.SRV.PHP.allowurlfopen));
$('#data-srv-php-curlavailable').html(DupPro.Pack.setScanStatus(data.SRV.PHP.curlavailable));
$('#data-srv-php-version').html(DupPro.Pack.setScanStatus(data.SRV.PHP.version));
$('#data-srv-php-all').html(DupPro.Pack.setScanStatus(data.SRV.PHP.ALL));
//Wordpress
$('#data-srv-wp-version').html(DupPro.Pack.setScanStatus(data.SRV.WP.version));
$('#data-srv-wp-core').html(DupPro.Pack.setScanStatus(data.SRV.WP.core));
$('#data-srv-wp-all').html(DupPro.Pack.setScanStatus(data.SRV.WP.ALL));
}
})(jQuery);
</script>