forked from LiveCarta/LiveCartaWP
Changed source root directory
This commit is contained in:
@@ -0,0 +1,75 @@
|
||||
<?php
|
||||
defined('ABSPATH') || defined('DUPXABSPATH') || exit;
|
||||
|
||||
require_once(DUPLICATOR_PLUGIN_PATH . '/classes/ui/class.ui.dialog.php');
|
||||
|
||||
$current_tab = isset($_REQUEST['tab']) ? sanitize_text_field($_REQUEST['tab']) : 'list';
|
||||
$_GET['_wpnonce'] = isset($_GET['_wpnonce']) ? $_GET['_wpnonce'] : null;
|
||||
|
||||
$txt_invalid_msg1 = __("An invalid request was made to this page.", 'duplicator');
|
||||
$txt_invalid_msg2 = __("Please retry by going to the", 'duplicator');
|
||||
$txt_invalid_lnk = __("Backups Screen", 'duplicator');
|
||||
|
||||
switch ($current_tab) {
|
||||
case 'new1':
|
||||
if (!wp_verify_nonce($_GET['_wpnonce'], 'new1-package')) {
|
||||
die(printf("%s <br/>%s <a href='admin.php?page=duplicator'>%s</a>.", $txt_invalid_msg1, $txt_invalid_msg2, $txt_invalid_lnk));
|
||||
}
|
||||
break;
|
||||
case 'new2':
|
||||
if (!wp_verify_nonce($_GET['_wpnonce'], 'new2-package')) {
|
||||
die(printf("%s <br/>%s <a href='admin.php?page=duplicator'>%s</a>.", $txt_invalid_msg1, $txt_invalid_msg2, $txt_invalid_lnk));
|
||||
}
|
||||
break;
|
||||
case 'new3':
|
||||
if (!wp_verify_nonce($_GET['_wpnonce'], 'new3-package')) {
|
||||
die(printf("%s <br/>%s <a href='admin.php?page=duplicator'>%s</a>.", $txt_invalid_msg1, $txt_invalid_msg2, $txt_invalid_lnk));
|
||||
}
|
||||
break;
|
||||
}
|
||||
?>
|
||||
|
||||
<style>
|
||||
/*TOOLBAR TABLE*/
|
||||
table#dup-toolbar td {white-space: nowrap !important; padding:10px 0 0 0}
|
||||
table#dup-toolbar td .button {box-shadow: none !important;}
|
||||
table#dup-toolbar {width:100%; border:0 solid red; padding: 0; margin:8px 0 4px 0; height: 35px}
|
||||
table#dup-toolbar td:last-child {font-size:16px; width:100%; text-align: right; vertical-align: bottom;white-space:nowrap; padding:0}
|
||||
table#dup-toolbar td:last-child a {top:0; margin-top:10px; }
|
||||
table#dup-toolbar td:last-child span {display:inline-block; padding:0 5px 5px 5px; color:#000;}
|
||||
hr.dup-toolbar-line {margin:2px 0 10px 0}
|
||||
|
||||
/*WIZARD TABS */
|
||||
div#dup-wiz {padding:0px; margin:0; }
|
||||
div#dup-wiz-steps {margin:10px 0px 0px 10px; padding:0px; clear:both; font-size:13px; min-width:350px;}
|
||||
div#dup-wiz-title {padding:8px 0 0 15px; clear:both;}
|
||||
#dup-wiz a { position:relative; display:block; width:auto; min-width:80px; height:25px; margin-right:12px; padding:0px 10px 0px 10px; float:left; line-height:24px;
|
||||
color:#000; background:#E4E4E4; border-radius:2px; letter-spacing:1px; border:1px solid #E4E4E4; text-align: center }
|
||||
#dup-wiz .active-step a {color:#fff; background:#ACACAC; font-weight: bold; border:1px solid #888; box-shadow: 3px 3px 3px 0 #999}
|
||||
#dup-wiz .completed-step a {color:#E1E1E1; background:#BBBBBB; }
|
||||
|
||||
/*Footer */
|
||||
div.dup-button-footer input {min-width: 105px}
|
||||
div.dup-button-footer {padding: 1px 10px 0px 0px; text-align: right}
|
||||
</style>
|
||||
|
||||
<?php
|
||||
switch ($current_tab) {
|
||||
case 'list':
|
||||
duplicator_header(__("Backups » All", 'duplicator'));
|
||||
include(DUPLICATOR_PLUGIN_PATH . 'views/packages/main/packages.php');
|
||||
break;
|
||||
case 'new1':
|
||||
duplicator_header(__("Backups » New", 'duplicator'));
|
||||
include(DUPLICATOR_PLUGIN_PATH . 'views/packages/main/s1.setup1.php');
|
||||
break;
|
||||
case 'new2':
|
||||
duplicator_header(__("Backups » New", 'duplicator'));
|
||||
include(DUPLICATOR_PLUGIN_PATH . 'views/packages/main/s2.scan1.php');
|
||||
break;
|
||||
case 'new3':
|
||||
duplicator_header(__("Backups » New", 'duplicator'));
|
||||
include(DUPLICATOR_PLUGIN_PATH . 'views/packages/main/s3.build.php');
|
||||
break;
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
|
||||
//silent
|
||||
@@ -0,0 +1,580 @@
|
||||
<?php
|
||||
|
||||
use Duplicator\Core\Controllers\ControllersManager;
|
||||
use Duplicator\Libs\Snap\SnapJson;
|
||||
use Duplicator\Utils\LinkManager;
|
||||
use Duplicator\Core\Notifications\Notifications;
|
||||
|
||||
defined('ABSPATH') || defined('DUPXABSPATH') || exit;
|
||||
/* @var $Package DUP_Package */
|
||||
|
||||
// Never display incomplete packages and purge those that are no longer active
|
||||
DUP_Package::purge_incomplete_package();
|
||||
|
||||
$totalElements = DUP_Package::count_by_status();
|
||||
$completeCount = DUP_Package::count_by_status(array(array('op' => '>=', 'status' => DUP_PackageStatus::COMPLETE))); // total packages completed
|
||||
$active_package_present = DUP_Package::isPackageRunning();
|
||||
$is_mu = is_multisite();
|
||||
|
||||
$package_running = false;
|
||||
global $packageTablerowCount;
|
||||
$packageTablerowCount = 0;
|
||||
|
||||
if (DUP_Settings::Get('installer_name_mode') == DUP_Settings::INSTALLER_NAME_MODE_SIMPLE) {
|
||||
$packageExeNameModeMsg = __("When clicking the Installer download button, the 'Save as' dialog is currently defaulting the name to 'installer.php'. "
|
||||
. "To improve the security and get more information, go to: Settings > Backups Tab > Installer > Name option or click on the gear icon at the top of this page.", 'duplicator');
|
||||
} else {
|
||||
$packageExeNameModeMsg = __("When clicking the Installer download button, the 'Save as' dialog is defaulting the name to '[name]_[hash]_[time]_installer.php'. "
|
||||
. "This is the secure and recommended option. For more information, go to: Settings > Backups Tab > Installer > Name or click on the gear icon at the top of this page.<br/><br/>"
|
||||
. "To quickly copy the hashed installer name, to your clipboard use the copy icon link or click the installer name and manually copy the selected text.", 'duplicator');
|
||||
}
|
||||
?>
|
||||
|
||||
<style>
|
||||
div#dup-list-alert-nodata {padding:70px 20px;text-align:center; font-size:20px; line-height:26px}
|
||||
div.dup-notice-msg {border:1px solid silver; padding: 10px; border-radius:3px; width: 550px;
|
||||
margin:40px auto 0px auto; font-size:12px; text-align: left; word-break:normal;
|
||||
background: #fefcea;
|
||||
background: -moz-linear-gradient(top, #fefcea 0%, #efe5a2 100%);
|
||||
background: -ms-linear-gradient(top, #fefcea 0%,#efe5a2 100%);
|
||||
background: linear-gradient(to bottom, #fefcea 0%,#efe5a2 100%);
|
||||
}
|
||||
input#dup-bulk-action-all {margin:0 2px 0 0;padding:0 2px 0 0 }
|
||||
button.dup-button-selected {border:1px solid #000 !important; background-color:#dfdfdf !important;}
|
||||
div.dup-quick-start {font-style:italic; font-size: 13px; line-height: 18px; margin-top: 15px}
|
||||
div.dup-no-mu {font-size:13px; margin-top:25px; color:maroon; line-height:18px}
|
||||
a.dup-btn-disabled {color:#999 !important; border: 1px solid #999 !important}
|
||||
|
||||
/* Table package details */
|
||||
table.dup-pack-table {word-break:break-all;}
|
||||
table.dup-pack-table th {white-space:nowrap !important;}
|
||||
table.dup-pack-table td.pack-name {text-overflow:ellipsis; white-space:nowrap}
|
||||
table.dup-pack-table td.pack-size {min-width: 65px; }
|
||||
|
||||
table.dup-pack-table input[name="delete_confirm"] {margin-left:15px}
|
||||
table.dup-pack-table td.fail {border-left: 4px solid maroon;}
|
||||
table.dup-pack-table td.pass {border-left: 4px solid #2ea2cc;}
|
||||
|
||||
.dup-pack-info {height:50px;}
|
||||
.dup-pack-info td {vertical-align: middle; }
|
||||
tr.dup-pack-info td {white-space:nowrap; padding:2px 30px 2px 7px;}
|
||||
tr.dup-pack-info td.get-btns {text-align:right; padding:3px 5px 6px 0px !important;}
|
||||
tr.dup-pack-info td.get-btns button {box-shadow:none}
|
||||
textarea.dup-pack-debug {width:98%; height:300px; font-size:11px; display:none}
|
||||
td.error-msg a {color:maroon; text-decoration: underline}
|
||||
td.error-msg a:hover {color:maroon; text-decoration:none}
|
||||
td.error-msg {padding:7px 18px 0px 0px; color:maroon; text-align: center !important;}
|
||||
div#dup-help-dlg i {display: inline-block; width: 15px; padding:2px;line-height:28px; font-size:14px;}
|
||||
tr.dup-pack-info sup {font-style:italic;font-size:10px; cursor: pointer; vertical-align: baseline; position: relative; top: -0.8em;}
|
||||
tr#pack-processing {display: none}
|
||||
|
||||
th.inst-name {width: 1000px; padding: 2px 7px; }
|
||||
.inst-name input {width: 175px; margin: 0 5px; border:1px solid #CCD0D4; cursor:pointer;}
|
||||
.inst-name input:focus { width: 600px;}
|
||||
|
||||
/* Building package */
|
||||
.dup-pack-info .building-info {display: none; color: #2C8021; font-style: italic}
|
||||
.dup-pack-info .building-info .perc {font-weight: bold}
|
||||
.dup-pack-info.is-running .building-info {display: inline;}
|
||||
.dup-pack-info.is-running .get-btns button {display: none;}
|
||||
div.sc-footer-left {color:maroon; font-size:11px; font-style: italic; float:left}
|
||||
div.sc-footer-right {font-style: italic; float:right; font-size:12px}
|
||||
</style>
|
||||
<?php do_action(Notifications::DUPLICATOR_BEFORE_PACKAGES_HOOK); ?>
|
||||
<form id="form-duplicator" method="post">
|
||||
|
||||
<!-- ====================
|
||||
TOOL-BAR -->
|
||||
<table id="dup-toolbar">
|
||||
<tr valign="top">
|
||||
<td style="white-space: nowrap">
|
||||
<select id="dup-pack-bulk-actions">
|
||||
<option value="-1" selected="selected">
|
||||
<?php esc_html_e("Bulk Actions", 'duplicator') ?>
|
||||
</option>
|
||||
<option value="delete" title="<?php esc_attr_e("Delete selected backup(s)", 'duplicator') ?>">
|
||||
<?php esc_html_e("Delete", 'duplicator') ?>
|
||||
</option>
|
||||
</select>
|
||||
<input
|
||||
type="button" id="dup-pack-bulk-apply"
|
||||
class="button action" value="<?php esc_html_e("Apply", 'duplicator') ?>"
|
||||
onclick="Duplicator.Pack.ConfirmDelete()"
|
||||
>
|
||||
<span class="btn-separator"></span>
|
||||
<a href="javascript:void(0)" class="button" title="<?php esc_attr_e("Get Help", 'duplicator') ?>" onclick="Duplicator.Pack.showHelp()">
|
||||
<i class="fa fa-question-circle"></i>
|
||||
</a>
|
||||
<a
|
||||
href="<?php echo esc_url(ControllersManager::getMenuLink(ControllersManager::SETTINGS_SUBMENU_SLUG, 'package')); ?>"
|
||||
class="button"
|
||||
title="<?php esc_attr_e("Backup Settings", 'duplicator'); ?>"
|
||||
>
|
||||
<i class="fas fa-sliders-h"></i>
|
||||
</a>
|
||||
<a
|
||||
href="<?php echo esc_url(ControllersManager::getMenuLink(ControllersManager::TOOLS_SUBMENU_SLUG, 'templates')); ?>"
|
||||
class="button dup-btn-disabled"
|
||||
title="<?php esc_attr_e("Templates", 'duplicator'); ?>"
|
||||
>
|
||||
<i class="far fa-clone"></i>
|
||||
</a>
|
||||
<span class="btn-separator"></span>
|
||||
<a
|
||||
href="<?php echo esc_url(ControllersManager::getMenuLink(ControllersManager::IMPORT_SUBMENU_SLUG)); ?>"
|
||||
class="button dup-btn-disabled"
|
||||
title="<?php esc_attr_e("Import", 'duplicator'); ?>"
|
||||
>
|
||||
<i class="fas fa-arrow-alt-circle-down"></i>
|
||||
</a>
|
||||
<a href="admin.php?page=duplicator-tools&tab=recovery" class="button dup-btn-disabled" title="<?php esc_html_e("Recovery", 'duplicator'); ?>">
|
||||
<i class="fas fa-undo-alt"></i>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
$package_url = ControllersManager::getPackageBuildUrl();
|
||||
?>
|
||||
<a id="dup-create-new"
|
||||
onclick="return Duplicator.Pack.CreateNew(this);"
|
||||
href="<?php echo esc_url($package_url); ?>"
|
||||
class="button <?php echo ($active_package_present ? 'disabled' : ''); ?>">
|
||||
<?php esc_html_e("Create New", 'duplicator'); ?>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<?php if ($totalElements == 0) : ?>
|
||||
<!-- ====================
|
||||
NO-DATA MESSAGES-->
|
||||
<table class="widefat dup-pack-table">
|
||||
<thead><tr><th> </th></tr></thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<div id='dup-list-alert-nodata'>
|
||||
<i class="fa fa-archive fa-sm"></i>
|
||||
<?php esc_html_e("No Backups Found", 'duplicator'); ?><br/>
|
||||
<i><?php esc_html_e("Click 'Create New' to Backup Site", 'duplicator'); ?></i><br/>
|
||||
<div class="dup-quick-start" <?php echo ($is_mu) ? 'style="display:none"' : ''; ?>>
|
||||
<b><?php esc_html_e("New to Duplicator?", 'duplicator'); ?></b><br/>
|
||||
<a href="<?php echo esc_url(LinkManager::getCategoryUrl(LinkManager::QUICK_START_CAT, 'package_list_no_package', 'Quick Start')); ?>" target="_blank">
|
||||
<?php esc_html_e("Visit the 'Quick Start' guide!", 'duplicator'); ?>
|
||||
</a>
|
||||
</div>
|
||||
<?php if ($is_mu) {
|
||||
echo '<div class="dup-no-mu">';
|
||||
echo '<i class="fa fa-exclamation-triangle" aria-hidden="true"></i> ';
|
||||
esc_html_e('Duplicator Lite does not officially support WordPress multisite.', 'duplicator');
|
||||
echo "<br/>";
|
||||
esc_html_e('We strongly recommend upgrading to ', 'duplicator');
|
||||
echo " <i><a href='" . esc_url(LinkManager::getCampaignUrl('packages-list', "Mutlisite no packages")) . "' target='_blank'>[" . esc_html__('Duplicator Pro', 'duplicator') . "]</a></i>.";
|
||||
echo '</div>';
|
||||
}
|
||||
?>
|
||||
<div style="height:75px"> </div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tfoot><tr><th> </th></tr></tfoot>
|
||||
</table>
|
||||
<?php else : ?>
|
||||
<!-- ====================
|
||||
LIST ALL PACKAGES -->
|
||||
<table class="widefat dup-pack-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 30px;">
|
||||
<input type="checkbox" id="dup-bulk-action-all" title="<?php esc_attr_e("Select all Backups", 'duplicator') ?>" style="margin-left:12px" onclick="Duplicator.Pack.SetDeleteAll()" />
|
||||
</th>
|
||||
<th style="width: 100px;" ><?php esc_html_e("Created", 'duplicator') ?></th>
|
||||
<th style="width: 70px;"><?php esc_html_e("Size", 'duplicator') ?></th>
|
||||
<th style="min-width: 70px;"><?php esc_html_e("Name", 'duplicator') ?></th>
|
||||
<th class="inst-name">
|
||||
<?php esc_html_e("Installer Name", 'duplicator'); ?>
|
||||
<i class="fas fa-question-circle fa-sm"
|
||||
data-tooltip-title="<?php esc_html_e("Installer Name:", 'duplicator'); ?>"
|
||||
data-tooltip="<?php echo esc_attr($packageExeNameModeMsg); ?>" >
|
||||
</i>
|
||||
</th>
|
||||
<th style="text-align:center; width: 200px;">
|
||||
<?php esc_html_e("Backup", 'duplicator') ?>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr id="pack-processing">
|
||||
<td colspan="6">
|
||||
<div id='dup-list-alert-nodata'>
|
||||
<i class="fa fa-archive fa-sm"></i>
|
||||
<?php esc_html_e("No Backups Found", 'duplicator'); ?><br/>
|
||||
<i><?php esc_html_e("Click 'Create New' to Backup Site", 'duplicator'); ?></i><br/>
|
||||
<div class="dup-quick-start">
|
||||
<?php esc_html_e("New to Duplicator?", 'duplicator'); ?><br/>
|
||||
<a href="<?php echo esc_url(LinkManager::getCategoryUrl(LinkManager::QUICK_START_CAT, 'package_list_processing', 'Quick Start')); ?>" target="_blank">
|
||||
<?php esc_html_e("Visit the 'Quick Start' guide!", 'duplicator'); ?>
|
||||
</a>
|
||||
</div>
|
||||
<div style="height:75px"> </div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
function tablePackageRow(DUP_Package $Package)
|
||||
{
|
||||
global $packageTablerowCount;
|
||||
|
||||
$is_running_package = $Package->isRunning();
|
||||
$pack_name = $Package->Name;
|
||||
$pack_archive_size = $Package->getArchiveSize();
|
||||
$pack_perc = $Package->Status;
|
||||
$pack_dbonly = $Package->Archive->ExportOnlyDB;
|
||||
$pack_build_mode = ($Package->Archive->Format === 'ZIP') ? true : false;
|
||||
|
||||
//Links
|
||||
$uniqueid = $Package->NameHash;
|
||||
$packagepath = DUP_Settings::getSsdirUrl() . '/' . $Package->Archive->File;
|
||||
|
||||
$css_alt = ($packageTablerowCount % 2 != 0) ? '' : 'alternate';
|
||||
|
||||
if ($Package->Status >= 100 || $is_running_package) :
|
||||
?>
|
||||
<tr class="dup-pack-info <?php echo esc_attr($css_alt); ?> <?php echo $is_running_package ? 'is-running' : ''; ?>">
|
||||
<td><input name="delete_confirm" type="checkbox" id="<?php echo absint($Package->ID); ?>" /></td>
|
||||
<td>
|
||||
<?php
|
||||
echo DUP_Package::getCreatedDateFormat($Package->Created, DUP_Settings::get_create_date_format());
|
||||
echo ' ' . ($pack_build_mode ?
|
||||
"<sup title='" . __('Backup created as zip file', 'duplicator') . "'>zip</sup>" :
|
||||
"<sup title='" . __('Backup created as daf file', 'duplicator') . "'>daf</sup>");
|
||||
?>
|
||||
</td>
|
||||
<td class="pack-size"><?php echo DUP_Util::byteSize($pack_archive_size); ?></td>
|
||||
<td class='pack-name'>
|
||||
<?php echo ($pack_dbonly) ? "{$pack_name} <sup title='" . esc_attr(__('Database Only', 'duplicator')) . "'>DB</sup>" : esc_html($pack_name); ?><br/>
|
||||
<span class="building-info" >
|
||||
<i class="fa fa-cog fa-sm fa-spin"></i> <b><?php esc_html_e('Building Backup', 'duplicator') ?></b> <span class="perc"><?php echo $pack_perc; ?></span>%
|
||||
<i class="fas fa-question-circle fa-sm" style="color:#2C8021"
|
||||
data-tooltip-title="<?php esc_attr_e("Backup Build Running", 'duplicator'); ?>"
|
||||
data-tooltip="<?php esc_attr_e('To stop or reset this Backup build goto Settings > Advanced > Reset Backups', 'duplicator'); ?>"></i>
|
||||
</span>
|
||||
</td>
|
||||
<td class="inst-name">
|
||||
<?php
|
||||
switch (DUP_Settings::Get('installer_name_mode')) {
|
||||
case DUP_Settings::INSTALLER_NAME_MODE_SIMPLE:
|
||||
$lockIcon = 'fa-shield-alt fa-fw shield-off';
|
||||
break;
|
||||
case DUP_Settings::INSTALLER_NAME_MODE_WITH_HASH:
|
||||
default:
|
||||
$lockIcon = 'fa-shield-alt fa-fw shield-on';
|
||||
break;
|
||||
}
|
||||
$installerName = $Package->getInstDownloadName();
|
||||
?>
|
||||
<a href="admin.php?page=duplicator-settings&tab=packageadmin.php?page=duplicator-settings&tab=package#duplicator-installer-settings"
|
||||
title="<?php esc_html_e("Click to configure installer name.", 'duplicator') ?>">
|
||||
<i class="fas <?php echo $lockIcon; ?>"></i>
|
||||
</a>
|
||||
<input type="text" readonly="readonly" value="<?php echo esc_attr($installerName); ?>" title="<?php echo esc_attr($installerName); ?>" onfocus="jQuery(this).select();"/>
|
||||
<span data-dup-copy-text="<?php echo $installerName; ?>" ><i class='far fa-copy' style='cursor: pointer'></i>
|
||||
</td>
|
||||
<td class="get-btns">
|
||||
<button
|
||||
id="<?php echo esc_attr("{$uniqueid}_installer.php"); ?>"
|
||||
class="button no-select"
|
||||
onclick="Duplicator.Pack.DownloadInstaller(<?php echo SnapJson::jsonEncodeEscAttr($Package->getInstallerDownloadInfo()); ?>); return false;">
|
||||
<i class="fa fa-bolt fa-sm"></i> <?php esc_html_e("Installer", 'duplicator') ?>
|
||||
</button>
|
||||
<button
|
||||
id="<?php echo esc_attr("{$uniqueid}_archive.zip"); ?>"
|
||||
class="button no-select"
|
||||
onclick="Duplicator.Pack.DownloadFile(<?php echo SnapJson::jsonEncodeEscAttr($Package->getPackageFileDownloadInfo(DUP_PackageFileType::Archive)); ?>); return false;">
|
||||
<i class="far fa-file-archive"></i> <?php esc_html_e("Backup", 'duplicator') ?>
|
||||
</button>
|
||||
<button type="button" class="button no-select" title="<?php esc_attr_e("Backup Details", 'duplicator') ?>" onclick="Duplicator.Pack.OpenPackageDetails(<?php echo "{$Package->ID}"; ?>);">
|
||||
<i class="fa fa-archive fa-sm" ></i>
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
else :
|
||||
$error_url = "?page=duplicator&action=detail&tab=detail&id={$Package->ID}";
|
||||
?>
|
||||
<tr class="dup-pack-info <?php echo esc_attr($css_alt); ?>">
|
||||
<td><input name="delete_confirm" type="checkbox" id="<?php echo absint($Package->ID); ?>" /></td>
|
||||
<td><?php echo DUP_Package::getCreatedDateFormat($Package->Created, DUP_Settings::get_create_date_format()); ?></td>
|
||||
<td class="pack-size"><?php echo DUP_Util::byteSize($pack_archive_size); ?></td>
|
||||
<td class='pack-name'><?php echo esc_html($pack_name); ?></td>
|
||||
<td> </td>
|
||||
<td class="get-btns error-msg" colspan="3">
|
||||
<i class="fa fa-exclamation-triangle fa-sm"></i>
|
||||
<a href="<?php echo esc_url($error_url); ?>"><?php esc_html_e("Error Processing", 'duplicator') ?></a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
<?php
|
||||
//$totalSize = $totalSize + $pack_archive_size;
|
||||
$packageTablerowCount++;
|
||||
}
|
||||
DUP_Package::by_status_callback('tablePackageRow', array(), false, 0, '`id` DESC');
|
||||
?>
|
||||
<tfoot>
|
||||
<?php do_action('duplicator_before_packages_footer') ?>
|
||||
<tr>
|
||||
<th colspan="11">
|
||||
<div class="sc-footer-left">
|
||||
<?php if (DUP_Settings::Get('trace_log_enabled')) {
|
||||
esc_html_e("Trace Logging Enabled. Please disable when trace capture is complete.", 'duplicator');
|
||||
echo '<br/>';
|
||||
} ?>
|
||||
</div>
|
||||
<div class="sc-footer-right">
|
||||
<span style="cursor:help" title="<?php esc_attr_e("Current Server Time", 'duplicator') ?>">
|
||||
<?php
|
||||
$dup_serv_time = date_i18n('H:i');
|
||||
esc_html_e("Time", 'duplicator');
|
||||
echo ": {$dup_serv_time}";
|
||||
?>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
</th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
|
||||
<div style="float:right; padding:10px 5px">
|
||||
<?php
|
||||
echo $totalElements;
|
||||
echo ' ';
|
||||
esc_html_e("Items", 'duplicator');
|
||||
?>
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
</form>
|
||||
|
||||
<!-- ==========================================
|
||||
THICK-BOX DIALOGS: -->
|
||||
<?php
|
||||
$alert1 = new DUP_UI_Dialog();
|
||||
$alert1->title = __('Bulk Action Required', 'duplicator');
|
||||
$alert1->message = '<i class="fa fa-exclamation-triangle fa-sm"></i> ';
|
||||
$alert1->message .= __('No selections made! Please select an action from the "Bulk Actions" drop down menu.', 'duplicator');
|
||||
$alert1->initAlert();
|
||||
|
||||
$alert2 = new DUP_UI_Dialog();
|
||||
$alert2->title = __('Selection Required', 'duplicator', 'duplicator');
|
||||
$alert2->message = '<i class="fa fa-exclamation-triangle fa-sm"></i> ';
|
||||
$alert2->message .= __('No selections made! Please select at least one Backup to delete.', 'duplicator');
|
||||
$alert2->initAlert();
|
||||
|
||||
$confirm1 = new DUP_UI_Dialog();
|
||||
$confirm1->title = __('Delete Backups?', 'duplicator');
|
||||
$confirm1->message = __('Are you sure you want to delete the selected Backup(s)?', 'duplicator');
|
||||
$confirm1->progressText = __('Removing Backups, Please Wait...', 'duplicator');
|
||||
$confirm1->jscallback = 'Duplicator.Pack.Delete()';
|
||||
$confirm1->initConfirm();
|
||||
|
||||
$alert3 = new DUP_UI_Dialog();
|
||||
$alert3->height = 400;
|
||||
$alert3->width = 450;
|
||||
$alert3->title = __('Duplicator Help', 'duplicator');
|
||||
$alert3->message = "<div id='dup-help-dlg'></div>";
|
||||
$alert3->initAlert();
|
||||
|
||||
$alertPackRunning = new DUP_UI_Dialog();
|
||||
$alertPackRunning->title = __('Alert!', 'duplicator');
|
||||
$alertPackRunning->message = __('A Backup is being processed. Retry later.', 'duplicator');
|
||||
$alertPackRunning->initAlert();
|
||||
?>
|
||||
|
||||
<!-- =======================
|
||||
DIALOG: HELP DIALOG -->
|
||||
<div id="dup-help-dlg-info" style="display:none">
|
||||
<b><?php esc_html_e("Common Questions:", 'duplicator') ?></b><hr size='1'/>
|
||||
<i class="far fa-file-alt fa-sm"></i>
|
||||
<a href="<?php echo esc_url(LinkManager::getDocUrl('backup-site', 'packages_help_popup', 'create_package')); ?>" target="_blank">
|
||||
<?php esc_html_e("How do I create a Backup", 'duplicator') ?>
|
||||
</a> <br/>
|
||||
<i class="far fa-file-alt fa-sm"></i>
|
||||
<a href="<?php echo esc_url(LinkManager::getDocUrl('classic-install', 'packages_help_popup', 'classic_install')); ?>" target="_blank">
|
||||
<?php esc_html_e('How do I install a Backup?', 'duplicator'); ?>
|
||||
</a> <br/>
|
||||
<i class="far fa-file-code"></i>
|
||||
<a href="<?php echo esc_url(LinkManager::getCategoryUrl(LinkManager::TROUBLESHOOTING_CAT, 'packages_help_popup', 'FAQ')); ?>" target="_blank">
|
||||
<?php esc_html_e("Frequently Asked Questions!", 'duplicator') ?>
|
||||
</a>
|
||||
<br/><br/>
|
||||
|
||||
<b><?php esc_html_e("Other Resources:", 'duplicator') ?></b><hr size='1'/>
|
||||
<i class="fas fa-question-circle fa-sm fa-fw"></i>
|
||||
<a href="https://wordpress.org/support/plugin/duplicator/" target="_blank"><?php esc_html_e("Need help with the plugin?", 'duplicator') ?></a> <br/>
|
||||
|
||||
<?php if ($completeCount >= 3) : ?>
|
||||
<i class="fa fa-star fa-fw"></i>
|
||||
<a href="<?php echo esc_url(\Duplicator\Core\Notifications\Review::getReviewUrl()); ?>" target="vote-wp"><?php esc_html_e("Help review the plugin!", 'duplicator') ?></a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
jQuery(document).ready(function ($)
|
||||
{
|
||||
/** Create new package check */
|
||||
Duplicator.Pack.CreateNew = function (e) {
|
||||
var cButton = $(e);
|
||||
if (cButton.hasClass('disabled')) {
|
||||
<?php $alertPackRunning->showAlert(); ?>
|
||||
} else {
|
||||
Duplicator.Pack.GetActivePackageInfo(function (info) {
|
||||
if (info.present) {
|
||||
cButton.addClass('disabled');
|
||||
// reloag current page to update packages list
|
||||
location.reload(true);
|
||||
} else {
|
||||
// no active package. Load step1 page.
|
||||
window.location = cButton.attr('href');
|
||||
}
|
||||
});
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
/* Creats a comma seperate list of all selected package ids */
|
||||
Duplicator.Pack.GetDeleteList = function ()
|
||||
{
|
||||
var arr = new Array;
|
||||
var count = 0;
|
||||
$("input[name=delete_confirm]").each(function () {
|
||||
if (this.checked) {
|
||||
arr[count++] = this.id;
|
||||
}
|
||||
});
|
||||
return arr;
|
||||
}
|
||||
|
||||
/* Provides the correct confirmation items when deleting packages */
|
||||
Duplicator.Pack.ConfirmDelete = function ()
|
||||
{
|
||||
if ($("#dup-pack-bulk-actions").val() != "delete") {
|
||||
<?php $alert1->showAlert(); ?>
|
||||
return;
|
||||
}
|
||||
|
||||
var list = Duplicator.Pack.GetDeleteList();
|
||||
if (list.length == 0) {
|
||||
<?php $alert2->showAlert(); ?>
|
||||
return;
|
||||
}
|
||||
<?php $confirm1->showConfirm(); ?>
|
||||
}
|
||||
|
||||
|
||||
/* Removes all selected package sets
|
||||
* @param event To prevent bubbling */
|
||||
Duplicator.Pack.Delete = function (event)
|
||||
{
|
||||
var list = Duplicator.Pack.GetDeleteList();
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: ajaxurl,
|
||||
data: {
|
||||
action: 'duplicator_package_delete',
|
||||
package_ids: list,
|
||||
nonce: '<?php echo esc_js(wp_create_nonce('duplicator_package_delete')); ?>'
|
||||
},
|
||||
complete: function (data) {
|
||||
console.log(data);
|
||||
Duplicator.ReloadWindow(data);
|
||||
}
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
Duplicator.Pack.ActivePackageInfo = function (info) {
|
||||
$('.dup-pack-info.is-running .pack-size').text(info.size_format);
|
||||
|
||||
if (info.present) {
|
||||
$('.dup-pack-info.is-running .building-info .perc').text(info.status);
|
||||
|
||||
setTimeout(function () {
|
||||
Duplicator.Pack.GetActivePackageInfo(Duplicator.Pack.ActivePackageInfo);
|
||||
}, 1000);
|
||||
|
||||
} else {
|
||||
$('.dup-pack-info.is-running').removeClass('is-running');
|
||||
$('#dup-create-new.disabled').removeClass('disabled');
|
||||
}
|
||||
}
|
||||
|
||||
/* Get active package info
|
||||
*
|
||||
* */
|
||||
Duplicator.Pack.GetActivePackageInfo = function (callbackOnSuccess)
|
||||
{
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
cache: false,
|
||||
url: ajaxurl,
|
||||
dataType: "json",
|
||||
timeout: 10000000,
|
||||
data: {
|
||||
action: 'duplicator_active_package_info',
|
||||
nonce: '<?php echo esc_js(wp_create_nonce('duplicator_active_package_info')); ?>'
|
||||
},
|
||||
complete: function () {},
|
||||
success: function (result) {
|
||||
console.log(result);
|
||||
if (result.success) {
|
||||
if ($.isFunction(callbackOnSuccess)) {
|
||||
callbackOnSuccess(result.data.active_package);
|
||||
}
|
||||
} else {
|
||||
// @todo manage error
|
||||
}
|
||||
},
|
||||
error: function (result) {
|
||||
var result = result || new Object();
|
||||
// @todo manage error
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/* Toogles the Bulk Action Check boxes */
|
||||
Duplicator.Pack.SetDeleteAll = function ()
|
||||
{
|
||||
var state = $('input#dup-bulk-action-all').is(':checked') ? 1 : 0;
|
||||
$("input[name=delete_confirm]").each(function () {
|
||||
this.checked = (state) ? true : false;
|
||||
});
|
||||
}
|
||||
|
||||
/* Opens detail screen */
|
||||
Duplicator.Pack.OpenPackageDetails = function (package_id)
|
||||
{
|
||||
window.location.href = '?page=duplicator&action=detail&tab=detail&id=' + package_id;
|
||||
}
|
||||
|
||||
/* Toggles the feedback form */
|
||||
Duplicator.Pack.showHelp = function ()
|
||||
{
|
||||
$('#dup-help-dlg').html($('#dup-help-dlg-info').html());
|
||||
<?php $alert3->showAlert(); ?>
|
||||
}
|
||||
|
||||
<?php if ($package_running) : ?>
|
||||
$('#pack-processing').show();
|
||||
<?php
|
||||
endif;
|
||||
|
||||
if ($active_package_present) :
|
||||
?>
|
||||
Duplicator.Pack.GetActivePackageInfo(Duplicator.Pack.ActivePackageInfo);
|
||||
<?php endif; ?>
|
||||
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,319 @@
|
||||
<?php
|
||||
|
||||
use Duplicator\Core\Controllers\ControllersManager;
|
||||
|
||||
defined('ABSPATH') || defined('DUPXABSPATH') || exit;
|
||||
global $wpdb;
|
||||
|
||||
//POST BACK: Rest Button
|
||||
if (isset($_POST['action'])) {
|
||||
$action = sanitize_text_field($_POST['action']);
|
||||
$action_result = DUP_Settings::DeleteWPOption($action);
|
||||
switch ($action) {
|
||||
case 'duplicator_package_active':
|
||||
$action_result = DUP_Settings::DeleteWPOption($action);
|
||||
$action_response = __('Backup settings have been reset.', 'duplicator');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
DUP_Util::initSnapshotDirectory();
|
||||
|
||||
$Package = DUP_Package::getActive();
|
||||
$dup_tests = array();
|
||||
$dup_tests = DUP_Server::getRequirements();
|
||||
|
||||
//View State
|
||||
$ctrl_ui = new DUP_CTRL_UI();
|
||||
$ctrl_ui->setResponseType('PHP');
|
||||
$data = $ctrl_ui->GetViewStateList();
|
||||
|
||||
$ui_css_storage = (isset($data->payload['dup-pack-storage-panel']) && !$data->payload['dup-pack-storage-panel']) ? 'display:none' : 'display:block';
|
||||
$ui_css_archive = (isset($data->payload['dup-pack-archive-panel']) && $data->payload['dup-pack-archive-panel']) ? 'display:block' : 'display:none';
|
||||
$ui_css_installer = (isset($data->payload['dup-pack-installer-panel']) && $data->payload['dup-pack-installer-panel']) ? 'display:block' : 'display:none';
|
||||
$dup_intaller_files = implode(", ", array_keys(DUP_Server::getInstallerFiles()));
|
||||
$dbbuild_mode = (DUP_Settings::Get('package_mysqldump') && DUP_DB::getMySqlDumpPath()) ? 'mysqldump' : 'PHP';
|
||||
$archive_build_mode = DUP_Settings::Get('archive_build_mode') == DUP_Archive_Build_Mode::ZipArchive ? 'zip' : 'daf';
|
||||
|
||||
//="No Selection", 1="Try Again", 2="Two-Part Install"
|
||||
$retry_state = isset($_GET['retry']) ? $_GET['retry'] : 0;
|
||||
?>
|
||||
|
||||
<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;font-weight:bold}
|
||||
div.dup-sys-fail {display:inline-block; color:#AF0000;font-weight:bold}
|
||||
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}
|
||||
table.dup-sys-info-results td:nth-child(2) {width:100px; font-weight:bold}
|
||||
table.dup-sys-info-results td:nth-child(3) {font-style:italic}
|
||||
</style>
|
||||
|
||||
|
||||
<!-- ============================
|
||||
TOOL BAR: STEPS -->
|
||||
<table id="dup-toolbar">
|
||||
<tr valign="top">
|
||||
<td style="white-space: nowrap">
|
||||
<div id="dup-wiz">
|
||||
<div id="dup-wiz-steps">
|
||||
<div class="active-step"><a>1 <?php esc_html_e('Setup', 'duplicator'); ?></a></div>
|
||||
<div><a>2 <?php esc_html_e('Scan', 'duplicator'); ?> </a></div>
|
||||
<div><a>3 <?php esc_html_e('Build', 'duplicator'); ?> </a></div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="dup-wiz-title" class="dup-guide-txt-color">
|
||||
<i class="fab fa-wordpress"></i>
|
||||
<?php esc_html_e('Step 1: Choose the WordPress contents to backup.', 'duplicator'); ?>
|
||||
</div>
|
||||
</td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
</table>
|
||||
<hr class="dup-toolbar-line">
|
||||
|
||||
<?php if (!empty($action_response)) : ?>
|
||||
<div id="message" class="notice notice-success is-dismissible"><p><?php echo esc_html($action_response); ?></p></div>
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
<!-- ============================
|
||||
SYSTEM REQUIREMENTS -->
|
||||
<?php if (!$dup_tests['Success'] || $dup_tests['Warning']) : ?>
|
||||
<div class="dup-box">
|
||||
<div class="dup-box-title">
|
||||
<?php
|
||||
esc_html_e("Requirements:", 'duplicator');
|
||||
echo ($dup_tests['Success']) ? ' <div class="dup-sys-pass">Pass</div>' : ' <div class="dup-sys-fail">Fail</div>';
|
||||
?>
|
||||
<div class="dup-box-arrow"></div>
|
||||
</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'); ?></i>
|
||||
</div>
|
||||
|
||||
<!-- PHP SUPPORT -->
|
||||
<div class='dup-sys-req'>
|
||||
<div class='dup-sys-title'>
|
||||
<a><?php esc_html_e('PHP Support', 'duplicator'); ?></a>
|
||||
<div><?php echo esc_html($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]", esc_html__("PHP Version", 'duplicator'), phpversion()); ?></td>
|
||||
<td><?php echo esc_html($dup_tests['PHP']['VERSION']); ?></td>
|
||||
<td><?php esc_html_e('PHP versions 5.2.9+ or higher is required.', 'duplicator')?></td>
|
||||
</tr>
|
||||
<?php if ($archive_build_mode == 'zip') : ?>
|
||||
<tr>
|
||||
<td><?php esc_html_e('Zip Archive Enabled', 'duplicator'); ?></td>
|
||||
<td><?php echo esc_html($dup_tests['PHP']['ZIP']); ?></td>
|
||||
<td>
|
||||
<?php printf(
|
||||
esc_html_x(
|
||||
'ZipArchive extension is required or %1$sSwitch to DupArchive%2$s to by-pass this requirement.',
|
||||
'1 and 2 are <a> tags',
|
||||
'duplicator'
|
||||
),
|
||||
'<a href="admin.php?page=duplicator-settings&tab=package">',
|
||||
'</a>'
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
<tr>
|
||||
<td><?php esc_html_e('Safe Mode Off', 'duplicator'); ?></td>
|
||||
<td><?php echo esc_html($dup_tests['PHP']['SAFE_MODE']); ?></td>
|
||||
<td><?php esc_html_e('Safe Mode should be set to Off in you php.ini file and is deprecated as of PHP 5.3.0.', 'duplicator')?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php esc_html_e('Function', 'duplicator'); ?> <a href="http://php.net/manual/en/function.file-get-contents.php" target="_blank">file_get_contents</a></td>
|
||||
<td><?php echo esc_html($dup_tests['PHP']['FUNC_1']); ?></td>
|
||||
<td><?php echo ''; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php esc_html_e('Function', 'duplicator'); ?> <a href="http://php.net/manual/en/function.file-put-contents.php" target="_blank">file_put_contents</a></td>
|
||||
<td><?php echo esc_html($dup_tests['PHP']['FUNC_2']); ?></td>
|
||||
<td><?php echo ''; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php esc_html_e('Function', 'duplicator'); ?> <a href="http://php.net/manual/en/mbstring.installation.php" target="_blank">mb_strlen</a></td>
|
||||
<td><?php echo esc_html($dup_tests['PHP']['FUNC_3']); ?></td>
|
||||
<td><?php echo ''; ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
<small>
|
||||
<?php esc_html_e("For any issues in this section please contact your hosting provider or server administrator. For additional information see our online documentation.", 'duplicator'); ?>
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- PERMISSIONS -->
|
||||
<div class='dup-sys-req'>
|
||||
<div class='dup-sys-title'>
|
||||
<a><?php esc_html_e('Required Paths', 'duplicator'); ?></a>
|
||||
<div>
|
||||
<?php
|
||||
if (!in_array('Fail', $dup_tests['IO'])) {
|
||||
echo in_array('Warn', $dup_tests['IO']) ? 'Warn' : 'Pass';
|
||||
} else {
|
||||
echo 'Fail';
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="dup-sys-info dup-info-box">
|
||||
<?php
|
||||
$abs_path = duplicator_get_abs_path();
|
||||
|
||||
printf("<b>%s</b> [%s] <br/>", $dup_tests['IO']['SSDIR'], DUP_Settings::getSsdirPath());
|
||||
printf("<b>%s</b> [%s] <br/>", $dup_tests['IO']['SSTMP'], DUP_Settings::getSsdirTmpPath());
|
||||
printf("<b>%s</b> [%s] <br/>", $dup_tests['IO']['WPROOT'], $abs_path);
|
||||
?>
|
||||
<div style="font-size:11px; padding-top: 3px">
|
||||
<?php
|
||||
if ($dup_tests['IO']['WPROOT'] == 'Warn') {
|
||||
echo sprintf(__('If the root WordPress path is not writable by PHP on some systems this can cause issues.', 'duplicator'), $abs_path);
|
||||
echo '<br/>';
|
||||
}
|
||||
esc_html_e("If Duplicator does not have enough permissions then you will need to manually create the paths above. ", 'duplicator');
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- SERVER SUPPORT -->
|
||||
<div class='dup-sys-req'>
|
||||
<div class='dup-sys-title'>
|
||||
<a><?php esc_html_e('Server Support', 'duplicator'); ?></a>
|
||||
<div><?php echo esc_html($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'), esc_html(DUP_DB::getVersion())); ?></td>
|
||||
<td><?php echo esc_html($dup_tests['SRV']['MYSQL_VER']); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printf("%s", esc_html__("MySQLi Support", 'duplicator')); ?></td>
|
||||
<td><?php echo esc_html($dup_tests['SRV']['MYSQLi']); ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
<small>
|
||||
<?php
|
||||
esc_html_e(
|
||||
"MySQL version 5.0+ or better is required and the PHP MySQLi extension (note the trailing 'i') is also required. " .
|
||||
"Contact your server administrator and request that mysqli extension and MySQL Server 5.0+ be installed.",
|
||||
'duplicator'
|
||||
);
|
||||
echo " <i><a href='http://php.net/manual/en/mysqli.installation.php' target='_blank'>[" . esc_html__('more info', 'duplicator') . "]</a></i>";
|
||||
?>
|
||||
</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"); ?>
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- RESERVED FILES -->
|
||||
<div class='dup-sys-req'>
|
||||
<div class='dup-sys-title'>
|
||||
<a><?php esc_html_e('Reserved Files', 'duplicator'); ?></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') : ?>
|
||||
<?php
|
||||
esc_html_e("None of the reserved files where found from a previous install. This means you are clear to create a new Backup.", 'duplicator');
|
||||
echo " [" . esc_html($dup_intaller_files) . "]";
|
||||
?>
|
||||
<?php
|
||||
else :
|
||||
$duplicator_nonce = wp_create_nonce('duplicator_cleanup_page');
|
||||
?>
|
||||
<form method="post" action="admin.php?page=duplicator-tools&tab=diagnostics§ion=info&action=installer&_wpnonce=<?php echo esc_js($duplicator_nonce); ?>">
|
||||
<b><?php esc_html_e('WordPress Root Path:', 'duplicator'); ?></b>
|
||||
<?php echo esc_html(duplicator_get_abs_path()); ?><br/>
|
||||
<?php esc_html_e("A reserved file(s) was found in the WordPress root directory. Reserved file names include [{$dup_intaller_files}]. " .
|
||||
" To archive your data correctly please remove any of these files from your WordPress root directory. " .
|
||||
" Then try creating your Backup again.", 'duplicator'); ?>
|
||||
<br/><input type='submit' class='button button-small' value='<?php esc_attr_e('Remove Files Now', 'duplicator') ?>' style='font-size:10px; margin-top:5px;' />
|
||||
</form>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div><br/>
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
<!-- ============================
|
||||
FORM PACKAGE OPTIONS -->
|
||||
<div style="padding:5px 5px 2px 5px">
|
||||
<?php include('s1.setup2.php'); ?>
|
||||
</div>
|
||||
|
||||
<!-- 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>
|
||||
|
||||
<script>
|
||||
jQuery(document).ready(function ($)
|
||||
{
|
||||
Duplicator.Pack.checkPageCache = function ()
|
||||
{
|
||||
var $state = $('#cache_state');
|
||||
if ($state.val() == "") {
|
||||
$state.val("fresh-load");
|
||||
} else {
|
||||
$state.val("cached");
|
||||
<?php
|
||||
$redirect = ControllersManager::getMenuLink(
|
||||
ControllersManager::PACKAGES_SUBMENU_SLUG,
|
||||
'new1'
|
||||
);
|
||||
$redirect_nonce_url = wp_nonce_url($redirect, 'new1-package');
|
||||
echo "window.location.href = '{$redirect_nonce_url}'";
|
||||
?>
|
||||
}
|
||||
}
|
||||
|
||||
//INIT
|
||||
Duplicator.Pack.checkPageCache();
|
||||
|
||||
//Toggle for system requirement detail links
|
||||
$('.dup-sys-title a').each(function () {
|
||||
$(this).attr('href', 'javascript:void(0)');
|
||||
$(this).click({selector: '.dup-sys-info'}, Duplicator.Pack.ToggleSystemDetails);
|
||||
$(this).prepend("<span class='ui-icon ui-icon-triangle-1-e dup-toggle' />");
|
||||
});
|
||||
|
||||
//Color code Pass/Fail/Warn items
|
||||
$('.dup-sys-title div').each(function () {
|
||||
console.log($(this).text());
|
||||
var state = $(this).text().trim();
|
||||
$(this).removeClass();
|
||||
$(this).addClass((state == 'Pass') ? 'dup-sys-pass' : 'dup-sys-fail');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,680 @@
|
||||
<?php
|
||||
|
||||
use Duplicator\Core\Controllers\ControllersManager;
|
||||
use Duplicator\Core\Views\TplMng;
|
||||
use Duplicator\Utils\LinkManager;
|
||||
|
||||
defined('ABSPATH') || defined('DUPXABSPATH') || exit;
|
||||
?>
|
||||
<style>
|
||||
/* -----------------------------
|
||||
PACKAGE OPTS*/
|
||||
form#dup-form-opts label {line-height:22px}
|
||||
form#dup-form-opts input[type=checkbox] {margin-top:3px}
|
||||
form#dup-form-opts textarea, input[type="text"] {width:100%}
|
||||
|
||||
textarea#package-notes {height:75px;}
|
||||
div.dup-notes-add {float:right; margin:-4px 2px 4px 0;}
|
||||
div#dup-notes-area {display:none}
|
||||
input#package-name {padding:4px; height: 2em; font-size: 1.2em; line-height: 100%; width: 100%; margin: 0 0 3px;}
|
||||
tr.dup-store-path td {padding:14px}
|
||||
label.lbl-larger {font-size:1.2em}
|
||||
div.tab-hdr-title {font-size: 16px; font-weight: bold; padding: 1px; margin:2px 0 5px 0; border-bottom:1px solid #dcdcde }
|
||||
|
||||
/*EXPANDER TITLE BOXES */
|
||||
div.dup-box-title div.dup-title-txt {float:left}
|
||||
div.dup-box-title
|
||||
div.dup-title-icons { margin-top:-5px; font-weight:normal; font-size:13px; float:left}
|
||||
div.dup-box-title div.dup-title-icons > span {border-left:1px solid silver; padding:2px 14px 5px 14px; user-select:none}
|
||||
span#dup-installer-secure-lock, span#dup-installer-secure-unlock {border:none; padding:0 12px 5px 2px;}
|
||||
span#dup-installer-secure-lock {border:none; padding:0 12px 5px 2px;}
|
||||
|
||||
/*TAB-1: ARCHIVE SECTION*/
|
||||
form#dup-form-opts div.tabs-panel{max-height:800px; padding:15px 20px 20px 20px; min-height:280px}
|
||||
|
||||
/* TAB-2: DATABASE */
|
||||
table#dup-dbtables td {padding:0 20px 5px 10px;}
|
||||
label.core-table,
|
||||
label.non-core-table {padding:2px 0 2px 0; font-size:14px; display: inline-block}
|
||||
label.core-table {color:#9A1E26;font-style:italic;font-weight:bold}
|
||||
i.core-table-info {color:#9A1E26;font-style:italic;}
|
||||
label.non-core-table {color:#000}
|
||||
label.non-core-table:hover, label.core-table:hover {text-decoration:line-through}
|
||||
table.dbmysql-compatibility {margin-top:-10px}
|
||||
table.dbmysql-compatibility td{padding:0 20px 0 2px}
|
||||
div.dup-store-pro {font-size:12px; font-style:italic;}
|
||||
div.dup-store-pro img {height:14px; width:14px; vertical-align:text-top}
|
||||
div.dup-store-pro a {text-decoration:underline}
|
||||
span.dup-pro-text {font-style:italic; font-size:12px; color:#555; font-style:italic }
|
||||
div#dup-exportdb-items-checked, div#dup-exportdb-items-off {min-height:275px; display:none}
|
||||
div#dup-exportdb-items-checked {padding: 5px; max-width:700px}
|
||||
div.dup-tbl-scroll {white-space:nowrap; height:350px; overflow-y: scroll; border:1px solid silver; padding:5px 10px; border-radius: 2px;
|
||||
background:#fafafa; margin:3px 0 0 0; width:98%}
|
||||
|
||||
/*INSTALLER SECTION*/
|
||||
div.dup-installer-header-1 {font-weight:bold; padding-bottom:2px; width:100%}
|
||||
div.dup-install-hdr-2 {font-weight:bold; border-bottom:1px solid #dfdfdf; padding-bottom:2px; width:100%}
|
||||
span#dup-installer-secure-lock {color:#A62426; display:none; font-size:14px}
|
||||
span#dup-installer-secure-unlock {display:none; font-size:14px}
|
||||
span#dup-installer-secure-lock {display:none; font-size:14px}
|
||||
label.chk-labels {display:inline-block; margin-top:1px}
|
||||
table.dup-install-setup {width:100%; margin-left:2px}
|
||||
table.dup-install-setup tr{vertical-align: top}
|
||||
div.dup-installer-panel-optional {text-align: center; font-style: italic; font-size: 12px; color:maroon}
|
||||
label.secure-pass-lbl {display:inline-block; width:125px}
|
||||
div#dup-pass-toggle {position: relative; margin:8px 0 0 0; width:243px}
|
||||
input#secure-pass {border-radius:4px 0 0 4px; width:214px; height:30px; min-height: auto; margin:0; padding: 0 4px;}
|
||||
button#secure-btn {height:30px; width:30px; position:absolute; top:0px; right:0px; border:1px solid silver; border-radius:0 4px 4px 0; cursor:pointer;}
|
||||
div.dup-install-prefill-tab-pnl.tabs-panel {overflow:visible;}
|
||||
|
||||
/*TABS*/
|
||||
ul.add-menu-item-tabs li, ul.category-tabs li {padding:3px 30px 5px}
|
||||
div.dup-install-prefill-tab-pnl {min-height:180px !important; }
|
||||
</style>
|
||||
<?php
|
||||
$action_url = ControllersManager::getMenuLink(ControllersManager::PACKAGES_SUBMENU_SLUG, 'new2', null, ['retry' => $retry_state]);
|
||||
$action_nonce_url = wp_nonce_url($action_url, 'new2-package');
|
||||
$storage_position = DUP_Settings::Get('storage_position');
|
||||
?>
|
||||
<form id="dup-form-opts" method="post" action="<?php echo $action_nonce_url; ?>" data-parsley-validate="" autocomplete="oldpassword">
|
||||
<input type="hidden" id="dup-form-opts-action" name="action" value="">
|
||||
<?php wp_nonce_field('dup_form_opts', 'dup_form_opts_nonce_field', false); ?>
|
||||
|
||||
<div>
|
||||
<label for="package-name" class="lbl-larger"><b> <?php esc_html_e('Name', 'duplicator') ?>:</b> </label>
|
||||
<div class="dup-notes-add">
|
||||
<a href="javascript:void(0)" onclick="jQuery('#dup-notes-area').toggle()">
|
||||
[<?php esc_html_e('Add Notes', 'duplicator') ?>]
|
||||
</a>
|
||||
</div>
|
||||
<a href="javascript:void(0)" onclick="Duplicator.Pack.ResetName()" title="<?php esc_attr_e('Toggle a default name', 'duplicator') ?>"><i class="fa fa-undo"></i></a> <br/>
|
||||
<input id="package-name" name="package-name" type="text" value="<?php echo esc_html($Package->Name); ?>" maxlength="40" data-required="true" data-regexp="^[0-9A-Za-z|_]+$" /> <br/>
|
||||
<div id="dup-notes-area">
|
||||
<label class="lbl-larger"><b> <?php esc_html_e('Notes', 'duplicator') ?>:</b></label> <br/>
|
||||
<textarea id="package-notes" name="package-notes" maxlength="300" /><?php echo esc_html($Package->Notes); ?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<br/>
|
||||
|
||||
<!-- ===================
|
||||
STORAGE -->
|
||||
<div class="dup-box">
|
||||
<div class="dup-box-title">
|
||||
<i class="fas fa-server fa-fw fa-sm"></i>
|
||||
<?php esc_html_e("Storage", 'duplicator'); ?>
|
||||
<div class="dup-box-arrow"></div>
|
||||
</div>
|
||||
<div class="dup-box-panel" id="dup-pack-storage-panel" style="<?php echo esc_html($ui_css_storage); ?>">
|
||||
<div style="padding:0 5px 3px 0">
|
||||
<span class="dup-guide-txt-color">
|
||||
<?php esc_html_e("This is the storage location on this server where the Backup and installer files will be saved.", 'duplicator'); ?>
|
||||
</span>
|
||||
<div style="float:right">
|
||||
<a href="admin.php?page=duplicator-settings&tab=storage"><?php esc_html_e("[Storage Options]", 'duplicator'); ?> </a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table class="widefat package-tbl" style="margin-bottom:15px" >
|
||||
<thead>
|
||||
<tr>
|
||||
<th style='width:30px'></th>
|
||||
<th style='width:200px'><?php esc_html_e("Name", 'duplicator'); ?></th>
|
||||
<th style='width:100px'><?php esc_html_e("Type", 'duplicator'); ?></th>
|
||||
<th style="white-space:nowrap"><?php esc_html_e("Location", 'duplicator'); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="dup-store-path">
|
||||
<td>
|
||||
<input type="checkbox" checked="checked" disabled="disabled" style="margin-top:-2px"/>
|
||||
</td>
|
||||
<td>
|
||||
<?php esc_html_e('Default', 'duplicator');?>
|
||||
<i>
|
||||
<?php
|
||||
if ($storage_position === DUP_Settings::STORAGE_POSITION_LEGACY) {
|
||||
esc_html_e("(Legacy Path)", 'duplicator');
|
||||
} else {
|
||||
esc_html_e("(Contents Path)", 'duplicator');
|
||||
}
|
||||
?>
|
||||
</i>
|
||||
</td>
|
||||
<td>
|
||||
<i class="far fa-hdd fa-fw"></i>
|
||||
<?php esc_html_e("Local", 'duplicator'); ?>
|
||||
</td>
|
||||
<td><?php echo DUP_Settings::getSsdirPath(); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="4" class="dup-store-promo-area">
|
||||
<div class="dup-store-pro">
|
||||
<span class="dup-pro-text">
|
||||
<?php echo sprintf(
|
||||
__('Back up this site to %1$s, %2$s, %3$s, %4$s, %5$s and other locations with ', 'duplicator'),
|
||||
'<i class="fab fa-aws fa-fw"></i> ' . 'Amazon',
|
||||
'<i class="fab fa-dropbox fa-fw"></i> ' . 'Dropbox',
|
||||
'<i class="fab fa-google-drive fa-fw"></i> ' . 'Google Drive',
|
||||
'<i class="fas fa-cloud fa-fw"></i> ' . 'OneDrive',
|
||||
'<i class="fas fa-network-wired fa-fw"></i> ' . 'FTP/SFTP'
|
||||
);
|
||||
?>
|
||||
<a href="<?php echo esc_url(LinkManager::getCampaignUrl('package-build-setup', 'Additional Storages')); ?>" target="_blank">
|
||||
<?php esc_html_e('Duplicator Pro', 'duplicator');?>
|
||||
</a>
|
||||
<i class="fas fa-question-circle"
|
||||
data-tooltip-title="<?php esc_attr_e("Additional Storage:", 'duplicator'); ?>"
|
||||
data-tooltip="<?php esc_attr_e('Duplicator Pro allows you to create a Backup and store it at a custom location on this server or to a remote '
|
||||
. 'cloud location such as Google Drive, Amazon, Dropbox and many more.', 'duplicator'); ?>">
|
||||
</i>
|
||||
</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div><br/>
|
||||
|
||||
|
||||
<!-- ============================
|
||||
ARCHIVE -->
|
||||
<div class="dup-box">
|
||||
<div class="dup-box-title">
|
||||
<div class="dup-title-txt">
|
||||
<i class="far fa-file-archive"></i>
|
||||
<?php
|
||||
_e('Backup', 'duplicator');
|
||||
echo " <sup class='archive-ext'>{$archive_build_mode}</sup>";
|
||||
?>
|
||||
</div>
|
||||
<div class="dup-title-icons" >
|
||||
<span id="dup-archive-filter-file" title="<?php esc_attr_e('File filter enabled', 'duplicator') ?>">
|
||||
<i class="far fa-copy fa-fw"></i>
|
||||
<sup><i class="fa fa-filter fa-sm"></i></sup>
|
||||
</span>
|
||||
<span id="dup-archive-filter-db" title="<?php esc_attr_e('Database filter enabled', 'duplicator') ?>">
|
||||
<i class="fa fa-table fa-fw"></i>
|
||||
<sup><i class="fa fa-filter fa-sm"></i></sup>
|
||||
</span>
|
||||
<span id="dup-archive-db-only" title="<?php esc_attr_e('Backup Only the Database', 'duplicator') ?>">
|
||||
<i class="fas fa-database fa-fw"></i> <?php esc_html_e('Database Only', 'duplicator') ?>
|
||||
<sup> </sup>
|
||||
</span>
|
||||
</div>
|
||||
<div class="dup-box-arrow"></div>
|
||||
</div>
|
||||
<div class="dup-box-panel" id="dup-pack-archive-panel" style="<?php echo esc_html($ui_css_archive); ?>">
|
||||
<input type="hidden" name="archive-format" value="ZIP" />
|
||||
|
||||
<!-- NESTED TABS -->
|
||||
<div data-dup-tabs='true'>
|
||||
<ul>
|
||||
<li><?php esc_html_e('Files', 'duplicator') ?></li>
|
||||
<li><?php esc_html_e('Database', 'duplicator') ?></li>
|
||||
<li><?php esc_html_e('File Backup Encryption', 'duplicator') ?></li>
|
||||
</ul>
|
||||
|
||||
<!-- TAB1:PACKAGE -->
|
||||
<?php TplMng::getInstance()->render('admin_pages/packages/setup/archive-filter-files-tab', array (
|
||||
'package' => $Package
|
||||
)); ?>
|
||||
|
||||
<!-- TAB2: DATABASE -->
|
||||
<div>
|
||||
<div class="tab-hdr-title">
|
||||
<?php esc_html_e('Filters', 'duplicator') ?>
|
||||
</div>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td><input type="checkbox" id="dbfilter-on" name="dbfilter-on" onclick="Duplicator.Pack.ToggleDBFilters()" <?php echo ($Package->Database->FilterOn) ? "checked='checked'" : ""; ?> /></td>
|
||||
<td>
|
||||
<label for="dbfilter-on"><?php esc_html_e("Enable Table Filters", 'duplicator') ?> </label>
|
||||
<i class="fas fa-question-circle fa-sm"
|
||||
data-tooltip-title="<?php esc_attr_e("Enable Table Filters:", 'duplicator'); ?>"
|
||||
data-tooltip="<?php esc_attr_e('Checked tables will not be added to the database script. Excluding certain tables can possibly cause your site or plugins to not work correctly after install!', 'duplicator'); ?>">
|
||||
</i>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div id="dup-db-filter-items">
|
||||
<div style="float:right; padding-right:10px;">
|
||||
<a href="javascript:void(0)" id="dball" onclick="jQuery('#dup-dbtables .checkbox').prop('checked', true).trigger('click');"><?php esc_html_e('Include All', 'duplicator'); ?></a>
|
||||
<a href="javascript:void(0)" id="dbnone" onclick="jQuery('#dup-dbtables .checkbox').prop('checked', false).trigger('click');"><?php esc_html_e('Exclude All', 'duplicator'); ?></a>
|
||||
</div>
|
||||
<div class="dup-tbl-scroll">
|
||||
<?php
|
||||
$tables = $wpdb->get_results("SHOW FULL TABLES FROM `" . esc_sql(DB_NAME) . "` WHERE Table_Type = 'BASE TABLE' ", ARRAY_N);
|
||||
$num_rows = count($tables);
|
||||
$next_row = round($num_rows / 4, 0);
|
||||
$counter = 0;
|
||||
$tableList = explode(',', $Package->Database->FilterTables);
|
||||
|
||||
echo '<table id="dup-dbtables"><tr><td valign="top">';
|
||||
foreach ($tables as $table) {
|
||||
if (DUP_Util::isTableExists($table[0])) {
|
||||
if (DUP_Util::isWPCoreTable($table[0])) {
|
||||
$core_css = 'core-table';
|
||||
$core_note = '*';
|
||||
} else {
|
||||
$core_css = 'non-core-table';
|
||||
$core_note = '';
|
||||
}
|
||||
|
||||
if (in_array($table[0], $tableList)) {
|
||||
$checked = 'checked="checked"';
|
||||
$css = 'text-decoration:line-through';
|
||||
} else {
|
||||
$checked = '';
|
||||
$css = '';
|
||||
}
|
||||
echo "<label for='dbtables-{$table[0]}' style='{$css}' class='{$core_css}'>"
|
||||
. "<input class='checkbox dbtable' $checked type='checkbox' name='dbtables[]' id='dbtables-{$table[0]}' value='{$table[0]}' onclick='Duplicator.Pack.ExcludeTable(this)' />"
|
||||
. " {$table[0]}{$core_note}</label><br />";
|
||||
$counter++;
|
||||
if ($next_row <= $counter) {
|
||||
echo '</td><td valign="top">';
|
||||
$counter = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
echo '</td></tr></table>';
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="dup-tabs-opts-help">
|
||||
<?php
|
||||
_e("Checked tables will be <u>excluded</u> from the database script. ", 'duplicator');
|
||||
_e("Excluding certain tables can cause your site or plugins to not work correctly after install!<br/>", 'duplicator');
|
||||
_e("<i class='core-table-info'> Use caution when excluding tables! It is highly recommended to not exclude WordPress core tables*, unless you know the impact.</i>", 'duplicator');
|
||||
?>
|
||||
</div>
|
||||
<br/>
|
||||
|
||||
<div class="tab-hdr-title">
|
||||
<?php esc_html_e('Configuration', 'duplicator') ?>
|
||||
</div>
|
||||
|
||||
<div class="db-configuration" style="line-height: 30px">
|
||||
|
||||
<?php esc_html_e("SQL Mode", 'duplicator') ?>:
|
||||
<a href="?page=duplicator-settings&tab=package" target="settings"><?php echo esc_html($dbbuild_mode); ?></a>
|
||||
|
||||
<br/>
|
||||
<?php esc_html_e("Compatibility Mode", 'duplicator') ?>:
|
||||
<i class="fas fa-question-circle fa-sm"
|
||||
data-tooltip-title="<?php esc_attr_e("Compatibility Mode:", 'duplicator'); ?>"
|
||||
data-tooltip="<?php esc_attr_e('This is an advanced database backwards compatibility feature that should ONLY be used if having problems installing Backups.'
|
||||
. ' If the database server version is lower than the version where the Backup was built then these options may help generate a script that is more compliant'
|
||||
. ' with the older database server. It is recommended to try each option separately starting with mysql40.', 'duplicator'); ?>">
|
||||
</i>
|
||||
<small style="font-style:italic">
|
||||
<a href="https://dev.mysql.com/doc/refman/5.7/en/mysqldump.html#option_mysqldump_compatible" target="_blank">[<?php esc_html_e('details', 'duplicator'); ?>]</a>
|
||||
</small>
|
||||
|
||||
<?php if ($dbbuild_mode == 'mysqldump') :?>
|
||||
<?php
|
||||
$modes = explode(',', $Package->Database->Compatible);
|
||||
$is_mysql40 = in_array('mysql40', $modes);
|
||||
$is_no_table = in_array('no_table_options', $modes);
|
||||
$is_no_key = in_array('no_key_options', $modes);
|
||||
$is_no_field = in_array('no_field_options', $modes);
|
||||
?>
|
||||
<table class="dbmysql-compatibility">
|
||||
<tr>
|
||||
<td>
|
||||
<input type="checkbox" name="dbcompat[]" id="dbcompat-mysql40" value="mysql40" <?php echo $is_mysql40 ? 'checked="true"' : ''; ?> >
|
||||
<label for="dbcompat-mysql40"><?php esc_html_e("mysql40", 'duplicator') ?></label>
|
||||
</td>
|
||||
<td>
|
||||
<input type="checkbox" name="dbcompat[]" id="dbcompat-no_table_options" value="no_table_options" <?php echo $is_no_table ? 'checked="true"' : ''; ?>>
|
||||
<label for="dbcompat-no_table_options"><?php esc_html_e("no_table_options", 'duplicator') ?></label>
|
||||
</td>
|
||||
<td>
|
||||
<input type="checkbox" name="dbcompat[]" id="dbcompat-no_key_options" value="no_key_options" <?php echo $is_no_key ? 'checked="true"' : ''; ?>>
|
||||
<label for="dbcompat-no_key_options"><?php esc_html_e("no_key_options", 'duplicator') ?></label>
|
||||
</td>
|
||||
<td>
|
||||
<input type="checkbox" name="dbcompat[]" id="dbcompat-no_field_options" value="no_field_options" <?php echo $is_no_field ? 'checked="true"' : ''; ?>>
|
||||
<label for="dbcompat-no_field_options"><?php esc_html_e("no_field_options", 'duplicator') ?></label>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<?php else :?>
|
||||
<i><?php esc_html_e("This option is only available with mysqldump mode.", 'duplicator'); ?></i>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- TAB3: SECURITY -->
|
||||
<div>
|
||||
<p>
|
||||
<?php _e('Protect and secure the Backup file with industry-standard AES-256 encryption.', 'duplicator'); ?>
|
||||
</p>
|
||||
<a href="<?php echo esc_url(LinkManager::getCampaignUrl('package_build-securit_tab', 'Upgrade To Pro')); ?>"
|
||||
class="dup-btn dup-btn-md dup-btn-green"
|
||||
target="_blank">
|
||||
<?php _e('Upgrade To Pro', 'duplicator'); ?>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div><br/>
|
||||
|
||||
<!-- ============================
|
||||
INSTALLER -->
|
||||
<div class="dup-box">
|
||||
<div class="dup-box-title">
|
||||
<div class="dup-title-txt">
|
||||
<i class="fa fa-bolt fa-sm"></i> <?php esc_html_e('Installer', 'duplicator') ?>
|
||||
</div>
|
||||
<div class="dup-title-icons">
|
||||
<span id="dup-installer-secure-lock" title="<?php esc_attr_e('Installer password protection is on', 'duplicator') ?>">
|
||||
<i class="fas fa-lock fa-sm"></i>
|
||||
</span>
|
||||
<span id="dup-installer-secure-unlock" title="<?php esc_attr_e('Installer password protection is off', 'duplicator') ?>">
|
||||
<i class="fas fa-unlock fa-sm"></i>
|
||||
</span>
|
||||
</div>
|
||||
<div class="dup-box-arrow"></div>
|
||||
</div>
|
||||
|
||||
<div class="dup-box-panel" id="dup-pack-installer-panel" style="<?php echo esc_html($ui_css_installer); ?>">
|
||||
|
||||
<div class="dup-installer-panel-optional">
|
||||
<span class="dup-guide-txt-color">
|
||||
<?php esc_html_e("The installer file is used to redeploy/install the Backup contents.", 'duplicator'); ?>
|
||||
</span><br/>
|
||||
<b><?php esc_html_e('All values in this section are', 'duplicator'); ?> <u><?php esc_html_e('optional', 'duplicator'); ?></u></b>
|
||||
<i class="fas fa-question-circle fa-sm"
|
||||
data-tooltip-title="<?php esc_attr_e("Setup/Prefills", 'duplicator'); ?>"
|
||||
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'); ?>">
|
||||
</i>
|
||||
</div>
|
||||
|
||||
<table class="dup-install-setup" style="margin-top: -10px">
|
||||
<tr>
|
||||
<td colspan="2"><div class="dup-install-hdr-2"><?php esc_html_e("Setup", 'duplicator') ?></div></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width:130px;"><b><?php esc_html_e("Branding", 'duplicator') ?></b></td>
|
||||
<td>
|
||||
<a href="<?php echo esc_url(LinkManager::getCampaignUrl('package-build-setup', 'Installer Branding')); ?>" target="_blank">
|
||||
<span class="dup-pro-text"><?php esc_html_e('Available with Duplicator Pro!', 'duplicator'); ?></span></a>
|
||||
<i class="fas fa-question-circle fa-sm"
|
||||
data-tooltip-title="<?php esc_attr_e("Branding", 'duplicator'); ?>:"
|
||||
data-tooltip="<?php esc_attr_e('Branding is a way to customize the installer look and feel. With branding you can create multiple brands of installers.', 'duplicator'); ?>"></i>
|
||||
<br/><br/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width:130px"><b><?php esc_html_e("Security", 'duplicator') ?></b></td>
|
||||
<td>
|
||||
<?php
|
||||
$dup_install_secure_on = isset($Package->Installer->OptsSecureOn) ? $Package->Installer->OptsSecureOn : 0;
|
||||
$dup_install_secure_pass = isset($Package->Installer->OptsSecurePass) ? DUP_Util::installerUnscramble($Package->Installer->OptsSecurePass) : '';
|
||||
?>
|
||||
<input type="checkbox" name="secure-on" id="secure-on" onclick="Duplicator.Pack.EnableInstallerPassword()" <?php echo ($dup_install_secure_on) ? 'checked' : ''; ?> />
|
||||
<label for="secure-on"><?php esc_html_e("Enable Password Protection", 'duplicator') ?></label>
|
||||
<i class="fas fa-question-circle fa-sm"
|
||||
data-tooltip-title="<?php esc_attr_e("Security:", 'duplicator'); ?>"
|
||||
data-tooltip="<?php esc_attr_e('Enabling this option will allow for basic password protection on the installer. Before running the installer the '
|
||||
. 'password below must be entered before proceeding with an install. This password is a general deterrent and should not be substituted for properly '
|
||||
. 'keeping your files secure. Be sure to remove all installer files when the install process is completed.', 'duplicator'); ?>"></i>
|
||||
|
||||
<div id="dup-pass-toggle">
|
||||
<input type="password" name="secure-pass" id="secure-pass" required="required" value="<?php echo esc_attr($dup_install_secure_pass); ?>" />
|
||||
<button type="button" id="secure-btn" class="pass-toggle" onclick="Duplicator.Pack.ToggleInstallerPassword()" title="<?php esc_attr_e('Show/Hide Password', 'duplicator'); ?>"><i class="fas fa-eye fa-xs"></i></button>
|
||||
</div>
|
||||
<br/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table style="width:100%">
|
||||
<tr>
|
||||
<td colspan="2"><div class="dup-install-hdr-2"><?php esc_html_e("Prefills", 'duplicator') ?></div></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<!-- ===================
|
||||
BASIC/CPANEL TABS -->
|
||||
<div data-dup-tabs="true">
|
||||
<ul>
|
||||
<li><?php esc_html_e('Basic', 'duplicator') ?></li>
|
||||
<li id="dpro-cpnl-tab-lbl"><?php esc_html_e('cPanel', 'duplicator') ?></li>
|
||||
</ul>
|
||||
|
||||
<!-- ===================
|
||||
TAB1: Basic -->
|
||||
<div class="dup-install-prefill-tab-pnl">
|
||||
<table class="dup-install-setup">
|
||||
<tr>
|
||||
<td colspan="2"><div class="dup-install-hdr-2"><?php esc_html_e(" MySQL Server", 'duplicator') ?></div></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width:130px"><?php esc_html_e("Host", 'duplicator') ?></td>
|
||||
<td>
|
||||
<input
|
||||
type="text"
|
||||
name="dbhost"
|
||||
id="dbhost"
|
||||
value="<?php echo esc_attr($Package->Installer->OptsDBHost); ?>"
|
||||
maxlength="200"
|
||||
placeholder="<?php esc_attr_e('example: localhost (value is optional)', 'duplicator'); ?>"
|
||||
>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php esc_html_e("Host Port", 'duplicator') ?></td>
|
||||
<td>
|
||||
<input
|
||||
type="text"
|
||||
name="dbport"
|
||||
id="dbport"
|
||||
value="<?php echo esc_attr($Package->Installer->OptsDBPort); ?>"
|
||||
maxlength="200"
|
||||
placeholder="<?php esc_attr_e('example: 3306 (value is optional)', 'duplicator'); ?>"
|
||||
>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php esc_html_e("Database", 'duplicator') ?></td>
|
||||
<td>
|
||||
<input
|
||||
type="text"
|
||||
name="dbname"
|
||||
id="dbname"
|
||||
value="<?php echo esc_attr($Package->Installer->OptsDBName); ?>"
|
||||
maxlength="100"
|
||||
placeholder="<?php esc_attr_e('example: DatabaseName (value is optional)', 'duplicator'); ?>"
|
||||
>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php esc_html_e("User", 'duplicator') ?></td>
|
||||
<td>
|
||||
<input
|
||||
type="text"
|
||||
name="dbuser"
|
||||
id="dbuser"
|
||||
value="<?php echo esc_attr($Package->Installer->OptsDBUser); ?>"
|
||||
maxlength="100"
|
||||
placeholder="<?php esc_attr_e('example: DatabaseUserName (value is optional)', 'duplicator'); ?>"
|
||||
>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php esc_html_e("Charset", 'duplicator') ?></td>
|
||||
<td>
|
||||
<input
|
||||
type="text"
|
||||
name="dbcharset"
|
||||
id="dbcharset"
|
||||
value="<?php echo esc_attr($Package->Installer->OptsDBCharset); ?>"
|
||||
maxlength="100"
|
||||
placeholder="<?php esc_attr_e('example: utf8 (value is optional)', 'duplicator'); ?>"
|
||||
>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php esc_html_e("Collation", 'duplicator') ?></td>
|
||||
<td>
|
||||
<input
|
||||
type="text"
|
||||
name="dbcollation"
|
||||
id="dbcollation"
|
||||
value="<?php echo esc_attr($Package->Installer->OptsDBCollation); ?>"
|
||||
maxlength="100"
|
||||
placeholder="<?php esc_attr_e('example: utf8_general_ci (value is optional)', 'duplicator'); ?>"
|
||||
>
|
||||
</td>
|
||||
</tr>
|
||||
</table><br />
|
||||
</div>
|
||||
|
||||
<!-- ===================
|
||||
TAB2: cPanel -->
|
||||
<div class="dup-install-prefill-tab-pnl">
|
||||
<div style="padding:10px 0 0 12px;">
|
||||
<img src="<?php echo esc_url(DUPLICATOR_PLUGIN_URL . "assets/img/cpanel-48.png"); ?>" style="width:16px; height:12px" />
|
||||
<?php esc_html_e("Create the database and database user at install time without leaving the installer!", 'duplicator'); ?><br/>
|
||||
<?php esc_html_e("This feature is only availble in ", 'duplicator'); ?>
|
||||
<a href="<?php echo esc_url(LinkManager::getCampaignUrl('package-build-setup', 'cPanel')); ?>" target="_blank">
|
||||
<?php esc_html_e('Duplicator Pro!', 'duplicator');?>
|
||||
</a><br/>
|
||||
<small><i><?php esc_html_e("This feature works only with hosts that support cPanel.", 'duplicator'); ?></i></small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div><br/>
|
||||
|
||||
|
||||
<div class="dup-button-footer">
|
||||
<input type="button" value="<?php esc_attr_e("Reset", 'duplicator') ?>" class="button button-large" <?php echo ($dup_tests['Success']) ? '' : 'disabled="disabled"'; ?> onclick="Duplicator.Pack.ConfirmReset();" />
|
||||
<input type="submit" value="<?php esc_html_e("Next", 'duplicator') ?> ▶" class="button button-primary button-large" <?php echo ($dup_tests['Success']) ? '' : 'disabled="disabled"'; ?> />
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
<!-- ==========================================
|
||||
THICK-BOX DIALOGS: -->
|
||||
<?php
|
||||
$confirm1 = new DUP_UI_Dialog();
|
||||
$confirm1->title = __('Reset Backup Settings?', 'duplicator');
|
||||
$confirm1->message = __('This will clear and reset all of the current Backup settings. Would you like to continue?', 'duplicator');
|
||||
$confirm1->jscallback = 'Duplicator.Pack.ResetSettings()';
|
||||
$confirm1->initConfirm();
|
||||
|
||||
$default_name1 = DUP_Package::getDefaultName();
|
||||
$default_name2 = DUP_Package::getDefaultName(false);
|
||||
?>
|
||||
<script>
|
||||
jQuery(document).ready(function ($)
|
||||
{
|
||||
var DUP_NAMEDEFAULT1 = '<?php echo esc_js($default_name1); ?>';
|
||||
var DUP_NAMEDEFAULT2 = '<?php echo esc_js($default_name2); ?>';
|
||||
var DUP_NAMELAST = $('#package-name').val();
|
||||
|
||||
/* Appends a path to the directory filter */
|
||||
Duplicator.Pack.ToggleDBFilters = function ()
|
||||
{
|
||||
var $filterItems = $('#dup-db-filter-items');
|
||||
if ($("#dbfilter-on").is(':checked')) {
|
||||
$filterItems.removeAttr('disabled').css({color:'#000'});
|
||||
$('#dup-dbtables input').removeAttr('readonly').css({color:'#000'});
|
||||
$('#dup-archive-filter-db').show();
|
||||
$('div.dup-tbl-scroll label').css({color:'#000'});
|
||||
} else {
|
||||
$filterItems.attr('disabled', 'disabled').css({color:'#999'});
|
||||
$('#dup-dbtables input').attr('readonly', 'readonly').css({color:'#999'});
|
||||
$('div.dup-tbl-scroll label').css({color:'#999'});
|
||||
$('#dup-archive-filter-db').hide();
|
||||
}
|
||||
};
|
||||
|
||||
Duplicator.Pack.ConfirmReset = function ()
|
||||
{
|
||||
<?php $confirm1->showConfirm(); ?>
|
||||
}
|
||||
|
||||
Duplicator.Pack.ResetSettings = function ()
|
||||
{
|
||||
var key = 'duplicator_package_active';
|
||||
jQuery('#dup-form-opts-action').val(key);
|
||||
jQuery('#dup-form-opts').attr('action', '');
|
||||
jQuery('#dup-form-opts').submit();
|
||||
}
|
||||
|
||||
Duplicator.Pack.ResetName = function ()
|
||||
{
|
||||
var current = $('#package-name').val();
|
||||
switch (current) {
|
||||
case DUP_NAMEDEFAULT1 : $('#package-name').val(DUP_NAMELAST); break;
|
||||
case DUP_NAMEDEFAULT2 : $('#package-name').val(DUP_NAMEDEFAULT1); break;
|
||||
case DUP_NAMELAST : $('#package-name').val(DUP_NAMEDEFAULT2); break;
|
||||
default: $('#package-name').val(DUP_NAMELAST);
|
||||
}
|
||||
}
|
||||
|
||||
Duplicator.Pack.ExcludeTable = function (check)
|
||||
{
|
||||
var $cb = $(check);
|
||||
if ($cb.is(":checked")) {
|
||||
$cb.closest("label").css('textDecoration', 'line-through');
|
||||
} else {
|
||||
$cb.closest("label").css('textDecoration', 'none');
|
||||
}
|
||||
}
|
||||
|
||||
Duplicator.Pack.EnableInstallerPassword = function ()
|
||||
{
|
||||
var $button = $('#secure-btn');
|
||||
if ($('#secure-on').is(':checked')) {
|
||||
$('#secure-pass').attr('readonly', false);
|
||||
$('#secure-pass').attr('required', 'true').focus();
|
||||
$('#dup-installer-secure-lock').show();
|
||||
$('#dup-installer-secure-unlock').hide();
|
||||
$button.removeAttr('disabled');
|
||||
} else {
|
||||
$('#secure-pass').removeAttr('required');
|
||||
$('#secure-pass').attr('readonly', true);
|
||||
$('#dup-installer-secure-lock').hide();
|
||||
$('#dup-installer-secure-unlock').show();
|
||||
$button.attr('disabled', 'true');
|
||||
}
|
||||
};
|
||||
|
||||
Duplicator.Pack.ToggleInstallerPassword = function()
|
||||
{
|
||||
var $input = $('#secure-pass');
|
||||
var $button = $('#secure-btn');
|
||||
if (($input).attr('type') == 'text') {
|
||||
$input.attr('type', 'password');
|
||||
$button.html('<i class="fas fa-eye fa-sm fa-fw"></i>');
|
||||
} else {
|
||||
$input.attr('type', 'text');
|
||||
$button.html('<i class="fas fa-eye-slash fa-sm fa-fw"></i>');
|
||||
}
|
||||
}
|
||||
|
||||
<?php if ($retry_state == '2') :?>
|
||||
$('#dup-pack-archive-panel').show();
|
||||
$('#export-onlydb').prop( "checked", true );
|
||||
<?php endif; ?>
|
||||
|
||||
//Init:Toggle OptionTabs
|
||||
Duplicator.Pack.ToggleDBFilters();
|
||||
Duplicator.Pack.EnableInstallerPassword();
|
||||
$('input#package-name').focus().select();
|
||||
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,467 @@
|
||||
<?php
|
||||
defined('ABSPATH') || defined('DUPXABSPATH') || exit;
|
||||
|
||||
use Duplicator\Core\Controllers\ControllersManager;
|
||||
use Duplicator\Views\AdminNotices;
|
||||
|
||||
//Nonce Check
|
||||
if (! isset($_POST['dup_form_opts_nonce_field']) || ! wp_verify_nonce(sanitize_text_field($_POST['dup_form_opts_nonce_field']), 'dup_form_opts')) {
|
||||
AdminNotices::redirect('admin.php?page=duplicator&tab=new1&_wpnonce=' . wp_create_nonce('new1-package'));
|
||||
}
|
||||
|
||||
global $wp_version;
|
||||
wp_enqueue_script('dup-handlebars');
|
||||
|
||||
if (empty($_POST)) {
|
||||
//F5 Refresh Check
|
||||
$redirect = ControllersManager::getMenuLink(
|
||||
ControllersManager::PACKAGES_SUBMENU_SLUG,
|
||||
'new1'
|
||||
);
|
||||
$redirect_nonce_url = wp_nonce_url($redirect, 'new1-package');
|
||||
die("<script>window.location.href = '{$reredirect_nonce_url}'</script>");
|
||||
}
|
||||
|
||||
$Package = new DUP_Package();
|
||||
$Package->saveActive($_POST);
|
||||
|
||||
DUP_Settings::Set('active_package_id', -1);
|
||||
DUP_Settings::Save();
|
||||
|
||||
$Package = DUP_Package::getActive();
|
||||
|
||||
$mysqldump_on = DUP_Settings::Get('package_mysqldump') && DUP_DB::getMySqlDumpPath();
|
||||
$mysqlcompat_on = isset($Package->Database->Compatible) && strlen($Package->Database->Compatible);
|
||||
$mysqlcompat_on = ($mysqldump_on && $mysqlcompat_on) ? true : false;
|
||||
$dbbuild_mode = ($mysqldump_on) ? 'mysqldump' : 'PHP';
|
||||
$zip_check = DUP_Util::getZipPath();
|
||||
|
||||
$action_url = ControllersManager::getMenuLink(
|
||||
ControllersManager::PACKAGES_SUBMENU_SLUG,
|
||||
'new3'
|
||||
);
|
||||
$action_nonce_url = wp_nonce_url($action_url, 'new3-package');
|
||||
?>
|
||||
|
||||
<style>
|
||||
/*PROGRESS-BAR - RESULTS - ERROR */
|
||||
form#form-duplicator {text-align:center; max-width:750px; 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:3px; 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;}
|
||||
#dup-msg-error-response-text {
|
||||
max-height:500px;
|
||||
overflow-y:scroll;
|
||||
border:1px solid silver;
|
||||
border-radius:3px;
|
||||
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 */
|
||||
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:8px 0 8px 0; cursor:pointer; height:20px;}
|
||||
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.badge {float:right; border-radius:4px; color:#fff; min-width:40px; text-align:center; position:relative; right:10px; font-size:12px; padding:0 3px 1px 3px}
|
||||
div.scan-item div.badge-pass {background:#197b19;}
|
||||
div.scan-item div.badge-warn {background:#636363;}
|
||||
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:#d61212;font-weight:bold;}
|
||||
div.dup-more-details {float:right; font-size:14px}
|
||||
div.dup-more-details a{color:black}
|
||||
div.dup-more-details a:hover {color:#777; cursor:pointer}
|
||||
div.dup-more-details:hover {color:#777; cursor:pointer}
|
||||
|
||||
div.help-tab-content span.badge-pass{display:inline-block; border-radius:4px; color:#fff; min-width:40px; text-align:center;padding:0 3px 1px 3px; background: #197b19; margin-top:4px}
|
||||
div.help-tab-content span.badge-warn{display:inline-block; border-radius:4px; color:#fff; min-width:40px; text-align:center;padding:0 3px 1px 3px; background: #636363; margin-top:4px}
|
||||
|
||||
/*FILES */
|
||||
div#data-arc-size1 {display:inline-block; font-size:11px; margin-right:1px;}
|
||||
sup.dup-small-ext-type {font-size:11px; font-weight: normal; font-style: italic}
|
||||
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:4px; 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 {padding:8px; line-height:21px; height:175px; overflow-y:scroll; }
|
||||
div.hb-files-style div.hdrs {padding:0 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}
|
||||
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;display:inline-block; width:475px; white-space: nowrap; overflow:hidden; text-overflow:ellipsis;}
|
||||
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; width:100%}
|
||||
div.hb-files-style div.apply-warn {float:left; font-size:11px; color:maroon; margin-top:-7px; font-style: italic; display:none; text-align: left}
|
||||
|
||||
div#size-more-details {display:none; margin:5px 0 20px 0; border:1px solid #dfdfdf; padding:8px; border-radius: 4px; background-color: #F1F1F1}
|
||||
div#size-more-details ul {list-style-type:circle; padding-left:20px; margin:0}
|
||||
div#size-more-details li {margin:0}
|
||||
|
||||
/*DATABASE*/
|
||||
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: 4px}
|
||||
div#data-db-tablelist td{padding:0 5px 3px 20px; min-width:100px}
|
||||
div#data-db-size1, div#data-ll-totalsize {display:inline-block; font-size:11px; margin-right:1px;}
|
||||
/*FILES */
|
||||
div#dup-confirm-area {color:maroon; display:none; text-align: center; font-size:14px; line-height:24px; font-weight: bold; margin: -5px 0 10px 0}
|
||||
div#dup-confirm-area label {font-size:14px !important}
|
||||
|
||||
/*WARNING-CONTINUE*/
|
||||
div#dup-scan-warning-continue {display:none; text-align:center; padding:0 0 15px 0}
|
||||
div#dup-scan-warning-continue div.msg2 {padding:2px; line-height:13px; font-size:11px !important;}
|
||||
div.dup-pro-support {text-align:center; font-style:italic; font-size:13px; margin-top:20px;font-weight:bold}
|
||||
|
||||
/*DIALOG WINDOWS*/
|
||||
div#arc-details-dlg {font-size:12px; line-height:18px !important}
|
||||
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 table#db-area {margin:0; width:98%}
|
||||
div#arc-details-dlg table#db-area td {padding:0;}
|
||||
div#arc-details-dlg table#db-area td:first-child {font-weight:bold; white-space:nowrap; width:100px}
|
||||
div#arc-details-dlg div.filter-area {height:245px; 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.file-info i.fa-question-circle { margin-right: 5px; font-size: 11px;}
|
||||
|
||||
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}
|
||||
|
||||
/*FOOTER*/
|
||||
div.dup-button-footer {text-align:center; margin:0}
|
||||
button.button {font-size:15px !important; height:30px !important; font-weight:bold; padding:3px 5px 5px 5px !important;}
|
||||
i.scan-warn {color:#630f0f;}
|
||||
</style>
|
||||
|
||||
<?php
|
||||
$validator = $Package->validateInputs();
|
||||
if (!$validator->isSuccess()) {
|
||||
?>
|
||||
<form id="form-duplicator" method="post" action="<?php echo $action_nonce_url; ?>">
|
||||
<!-- ERROR MESSAGE -->
|
||||
<div id="dup-msg-error" >
|
||||
<div class="dup-hdr-error"><i class="fa fa-exclamation-circle"></i> <?php _e('Input fields not valid', 'duplicator'); ?></div>
|
||||
<i><?php esc_html_e('Please try again!', 'duplicator'); ?></i><br/>
|
||||
<div class="dup-hdr-error-details">
|
||||
<b><?php esc_html_e("Error Message:", 'duplicator'); ?></b>
|
||||
<div id="dup-msg-error-response-text">
|
||||
<ul>
|
||||
<?php
|
||||
$validator->getErrorsFormat("<li>%s</li>");
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<input type="button" value="◀ <?php esc_html_e("Back", 'duplicator') ?>" onclick="window.location.assign('?page=duplicator&tab=new1&_wpnonce=<?php echo wp_create_nonce('new1-package'); ?>')" class="button button-large" />
|
||||
</form>
|
||||
<?php
|
||||
return;
|
||||
}
|
||||
?>
|
||||
|
||||
<!-- =========================================
|
||||
TOOL BAR:STEPS -->
|
||||
<table id="dup-toolbar">
|
||||
<tr valign="top">
|
||||
<td style="white-space:nowrap">
|
||||
<div id="dup-wiz">
|
||||
<div id="dup-wiz-steps">
|
||||
<div class="completed-step"><a>1 <?php esc_html_e('Setup', 'duplicator'); ?></a></div>
|
||||
<div class="active-step"><a>2 <?php esc_html_e('Scan', 'duplicator'); ?> </a></div>
|
||||
<div><a>3 <?php esc_html_e('Build', 'duplicator'); ?> </a></div>
|
||||
</div>
|
||||
<div id="dup-wiz-title" class="dup-guide-txt-color">
|
||||
<i class="fab fa-wordpress"></i>
|
||||
<?php esc_html_e('Step 2: Scan site for configuration & system notices.', 'duplicator'); ?>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
</table>
|
||||
<hr class="dup-toolbar-line">
|
||||
|
||||
<form id="form-duplicator" method="post" action="<?php echo $action_nonce_url; ?>">
|
||||
<?php wp_nonce_field('dup_form_opts', 'dup_form_opts_nonce_field', false); ?>
|
||||
|
||||
<!-- PROGRESS BAR -->
|
||||
<div id="dup-scan-progress-bar-wrapper">
|
||||
<?php do_action('duplicator_scan_progress_header'); ?>
|
||||
<div id="dup-progress-bar-area">
|
||||
<div class="dup-progress-title"><i class="fas fa-circle-notch fa-spin"></i> <?php esc_html_e('Scanning Site', 'duplicator'); ?></div>
|
||||
<div id="dup-progress-bar"></div>
|
||||
<b><?php esc_html_e('Please Wait...', 'duplicator'); ?></b><br/><br/>
|
||||
<i><?php esc_html_e('Keep this window open during the scan process.', 'duplicator'); ?></i><br/>
|
||||
<i><?php esc_html_e('This can take several minutes.', 'duplicator'); ?></i><br/>
|
||||
</div>
|
||||
<?php do_action('duplicator_scan_progress_footer'); ?>
|
||||
</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'); ?></div>
|
||||
<i><?php esc_html_e('Please try again!', 'duplicator'); ?></i><br/>
|
||||
<div class="dup-hdr-error-details">
|
||||
<b><?php esc_html_e("Server Status:", 'duplicator'); ?></b>
|
||||
<div id="dup-msg-error-response-status" style="display:inline-block"></div><br/>
|
||||
|
||||
<b><?php esc_html_e("Error Message:", 'duplicator'); ?></b>
|
||||
<div id="dup-msg-error-response-text"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- SUCCESS MESSAGE -->
|
||||
<div id="dup-msg-success" style="display:none">
|
||||
|
||||
<div style="text-align:center">
|
||||
<div class="dup-hdr-success"><i class="far fa-check-square fa-lg"></i> <?php esc_html_e('Scan Complete', 'duplicator'); ?></div>
|
||||
<div id="dup-msg-success-subtitle">
|
||||
<?php esc_html_e('Scan Time:', 'duplicator'); ?> <span id="data-rpt-scantime"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="details">
|
||||
<?php
|
||||
include('s2.scan2.php');
|
||||
echo '<br/>';
|
||||
include('s2.scan3.php');
|
||||
?>
|
||||
</div>
|
||||
|
||||
<!-- WARNING CONTINUE -->
|
||||
<div id="dup-scan-warning-continue">
|
||||
<div class="msg2">
|
||||
<?php
|
||||
_e("Scan checks are not required to pass, however they could cause issues on some systems.", 'duplicator');
|
||||
echo '<br/>';
|
||||
_e("Please review the details for each section by clicking on the detail title.", 'duplicator');
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="dup-confirm-area">
|
||||
<label for="duplicator-confirm-check"><?php esc_html_e('Do you want to continue?', 'duplicator');
|
||||
echo '<br/> ';
|
||||
esc_html_e('At least one or more checkboxes were checked in "Quick Filters".', 'duplicator') ?><br/>
|
||||
<i style="font-weight:normal"><?php esc_html_e('To apply a "Quick Filter" click the "Add Filters & Rescan" button', 'duplicator') ?></i><br/>
|
||||
<input type="checkbox" id="duplicator-confirm-check" onclick="jQuery('#dup-build-button').removeAttr('disabled');">
|
||||
<?php esc_html_e('Yes. Continue without applying any file filters.', 'duplicator') ?></label><br/>
|
||||
</div>
|
||||
|
||||
<div class="dup-button-footer" style="display:none">
|
||||
<input type="button" value="◀ <?php esc_html_e("Back", 'duplicator') ?>" onclick="window.location.assign('?page=duplicator&tab=new1&_wpnonce=<?php echo wp_create_nonce('new1-package');?>')" class="button button-large" />
|
||||
<input type="button" value="<?php esc_attr_e("Rescan", 'duplicator') ?>" onclick="Duplicator.Pack.rescan()" class="button button-large" />
|
||||
<input type="submit" onclick="return Duplicator.Pack.startBuild();" value="<?php esc_attr_e("Build", 'duplicator') ?> ▶" class="button button-primary button-large" id="dup-build-button" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
<script>
|
||||
jQuery(document).ready(function($)
|
||||
{
|
||||
// Performs ajax call to get scanner retults via JSON response
|
||||
Duplicator.Pack.runScanner = function()
|
||||
{
|
||||
var data = {action : 'duplicator_package_scan',file_notice:'<?= $core_file_notice; ?>',dir_notice:'<?= $core_dir_notice; ?>', nonce: '<?php echo wp_create_nonce('duplicator_package_scan'); ?>'}
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
dataType: "text",
|
||||
cache: false,
|
||||
url: ajaxurl,
|
||||
timeout: 10000000,
|
||||
data: data,
|
||||
complete: function() {$('.dup-button-footer').show()},
|
||||
success: function(respData, textStatus, xHr) {
|
||||
try {
|
||||
var data = Duplicator.parseJSON(respData);
|
||||
} catch(err) {
|
||||
console.error(err);
|
||||
console.error('JSON parse failed for response data: ' + respData);
|
||||
$('#dup-scan-progress-bar-wrapper').hide();
|
||||
var status = xHr.status + ' -' + xHr.statusText;
|
||||
$('#dup-msg-error-response-status').html(status)
|
||||
$('#dup-msg-error-response-text').html(xHr.responseText);
|
||||
$('#dup-msg-error').show(200);
|
||||
console.log(data);
|
||||
return false;
|
||||
}
|
||||
Duplicator.Pack.loadScanData(data);
|
||||
},
|
||||
error: function(data) {
|
||||
$('#dup-scan-progress-bar-wrapper').hide();
|
||||
var status = data.status + ' -' + data.statusText;
|
||||
$('#dup-msg-error-response-status').html(status)
|
||||
$('#dup-msg-error-response-text').html(data.responseText);
|
||||
$('#dup-msg-error').show(200);
|
||||
console.log(data);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//Loads the scanner data results into the various sections of the screen
|
||||
Duplicator.Pack.loadScanData = function(data)
|
||||
{
|
||||
$('#dup-scan-progress-bar-wrapper').hide();
|
||||
|
||||
//ERROR: Data object is corrupt or empty return error
|
||||
if (data == undefined || data.RPT == undefined) {
|
||||
Duplicator.Pack.intErrorView();
|
||||
console.log('JSON Report Data:');
|
||||
console.log(data);
|
||||
return;
|
||||
}
|
||||
|
||||
console.log('scan data',data);
|
||||
|
||||
$('#data-rpt-scantime').text(data.RPT.ScanTime || 0);
|
||||
Duplicator.Pack.intServerData(data);
|
||||
Duplicator.Pack.initArchiveFilesData(data);
|
||||
Duplicator.Pack.initArchiveDBData(data);
|
||||
|
||||
//Addon Sites
|
||||
$('#data-arc-status-addonsites').html(Duplicator.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();
|
||||
|
||||
//Waring Check
|
||||
var warnCount = data.RPT.Warnings || 0;
|
||||
if (warnCount > 0) {
|
||||
$('#dup-scan-warning-continue').show();
|
||||
} else {
|
||||
$('#dup-scan-warning-continue').hide();
|
||||
$('#dup-build-button').prop("disabled",false).addClass('button-primary');
|
||||
}
|
||||
|
||||
<?php if (DUP_Settings::Get('archive_build_mode') == DUP_Archive_Build_Mode::DupArchive) :?>
|
||||
Duplicator.Pack.initLiteLimitData(data);
|
||||
<?php endif; ?>
|
||||
}
|
||||
|
||||
Duplicator.Pack.startBuild = function()
|
||||
{
|
||||
if ($('#duplicator-confirm-check').is(":checked")) {
|
||||
$('#form-duplicator').submit();
|
||||
return true;
|
||||
}
|
||||
|
||||
var sizeChecks = $('#hb-files-large-result input:checked');
|
||||
var addonChecks = $('#hb-addon-sites-result input:checked');
|
||||
var utf8Checks = $('#hb-files-utf8-result input:checked');
|
||||
if (sizeChecks.length > 0 || addonChecks.length > 0 || utf8Checks.length > 0) {
|
||||
$('#dup-confirm-area').show();
|
||||
$('#dup-build-button').prop('disabled', true);
|
||||
return false;
|
||||
} else {
|
||||
$('#form-duplicator').submit();
|
||||
}
|
||||
}
|
||||
|
||||
//Toggles each scan item to hide/show details
|
||||
Duplicator.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);
|
||||
}
|
||||
}
|
||||
|
||||
//Returns the scanner without a page refresh
|
||||
Duplicator.Pack.rescan = function()
|
||||
{
|
||||
$('#dup-msg-success,#dup-msg-error, #dup-confirm-area, .dup-button-footer').hide();
|
||||
$('#dup-scan-progress-bar-wrapper').show();
|
||||
Duplicator.Pack.runScanner();
|
||||
}
|
||||
|
||||
//Allows user to continue with build if warnings found
|
||||
Duplicator.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');
|
||||
}
|
||||
|
||||
//Show the error message if the JSON data is corrupted
|
||||
Duplicator.Pack.intErrorView = function()
|
||||
{
|
||||
var html_msg;
|
||||
html_msg = '<?php esc_html_e("Unable to perform a full scan, please try the following actions:", 'duplicator') ?><br/><br/>';
|
||||
html_msg += '<?php esc_html_e("1. Go back and create a root path directory filter to validate the site is scan-able.", 'duplicator') ?><br/>';
|
||||
html_msg += '<?php esc_html_e("2. Continue to add/remove filters to isolate which path is causing issues.", 'duplicator') ?><br/>';
|
||||
html_msg += '<?php esc_html_e("3. This message will go away once the correct filters are applied.", 'duplicator') ?><br/><br/>';
|
||||
|
||||
html_msg += '<?php esc_html_e("Common Issues:", 'duplicator') ?><ul>';
|
||||
html_msg += '<li><?php esc_html_e(
|
||||
"- On some budget hosts scanning over 30k files can lead to timeout/gateway issues. " .
|
||||
"Consider scanning only your main WordPress site and avoid trying to backup other external directories.",
|
||||
'duplicator'
|
||||
) ?></li>';
|
||||
html_msg += '<li><?php esc_html_e(
|
||||
"- Symbolic link recursion can cause timeouts. " .
|
||||
"Ask your server admin if any are present in the scan path. " .
|
||||
"If they are add the full path as a filter and try running the scan again.",
|
||||
'duplicator'
|
||||
) ?></li>';
|
||||
html_msg += '</ul>';
|
||||
$('#dup-msg-error-response-status').html('Scan Path Error [<?php echo esc_js(duplicator_get_abs_path()); ?>]');
|
||||
$('#dup-msg-error-response-text').html(html_msg);
|
||||
$('#dup-msg-error').show(200);
|
||||
}
|
||||
|
||||
//Sets various can statuses
|
||||
Duplicator.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"><?php esc_html_e("Notice", 'duplicator') ?></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"><?php esc_html_e("Good", 'duplicator') ?></div>'; break;
|
||||
case 'Fail' : result = '<div class="badge badge-warn"><?php esc_html_e("Fail", 'duplicator') ?></div>'; break;
|
||||
default :
|
||||
result = 'unable to read';
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
//PAGE INIT:
|
||||
Duplicator.UI.AnimateProgressBar('dup-progress-bar');
|
||||
Duplicator.Pack.runScanner();
|
||||
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,258 @@
|
||||
<?php
|
||||
|
||||
use Duplicator\Utils\LinkManager;
|
||||
|
||||
defined('ABSPATH') || defined('DUPXABSPATH') || exit;
|
||||
?>
|
||||
<!-- ================================================================
|
||||
SETUP -->
|
||||
<div class="details-title">
|
||||
<i class="fas fa-tasks"></i> <?php esc_html_e("Setup", 'duplicator'); ?>
|
||||
<div class="dup-more-details">
|
||||
<a href="?page=duplicator-tools&tab=diagnostics" target="_blank" title="<?php esc_attr_e('Show Diagnostics', 'duplicator');?>"><i class="fa fa-microchip"></i></a>
|
||||
<a href="site-health.php" target="_blank" title="<?php esc_attr_e('Check Site Health', 'duplicator');?>"><i class="fas fa-file-medical-alt"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- ============
|
||||
SYSTEM AND WORDPRESS -->
|
||||
<div class="scan-item scan-item-first">
|
||||
|
||||
<?php
|
||||
//TODO Login Need to go here
|
||||
|
||||
$core_dir_included = array();
|
||||
$core_files_included = array();
|
||||
$core_dir_notice = false;
|
||||
$core_file_notice = false;
|
||||
$filterDirs = explode(';', $Package->Archive->FilterDirs);
|
||||
$filterFiles = explode(';', $Package->Archive->FilterFiles);
|
||||
|
||||
if (!$Package->Archive->ExportOnlyDB && $Package->Archive->FilterOn) {
|
||||
$core_dir_included = array_intersect($filterDirs, DUP_Util::getWPCoreDirs());
|
||||
if (count($core_dir_included)) {
|
||||
$core_dir_notice = true;
|
||||
}
|
||||
|
||||
$core_files_included = array_intersect($filterFiles, DUP_Util::getWPCoreFiles());
|
||||
if (count($core_files_included)) {
|
||||
$core_file_notice = true;
|
||||
}
|
||||
}
|
||||
?>
|
||||
<div class='title' onclick="Duplicator.Pack.toggleScanItem(this);">
|
||||
<div class="text"><i class="fa fa-caret-right"></i> <?php esc_html_e('System', 'duplicator');?></div>
|
||||
<div id="data-srv-sys-all"></div>
|
||||
</div>
|
||||
<div class="info">
|
||||
<?php
|
||||
//WEB SERVER
|
||||
$web_servers = implode(', ', $GLOBALS['DUPLICATOR_SERVER_LIST']);
|
||||
echo '<span id="data-srv-php-websrv"></span> <b>' . esc_html__('Web Server', 'duplicator') . ":</b> '" . esc_attr($_SERVER['SERVER_SOFTWARE']) . "' <br/>";
|
||||
_e("Supported web servers: ", 'duplicator');
|
||||
echo "<i>" . esc_html($web_servers) . "</i>";
|
||||
|
||||
//PHP VERSION
|
||||
echo '<hr size="1" /><span id="data-srv-php-version"></span> <b>' . esc_html__('PHP Version', 'duplicator') . "</b> <br/>";
|
||||
_e('The minimum PHP version supported by Duplicator is 5.2.9. It is highly recommended to use PHP 5.3+ for improved stability. For international language support please use PHP 7.0+.', 'duplicator');
|
||||
|
||||
//OPEN_BASEDIR
|
||||
$test = ini_get("open_basedir");
|
||||
$test = ($test) ? 'ON' : 'OFF';
|
||||
echo '<hr size="1" /><span id="data-srv-php-openbase"></span> <b>' . esc_html__('PHP Open Base Dir', 'duplicator') . ":</b> '{$test}' <br/>";
|
||||
_e('Issues might occur when [open_basedir] is enabled. Work with your server admin to disable this value in the php.ini file if you’re having issues building a Backup.', 'duplicator');
|
||||
echo " <i><a href='http://php.net/manual/en/ini.core.php#ini.open-basedir' target='_blank'>[" . esc_html__('details', 'duplicator') . "]</a></i><br/>";
|
||||
|
||||
//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> <b>' . esc_html__('PHP Max Execution Time', 'duplicator') . ":</b> '{$test}' <br/>";
|
||||
_e('Timeouts may occur for larger Backups when [max_execution_time] time in the php.ini is too low. A value of 0 (recommended) indicates that PHP has no time limits. '
|
||||
. 'An attempt is made to override this value if the server allows it.', 'duplicator');
|
||||
echo '<br/><br/>';
|
||||
_e('Note: Timeouts can also be set at the web server layer, so if the PHP max timeout passes and you still see a build timeout messages, then your web server could be killing '
|
||||
. 'the process. If you are on a budget host and limited on processing time, consider using the database or file filters to shrink the size of your overall Backup. '
|
||||
. 'However use caution as excluding the wrong resources can cause your install to not work properly.', 'duplicator');
|
||||
echo " <i><a href='http://www.php.net/manual/en/info.configuration.php#ini.max-execution-time' target='_blank'>[" . esc_html__('details', 'duplicator') . "]</a></i>";
|
||||
if ($zip_check != null) {
|
||||
echo '<br/><br/>';
|
||||
echo '<span style="font-weight:bold">';
|
||||
_e('Get faster builds with Duplicator Pro with access to shell_exec zip.', 'duplicator');
|
||||
echo '</span>';
|
||||
echo " <i><a href='" . esc_url(LinkManager::getCampaignUrl('package-build-scan', 'For Shell Zip Get Pro')) . "' target='_blank'>[" . esc_html__('details', 'duplicator') . "]</a></i>";
|
||||
}
|
||||
|
||||
//MANAGED HOST
|
||||
$test = DUP_Custom_Host_Manager::getInstance()->isManaged() ? "true" : "false";
|
||||
echo '<hr size="1" /><span id="data-srv-sys-managedHost"></span> <b>' . esc_html__('Managed Host', 'duplicator') . ":</b> '{$test}' <br/>";
|
||||
_e('A managed host is a WordPress host that tightly controls the server environment so that the software running on it can be closely ‘managed’ by the hosting company. '
|
||||
. 'Managed hosts typically have constraints imposed to facilitate this management, including the locking down of certain files and directories as well as non-standard configurations.', 'duplicator');
|
||||
echo '<br/><br/>';
|
||||
_e('Duplicator Lite allows users to build a Backup on managed hosts, however, the installer may not properly install Backups created on managed hosts due to the non-standard configurations of managed hosts. '
|
||||
. 'It is also possible the Backup engine of Duplicator Lite won’t be able to capture all of the necessary data of a site running on a managed host.', 'duplicator');
|
||||
echo '<br/><br/>';
|
||||
_e('<b>Due to these constraints Lite does not officially support the migration of managed hosts.</b> ');
|
||||
printf(
|
||||
esc_html_x(
|
||||
'It\'s possible one could get the Backup to install but it may require custom manual effort.
|
||||
To get support and the advanced installer processing required for managed host support we encourage users to %1$supgrade to Duplicator Pro%2$s.
|
||||
Pro has more sophisticated Backup and installer logic and accounts for odd configurations associated with managed hosts.',
|
||||
'1 and 2 are <a> tags',
|
||||
'duplicator'
|
||||
),
|
||||
'<i><a href="' . esc_url(LinkManager::getCampaignUrl('package-build-scan', 'Managed Host Support')) . '" target="_blank">',
|
||||
'</a></i>'
|
||||
);
|
||||
echo '<br/><br/>';
|
||||
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- ============
|
||||
WP SETTINGS -->
|
||||
<div class="scan-item">
|
||||
|
||||
<div class="title" onclick="Duplicator.Pack.toggleScanItem(this);">
|
||||
<div class="text"><i class="fa fa-caret-right"></i> <?php esc_html_e('WordPress', 'duplicator');?></div>
|
||||
<div id="data-srv-wp-all"></div>
|
||||
</div>
|
||||
<div class="info">
|
||||
<?php
|
||||
//VERSION CHECK
|
||||
echo '<span id="data-srv-wp-version"></span> <b>' . esc_html__('WordPress Version', 'duplicator') . ":</b> '{$wp_version}' <br/>";
|
||||
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'), DUPLICATOR_SCAN_MIN_WP);
|
||||
|
||||
//CORE FILES
|
||||
echo '<hr size="1" /><span id="data-srv-wp-core"></span> <b>' . esc_html__('Core Files', 'duplicator') . "</b> <br/>";
|
||||
|
||||
|
||||
$filter_text = "";
|
||||
if ($core_dir_notice) {
|
||||
echo '<small id="data-srv-wp-core-missing-dirs">';
|
||||
esc_html_e("The core WordPress paths below will NOT be included in the Backup. These paths are required for WordPress to function!", 'duplicator');
|
||||
echo "<br/>";
|
||||
foreach ($core_dir_included as $core_dir) {
|
||||
echo ' <b><i class="fa fa-exclamation-circle scan-warn"></i> ' . $core_dir . '</b><br/>';
|
||||
}
|
||||
echo '</small><br/>';
|
||||
$filter_text = __("directories");
|
||||
}
|
||||
|
||||
if ($core_file_notice) {
|
||||
echo '<small id="data-srv-wp-core-missing-dirs">';
|
||||
esc_html_e("The core WordPress file below will NOT be included in the Backup. This file is required for WordPress to function!", 'duplicator');
|
||||
echo "<br/>";
|
||||
foreach ($core_files_included as $core_file) {
|
||||
echo ' <b><i class="fa fa-exclamation-circle scan-warn"></i> ' . $core_file . '</b><br/>';
|
||||
}
|
||||
echo '</small><br/>';
|
||||
$filter_text .= (strlen($filter_text) > 0) ? __(" and file") : __("files");
|
||||
}
|
||||
|
||||
if (strlen($filter_text) > 0) {
|
||||
echo '<small>';
|
||||
printf(
|
||||
esc_html__(
|
||||
'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'
|
||||
),
|
||||
esc_html($filter_text)
|
||||
);
|
||||
echo '</small>';
|
||||
}
|
||||
|
||||
|
||||
if (!$core_dir_notice && !$core_file_notice) :
|
||||
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 Backup for WordPress to work correctly.", 'duplicator');
|
||||
endif;
|
||||
|
||||
|
||||
|
||||
//CACHE DIR
|
||||
/*
|
||||
$cache_path = DUP_Util::safePath(WP_CONTENT_DIR) . '/cache';
|
||||
$cache_size = DUP_Util::byteSize(DUP_Util::getDirectorySize($cache_path));
|
||||
echo '<hr size="1" /><span id="data-srv-wp-cache"></span> <b>' . esc_html__('Cache Path', 'duplicator') . ":</b> '".esc_html($cache_path)."' (".esc_html($cache_size).") <br/>";
|
||||
_e("Cached data will lead to issues at install time and increases your Backup size. Empty your cache directory before building the Backup by using "
|
||||
. "your cache plugins clear cache feature. Use caution if manually removing files the cache folder. The cache "
|
||||
. "size minimum threshold that triggers this warning is currently set at ", 'duplicator');
|
||||
echo esc_html(DUP_Util::byteSize(DUPLICATOR_SCAN_CACHESIZE)) . '.';
|
||||
*/
|
||||
|
||||
//MU SITE
|
||||
if (is_multisite()) {
|
||||
echo '<hr size="1" /><span><div class="scan-warn"><i class="fa fa-exclamation-triangle fa-sm"></i></div></span> <b>' . esc_html__('Multisite: Unsupported', 'duplicator') . "</b> <br/>";
|
||||
esc_html_e('Duplicator does not support WordPress multisite migrations. We strongly recommend using Duplicator Pro which currently supports full multisite migrations and various other '
|
||||
. 'subsite scenarios.', 'duplicator');
|
||||
echo '<br/><br/>';
|
||||
|
||||
esc_html_e('While it is not recommended you can still continue with the build of this Backup. At install time additional manual custom configurations will '
|
||||
. 'need to be made to finalize this multisite migration. Please note that any support requests for mulitsite with Duplicator Lite will not be supported.', 'duplicator');
|
||||
echo " <i><a href='" . esc_url(LinkManager::getCampaignUrl('package-build-scan', 'Not Multisite Get Pro')) . "' target='_blank'>[" . esc_html__('upgrade to pro', 'duplicator') . "]</a></i>";
|
||||
} else {
|
||||
echo '<hr size="1" /><span><div class="scan-good"><i class="fa fa-check"></i></div></span> <b>' . esc_html__('Multisite: N/A', 'duplicator') . "</b> <br/>";
|
||||
esc_html_e('This is not a multisite install so duplication will proceed without issue. Duplicator does not officially support multisite. However, Duplicator Pro supports '
|
||||
. 'duplication of a full multisite network and also has the ability to install a multisite subsite as a standalone site.', 'duplicator');
|
||||
echo " <i><a href='" . esc_url(LinkManager::getCampaignUrl('package-build-scan', 'Multisite Get Pro')) . "' target='_blank'>[" . esc_html__('upgrade to pro', 'duplicator') . "]</a></i>";
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- ======================
|
||||
MIGRATION STATUS -->
|
||||
<div id="migratepackage-block" class="scan-item">
|
||||
<div class='title' onclick="Duplicator.Pack.toggleScanItem(this);">
|
||||
<div class="text"><i class="fa fa-caret-right"></i> <?php esc_html_e('Migration Status', 'duplicator');?></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.CanbeMigratePackage}}
|
||||
<?php esc_html_e("The Backup created here can be migrated to a new server.", 'duplicator'); ?>
|
||||
{{else}}
|
||||
<span style="color: red;">
|
||||
<?php
|
||||
esc_html_e("The Backup created here cannot be migrated to a new server.
|
||||
The Backup created here can be restored on the same server.", 'duplicator');
|
||||
?>
|
||||
</span>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
<div id="migrate-package-result"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
(function($){
|
||||
|
||||
//Ints the various server data responses from the scan results
|
||||
Duplicator.Pack.intServerData= function(data)
|
||||
{
|
||||
$('#data-srv-php-websrv').html(Duplicator.Pack.setScanStatus(data.SRV.PHP.websrv));
|
||||
$('#data-srv-php-openbase').html(Duplicator.Pack.setScanStatus(data.SRV.PHP.openbase));
|
||||
$('#data-srv-php-maxtime').html(Duplicator.Pack.setScanStatus(data.SRV.PHP.maxtime));
|
||||
$('#data-srv-php-version').html(Duplicator.Pack.setScanStatus(data.SRV.PHP.version));
|
||||
$('#data-srv-php-openssl').html(Duplicator.Pack.setScanStatus(data.SRV.PHP.openssl));
|
||||
$('#data-srv-sys-managedHost').html(Duplicator.Pack.setScanStatus(data.SRV.SYS.managedHost));
|
||||
$('#data-srv-sys-all').html(Duplicator.Pack.setScanStatus(data.SRV.SYS.ALL));
|
||||
|
||||
$('#data-srv-wp-version').html(Duplicator.Pack.setScanStatus(data.SRV.WP.version));
|
||||
$('#data-srv-wp-core').html(Duplicator.Pack.setScanStatus(data.SRV.WP.core));
|
||||
// $('#data-srv-wp-cache').html(Duplicator.Pack.setScanStatus(data.SRV.WP.cache));
|
||||
var duplicatorScanWPStatus = $('#data-srv-wp-all');
|
||||
duplicatorScanWPStatus.html(Duplicator.Pack.setScanStatus(data.SRV.WP.ALL));
|
||||
if ('Warn' == data.SRV.WP.ALL) {
|
||||
duplicatorScanWPStatus.parent().click();
|
||||
}
|
||||
}
|
||||
|
||||
})(jQuery);
|
||||
</script>
|
||||
1181
html/wp-content/plugins/duplicator/views/packages/main/s2.scan3.php
Normal file
1181
html/wp-content/plugins/duplicator/views/packages/main/s2.scan3.php
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,875 @@
|
||||
<?php
|
||||
|
||||
use Duplicator\Core\Controllers\ControllersManager;
|
||||
use Duplicator\Utils\LinkManager;
|
||||
use Duplicator\Views\EducationElements;
|
||||
use Duplicator\Views\AdminNotices;
|
||||
|
||||
defined('ABSPATH') || defined('DUPXABSPATH') || exit;
|
||||
//Nonce Check
|
||||
if (!isset($_POST['dup_form_opts_nonce_field']) || !wp_verify_nonce(sanitize_text_field($_POST['dup_form_opts_nonce_field']), 'dup_form_opts')) {
|
||||
AdminNotices::redirect('admin.php?page=duplicator&tab=new1&_wpnonce=' . wp_create_nonce('new1-package'));
|
||||
}
|
||||
require_once(DUPLICATOR_PLUGIN_PATH . 'classes/package/duparchive/class.pack.archive.duparchive.php');
|
||||
|
||||
$retry_nonuce = wp_create_nonce('new1-package');
|
||||
$zip_build_nonce = wp_create_nonce('duplicator_package_build');
|
||||
$duparchive_build_nonce = wp_create_nonce('duplicator_duparchive_package_build');
|
||||
$active_package_present = true;
|
||||
|
||||
if (DUP_Settings::Get('installer_name_mode') == DUP_Settings::INSTALLER_NAME_MODE_SIMPLE) {
|
||||
$txtInstallHelpMsg = __("When clicking the Installer download button, the 'Save as' dialog will default the name to 'installer.php'. "
|
||||
. "To improve the security and get more information, goto: Settings ❯ Backups Tab ❯ Installer Name option.", 'duplicator');
|
||||
} else {
|
||||
$txtInstallHelpMsg = __("When clicking the Installer download button, the 'Save as' dialog will save the name as '[name]_[hash]_[time]_installer.php'. "
|
||||
. "This is the secure and recommended option. For more information goto: Settings ❯ Backups Tab ❯ Installer Name Option. To quickly copy the hashed "
|
||||
. "installer name, to your clipboard use the copy icon link.", 'duplicator');
|
||||
}
|
||||
?>
|
||||
|
||||
<style>
|
||||
a#dup-create-new {margin-left:-5px}
|
||||
div#dup-progress-area {text-align:center; max-width:800px; min-height:200px; border:1px solid silver; border-radius:3px; margin:25px auto 50px auto;
|
||||
padding:0px; box-shadow:0 8px 6px -6px #999;}
|
||||
div.dup-progress-title {font-size:22px;padding:5px 0 20px 0; font-weight:bold}
|
||||
div#dup-progress-area div.inner {padding:10px; line-height:22px}
|
||||
div#dup-progress-area h2.title {background-color:#efefef; margin:0px}
|
||||
div#dup-progress-area span.label {font-weight:bold}
|
||||
div#dup-msg-success {color:#18592A; padding:5px;}
|
||||
div.dup-no-mu {font-size:13px; margin-top:15px; color:maroon; line-height:18px}
|
||||
sup.dup-new {font-weight:normal; color:#b10202; font-size:12px}
|
||||
|
||||
div.dup-msg-success-stats{color:#999;margin:5px 0; font-size:11px; line-height:13px}
|
||||
div.dup-msg-success-links {margin:20px 5px 5px 5px; font-size:13px;}
|
||||
div#dup-progress-area div.done-title {font-size:18px; font-weight:bold; margin:0px 0px 10px 0px}
|
||||
div#dup-progress-area div.dup-panel-title {background-color:#dfdfdf;}
|
||||
div.hdr-pack-complete {font-size:14px; color:green; font-weight:bold}
|
||||
|
||||
div#dup-create-area-nolink, div#dup-create-area-link {float:right; font-weight:bold; margin:0; padding:0}
|
||||
div#dup-create-area-link {display:none; margin-left:-5px}
|
||||
div#dup-progress-area div.dup-panel-panel { border-top:1px solid silver}
|
||||
fieldset.download-area {border:2px dashed #b5b5b5; padding:20px 20px 20px 20px; border-radius:4px; margin:auto; width:500px }
|
||||
fieldset.download-area legend {font-weight:bold; font-size:18px; margin:auto; color:#000}
|
||||
button#dup-btn-installer, button#dup-btn-archive { line-height:28px; min-width:175px; height:38px !important; padding-top:3px !important; }
|
||||
a#dup-link-download-both {min-width:200px; padding:3px;}
|
||||
div.one-click-download {margin:20px 0 10px 0; font-size:16px; font-weight:bold}
|
||||
div.one-click-download i.fa-bolt{padding-right:5px}
|
||||
div.one-click-download i.fa-file-archive-o{padding-right:5px}
|
||||
|
||||
div.dup-button-footer {text-align:right; margin:20px 10px 0px 0px}
|
||||
button.button {font-size:16px !important; height:30px !important; font-weight:bold; padding:0px 10px 5px 10px !important; min-width:150px }
|
||||
span.dup-btn-size {font-size:11px;font-weight:normal}
|
||||
p.get-pro {font-size:13px; color:#222; border-bottom:1px solid #eeeeee; padding-bottom: 10px; margin-bottom: 25px; font-style:italic}
|
||||
p.get-pro.subscribed {border-top: 1px solid #eeeeee; border-bottom: 0; padding:5px 0 0 0; margin:0;}
|
||||
div.dup-howto-exe {font-size:14px; font-weight:bold; margin:25px 0 40px 0;line-height:20px; color:#000; padding-top:10px;}
|
||||
div.dup-howto-exe-title {font-size:18px; margin:0 0 8px 0; color:#000}
|
||||
div.dup-howto-exe-title a {text-decoration:none; outline:none; box-shadow:none}
|
||||
div.dup-howto-exe small {font-weight:normal; display:block; margin-top:-2px; font-style:italic; font-size:12px; color:#444 }
|
||||
div.dup-howto-exe a {margin-top:8px; display:inline-block}
|
||||
div.dup-howto-exe-info {display:block; border:1px dotted #b5b5b5; padding:20px; margin:auto; width:500px; background-color:#F0F0F1; border-radius:4px;}
|
||||
div.dup-howto-exe-info a i {display:inline-block; margin:0 2px 0 2px}
|
||||
div.dup-howto-exe-area {display: flex; justify-content: center;}
|
||||
div.dup-howto-exe-txt {text-align: left; font-size:16px}
|
||||
div.dup-howto-exe-txt sup.modes {font-weight: normal; color:#999; font-style: italic;}
|
||||
div.dup-howto-exe-txt small {padding:4px 0 4px 0}
|
||||
span#dup-installer-name {display:inline-block; color:gray; font-style: italic;}
|
||||
span#dup-installer-name a {text-decoration: none}
|
||||
span#dup-installer-name-help-icon {display:none}
|
||||
|
||||
/*HOST TIMEOUT */
|
||||
div#dup-msg-error {color:maroon; padding:5px;}
|
||||
div.dup-box-title {text-align:left; background-color:#F6F6F6}
|
||||
div.dup-box-title:hover { background-color:#efefef}
|
||||
div.dup-box-panel {text-align:left}
|
||||
div.no-top {border-top:none}
|
||||
div.dup-box-panel b.opt-title {font-size:18px}
|
||||
div.dup-msg-error-area {
|
||||
overflow-y:scroll; padding:5px 15px 15px 15px;
|
||||
height:100px;
|
||||
width:95%;
|
||||
border:1px solid #EEEEEE;
|
||||
border-radius:2px;
|
||||
line-height:22px;
|
||||
text-align: left;
|
||||
background-color: #FFFFF3;
|
||||
}
|
||||
.dup-msg-error-area .data {
|
||||
white-space: pre;
|
||||
}
|
||||
div#dup-logs {text-align:center; margin:auto; padding:5px; width:350px;}
|
||||
div#dup-logs a {display:inline-block;}
|
||||
span.sub-data {display:inline-block; padding-left:20px}
|
||||
</style>
|
||||
|
||||
<!-- =========================================
|
||||
TOOL BAR:STEPS -->
|
||||
<table id="dup-toolbar">
|
||||
<tr valign="top">
|
||||
<td style="white-space:nowrap">
|
||||
<div id="dup-wiz">
|
||||
<div id="dup-wiz-steps">
|
||||
<div class="completed-step"><a>1 <?php esc_html_e('Setup', 'duplicator'); ?></a></div>
|
||||
<div class="completed-step"><a>2 <?php esc_html_e('Scan', 'duplicator'); ?> </a></div>
|
||||
<div class="active-step"><a>3 <?php esc_html_e('Build', 'duplicator'); ?> </a></div>
|
||||
</div>
|
||||
<div id="dup-wiz-title" class="dup-guide-txt-color">
|
||||
<i class="fab fa-wordpress"></i>
|
||||
<?php esc_html_e('Step 3: Build and download the Backup files.', 'duplicator'); ?>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td style="padding-bottom:4px">
|
||||
<span>
|
||||
<a id="dup-packages-btn" href="?page=duplicator" class="button <?php echo ($active_package_present ? 'no-display' : ''); ?>">
|
||||
<?php esc_html_e("Backups", 'duplicator'); ?>
|
||||
</a>
|
||||
</span>
|
||||
<?php
|
||||
$package_url = ControllersManager::getMenuLink(
|
||||
ControllersManager::PACKAGES_SUBMENU_SLUG,
|
||||
'new1'
|
||||
);
|
||||
$package_nonce_url = wp_nonce_url($package_url, 'new1-package');
|
||||
?>
|
||||
<a id="dup-create-new"
|
||||
onclick="return !jQuery(this).hasClass('disabled');"
|
||||
href="<?php echo $package_nonce_url;?>"
|
||||
class="button <?php echo ($active_package_present ? 'no-display' : ''); ?>">
|
||||
<?php esc_html_e("Create New", 'duplicator'); ?>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<hr class="dup-toolbar-line">
|
||||
|
||||
|
||||
<form id="form-duplicator" method="post" action="?page=duplicator">
|
||||
<?php wp_nonce_field('dup_form_opts', 'dup_form_opts_nonce_field', false); ?>
|
||||
|
||||
<!-- PROGRESS BAR -->
|
||||
<div id="dup-build-progress-bar-wrapper">
|
||||
<?php do_action('duplicator_build_progress_header'); ?>
|
||||
<div id="dup-progress-bar-area">
|
||||
<div class="dup-progress-title"><?php esc_html_e('Building Backup', 'duplicator'); ?> <i class="fa fa-cog fa-spin"></i> <span id="dup-progress-percent">0%</span></div>
|
||||
<div id="dup-progress-bar"></div>
|
||||
<b><?php esc_html_e('Please Wait...', 'duplicator'); ?></b><br/><br/>
|
||||
<i><?php esc_html_e('Keep this window open and do not close during the build process.', 'duplicator'); ?></i><br/>
|
||||
<i><?php esc_html_e('This may take several minutes to complete.', 'duplicator'); ?></i><br/>
|
||||
</div>
|
||||
<?php do_action('duplicator_build_progress_footer'); ?>
|
||||
</div>
|
||||
|
||||
<div id="dup-progress-area" class="dup-panel" style="display:none">
|
||||
<div class="dup-panel-title"><b style="font-size:22px"><?php esc_html_e('Build Status', 'duplicator'); ?></b></div>
|
||||
<div class="dup-panel-panel">
|
||||
|
||||
<!-- =========================
|
||||
SUCCESS MESSAGE -->
|
||||
<div id="dup-msg-success" style="display:none">
|
||||
<div class="hdr-pack-complete">
|
||||
<i class="far fa-check-square fa-lg"></i> <?php esc_html_e('Backup Build Completed', 'duplicator'); ?>
|
||||
</div>
|
||||
|
||||
<div class="dup-msg-success-stats">
|
||||
<b><?php esc_html_e('Build Time', 'duplicator'); ?>:</b> <span id="data-time"></span><br/>
|
||||
</div><br/>
|
||||
|
||||
<!-- DOWNLOAD FILES -->
|
||||
<fieldset class="download-area">
|
||||
<legend>
|
||||
<i class="fa fa-download"></i> <?php esc_html_e("Download Backup Files", 'duplicator') ?>
|
||||
</legend>
|
||||
<button id="dup-btn-installer" class="button button-primary button-large" title="<?php esc_attr_e("Click to download installer file", 'duplicator') ?>">
|
||||
<i class="fa fa-bolt fa-sm"></i> <?php esc_html_e("Installer", 'duplicator') ?>
|
||||
</button>
|
||||
<button id="dup-btn-archive" class="button button-primary button-large" title="<?php esc_attr_e("Click to download Backup file", 'duplicator') ?>">
|
||||
<i class="far fa-file-archive"></i> <?php esc_html_e("Archive", 'duplicator') ?>
|
||||
<span id="dup-btn-archive-size" class="dup-btn-size"></span>
|
||||
</button>
|
||||
<div class="one-click-download">
|
||||
<a href="javascript:void(0)" id="dup-link-download-both" title="<?php esc_attr_e("Click to download both files", 'duplicator') ?>" class="button">
|
||||
<i class="fa fa-bolt fa-sm"></i><i class="far fa-file-archive"></i>
|
||||
<?php esc_html_e("Download Both Files", 'duplicator') ?>
|
||||
</a>
|
||||
<sup>
|
||||
<i class="fas fa-question-circle fa-sm" style='font-size:11px'
|
||||
data-tooltip-title="<?php esc_attr_e("Download Both Files:", 'duplicator'); ?>"
|
||||
data-tooltip="<?php esc_attr_e('Clicking this button will open the installer and Backup download prompts one after the other with one click verses '
|
||||
. 'downloading each file separately with two clicks. On some browsers you may have to disable pop-up warnings on this domain for this to '
|
||||
. 'work correctly.', 'duplicator'); ?>">
|
||||
</i>
|
||||
</sup>
|
||||
</div>
|
||||
<div style="margin-top:20px; font-size:11px">
|
||||
<span id="dup-click-to-copy-installer-name"
|
||||
class="link-style no-decoration"
|
||||
data-dup-copy-text="<?php echo DUP_Installer::DEFAULT_INSTALLER_FILE_NAME_WITHOUT_HASH . DUP_Installer::INSTALLER_SERVER_EXTENSION; ?>">
|
||||
<?php esc_html_e("[Copy Installer Name to Clipboard]", 'duplicator'); ?>
|
||||
<i class="far fa-copy"></i>
|
||||
</span><br/>
|
||||
<span id="dup-installer-name" data-installer-name="">
|
||||
<span class="link-style" onclick="Duplicator.Pack.ShowInstallerName()">
|
||||
<?php esc_html_e("[Show Installer Name]", 'duplicator'); ?>
|
||||
</span>
|
||||
</span>
|
||||
<span id="dup-installer-name-help-icon">
|
||||
<i class="fas fa-question-circle fa-sm"
|
||||
data-tooltip-title="<?php esc_attr_e("Installer Name:", 'duplicator'); ?>"
|
||||
data-tooltip="<?php echo $txtInstallHelpMsg ?>">
|
||||
</i>
|
||||
</span>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<?php
|
||||
if (is_multisite()) {
|
||||
echo '<div class="dup-no-mu">';
|
||||
echo '<i class="fa fa-exclamation-triangle" aria-hidden="true"></i> ';
|
||||
esc_html_e('Notice:Duplicator Lite does not officially support WordPress multisite.', 'duplicator');
|
||||
echo "<br/>";
|
||||
esc_html_e('We strongly recommend upgrading to ', 'duplicator');
|
||||
echo " <i><a href='" . esc_url(LinkManager::getCampaignUrl('package-build-complete', 'Multisite Get Pro')) . "' target='_blank'>[" . esc_html__('Duplicator Pro', 'duplicator') . "]</a></i>.";
|
||||
echo '</div>';
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="dup-howto-exe">
|
||||
<div class="dup-howto-exe-title">
|
||||
<?php esc_html_e('How to install this Backup?', 'duplicator'); ?>
|
||||
</div>
|
||||
<div class="dup-howto-exe-info">
|
||||
<div class="dup-howto-exe-area">
|
||||
<div class="dup-howto-exe-txt">
|
||||
|
||||
<!-- CLASSIC -->
|
||||
<i class="far fa-save fa-sm fa-fw"></i>
|
||||
<a href="<?php echo esc_url(LinkManager::getDocUrl('classic-install', 'build_success', 'Classic Install')); ?>" target="_blank">
|
||||
<?php esc_html_e('Install to Empty Directory ', 'duplicator'); ?>
|
||||
</a>
|
||||
<sup class="modes">
|
||||
<i class="fas fa-external-link-alt fa-xs"></i>
|
||||
</sup>
|
||||
<br/>
|
||||
|
||||
<small>
|
||||
<?php
|
||||
_e('Install to an empty directory like a new WordPress install does.', 'duplicator');
|
||||
?>
|
||||
</small><br/>
|
||||
|
||||
<!-- OVERWRITE -->
|
||||
<i class="far fa-window-close fa-sm fa-fw"></i>
|
||||
<a href="<?php echo esc_url(LinkManager::getDocUrl('overwrite-install', 'build_success', 'Overwrite Install')); ?>" target="_blank">
|
||||
<?php esc_html_e('Overwrite Site', 'duplicator'); ?>
|
||||
</a>
|
||||
<sup class="modes">
|
||||
<i class="fas fa-external-link-alt fa-xs"></i>
|
||||
</sup>
|
||||
<br/>
|
||||
|
||||
<small><?php _e("Quickly overwrite an existing WordPress site in a few clicks.", 'duplicator');?></small>
|
||||
<br/>
|
||||
|
||||
|
||||
<!-- IMPORT -->
|
||||
<i class="fas fa-arrow-alt-circle-down fa-sm fa-fw"></i>
|
||||
<a href="<?php echo esc_url(LinkManager::getDocUrl('import-install', 'build_success', 'Import Install')); ?>" target="_blank">
|
||||
<?php esc_html_e('Import Backup and Overwrite Site', 'duplicator'); ?>
|
||||
</a>
|
||||
<sup class="modes">
|
||||
<i class="fas fa-external-link-alt fa-xs"></i>
|
||||
</sup>
|
||||
<br/>
|
||||
<small><?php _e("Drag and drop or use a URL for super-fast installs (requires Pro*)", 'duplicator');?></small>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<p class="get-pro<?php echo EducationElements::userIsSubscribed() ? ' subscribed' : ''; ?>">
|
||||
<a target="_blank" href="<?php echo esc_url(\Duplicator\Core\Notifications\Review::getReviewUrl()); ?>">
|
||||
<?php esc_html_e('Help review the plugin!', 'duplicator'); ?>
|
||||
</a>
|
||||
</p>
|
||||
<?php do_action('duplicator_build_success_footer'); ?>
|
||||
</div>
|
||||
|
||||
<!-- =========================
|
||||
ERROR MESSAGE -->
|
||||
<div id="dup-msg-error" style="display:none; color:#000">
|
||||
<div class="done-title"><i class="fa fa-chain-broken"></i> <?php esc_html_e('Host Build Interrupt', 'duplicator'); ?></div>
|
||||
<b><?php esc_html_e('This server cannot complete the build due to host setup constraints, see the error message for more details.', 'duplicator'); ?></b><br/>
|
||||
<i><?php esc_html_e("If the error details are not specific consider the options below by clicking each section.", 'duplicator'); ?></i>
|
||||
<br/><br/>
|
||||
|
||||
<!-- OPTION 1:Try DupArchive Engine -->
|
||||
<div class="dup-box">
|
||||
<div class="dup-box-title">
|
||||
<i class="far fa-check-circle fa-sm fa-fw"></i>
|
||||
<?php esc_html_e('Option 1: DupArchive', 'duplicator'); ?>
|
||||
<div class="dup-box-arrow"><i class="fa fa-caret-down"></i></div>
|
||||
</div>
|
||||
<div class="dup-box-panel" id="dup-pack-build-try1" style="display:none">
|
||||
|
||||
<?php esc_html_e('Enable the DupArchive format which is specific to Duplicator and designed to perform better on constrained budget hosts.', 'duplicator'); ?>
|
||||
<br/><br/>
|
||||
|
||||
<div style="font-style:italic">
|
||||
<?php
|
||||
printf(
|
||||
esc_html_x(
|
||||
'Note: DupArchive on Duplicator only supports sites up to 500MB. If your site is over 500MB then use a file filter on
|
||||
step 1 to get the size below 500MB or try the other options mentioned below. Alternatively, you may want to consider
|
||||
%1$sDuplicator Pro%2$s, which is capable of migrating sites much larger than 500MB.',
|
||||
'1: opening link tag, 2: closing link tag (<a></a>)',
|
||||
'duplicator'
|
||||
),
|
||||
'<a href="' . esc_url(LinkManager::getCampaignUrl('package-build-complete', 'Build Failed Get Pro')) . '" target="_blank">',
|
||||
'</a>'
|
||||
);
|
||||
?>
|
||||
</div><br/>
|
||||
|
||||
<b><i class="far fa-file-alt fa-sm"></i> <?php esc_html_e('Overview', 'duplicator'); ?></b><br/>
|
||||
<?php esc_html_e('Please follow these steps:', 'duplicator'); ?>
|
||||
<ol>
|
||||
<li><?php esc_html_e('On the scanner step check to make sure your Backup is under 500MB. If not see additional options below.', 'duplicator'); ?></li>
|
||||
<li>
|
||||
<?php esc_html_e('Go to Duplicator > Settings > Backups Tab > Backup Engine >', 'duplicator'); ?>
|
||||
<a href="admin.php?page=duplicator-settings&tab=package"><?php esc_html_e('Enable DupArchive', 'duplicator'); ?></a>
|
||||
</li>
|
||||
<li><?php esc_html_e('Build a new Backup using the new engine format.', 'duplicator'); ?></li>
|
||||
</ol>
|
||||
|
||||
<small style="font-style:italic">
|
||||
<?php
|
||||
printf(
|
||||
esc_html_x(
|
||||
'Note: The DupArchive engine will generate an archive.daf file. This file is very similar to a .zip except that it can
|
||||
only be extracted by the installer.php file or the %1$scommandline extraction tool%2$s.',
|
||||
'1: opening link tag, 2: closing link tag (<a></a>)',
|
||||
'duplicator'
|
||||
),
|
||||
'<a href="'
|
||||
. esc_url(LinkManager::getDocUrl('how-to-work-with-daf-files-and-the-duparchive-extraction-tool', 'backup_step_3_fail', 'DupArchive Extraction Tool'))
|
||||
. '" target="_blank">',
|
||||
'</a>'
|
||||
);
|
||||
?>
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- OPTION 2:TRY AGAIN -->
|
||||
<div class="dup-box no-top">
|
||||
<div class="dup-box-title">
|
||||
<i class="fas fa-filter fa-sm fa-fw"></i>
|
||||
<?php esc_html_e('Option 2: File Filters', 'duplicator'); ?>
|
||||
<div class="dup-box-arrow"><i class="fa fa-caret-down"></i></div>
|
||||
</div>
|
||||
<div class="dup-box-panel" style="display:none">
|
||||
<?php
|
||||
esc_html_e('The first pass for reading files on some budget hosts maybe slow and have conflicts with strict timeout settings setup by the hosting provider. '
|
||||
. 'In these cases, it is recommended to retry the build by adding file filters to larger files/directories.', 'duplicator');
|
||||
|
||||
echo ' <br/><br/>';
|
||||
|
||||
esc_html_e('For example, you could filter out the "/wp-content/uploads/" folder to create the Backup then move the files from that directory over manually. '
|
||||
. 'If this work-flow is not desired or does not work please check-out the other options below.', 'duplicator');
|
||||
?>
|
||||
<br/><br/>
|
||||
<div style="text-align:center; margin:10px 0 2px 0">
|
||||
<input type="button" class="button-large button-primary" value="<?php esc_attr_e('Retry Build With Filters', 'duplicator'); ?>" onclick="window.history.back()" />
|
||||
</div>
|
||||
|
||||
<div style="color:#777; padding:15px 5px 5px 5px">
|
||||
<b> <?php esc_html_e('Notice', 'duplicator'); ?></b><br/>
|
||||
<?php
|
||||
printf(
|
||||
'<b><i class="fa fa-folder-o"></i> %s %s</b> <br/> %s',
|
||||
esc_html__('Build Folder:', 'duplicator'),
|
||||
DUP_Settings::getSsdirTmpPath(),
|
||||
__("On some servers the build will continue to run in the background. To validate if a build is still running; open the 'tmp' folder above and see "
|
||||
. "if the Backup file is growing in size or check the main Backups screen to see if the Backup completed. If it is not then your server "
|
||||
. "has strict timeout constraints.", 'duplicator')
|
||||
);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- OPTION 3:Two-Part Install -->
|
||||
<div class="dup-box no-top">
|
||||
<div class="dup-box-title">
|
||||
<i class="fas fa-random fa-sm fa-fw"></i>
|
||||
<?php esc_html_e('Option 3: Two-Part Install', 'duplicator'); ?>
|
||||
<div class="dup-box-arrow"><i class="fa fa-caret-down"></i></div>
|
||||
</div>
|
||||
<div class="dup-box-panel" style="display:none">
|
||||
|
||||
<?php esc_html_e('A two-part install minimizes server load and can avoid I/O and CPU issues encountered on some budget hosts. With this procedure you simply build a '
|
||||
. '\'database-only\' Backup, manually move the website files, and then run the installer to complete the process.', 'duplicator');
|
||||
?><br/><br/>
|
||||
|
||||
<b><i class="far fa-file-alt fa-sm"></i><?php esc_html_e(' Overview', 'duplicator'); ?></b><br/>
|
||||
<?php esc_html_e('Please follow these steps:', 'duplicator'); ?><br/>
|
||||
<ol>
|
||||
<li><?php esc_html_e('Click the button below to go back to Step 1.', 'duplicator'); ?></li>
|
||||
<li><?php esc_html_e('On Step 1 the "Backup Only the Database" checkbox will be auto checked.', 'duplicator'); ?></li>
|
||||
<li>
|
||||
<?php
|
||||
printf(
|
||||
esc_html_x(
|
||||
'Complete the Backup build and follow the %1$sQuick Start Two-Part Install Instructions%2$s',
|
||||
'1: opening link, 2: closing link',
|
||||
'duplicator'
|
||||
),
|
||||
'<a href="' . esc_url(LinkManager::getDocUrl('two-part-install', 'backup_step_3_fail', 'Two-Part Install')) . '" target="_blank">',
|
||||
'</a>'
|
||||
);
|
||||
?>
|
||||
</li>
|
||||
</ol>
|
||||
|
||||
<div style="text-align:center; margin:10px">
|
||||
<input type="checkbox" id="dup-two-part-check" onclick="Duplicator.Pack.ToggleTwoPart()">
|
||||
<label for="dup-two-part-check"><?php esc_html_e('Yes. I have read the above overview and would like to continue!', 'duplicator'); ?></label><br/><br/>
|
||||
<button id="dup-two-part-btn" type="button" class="button-large button-primary" disabled="true" onclick="window.location = 'admin.php?page=duplicator&tab=new1&retry=2&_wpnonce=<?php echo $retry_nonuce; ?>'">
|
||||
<i class="fa fa-random"></i> <?php esc_html_e('Start Two-Part Install Process', 'duplicator'); ?>
|
||||
</button>
|
||||
</div><br/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- OPTION 4:DIAGNOSE SERVER -->
|
||||
<div class="dup-box no-top">
|
||||
<div class="dup-box-title">
|
||||
<i class="fas fa-cog fa-sm fa-fw"></i>
|
||||
<?php esc_html_e('Option 4: Configure Server', 'duplicator'); ?>
|
||||
<div class="dup-box-arrow"><i class="fa fa-caret-down"></i></div>
|
||||
</div>
|
||||
<div class="dup-box-panel" id="dup-pack-build-try3" style="display:none">
|
||||
<!-- <b class="opt-title"><?php esc_html_e('OPTION 4:', 'duplicator'); ?></b><br/>-->
|
||||
<?php esc_html_e('This option is available on some hosts that allow for users to adjust server configurations. With this option you will be directed to an '
|
||||
. 'FAQ page that will show various recommendations you can take to improve/unlock constraints set up on this server.', 'duplicator');
|
||||
?><br/><br/>
|
||||
|
||||
<div style="text-align:center; margin:10px; font-size:16px; font-weight:bold">
|
||||
<a
|
||||
href="<?php echo esc_url(LinkManager::getDocUrl('how-to-handle-server-timeout-issues', 'backup_step_3_fail', 'Server Timeout')); ?>"
|
||||
target="_blank"
|
||||
>
|
||||
[<?php esc_html_e('Diagnose Server Setup', 'duplicator'); ?>]
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<b><?php esc_html_e('RUNTIME DETAILS', 'duplicator'); ?>:</b><br/>
|
||||
<div class="dup-msg-error-area">
|
||||
<div id="dup-msg-error-response-time">
|
||||
<span class="label"><?php esc_html_e("Allowed Runtime:", 'duplicator'); ?></span>
|
||||
<span class="data"></span>
|
||||
</div>
|
||||
<div id="dup-msg-error-response-php">
|
||||
<span class="label"><?php esc_html_e("PHP Max Execution", 'duplicator'); ?></span><br/>
|
||||
<span class="data sub-data">
|
||||
<span class="label"><?php esc_html_e("Time", 'duplicator'); ?>:</span>
|
||||
<?php
|
||||
$try_value = @ini_get('max_execution_time');
|
||||
$try_update = set_time_limit(0);
|
||||
echo "$try_value <a href='http://www.php.net/manual/en/info.configuration.php#ini.max-execution-time' target='_blank'> (default)</a>";
|
||||
?>
|
||||
<i class="fa fa-question-circle data-size-help"
|
||||
data-tooltip-title="<?php esc_attr_e("PHP Max Execution Time", 'duplicator'); ?>"
|
||||
data-tooltip="<?php esc_attr_e('This value is represented in seconds. A value of 0 means no timeout limit is set for PHP.', 'duplicator'); ?>"></i>
|
||||
</span><br/>
|
||||
|
||||
<span class="data sub-data">
|
||||
<span class="label"><?php esc_html_e("Mode", 'duplicator'); ?>:</span>
|
||||
<?php
|
||||
$try_update = $try_update ? __('is dynamic') : __('value is fixed');
|
||||
echo "{$try_update}";
|
||||
?>
|
||||
<i class="fa fa-question-circle data-size-help"
|
||||
data-tooltip-title="<?php esc_attr_e("PHP Max Execution Mode", 'duplicator'); ?>"
|
||||
data-tooltip="<?php
|
||||
esc_html_e('If the value is [dynamic] then its possible for PHP to run longer than the default. '
|
||||
. 'If the value is [fixed] then PHP will not be allowed to run longer than the default. <br/><br/> If this value is larger than the [Allowed Runtime] above then '
|
||||
. 'the web server has been enabled with a timeout cap and is overriding the PHP max time setting.', 'duplicator');
|
||||
?>"></i>
|
||||
</span>
|
||||
</div>
|
||||
<div id="dup-msg-error-response-status">
|
||||
<span class="label"><?php esc_html_e("Server Status:", 'duplicator'); ?></span>
|
||||
<span class="data"><?php esc_html_e("unavailable", 'duplicator'); ?></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<br/><br/>
|
||||
|
||||
|
||||
<!-- ERROR DETAILS-->
|
||||
<div class="dup-box no-top">
|
||||
<div class="dup-box-title" id="dup-pack-build-err-info" >
|
||||
<i class="fas fa-file-contract fa-fw fa-sm"></i>
|
||||
<?php esc_html_e('System Details', 'duplicator'); ?>
|
||||
<div class="dup-box-arrow"><i class="fa fa-caret-down"></i></div>
|
||||
</div>
|
||||
<div class="dup-box-panel" style="display:none">
|
||||
<span class="label"><?php esc_html_e("Error Message:", 'duplicator'); ?></span>
|
||||
<div class="dup-msg-error-area">
|
||||
<div id="dup-msg-error-response-text">
|
||||
<span class="data"><?php esc_html_e("Error status unavailable.", 'duplicator'); ?></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="dup-logs" style="color:maroon; font-size:16px">
|
||||
<br/>
|
||||
<i class="fas fa-file-contract fa-fw "></i>
|
||||
<a href='javascript:void(0)' style="color:maroon" onclick='Duplicator.OpenLogWindow(true)'>
|
||||
<?php esc_html_e('See Backup Log For Complete Details', 'duplicator'); ?>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<br/><br/>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<div id="build-success-footer-cta" style="display: none;">
|
||||
<?php EducationElements::displayCalloutCTA(); ?>
|
||||
</div>
|
||||
<script>
|
||||
jQuery(document).ready(function ($) {
|
||||
|
||||
Duplicator.Pack.DupArchiveFailureCount = 0;
|
||||
Duplicator.Pack.DupArchiveMaxRetries = 10;
|
||||
Duplicator.Pack.DupArchiveRetryDelayInMs = 8000;
|
||||
Duplicator.Pack.DupArchiveStartTime = new Date().getTime();
|
||||
Duplicator.Pack.StatusFrequency = 8000;
|
||||
|
||||
/* ----------------------------------------
|
||||
* METHOD:Performs Ajax post to create a new package
|
||||
* Timeout (10000000 = 166 minutes) */
|
||||
Duplicator.Pack.CreateZip = function () {
|
||||
var startTime;
|
||||
var data = {action:'duplicator_package_build', nonce:'<?php echo esc_js($zip_build_nonce); ?>'}
|
||||
var statusInterval = setInterval(Duplicator.Pack.GetActivePackageStatus, Duplicator.Pack.StatusFrequency);
|
||||
|
||||
$.ajax({
|
||||
type:"POST",
|
||||
cache:false,
|
||||
dataType:"text",
|
||||
url:ajaxurl,
|
||||
timeout:0, // no timeout
|
||||
data:data,
|
||||
beforeSend:function () {
|
||||
startTime = new Date().getTime();
|
||||
},
|
||||
complete:function () {
|
||||
Duplicator.Pack.PostTransferCleanup(statusInterval, startTime);
|
||||
},
|
||||
success:function (respData, textStatus, xHr) {
|
||||
try {
|
||||
var data = Duplicator.parseJSON(respData);
|
||||
} catch(err) {
|
||||
console.error(err);
|
||||
console.error('JSON parse failed for response data:' + respData);
|
||||
$('#dup-build-progress-bar-wrapper').hide();
|
||||
$('#dup-progress-area, #dup-msg-error').show(200);
|
||||
var status = xHr.status + ' -' + data.statusText;
|
||||
var response = (xHr.responseText != undefined && xHr.responseText.trim().length > 1)
|
||||
? xHr.responseText.trim()
|
||||
: 'No client side error - see Backup log file';
|
||||
$('#dup-msg-error-response-status span.data').html(status)
|
||||
$('#dup-msg-error-response-text span.data').html(response);
|
||||
console.log(xHr);
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((data != null) && (typeof (data) != 'undefined') && data.status == 1) {
|
||||
Duplicator.Pack.WireDownloadLinks(data);
|
||||
} else {
|
||||
var message = (typeof (data.error) != 'undefined' && data.error.length) ? data.error :'Error processing Backup';
|
||||
Duplicator.Pack.DupArchiveProcessingFailed(message);
|
||||
}
|
||||
|
||||
},
|
||||
error:function (xHr) {
|
||||
$('#dup-build-progress-bar-wrapper').hide();
|
||||
$('#dup-progress-area, #dup-msg-error').show(200);
|
||||
var status = xHr.status + ' -' + data.statusText;
|
||||
var response = (xHr.responseText != undefined && xHr.responseText.trim().length > 1)
|
||||
? xHr.responseText.trim()
|
||||
: 'No client side error - see Backup log file';
|
||||
$('#dup-msg-error-response-status span.data').html(status)
|
||||
$('#dup-msg-error-response-text span.data').html(response);
|
||||
console.log(xHr);
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
/* ----------------------------------------
|
||||
* METHOD:Performs Ajax post to create a new DupArchive-based package */
|
||||
Duplicator.Pack.CreateDupArchive = function () {
|
||||
console.log('Duplicator.Pack.CreateDupArchive');
|
||||
var data = {action:'duplicator_duparchive_package_build', nonce:'<?php echo esc_js($duparchive_build_nonce); ?>'}
|
||||
var statusInterval = setInterval(Duplicator.Pack.GetActivePackageStatus, Duplicator.Pack.StatusFrequency);
|
||||
|
||||
$.ajax({
|
||||
type:"POST",
|
||||
timeout:0, // no timeout
|
||||
dataType:"text",
|
||||
url:ajaxurl,
|
||||
data:data,
|
||||
complete:function () {
|
||||
Duplicator.Pack.PostTransferCleanup(statusInterval, Duplicator.Pack.DupArchiveStartTime);
|
||||
},
|
||||
success:function (respData, textStatus, xHr) {
|
||||
try {
|
||||
var data = Duplicator.parseJSON(respData);
|
||||
} catch(err) {
|
||||
console.log(err);
|
||||
console.log('JSON parse failed for response data:' + respData);
|
||||
console.log('DupArchive AJAX error!');
|
||||
console.log("jqHr:");
|
||||
console.log(xHr);
|
||||
console.log("textStatus:");
|
||||
console.log(textStatus);
|
||||
Duplicator.Pack.HandleDupArchiveInterruption(xHr.responseText);
|
||||
return false;
|
||||
}
|
||||
|
||||
console.log("CreateDupArchive:AJAX success. Data equals:");
|
||||
console.log(data);
|
||||
// DATA FIELDS
|
||||
// archive_offset, archive_size, failures, file_index, is_done, timestamp
|
||||
|
||||
if ((data != null) && (typeof (data) != 'undefined') && ((data.status == 1) || (data.status == 3) || (data.status == 4))) {
|
||||
|
||||
Duplicator.Pack.DupArchiveFailureCount = 0;
|
||||
|
||||
// Status = 1 means complete, 4 means more to process
|
||||
console.log("CreateDupArchive:Passed");
|
||||
var criticalFailureText = Duplicator.Pack.GetFailureText(data.failures, true);
|
||||
|
||||
if (data.failures.length > 0) {
|
||||
console.log("CreateDupArchive:There are failures present. (" + data.failures.length) + ")";
|
||||
}
|
||||
|
||||
if ((criticalFailureText === '') && (data.status != 3)) {
|
||||
console.log("CreateDupArchive:No critical failures");
|
||||
if (data.status == 1) {
|
||||
|
||||
// Don't stop for non-critical failures - just display those at the end TODO:put these in the log not popup
|
||||
console.log("CreateDupArchive:archive has completed");
|
||||
if (data.failures.length > 0) {
|
||||
console.log(data.failures);
|
||||
var errorMessage = "CreateDupArchive:Problems during Backup creation. These may be non-critical so continue with install.\n------\n";
|
||||
var len = data.failures.length;
|
||||
|
||||
for (var j = 0; j < len; j++) {
|
||||
failure = data.failures[j];
|
||||
errorMessage += failure + "\n";
|
||||
}
|
||||
alert(errorMessage);
|
||||
}
|
||||
|
||||
Duplicator.Pack.WireDownloadLinks(data);
|
||||
|
||||
} else {
|
||||
// data.Status == 4
|
||||
console.log('CreateDupArchive:Archive not completed so continue ping DAWS in 500');
|
||||
setTimeout(Duplicator.Pack.CreateDupArchive, 500);
|
||||
}
|
||||
} else {
|
||||
console.log("CreateDupArchive:critical failures present");
|
||||
// If we get a critical failure it means it's something we can't recover from so no purpose in retrying, just fail immediately.
|
||||
var errorString = 'Error Processing Step 1<br/>';
|
||||
errorString += criticalFailureText;
|
||||
Duplicator.Pack.DupArchiveProcessingFailed(errorString);
|
||||
}
|
||||
} else {
|
||||
// data is null or Status is warn or fail
|
||||
var errorString = '';
|
||||
if(data == null) {
|
||||
errorString = "Data returned from web service is null.";
|
||||
}
|
||||
else {
|
||||
var errorString = '';
|
||||
if(data.failures.length > 0) {
|
||||
errorString += Duplicator.Pack.GetFailureText(data.failures, false);
|
||||
}
|
||||
}
|
||||
Duplicator.Pack.HandleDupArchiveInterruption(errorString);
|
||||
}
|
||||
},
|
||||
error:function (xHr, textStatus) {
|
||||
console.log('DupArchive AJAX error!');
|
||||
console.log("jqHr:");
|
||||
console.log(xHr);
|
||||
console.log("textStatus:");
|
||||
console.log(textStatus);
|
||||
Duplicator.Pack.HandleDupArchiveInterruption(xHr.responseText);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/* ----------------------------------------
|
||||
* METHOD:Retrieves package status and updates UI with build percentage */
|
||||
Duplicator.Pack.GetActivePackageStatus = function () {
|
||||
var data = {action:'DUP_CTRL_Package_getActivePackageStatus', nonce:'<?php echo wp_create_nonce('DUP_CTRL_Package_getActivePackageStatus'); ?>'}
|
||||
console.log('####Duplicator.Pack.GetActivePackageStatus');
|
||||
|
||||
$.ajax({
|
||||
type:"POST",
|
||||
url:ajaxurl,
|
||||
dataType:"text",
|
||||
timeout:0, // no timeout
|
||||
data:data,
|
||||
success:function (respData, textStatus, xHr) {
|
||||
try {
|
||||
var data = Duplicator.parseJSON(respData);
|
||||
} catch(err) {
|
||||
console.error(err);
|
||||
console.error('JSON parse failed for response data:' + respData);
|
||||
console.log('Error retrieving build status');
|
||||
console.log(xHr);
|
||||
return false;
|
||||
}
|
||||
if(data.report.status == 1) {
|
||||
$('#dup-progress-percent').html(data.payload.status + "%");
|
||||
} else {
|
||||
console.log('Error retrieving build status');
|
||||
console.log(data);
|
||||
}
|
||||
},
|
||||
error:function (xHr) {
|
||||
console.log('Error retrieving build status');
|
||||
console.log(xHr);
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
Duplicator.Pack.PostTransferCleanup = function(statusInterval, startTime) {
|
||||
clearInterval(statusInterval);
|
||||
endTime = new Date().getTime();
|
||||
var millis = (endTime - startTime);
|
||||
var minutes = Math.floor(millis / 60000);
|
||||
var seconds = ((millis % 60000) / 1000).toFixed(0);
|
||||
var status = minutes + ":" + (seconds < 10 ? '0' :'') + seconds;
|
||||
$('#dup-msg-error-response-time span.data').html(status);
|
||||
};
|
||||
|
||||
Duplicator.Pack.WireDownloadLinks = function(data) {
|
||||
var pack = data.package;
|
||||
var archive_json = {
|
||||
filename:pack.Archive.File,
|
||||
url:"<?php echo DUP_Settings::getSsdirUrl(); ?>" + "/" + pack.Archive.File
|
||||
};
|
||||
var installer_json = {
|
||||
id:pack.ID,
|
||||
hash:pack.Hash
|
||||
};
|
||||
|
||||
$('#dup-build-progress-bar-wrapper').hide();
|
||||
$('#dup-progress-area, #dup-msg-success').show(300);
|
||||
$('#build-success-footer-cta').show();
|
||||
|
||||
$('#dup-btn-archive-size').append(' (' + data.archiveSize + ')')
|
||||
$('#data-name-hash').text(pack.NameHash || 'error read');
|
||||
$('#data-time').text(data.runtime || 'unable to read time');
|
||||
$('#dup-create-new').removeClass('no-display');
|
||||
$('#dup-packages-btn').removeClass('no-display');
|
||||
|
||||
//Wire Up Downloads
|
||||
$('#dup-btn-installer').click(function() {
|
||||
Duplicator.Pack.DownloadInstaller(installer_json);
|
||||
return false;
|
||||
});
|
||||
|
||||
$('#dup-btn-archive').click(function() {
|
||||
Duplicator.Pack.DownloadFile(archive_json);
|
||||
return false;
|
||||
});
|
||||
|
||||
$('#dup-link-download-both').on("click", function () {
|
||||
$('#dup-btn-installer').trigger('click');
|
||||
setTimeout(function(){
|
||||
$('#dup-btn-archive').trigger('click');
|
||||
}, 700);
|
||||
return false;
|
||||
});
|
||||
|
||||
$('#dup-click-to-copy-installer-name').data('dup-copy-text', data.instDownloadName);
|
||||
$('#dup-installer-name').data('data-installer-name', data.instDownloadName);
|
||||
};
|
||||
|
||||
Duplicator.Pack.HandleDupArchiveInterruption = function (errorText) {
|
||||
Duplicator.Pack.DupArchiveFailureCount++;
|
||||
|
||||
if (Duplicator.Pack.DupArchiveFailureCount <= Duplicator.Pack.DupArchiveMaxRetries) {
|
||||
console.log("Failure count:" + Duplicator.Pack.DupArchiveFailureCount);
|
||||
// / rsr todo don’t worry about this right now Duplicator.Pack.DupArchiveThrottleDelay = 9; // Equivalent of 'low' server throttling (ms)
|
||||
console.log('Relaunching in ' + Duplicator.Pack.DupArchiveRetryDelayInMs);
|
||||
setTimeout(Duplicator.Pack.CreateDupArchive, Duplicator.Pack.DupArchiveRetryDelayInMs);
|
||||
} else {
|
||||
console.log('Too many failures.' + errorText);
|
||||
// Processing problem
|
||||
Duplicator.Pack.DupArchiveProcessingFailed("Too many retries when building DupArchive Backup. " + errorText);
|
||||
}
|
||||
};
|
||||
|
||||
Duplicator.Pack.DupArchiveProcessingFailed = function (errorText) {
|
||||
$('#dup-build-progress-bar-wrapper').hide();
|
||||
$('#dup-progress-area, #dup-msg-error').show(200);
|
||||
$('#dup-msg-error-response-text span.data').html(errorText);
|
||||
$('#dup-pack-build-err-info').trigger('click');
|
||||
};
|
||||
|
||||
Duplicator.Pack.GetFailureText = function (failures, onlyCritical)
|
||||
{
|
||||
var retVal = '';
|
||||
if ((failures !== null) && (typeof failures !== 'undefined')) {
|
||||
var len = failures.length;
|
||||
|
||||
for (var j = 0; j < len; j++) {
|
||||
failure = failures[j];
|
||||
if (!onlyCritical || failure.isCritical) {
|
||||
retVal += failure.description;
|
||||
retVal += "<br/>";
|
||||
}
|
||||
}
|
||||
}
|
||||
return retVal;
|
||||
};
|
||||
|
||||
Duplicator.Pack.ToggleTwoPart = function () {
|
||||
var $btn = $('#dup-two-part-btn');
|
||||
if ($('#dup-two-part-check').is(':checked')) {
|
||||
$btn.removeAttr("disabled");
|
||||
} else {
|
||||
$btn.attr("disabled", true);
|
||||
}
|
||||
};
|
||||
|
||||
Duplicator.Pack.ShowInstallerName = function () {
|
||||
var txt = $('#dup-installer-name').data('data-installer-name');
|
||||
$('#dup-installer-name').html(txt);
|
||||
$('#dup-installer-name-help-icon').show();
|
||||
};
|
||||
|
||||
//Page Init:
|
||||
Duplicator.UI.AnimateProgressBar('dup-progress-bar');
|
||||
|
||||
<?php if (DUP_Settings::Get('archive_build_mode') == DUP_Archive_Build_Mode::ZipArchive) :?>
|
||||
Duplicator.Pack.CreateZip();
|
||||
<?php else :?>
|
||||
Duplicator.Pack.CreateDupArchive();
|
||||
<?php endif; ?>
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user