first commit

This commit is contained in:
2026-03-05 13:07:40 +01:00
commit 64ba0721ee
25709 changed files with 4691006 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
<?php
/**
* Display header
*
* @param string $title Header title
*
* @return void
*/
function duplicator_header($title)
{
echo "<h1>" . esc_html($title) . "</h1>";
}

View File

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

View File

@@ -0,0 +1,80 @@
<?php
defined('ABSPATH') || defined('DUPXABSPATH') || exit;
DUP_Handler::init_error_handler();
DUP_Util::hasCapability('export');
global $wpdb;
//COMMON HEADER DISPLAY
require_once(DUPLICATOR_PLUGIN_PATH . '/assets/js/javascript.php');
require_once(DUPLICATOR_PLUGIN_PATH . '/views/inc.header.php');
$current_view = (isset($_REQUEST['action']) && $_REQUEST['action'] == 'detail') ? 'detail' : 'main';
$download_installer_nonce = wp_create_nonce('duplicator_download_installer');
?>
<script>
jQuery(document).ready(function($) {
Duplicator.Pack.DownloadInstaller = function (json)
{
var actionLocation = ajaxurl + '?action=duplicator_download_installer&id=' + json.id + '&hash='+ json.hash +'&nonce=' + '<?php echo $download_installer_nonce; ?>';
location.href = actionLocation;
return false;
};
Duplicator.Pack.DownloadFile = function(json)
{
var link = document.createElement('a');
link.target = "_blank";
link.download = json.filename;
link.href= json.url;
document.body.appendChild(link);
// click event fire
if (document.dispatchEvent) {
// First create an event
var click_ev = document.createEvent("MouseEvents");
// initialize the event
click_ev.initEvent("click", true /* bubble */, true /* cancelable */);
// trigger the event
link.dispatchEvent(click_ev);
} else if (document.fireEvent) {
link.fireEvent('onclick');
} else if (link.click()) {
link.click()
}
document.body.removeChild(link);
return false;
};
/* ----------------------------------------
* METHOD: Toggle links with sub-details */
Duplicator.Pack.ToggleSystemDetails = function(event) {
if ($(this).parents('div').children(event.data.selector).is(":hidden")) {
$(this).children('span').addClass('ui-icon-triangle-1-s').removeClass('ui-icon-triangle-1-e');
;
$(this).parents('div').children(event.data.selector).show(250);
} else {
$(this).children('span').addClass('ui-icon-triangle-1-e').removeClass('ui-icon-triangle-1-s');
$(this).parents('div').children(event.data.selector).hide(250);
}
}
});
</script>
<div class="wrap">
<?php
switch ($current_view) {
case 'main':
include(DUPLICATOR_PLUGIN_PATH . 'views/packages/main/controller.php');
break;
case 'detail':
include(DUPLICATOR_PLUGIN_PATH . 'views/packages/details/controller.php');
break;
}
?>
</div>

View File

@@ -0,0 +1,80 @@
<?php
use Duplicator\Installer\Utils\LinkManager;
use Duplicator\Core\Bootstrap;
use Duplicator\Core\Views\TplMng;
defined('ABSPATH') || defined('DUPXABSPATH') || exit;
DUP_Util::hasCapability('manage_options');
global $wpdb;
//COMMON HEADER DISPLAY
$current_tab = isset($_REQUEST['tab']) ? sanitize_text_field($_REQUEST['tab']) : 'detail';
$package_id = isset($_REQUEST["id"]) ? sanitize_text_field($_REQUEST["id"]) : 0;
$package = DUP_Package::getByID($package_id);
$err_found = ($package == null || $package->Status < 100);
?>
<style>
.narrow-input { width: 80px; }
.wide-input {width: 400px; }
table.form-table tr td { padding-top: 25px; }
div.all-packages {float:right; margin-top: -35px; }
</style>
<div class="wrap">
<?php
duplicator_header(__("Package Details &raquo; {$package->Name}", 'duplicator'));
?>
<?php if ($err_found) :?>
<div class="error">
<p>
<?php printf(
_x(
'This package contains an error. Please review the %1$spackage log%2$s for details.',
'%1 and %2 are replaced with <a> and </a> respectively',
'duplicator'
),
'<a href="' . DUP_Settings::getSsdirUrl() . '/{$package->NameHash}.log" target="_blank">',
'</a>'
);
?>
<?php printf(
_x(
'For help visit the %1$sFAQ%2$s and %3$sresources page%4$s.',
'%1, %3 and %2, %4 are replaced with <a> and </a> respectively',
'duplicator'
),
'<a href="' . esc_url(LinkManager::getCategoryUrl(LinkManager::TROUBLESHOOTING_CAT, 'failed_package_details_notice', 'FAQ')) . '" target="_blank">',
'</a>',
'<a href="' . esc_url(LinkManager::getCategoryUrl(LinkManager::RESOURCES_CAT, 'failed_package_details_notice', 'resources page')) . '" target="_blank">',
'</a>'
);
?>
</p>
</div>
<?php endif; ?>
<h2 class="nav-tab-wrapper">
<a href="?page=duplicator&action=detail&tab=detail&id=<?php echo absint($package_id); ?>" class="nav-tab <?php echo ($current_tab == 'detail') ? 'nav-tab-active' : '' ?>">
<?php esc_html_e('Details', 'duplicator'); ?>
</a>
<a href="?page=duplicator&action=detail&tab=transfer&id=<?php echo absint($package_id); ?>" class="nav-tab <?php echo ($current_tab == 'transfer') ? 'nav-tab-active' : '' ?>">
<?php esc_html_e('Transfer', 'duplicator'); ?>
</a>
</h2>
<div class="all-packages"><a href="?page=duplicator" class="button"><i class="fa fa-archive fa-sm"></i> <?php esc_html_e('Packages', 'duplicator'); ?></a></div>
<?php
switch ($current_tab) {
case 'detail':
include(DUPLICATOR_PLUGIN_PATH . 'views/packages/details/detail.php');
break;
case 'transfer':
Bootstrap::mocksStyles();
TplMng::getInstance()->render('mocks/transfer/transfer', array(), true);
break;
}
?>
</div>

View File

@@ -0,0 +1,610 @@
<?php
use Duplicator\Installer\Utils\LinkManager;
use Duplicator\Libs\Snap\SnapJson;
use Duplicator\Utils\Upsell;
defined('ABSPATH') || defined('DUPXABSPATH') || exit;
$view_state = DUP_UI_ViewState::getArray();
$ui_css_general = (isset($view_state['dup-package-dtl-general-panel']) && $view_state['dup-package-dtl-general-panel']) ? 'display:block' : 'display:none';
$ui_css_storage = (isset($view_state['dup-package-dtl-storage-panel']) && $view_state['dup-package-dtl-storage-panel']) ? 'display:block' : 'display:none';
$ui_css_archive = (isset($view_state['dup-package-dtl-archive-panel']) && $view_state['dup-package-dtl-archive-panel']) ? 'display:block' : 'display:none';
$ui_css_install = (isset($view_state['dup-package-dtl-install-panel']) && $view_state['dup-package-dtl-install-panel']) ? 'display:block' : 'display:none';
$archiveDownloadInfo = $package->getPackageFileDownloadInfo(DUP_PackageFileType::Archive);
$logDownloadInfo = $package->getPackageFileDownloadInfo(DUP_PackageFileType::Log);
$installerDownloadInfo = $package->getInstallerDownloadInfo();
$archiveDownloadInfoJson = SnapJson::jsonEncodeEscAttr($archiveDownloadInfo);
$logDownloadInfoJson = SnapJson::jsonEncodeEscAttr($logDownloadInfo);
$installerDownloadInfoJson = SnapJson::jsonEncodeEscAttr($installerDownloadInfo);
$showLinksDialogJson = SnapJson::jsonEncodeEscAttr(array(
"archive" => $archiveDownloadInfo["url"],
"log" => $logDownloadInfo["url"],
));
$debug_on = DUP_Settings::Get('package_debug');
$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';
$archive_build_mode = ($package->Archive->Format === 'ZIP') ? 'ZipArchive (zip)' : 'DupArchive (daf)';
$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) : '';
$installerNameMode = DUP_Settings::Get('installer_name_mode');
$currentStoreURLPath = DUP_Settings::getSsdirUrl();
$installerSecureName = $package->getInstDownloadName(true);
$installerDirectLink = "{$currentStoreURLPath}/" . pathinfo($installerSecureName, PATHINFO_FILENAME) . DUP_Installer::INSTALLER_SERVER_EXTENSION;
?>
<style>
/*COMMON*/
div.toggle-box {float:right; margin: 5px 5px 5px 0}
div.dup-box {margin-top: 15px; font-size:14px; clear: both}
table.dup-dtl-data-tbl {width:100%}
table.dup-dtl-data-tbl tr {vertical-align: top}
table.dup-dtl-data-tbl tr:first-child td {margin:0; padding-top:0 !important;}
table.dup-dtl-data-tbl td {padding:0 5px 0 0; padding-top:10px !important;}
table.dup-dtl-data-tbl td:first-child {font-weight: bold; width:130px}
table.dup-sub-list td:first-child {white-space: nowrap; vertical-align: middle; width:100px !important;}
table.dup-sub-list td {white-space: nowrap; vertical-align:top; padding:2px !important;}
div.dup-box-panel-hdr {font-size:14px; display:block; border-bottom: 1px solid #efefef; margin:5px 0 5px 0; font-weight: bold; padding: 0 0 5px 0}
td.sub-notes {font-weight: normal !important; font-style: italic; color:#999; padding-top:10px;}
div.sub-notes {font-weight: normal !important; font-style: italic; color:#999;}
/*STORAGE*/
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}
/*GENERAL*/
div#dup-name-info, div#dup-version-info {display: none; line-height:20px; margin:4px 0 0 0}
table.dup-sub-info td {padding: 1px !important}
table.dup-sub-info td:first-child {font-weight: bold; width:100px; padding-left:10px}
div#dup-downloads-area {padding: 5px 0 5px 0; }
div#dup-downloads-area i.fa-shield-alt {display: block; float:right; margin-top:8px}
div#dup-downloads-area i.fa-bolt {display: inline-block; border:0 solid red}
div#dup-downloads-msg {margin-bottom:-5px; font-style: italic}
div.sub-section {padding:7px 0 0 0}
textarea.file-info {width:100%; height:100px; font-size:12px }
/*INSTALLER*/
div#dup-pass-toggle {position: relative; margin:0; width:273px}
input#secure-pass {border-radius:4px 0 0 4px; width:250px; height: 23px; margin:0}
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-hdr-2 {font-weight:bold; border-bottom:1px solid #dfdfdf; padding-bottom:2px; width:100%}
</style>
<?php if ($package_id == 0) :?>
<div class="notice notice-error is-dismissible"><p><?php esc_html_e('Invalid Package ID request. Please try again!', 'duplicator'); ?></p></div>
<?php endif; ?>
<div class="toggle-box">
<span class="link-style" onclick="Duplicator.Pack.OpenAll()">[open all]</span> &nbsp;
<span class="link-style" onclick="Duplicator.Pack.CloseAll()">[close all]</span>
</div>
<!-- ===============================
GENERAL -->
<div class="dup-box">
<div class="dup-box-title">
<i class="fa fa-archive fa-sm"></i> <?php esc_html_e('General', 'duplicator') ?>
<div class="dup-box-arrow"></div>
</div>
<div class="dup-box-panel" id="dup-package-dtl-general-panel" style="<?php echo esc_attr($ui_css_general); ?>">
<table class='dup-dtl-data-tbl'>
<tr>
<td><?php esc_html_e('Name', 'duplicator') ?></td>
<td>
<span class="link-style" onclick="jQuery('#dup-name-info').toggle()">
<?php echo esc_js($package->Name); ?>
</span>
<div id="dup-name-info">
<table class="dup-sub-info">
<tr>
<td><?php esc_html_e('ID', 'duplicator') ?></td>
<td><?php echo absint($package->ID); ?></td>
</tr>
<tr>
<td><?php esc_html_e('Hash', 'duplicator') ?></td>
<td><?php echo esc_html($package->Hash); ?></td>
</tr>
<tr>
<td><?php esc_html_e('Full Name', 'duplicator') ?></td>
<td><?php echo esc_html($package->NameHash); ?></td>
</tr>
</table>
</div>
</td>
</tr>
<tr>
<td><?php esc_html_e('Notes', 'duplicator') ?></td>
<td><?php echo strlen($package->Notes) ? $package->Notes : esc_html__('- no notes -', 'duplicator') ?></td>
</tr>
<tr>
<td><?php esc_html_e('Created', 'duplicator') ?></td>
<td><?php echo get_date_from_gmt($package->Created) ?></td>
</tr>
<tr>
<td><?php esc_html_e('Version', 'duplicator') ?></td>
<td>
<span class="link-style" onclick="jQuery('#dup-version-info').toggle()">
<?php echo esc_html($package->Version); ?>
</span>
<div id="dup-version-info">
<table class="dup-sub-info">
<tr>
<td><?php esc_html_e('WordPress', 'duplicator') ?></td>
<td><?php echo strlen($package->VersionWP) ? esc_html($package->VersionWP) : esc_html__('- unknown -', 'duplicator') ?></td>
</tr>
<tr>
<td><?php esc_html_e('PHP', 'duplicator') ?> </td>
<td><?php echo strlen($package->VersionPHP) ? esc_html($package->VersionPHP) : esc_html__('- unknown -', 'duplicator') ?></td>
</tr>
<tr>
<td><?php esc_html_e('Mysql', 'duplicator') ?></td>
<td>
<?php echo strlen($package->VersionDB) ? esc_html($package->VersionDB) : esc_html__('- unknown -', 'duplicator') ?> |
<?php echo strlen($package->Database->Comments) ? esc_html($package->Database->Comments) : esc_html__('- unknown -', 'duplicator') ?>
</td>
</tr>
</table>
</div>
</td>
</tr>
<tr>
<td><?php esc_html_e('Runtime', 'duplicator') ?></td>
<td><?php echo strlen($package->Runtime) ? esc_html($package->Runtime) : esc_html__("error running", 'duplicator'); ?></td>
</tr>
<tr>
<td><?php esc_html_e('Status', 'duplicator') ?></td>
<td><?php echo ($package->Status >= 100) ? esc_html__('completed', 'duplicator') : esc_html__('in-complete', 'duplicator') ?></td>
</tr>
<tr>
<td><?php esc_html_e('User', 'duplicator') ?></td>
<td><?php echo strlen($package->WPUser) ? esc_html($package->WPUser) : esc_html__('- unknown -', 'duplicator') ?></td>
</tr>
<tr>
<td><?php esc_html_e('Files', 'duplicator') ?> </td>
<td>
<div id="dup-downloads-area">
<?php if (!$err_found) :?>
<?php
if ($installerNameMode === DUP_Settings::INSTALLER_NAME_MODE_WITH_HASH) {
$installBtnTooltip = __('Download hashed installer ([name]_[hash]_[time]_installer.php)', 'duplicator');
$installBtnIcon = '<i class="fas fa-shield-alt fa-sm fa-fw shield-on"></i>';
} else {
$installBtnTooltip = __('Download basic installer (installer.php)', 'duplicator');
$installBtnIcon = '<i class="fas fa-shield-alt fa-sm fa-fw shield-off"></i>';
}
?>
<div class="sub-notes">
<i class="fas fa-download fa-fw"></i>
<?php _e("Click buttons or links to download.", 'duplicator') ?>
<br/><br/>
</div>
<button class="button"
title="<?php echo $installBtnTooltip; ?>"
onclick="Duplicator.Pack.DownloadInstaller(<?php echo $installerDownloadInfoJson; ?>);">
<i class="fas fa-bolt fa-sm fa-fw"></i>&nbsp; Installer &nbsp; <?php echo $installBtnIcon; ?>
</button>
<button class="button" onclick="Duplicator.Pack.DownloadFile(<?php echo $archiveDownloadInfoJson; ?>);return false;">
<i class="far fa-file-archive"></i>&nbsp; Archive - <?php echo esc_html($package->ZipSize); ?>
</button>
<button class="button" onclick="Duplicator.Pack.ShowLinksDialog(<?php echo $showLinksDialogJson;?>);" class="thickbox">
<i class="fas fa-share-alt"></i>&nbsp; <?php esc_html_e("Share File Links", 'duplicator')?>
</button>
<?php else : ?>
<button class="button" onclick="Duplicator.Pack.DownloadFile(<?php echo $logDownloadInfoJson; ?>);return false;">
<i class="fas fa-file-contract fa-sm"></i>&nbsp; Log
</button>
<?php endif; ?>
</div>
<?php if (!$err_found) :?>
<table class="dup-sub-list">
<tr>
<td><?php esc_html_e('Archive', 'duplicator') ?> </td>
<td>
<a href="<?php echo esc_url($archiveDownloadInfo["url"]); ?>" class="link-style">
<?php echo esc_html($package->Archive->File); ?>
</a>
</td>
</tr>
<tr>
<td><?php esc_html_e("Build Log", 'duplicator') ?> </td>
<td>
<a href="<?php echo $logDownloadInfo["url"] ?>" target="file_results" class="link-style">
<?php echo $logDownloadInfo["filename"]; ?>
</a>
</td>
</tr>
<tr>
<td><?php esc_html_e('Installer', 'duplicator') ?> </td>
<td><?php echo "{$installerSecureName}"; ?></td>
</tr>
<tr>
<td class="sub-notes" colspan="2">
<?php _e("The installer is also available inside the archive file.", 'duplicator') ?>
</td>
</tr>
</table>
<?php endif; ?>
</td>
</tr>
</table>
</div>
</div>
<!-- ==========================================
DIALOG: QUICK PATH -->
<?php add_thickbox(); ?>
<div id="dup-dlg-quick-path" title="<?php esc_attr_e('Download Links', 'duplicator'); ?>" style="display:none">
<p style="color:maroon">
<i class="fa fa-lock fa-xs"></i>
<?php esc_html_e("The following links contain sensitive data. Share with caution!", 'duplicator'); ?>
</p>
<div style="padding: 0px 5px 5px 5px;">
<a href="javascript:void(0)" style="display:inline-block; text-align:right" onclick="Duplicator.Pack.GetLinksText()">[Select All]</a> <br/>
<textarea id="dup-dlg-quick-path-data" style='border:1px solid silver; border-radius:2px; width:100%; height:175px; font-size:11px'></textarea><br/>
<i style='font-size:11px'>
<?php
printf(
esc_html_x(
"A copy of the database.sql and installer.php files can both be found inside of the archive.zip/daf file. "
. "Download and extract the archive file to get a copy of the installer which will be named 'installer-backup.php'. "
. "For details on how to extract a archive.daf file please see: "
. '%1$sHow to work with DAF files and the DupArchive extraction tool?%2$s',
'%1$s and %2$s are opening and closing <a> tags',
'duplicator'
),
'<a href="' . esc_url(LinkManager::getDocUrl('how-to-work-with-daf-files-and-the-duparchive-extraction-tool', 'package-deatils')) . '" '
. 'target="_blank">',
'</a>'
);
?>
</i>
</div>
</div>
<!-- ===============================
STORAGE -->
<div class="dup-box">
<div class="dup-box-title">
<i class="fas fa-server fa-sm"></i>
<?php esc_html_e('Storage', 'duplicator') ?>
<div class="dup-box-arrow"></div>
</div>
<div class="dup-box-panel" id="dup-package-dtl-storage-panel" style="<?php echo esc_attr($ui_css_storage); ?>">
<table class="widefat package-tbl" style="margin-bottom:15px" >
<thead>
<tr>
<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("Locations", 'duplicator'); ?></th>
</tr>
</thead>
<tbody>
<tr class="dup-store-path">
<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();
echo '<br/>';
echo DUP_Settings:: getSsdirUrl();
?>
</td>
</tr>
<tr>
<td colspan="5" 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>&nbsp;' . 'Amazon',
'<i class="fab fa-dropbox fa-fw"></i>&nbsp;' . 'Dropbox',
'<i class="fab fa-google-drive fa-fw"></i>&nbsp;' . 'Google Drive',
'<i class="fas fa-cloud fa-fw"></i>&nbsp;' . 'OneDrive',
'<i class="fas fa-network-wired fa-fw"></i>&nbsp;' . 'FTP/SFTP'
); ?>
<a
href="<?php echo esc_url(Upsell::getCampaignUrl('details-storage')); ?>"
target="_blank"
class="link-style">
<?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 package 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>
<!-- ===============================
ARCHIVE -->
<div class="dup-box">
<div class="dup-box-title">
<i class="far fa-file-archive"></i> <?php esc_html_e('Archive', 'duplicator') ?>
<div class="dup-box-arrow"></div>
</div>
<div class="dup-box-panel" id="dup-package-dtl-archive-panel" style="<?php echo esc_attr($ui_css_archive); ?>">
<!-- FILES -->
<div class="dup-box-panel-hdr">
<i class="fas fa-folder-open fa-sm"></i>
<?php esc_html_e('FILES', 'duplicator'); ?>
</div>
<table class='dup-dtl-data-tbl'>
<tr>
<td><?php esc_html_e('Build Mode', 'duplicator') ?> </td>
<td><?php echo esc_html($archive_build_mode); ?></td>
</tr>
<?php if ($package->Archive->ExportOnlyDB) : ?>
<tr>
<td><?php esc_html_e('Database Mode', 'duplicator') ?> </td>
<td><?php esc_html_e('Archive Database Only Enabled', 'duplicator') ?></td>
</tr>
<?php else : ?>
<tr>
<td><?php esc_html_e('Filters', 'duplicator') ?> </td>
<td>
<?php echo $package->Archive->FilterOn == 1 ? 'On' : 'Off'; ?>
<div class="sub-section">
<b><?php esc_html_e('Directories', 'duplicator') ?></b> <br/>
<?php
$txt = strlen($package->Archive->FilterDirs)
? str_replace(';', ";\n", $package->Archive->FilterDirs)
: esc_html__('- no filters -', 'duplicator');
?>
<textarea class='file-info' readonly="true"><?php echo esc_textarea($txt); ?></textarea>
</div>
<div class="sub-section">
<b><?php esc_html_e('Extensions', 'duplicator') ?> </b><br/>
<?php
echo isset($package->Archive->FilterExts) && strlen($package->Archive->FilterExts)
? esc_html($package->Archive->FilterExts)
: esc_html__('- no filters -', 'duplicator');
?>
</div>
<div class="sub-section">
<b><?php esc_html_e('Files', 'duplicator') ?></b><br/>
<?php
$txt = strlen($package->Archive->FilterFiles)
? str_replace(';', ";\n", $package->Archive->FilterFiles)
: esc_html__('- no filters -', 'duplicator');
?>
<textarea class='file-info' readonly="true"><?php echo esc_html($txt); ?></textarea>
</div>
</td>
</tr>
<?php endif; ?>
</table>
<br/><br/>
<!-- DATABASE -->
<div class="dup-box-panel-hdr">
<i class="fas fa-database fa-sm"></i>
<?php esc_html_e('DATABASE', 'duplicator'); ?>
</div>
<table class='dup-dtl-data-tbl'>
<tr>
<td><?php esc_html_e('Name', 'duplicator') ?> </td>
<td><?php echo esc_html($package->Database->info->name); ?></td>
</tr>
<tr>
<td><?php esc_html_e('Type', 'duplicator') ?> </td>
<td><?php echo esc_html($package->Database->Type); ?></td>
</tr>
<tr>
<td><?php esc_html_e('SQL Mode', 'duplicator') ?> </td>
<td>
<a href="?page=duplicator-settings&tab=package" target="_blank" class="link-style"><?php echo esc_html($dbbuild_mode); ?></a>
<?php if ($mysqlcompat_on) : ?>
<br/>
<small style="font-style:italic; color:maroon">
<i class="fa fa-exclamation-circle"></i> <?php esc_html_e('MySQL Compatibility Mode Enabled', 'duplicator'); ?>
<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 endif; ?>
</td>
</tr>
<tr>
<td><?php esc_html_e('Filters', 'duplicator') ?> </td>
<td><?php echo $package->Database->FilterOn == 1 ? 'On' : 'Off'; ?></td>
</tr>
<tr class="sub-section">
<td>&nbsp;</td>
<td>
<b><?php esc_html_e('Tables', 'duplicator') ?></b><br/>
<?php
echo isset($package->Database->FilterTables) && strlen($package->Database->FilterTables)
? str_replace(',', "<br>\n", $package->Database->FilterTables)
: esc_html__('- no filters -', 'duplicator');
?>
</td>
</tr>
</table>
</div>
</div>
<!-- ===============================
INSTALLER -->
<div class="dup-box" style="margin-bottom: 50px">
<div class="dup-box-title">
<i class="fa fa-bolt fa-sm"></i> <?php esc_html_e('Installer', 'duplicator') ?>
<div class="dup-box-arrow"></div>
</div>
<div class="dup-box-panel" id="dup-package-dtl-install-panel" style="<?php echo esc_html($ui_css_install); ?>">
<table class='dup-dtl-data-tbl'>
<tr>
<td colspan="2">
<div class="dup-install-hdr-2"><?php esc_html_e("Setup", 'duplicator') ?></div>
</td>
</tr>
<tr>
<td>
<?php esc_html_e("Security", 'duplicator');?>
</td>
<td>
<?php
if ($dup_install_secure_on) {
_e('Password Protection Enabled', 'duplicator');
} else {
_e('Password Protection Disabled', 'duplicator');
}
?>
</td>
</tr>
<?php if ($dup_install_secure_on) :?>
<tr>
<td></td>
<td>
<div id="dup-pass-toggle">
<input type="password" name="secure-pass" id="secure-pass" readonly="true" value="<?php echo esc_attr($dup_install_secure_pass); ?>" />
<button type="button" id="secure-btn" onclick="Duplicator.Pack.TogglePassword()" title="<?php esc_attr_e('Show/Hide Password', 'duplicator'); ?>">
<i class="fas fa-eye"></i>
</button>
</div>
</td>
</tr>
<?php endif; ?>
</table>
<br/><br/>
<table class='dup-dtl-data-tbl'>
<tr>
<td colspan="2">
<div class="dup-install-hdr-2"><?php esc_html_e(" MySQL Server", 'duplicator') ?></div>
</td>
</tr>
<tr>
<td><?php esc_html_e('Host', 'duplicator') ?></td>
<td><?php echo strlen($package->Installer->OptsDBHost) ? esc_html($package->Installer->OptsDBHost) : esc_html__('- not set -', 'duplicator') ?></td>
</tr>
<tr>
<td><?php esc_html_e('Database', 'duplicator') ?></td>
<td><?php echo strlen($package->Installer->OptsDBName) ? esc_html($package->Installer->OptsDBName) : esc_html__('- not set -', 'duplicator') ?></td>
</tr>
<tr>
<td><?php esc_html_e('User', 'duplicator') ?></td>
<td><?php echo strlen($package->Installer->OptsDBUser) ? esc_html($package->Installer->OptsDBUser) : esc_html__('- not set -', 'duplicator') ?></td>
</tr>
</table>
</div>
</div>
<?php if ($debug_on) : ?>
<div style="margin:0">
<a href="javascript:void(0)" onclick="jQuery(this).parent().find('.dup-pack-debug').toggle()">[<?php esc_html_e('View Package Object', 'duplicator') ?>]</a><br/>
<pre class="dup-pack-debug" style="display:none"><?php @print_r($package); ?> </pre>
</div>
<?php endif; ?>
<script>
jQuery(document).ready(function($)
{
/* Shows the 'Download Links' dialog
* @param db The path to the sql file
* @param install The path to the install file
* @param pack The path to the package file */
Duplicator.Pack.ShowLinksDialog = function(json)
{
var url = '#TB_inline?width=650&height=325&inlineId=dup-dlg-quick-path';
tb_show("<?php esc_html_e('Package File Links', 'duplicator') ?>", url);
var msg = <?php printf(
'"%s" + "\n\n%s:\n" + json.archive + "\n\n%s:\n" + json.log + "\n\n%s";',
'=========== SENSITIVE INFORMATION START ===========',
esc_html__("ARCHIVE", 'duplicator'),
esc_html__("LOG", 'duplicator'),
'=========== SENSITIVE INFORMATION END ==========='
);
?>
$("#dup-dlg-quick-path-data").val(msg);
return false;
}
//LOAD: 'Download Links' Dialog and other misc setup
Duplicator.Pack.GetLinksText = function() {$('#dup-dlg-quick-path-data').select();};
Duplicator.Pack.OpenAll = function () {
Duplicator.UI.IsSaveViewState = false;
var states = [];
$("div.dup-box").each(function() {
var pan = $(this).find('div.dup-box-panel');
var panel_open = pan.is(':visible');
if (! panel_open)
$( this ).find('div.dup-box-title').trigger("click");
states.push({
key: pan.attr('id'),
value: 1
});
});
Duplicator.UI.SaveMulViewStates(states);
Duplicator.UI.IsSaveViewState = true;
};
Duplicator.Pack.CloseAll = function () {
Duplicator.UI.IsSaveViewState = false;
var states = [];
$("div.dup-box").each(function() {
var pan = $(this).find('div.dup-box-panel');
var panel_open = pan.is(':visible');
if (panel_open)
$( this ).find('div.dup-box-title').trigger("click");
states.push({
key: pan.attr('id'),
value: 0
});
});
Duplicator.UI.SaveMulViewStates(states);
Duplicator.UI.IsSaveViewState = true;
};
Duplicator.Pack.TogglePassword = 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-xs"></i>');
} else {
$input.attr('type', 'text');
$button.html('<i class="fas fa-eye-slash fa-xs"></i>');
}
}
});
</script>

View File

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

View File

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

View File

@@ -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 = __("Packages 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(__("Packages &raquo; All", 'duplicator'));
include(DUPLICATOR_PLUGIN_PATH . 'views/packages/main/packages.php');
break;
case 'new1':
duplicator_header(__("Packages &raquo; New", 'duplicator'));
include(DUPLICATOR_PLUGIN_PATH . 'views/packages/main/s1.setup1.php');
break;
case 'new2':
duplicator_header(__("Packages &raquo; New", 'duplicator'));
include(DUPLICATOR_PLUGIN_PATH . 'views/packages/main/s2.scan1.php');
break;
case 'new3':
duplicator_header(__("Packages &raquo; New", 'duplicator'));
include(DUPLICATOR_PLUGIN_PATH . 'views/packages/main/s3.build.php');
break;
}
?>

View File

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

View File

@@ -0,0 +1,590 @@
<?php
use Duplicator\Core\Controllers\ControllersManager;
use Duplicator\Libs\Snap\SnapJson;
use Duplicator\Installer\Utils\LinkManager;
use Duplicator\Utils\Upsell;
use Duplicator\Views\ViewHelper;
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 > Packages 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 > Packages 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 package(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("Package 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>&nbsp;</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 Packages Found", 'duplicator'); ?><br/>
<i><?php esc_html_e("Click 'Create New' to Archive 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>&nbsp;';
esc_html_e('Duplicator Lite does not officially support WordPress multisite.', 'duplicator');
echo "<br/>";
esc_html_e('We strongly recommend upgrading to ', 'duplicator');
echo "&nbsp;<i><a href='" . esc_url(Upsell::getCampaignUrl('packages-list', "Mutlisite no packages")) . "' target='_blank'>[" . esc_html__('Duplicator Pro', 'duplicator') . "]</a></i>.";
echo '</div>';
}
?>
<div style="height:75px">&nbsp;</div>
</div>
</td>
</tr>
</tbody>
<tfoot><tr><th>&nbsp;</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 packages", '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("Package", '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 Packages Found", 'duplicator'); ?><br/>
<i><?php esc_html_e("Click 'Create New' to Archive 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">&nbsp;</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='" . __('Archive created as zip file', 'duplicator') . "'>zip</sup>" :
"<sup title='" . __('Archive 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>Building Package</b> <span class="perc"><?php echo $pack_perc; ?></span>%
&nbsp; <i class="fas fa-question-circle fa-sm" style="color:#2C8021"
data-tooltip-title="<?php esc_attr_e("Package Build Running", 'duplicator'); ?>"
data-tooltip="<?php esc_attr_e('To stop or reset this package build goto Settings > Advanced > Reset Packages', '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("Archive", 'duplicator') ?>
</button>
<button type="button" class="button no-select" title="<?php esc_attr_e("Package 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>&nbsp;</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/>';
}
if ($is_mu) {
esc_html_e('Duplicator Lite does not officially support WordPress multisite.', 'duplicator');
echo '<br/>';
esc_html_e('We strongly recommend using', 'duplicator');
echo "&nbsp;<i><a href='" . esc_url(Upsell::getCampaignUrl('packages-list', "Mutlisite bottom package list")) . "' target='_blank'>[" . esc_html__('Duplicator Pro', 'duplicator') . "]</a></i>.";
}
?>
</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 '&nbsp;';
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>&nbsp;';
$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>&nbsp;';
$alert2->message .= __('No selections made! Please select at least one package to delete.', 'duplicator');
$alert2->initAlert();
$confirm1 = new DUP_UI_Dialog();
$confirm1->title = __('Delete Packages?', 'duplicator');
$confirm1->message = __('Are you sure you want to delete the selected package(s)?', 'duplicator');
$confirm1->progressText = __('Removing Packages, 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 package 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 package", '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 package?', '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>

View File

@@ -0,0 +1,310 @@
<?php
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 = __('Package 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>&nbsp;</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(
"%s <a href='admin.php?page=duplicator-settings&tab=package'>%s</a> %s",
esc_html__("ZipArchive extension is required or", 'duplicator'),
esc_html__("Switch to DupArchive", 'duplicator'),
esc_html__("to by-pass this requirement.", 'duplicator')
);
?>
</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> &nbsp; [%s] <br/>", $dup_tests['IO']['SSDIR'], DUP_Settings::getSsdirPath());
printf("<b>%s</b> &nbsp; [%s] <br/>", $dup_tests['IO']['SSTMP'], DUP_Settings::getSsdirTmpPath());
printf("<b>%s</b> &nbsp; [%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. &nbsp; ", '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 "&nbsp;<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 package.", '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&section=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 package 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 = admin_url('admin.php?page=duplicator&tab=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>

View File

@@ -0,0 +1,679 @@
<?php
use Duplicator\Core\Views\TplMng;
use Duplicator\Utils\Upsell;
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 = admin_url("admin.php?page=duplicator&tab=new2&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>&nbsp;<?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>&nbsp;<?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 archive 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>&nbsp;' . 'Amazon',
'<i class="fab fa-dropbox fa-fw"></i>&nbsp;' . 'Dropbox',
'<i class="fab fa-google-drive fa-fw"></i>&nbsp;' . 'Google Drive',
'<i class="fas fa-cloud fa-fw"></i>&nbsp;' . 'OneDrive',
'<i class="fas fa-network-wired fa-fw"></i>&nbsp;' . 'FTP/SFTP'
);
?>
<a href="<?php echo esc_url(Upsell::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 package 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('Archive', 'duplicator');
echo "&nbsp;<sup class='archive-ext'>{$archive_build_mode}</sup>";
?> &nbsp; &nbsp;
</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('Archive Only the Database', 'duplicator') ?>">
<i class="fas fa-database fa-fw"></i> <?php esc_html_e('Database Only', 'duplicator') ?>
<sup>&nbsp;</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 Archive 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') ?>&nbsp;</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> &nbsp;
<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 `" . 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)' />"
. "&nbsp;{$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') ?>:&nbsp;
<a href="?page=duplicator-settings&amp;tab=package" target="settings"><?php echo esc_html($dbbuild_mode); ?></a>
<br/>
<?php esc_html_e("Compatibility Mode", 'duplicator') ?>:&nbsp;
<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 packages.'
. ' If the database server version is lower than the version where the package 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>&nbsp;
<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 archive file with industry-standard AES-256 encryption.', 'duplicator'); ?>
</p>
<a href="<?php echo esc_url(Upsell::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') ?>&nbsp;
</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 archive 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(Upsell::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(Upsell::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') ?> &#9654;" 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 Package Settings?', 'duplicator');
$confirm1->message = __('This will clear and reset all of the current package 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>

View File

@@ -0,0 +1,460 @@
<?php
defined('ABSPATH') || defined('DUPXABSPATH') || exit;
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 = admin_url('admin.php?page=duplicator&tab=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 = admin_url('admin.php?page=duplicator&tab=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="&#9664; <?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 &amp; system notices.', 'duplicator'); ?>
</div>
</div>
</td>
<td>&nbsp;</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> &nbsp;
<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="&#9664; <?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') ?> &#9654" 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>

View File

@@ -0,0 +1,245 @@
<?php
use Duplicator\Utils\Upsell;
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>&nbsp;
<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>&nbsp;<b>' . esc_html__('Web Server', 'duplicator') . ":</b>&nbsp; '" . 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>&nbsp;<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>&nbsp;<b>' . esc_html__('PHP Open Base Dir', 'duplicator') . ":</b>&nbsp; '{$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 youre having issues building a package.', 'duplicator');
echo "&nbsp;<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>&nbsp;<b>' . esc_html__('PHP Max Execution Time', 'duplicator') . ":</b>&nbsp; '{$test}' <br/>";
_e('Timeouts may occur for larger packages 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 package. '
. 'However use caution as excluding the wrong resources can cause your install to not work properly.', 'duplicator');
echo "&nbsp;<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 "&nbsp;<i><a href='" . esc_url(Upsell::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>&nbsp;<b>' . esc_html__('Managed Host', 'duplicator') . ":</b>&nbsp; '{$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 package on managed hosts, however, the installer may not properly install packages created on managed hosts due to the non-standard configurations of managed hosts. '
. 'It is also possible the package engine of Duplicator Lite wont 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> '
. 'Its possible one could get the package 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 <i>'
. '<a href="' . esc_url(Upsell::getCampaignUrl('package-build-scan', 'Managed Host Support')) . '" target="_blank">upgrade to Duplicator Pro</a></i>. '
. 'Pro has more sophisticated package and installer logic and accounts for odd configurations associated with managed hosts.', 'duplicator');
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>&nbsp;<b>' . esc_html__('WordPress Version', 'duplicator') . ":</b>&nbsp; '{$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>&nbsp;<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 archive. These paths are required for WordPress to function!", 'duplicator');
echo "<br/>";
foreach ($core_dir_included as $core_dir) {
echo '&nbsp; &nbsp; <b><i class="fa fa-exclamation-circle scan-warn"></i>&nbsp;' . $core_dir . '</b><br/>';
}
echo '</small><br/>';
$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 archive. This file is required for WordPress to function!", 'duplicator');
echo "<br/>";
foreach ($core_files_included as $core_file) {
echo '&nbsp; &nbsp; <b><i class="fa fa-exclamation-circle scan-warn"></i>&nbsp;' . $core_file . '</b><br/>';
}
echo '</small><br/>';
$filter_text .= (strlen($filter_text) > 0) ? " and file" : "files";
}
if (strlen($filter_text) > 0) {
echo '<small>';
esc_html_e("Note: Please change the {$filter_text} 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');
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 archive 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>&nbsp;<b>' . esc_html__('Cache Path', 'duplicator') . ":</b>&nbsp; '".esc_html($cache_path)."' (".esc_html($cache_size).") <br/>";
_e("Cached data will lead to issues at install time and increases your archive size. Empty your cache directory before building the package 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>&nbsp;<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 package. 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 "&nbsp;<i><a href='" . esc_url(Upsell::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>&nbsp;<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 "&nbsp;<i><a href='" . esc_url(Upsell::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 package created here can be migrated to a new server.", 'duplicator'); ?>
{{else}}
<span style="color: red;">
<?php
esc_html_e("The package created here cannot be migrated to a new server.
The Package 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>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,859 @@
<?php
use Duplicator\Installer\Utils\LinkManager;
use Duplicator\Utils\Upsell;
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 Packages 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 Packages 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 package 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("Packages", 'duplicator'); ?>
</a>
</span>
<?php
$package_url = admin_url('admin.php?page=duplicator&tab=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 Package', '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('Package 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>
&nbsp; <i class="fa fa-download"></i> <?php esc_html_e("Download Package Files", 'duplicator') ?> &nbsp;
</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') ?> &nbsp;
</button> &nbsp;
<button id="dup-btn-archive" class="button button-primary button-large" title="<?php esc_attr_e("Click to download archive 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> &nbsp;
</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 archive 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>&nbsp;';
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 "&nbsp;<i><a href='" . esc_url(Upsell::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 package?', '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 Archive 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 esc_html_e(
'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',
'duplicator'
); ?>
<a href="<?php echo esc_url(Upsell::getCampaignUrl('package-build-complete', 'Build Failed Get Pro')); ?>" target="_blank">
Duplicator Pro,
</a>
<?php esc_html_e(' which is capable of migrating sites much larger than 500MB.', 'duplicator'); ?>
</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 package is under 500MB. If not see additional options below.', 'duplicator'); ?></li>
<li>
<?php esc_html_e('Go to Duplicator &gt; Settings &gt; Packages Tab &gt; Archive Engine &gt;', '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 package using the new engine format.', 'duplicator'); ?></li>
</ol>
<small style="font-style:italic">
<?php esc_html_e('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', 'duplicator'); ?>
<a href="<?php echo esc_url(LinkManager::getDocUrl('how-to-work-with-daf-files-and-the-duparchive-extraction-tool', 'backup_step_3_fail', 'DupArchive Extraction Tool')); ?>" target="_blank">
<?php esc_html_e('commandline extraction tool', 'duplicator'); ?>
</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 package 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 archive file is growing in size or check the main packages screen to see if the package 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\' archive, 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 "Archive Only the Database" checkbox will be auto checked.', 'duplicator'); ?></li>
<li>
<?php
printf(
esc_html_x(
'Complete the package 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 Package 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 package 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 package';
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 package 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 package 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('&nbsp; (' + 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 dont 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 package. " + 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>

View File

@@ -0,0 +1,154 @@
<?php
defined('ABSPATH') || defined('DUPXABSPATH') || exit;
require_once DUPLICATOR_PLUGIN_PATH . '/classes/ui/class.ui.screen.base.php';
/*
Because the default way is overwriting the option names in the hidden input wp_screen_options[option]
I added all inputs via one option name and saved them with the update_user_meta function.
Also, the set-screen-option is not being triggered inside the class, that's why it's here. -TG
*/
add_filter('set-screen-option', 'dup_packages_set_option', 10, 3);
function dup_packages_set_option($status, $option, $value)
{
if ('package_screen_options' == $option) {
$user_id = get_current_user_id();
}
return false;
}
class DUP_Package_Screen extends DUP_UI_Screen
{
public function __construct($page)
{
add_action('load-' . $page, array($this, 'Init'));
}
public function Init()
{
$active_tab = isset($_GET['tab']) ? $_GET['tab'] : 'list';
$active_tab = isset($_GET['action']) && $_GET['action'] == 'detail' ? 'detail' : $active_tab;
$this->screen = get_current_screen();
switch (strtoupper($active_tab)) {
case 'LIST':
$content = $this->get_list_help();
break;
case 'NEW1':
$content = $this->get_step1_help();
break;
case 'NEW2':
$content = $this->get_step2_help();
break;
case 'NEW3':
$content = $this->get_step3_help();
break;
case 'DETAIL':
$content = $this->get_details_help();
break;
default:
$content = $this->get_list_help();
break;
}
$guide = '#guide-packs';
$faq = '#faq-package';
$content .= "<b>References:</b><br/>"
. "<a href='" . esc_url(DUPLICATOR_DOCS_URL . $guide)
. "' target='_sc-guide'>User Guide</a> | "
. "<a href='" . esc_url(DUPLICATOR_TECH_FAQ_URL . $faq) . "' target='_sc-guide'>FAQs</a> | "
. "<a href='" . DUPLICATOR_BLOG_URL . "knowledge-base-article-categories/quick-start/' target='_sc-guide'>Quick Start</a>";
$this->screen->add_help_tab(array(
'id' => 'dup_help_package_overview',
'title' => esc_html__('Overview', 'duplicator'),
'content' => "<p>{$content}</p>"
));
$this->getSupportTab($guide, $faq);
$this->getHelpSidbar();
}
public function get_list_help()
{
return __(
"<b><i class='fa fa-archive'></i> Packages » All</b><br/> The 'Packages' section is the main interface for managing all the packages that have been created. "
. "A Package consists of two core files, the 'archive.zip' and the 'installer.php' file. The archive file is a zip file containing all your WordPress files and a "
. "copy of your WordPress database. The installer file is a php file that when browsed to via a web browser presents a wizard that redeploys/installs the website "
. "by extracting the archive file and installing the database. To create a package, click the 'Create New' button and follow the prompts. <br/><br/>"
. "<b><i class='fa fa-download'></i> Downloads</b><br/>"
. "To download the package files click on the Installer and Archive buttons after creating a package. The archive file will have a copy of the installer inside of it named "
. "installer-backup.php in case the original installer file is lost. To see the details of a package click on the <i class='fa fa-archive'></i> details button.<br/><br/>"
. "<b><i class='far fa-file-archive'></i> Archive Types</b><br/>"
. "An archive file can be saved as either a .zip file or .daf file. A zip file is a common archive format used to compress and group files. The daf file short for "
. "'Duplicator Archive Format' is a custom format used specifically for working with larger packages and scale-ability issues on many shared hosting platforms. Both "
. "formats work very similar. The main difference is that the daf file can only be extracted using the installer.php file or the "
. "<a href='" . DUPLICATOR_DOCS_URL . "how-to-work-with-daf-files-and-the-duparchive-extraction-tool'"
. " target='_blank'>DAF extraction tool</a>. The zip file can be used by the installer.php "
. "or other zip tools like winrar/7-Zip/winzip or other client-side tools. <br/><br/>",
'duplicator'
);
}
public function get_step1_help()
{
return __("<b>Packages New » 1 Setup</b> <br/>"
. "The setup step allows for optional filtered directory paths, files, file extensions and database tables. To filter specific system files, click the 'Enable File Filters' "
. "checkbox and add the full path of the file or directory, followed by a semicolon. For a file extension add the name (i.e. 'zip') followed by a semicolon. <br/><br/>"
. "To exclude a database table, check the box labeled 'Enable Table Filters' and check the table name to exclude. To include only a copy of your database in the "
. "archive file check the box labeled 'Archive Only the Database'. The installer.php file can optionally be pre-filled with data at install time but is not "
. "required. <br/><br/>", 'duplicator');
}
public function get_step2_help()
{
$status1 = sprintf('%1$s Good %2$s', '<span class="badge badge-pass">', '</span>');
$status2 = sprintf('%1$s Notice %2$s', '<span class="badge badge-warn">', '</span>');
//TITLE
$msg = sprintf('%1$s Packages » 2 Scan %2$s', '<b>', '</b><br/>');
//MESSAGE
$msg .= sprintf(
'In Step-2 of the build process Duplicator scans your WordPress site files and database for any possible issues. Each section is expandable '
. 'and will show more details regarding the parameters of that section. The following indicators will be present for each section: %3$s'
. '%1$s Indicates that no issues were detected. It is best to try and get all the values to display this status if possible, but not required. %3$s'
. '%2$s Indicates a possible issue. A notice will not prevent the build from running however, if you do have issues then the section should be observed. %4$s',
$status1,
$status2,
'<br/>',
'<br/><br/>'
);
return $msg;
}
public function get_step3_help()
{
return __("<b>Packages » 3 Build</b> <br/>"
. "The final step in the build process where the installer script and archive of the website can be downloaded. To start the install process follow these steps: "
. "<ol>"
. "<li>Download the installer.php and archive.zip files to your local computer.</li>"
. "<li>For localhost installs be sure you have PHP, Apache & MySQL installed on your local computer with software such as XAMPP, Instant WordPress or MAMP for MAC. "
. "Place the package.zip and installer.php into any empty directory under your webroot then browse to the installer.php via your web browser to launch the install wizard.</li>"
. "<li>For remote installs use FTP or cPanel to upload both the archive.zip and installer.php to your hosting provider. Place the files in a new empty directory under "
. "your host's webroot accessible from a valid URL such as http://your-domain/your-wp-directory/installer.php to launch the install wizard. On some hosts the root directory "
. "will be a something like public_html -or- www. If your're not sure contact your hosting provider. </li>"
. "</ol>"
. "For complete instructions see:<br/>"
. "<a href='" . DUPLICATOR_BLOG_URL . "knowledge-base-article-categories/quick-start/"
. "?utm_source=duplicator_free&amp;utm_medium=wordpress_plugin&amp;utm_content=package_built_install_help4&amp;utm_campaign=duplicator_free"
. "#quick-040-q' target='_blank'>How do I install this Package?</a><br/><br/>", 'duplicator');
}
public function get_details_help()
{
return __("<b>Packages » Details</b> <br/>"
. "The details view will give you a full break-down of the package including any errors that may have occured during the install. <br/><br/>", 'duplicator');
}
}

View File

@@ -0,0 +1,53 @@
<?php
use Duplicator\Core\MigrationMng;
defined('ABSPATH') || defined('DUPXABSPATH') || exit;
$safeMsg = MigrationMng::getSaveModeWarning();
$nonce = wp_create_nonce('duplicator_cleanup_page');
$url = DUP_CTRL_Tools::getDiagnosticURL();
?>
<div class="dup-notice-success notice notice-success duplicator-pro-admin-notice dup-migration-pass-wrapper" >
<p>
<b><?php
if (MigrationMng::getMigrationData('restoreBackupMode')) {
_e('Restore Backup Almost Complete!', 'duplicator');
} else {
_e('Migration Almost Complete!', 'duplicator');
}
?></b>
</p>
<p>
<?php
esc_html_e(
'Reserved Duplicator installation files have been detected in the root directory. '
. 'Please delete these installation files to avoid security issues.',
'duplicator'
);
?>
<br/>
<?php
esc_html_e('Go to: Tools > General > Information > Stored Data > and click the "Remove Installation Files" button', 'duplicator'); ?><br>
<a id="dpro-notice-action-general-site-page" href="<?php echo $url; ?>">
<?php esc_html_e('Take me there now!', 'duplicator'); ?>
</a>
</p>
<?php if (strlen($safeMsg) > 0) { ?>
<div class="notice-safemode">
<?php echo esc_html($safeMsg); ?>
</div>
<?php } ?>
<p class="sub-note">
<i><?php
_e(
'If an archive.zip/daf file was intentially added to the root '
. 'directory to perform an overwrite install of this site then you can ignore this message.',
'duplicator'
);
?>
</i>
</p>
<?php echo apply_filters(MigrationMng::HOOK_BOTTOM_MIGRATION_MESSAGE, ''); ?>
</div>

View File

@@ -0,0 +1,95 @@
<?php
defined('ABSPATH') || defined('DUPXABSPATH') || exit;
use Duplicator\Core\MigrationMng;
use Duplicator\Installer\Utils\LinkManager;
use Duplicator\Views\AdminNotices;
?>
<div class="dpro-diagnostic-action-installer">
<p>
<b><?php echo __('Installation cleanup ran!', 'duplicator'); ?></b>
</p>
<?php
$fileRemoved = MigrationMng::cleanMigrationFiles();
$removeError = false;
if (count($fileRemoved) === 0) {
?>
<p>
<b><?php _e('No Duplicator files were found on this WordPress Site.', 'duplicator'); ?></b>
</p> <?php
} else {
foreach ($fileRemoved as $path => $success) {
if ($success) {
?><div class="success">
<i class="fa fa-check"></i> <?php _e("Removed", 'duplicator'); ?> - <?php echo esc_html($path); ?>
</div><?php
} else {
?><div class="failed">
<i class='fa fa-exclamation-triangle'></i> <?php _e("Found", 'duplicator'); ?> - <?php echo esc_html($path); ?>
</div><?php
$removeError = true;
}
}
}
foreach (MigrationMng::purgeCaches() as $message) {
?><div class="success">
<i class="fa fa-check"></i> <?php echo $message; ?>
</div>
<?php
}
if ($removeError) {
?>
<p>
<?php _e('Some of the installer files did not get removed, ', 'duplicator'); ?>
<span class="link-style" onclick="Duplicator.Tools.deleteInstallerFiles();">
<?php _e('please retry the installer cleanup process', 'duplicator'); ?>
</span><br>
<?php _e(' If this process continues please see the previous FAQ link.', 'duplicator'); ?>
</p>
<?php
} else {
delete_option(AdminNotices::OPTION_KEY_MIGRATION_SUCCESS_NOTICE);
}
?>
<div style="font-style: italic; max-width:900px; padding:10px 0 25px 0;">
<p>
<b><i class="fa fa-shield-alt"></i> <?php esc_html_e('Security Notes', 'duplicator'); ?>:</b>
<?php
_e(
' If the installer files do not successfully get removed with this action, '
. 'then they WILL need to be removed manually through your hosts control panel '
. 'or FTP. Please remove all installer files to avoid any security issues on this site.',
'duplicator'
);
?><br>
<?php
printf(
_x(
'For more details please visit the FAQ link %1$sWhich files need to be removed after an install?%2$s',
'%1$s and %2$s are <a> tags',
'duplicator'
),
'<a href="' . esc_url(LinkManager::getDocUrl('which-files-need-to-be-removed-after-an-install', 'migration-notice')) . '" target="_blank">',
'</a>'
);
?>
</p>
<p>
<b><i class="fa fa-thumbs-up"></i> <?php esc_html_e('Help Support Duplicator', 'duplicator'); ?>:</b>
<?php
_e('The Duplicator team has worked many years to make moving a WordPress site a much easier process. ', 'duplicator');
echo '<br/>';
_e(
'Show your support with a '
. '<a href="' . esc_url(\Duplicator\Core\Notifications\Review::getReviewUrl()) . '" '
. 'target="_blank">5 star review</a>! We would be thrilled if you could!',
'duplicator'
);
?>
</p>
</div>
</div>

View File

@@ -0,0 +1,85 @@
<?php
defined('ABSPATH') || defined('DUPXABSPATH') || exit;
use Duplicator\Core\MigrationMng;
use Duplicator\Libs\Snap\SnapUtil;
$safeMsg = MigrationMng::getSaveModeWarning();
$cleanupReport = MigrationMng::getCleanupReport();
$cleanFileAction = (SnapUtil::filterInputRequest('action', FILTER_DEFAULT) === 'installer');
?>
<div class="dup-notice-success notice notice-success duplicator-pro-admin-notice dup-migration-pass-wrapper">
<div class="dup-migration-pass-title">
<i class="fa fa-check-circle"></i> <?php
if (MigrationMng::getMigrationData('restoreBackupMode')) {
_e('This site has been successfully restored!', 'duplicator');
} else {
_e('This site has been successfully migrated!', 'duplicator');
}
?>
</div>
<p>
<?php printf(__('The following installation files are stored in the folder <b>%s</b>', 'duplicator'), DUP_Settings::getSsdirPath()); ?>
</p>
<ul class="dup-stored-minstallation-files">
<?php foreach (MigrationMng::getStoredMigrationLists() as $path => $label) { ?>
<li>
- <?php echo esc_html($label); ?>
</li>
<?php } ?>
</ul>
<?php
if ($cleanFileAction) {
require DUPLICATOR_LITE_PATH . '/views/parts/migration-clean-installation-files.php';
} else {
if (count($cleanupReport['instFile']) > 0) { ?>
<p>
<?php _e('Security actions:', 'duplicator'); ?>
</p>
<ul class="dup-stored-minstallation-files">
<?php
foreach ($cleanupReport['instFile'] as $html) { ?>
<li>
<?php echo $html; ?>
</li>
<?php } ?>
</ul>
<?php } ?>
<p>
<b><?php _e('Final step:', 'duplicator'); ?></b><br>
<span id="dpro-notice-action-remove-installer-files" class="link-style" onclick="Duplicator.Tools.deleteInstallerFiles();" >
<?php esc_html_e('Remove Installation Files Now!', 'duplicator'); ?>
</span>
</p>
<?php if (strlen($safeMsg) > 0) { ?>
<div class="notice-safemode">
<?php echo esc_html($safeMsg); ?>
</div>
<?php } ?>
<p class="sub-note">
<i><?php
_e(
'Note: This message will be removed after all installer files are removed.'
. ' Installer files must be removed to maintain a secure site.'
. ' Click the link above to remove all installer files and complete the migration.',
'duplicator'
);
?><br>
<i class="fas fa-info-circle"></i>
<?php
_e(
'If an archive.zip/daf file was intentially added to the root directory to '
. 'perform an overwrite install of this site then you can ignore this message.',
'duplicator'
)
?>
</i>
</p>
<?php
}
echo apply_filters(MigrationMng::HOOK_BOTTOM_MIGRATION_MESSAGE, '');
?>
</div>

View File

@@ -0,0 +1,125 @@
<?php
defined('ABSPATH') || defined('DUPXABSPATH') || exit;
?>
<style>
/*================================================
PAGE-SUPPORT:*/
div.dup-support-all {font-size:13px; line-height:20px}
table.dup-support-hlp-hdrs {border-collapse:collapse; width:100%; border-bottom:1px solid #dfdfdf}
table.dup-support-hlp-hdrs {background-color:#efefef;}
table.dup-support-hlp-hdrs td {
padding:2px; height:52px;
font-weight:bold; font-size:17px;
background-image:-ms-linear-gradient(top, #FFFFFF 0%, #DEDEDE 100%);
background-image:-moz-linear-gradient(top, #FFFFFF 0%, #DEDEDE 100%);
background-image:-o-linear-gradient(top, #FFFFFF 0%, #DEDEDE 100%);
background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0, #FFFFFF), color-stop(1, #DEDEDE));
background-image:-webkit-linear-gradient(top, #FFFFFF 0%, #DEDEDE 100%);
background-image:linear-gradient(to bottom, #FFFFFF 0%, #DEDEDE 100%);
}
table.dup-support-hlp-hdrs td img{margin-left:7px}
div.dup-support-hlp-txt{padding:10px 4px 4px 4px; text-align:center}
div.dup-support-give-area {width:265px; height:225px; float:left; margin:10px; line-height:18px;}
div.dup-spread-word {display:inline-block; border:1px solid red; text-align:center}
img#dup-support-approved { -webkit-animation:approve-keyframe 12s 1s infinite alternate backwards}
img#dup-img-5stars {opacity:0.7;}
img#dup-img-5stars:hover {opacity:1.0;}
div.social-item {float:right; width: 170px; padding:10px; border:0px solid red; text-align: left; font-size:20px}
/* EMAIL AREA */
div.dup-support-email-area {width:825px; height:355px; margin:10px; line-height:18px;}
#mce-EMAIL {font-size:20px; height:40px; width:500px}
#mce-responses {width:300px}
#mc-embedded-subscribe { height: 35px; font-size: 16px; font-weight: bold}
div.mce_inline_error {width:300px; margin: auto !important}
div#mce-responses {margin: auto; padding: 10px; width:500px; font-weight: bold;}
</style>
<div class="wrap dup-wrap dup-support-all">
<div style="width:850px; margin:auto; margin-top:30px">
<table style="width:825px">
<tr>
<td style="width:230px;">
<img src="<?php echo esc_url(DUPLICATOR_PLUGIN_URL . "assets/img/logo-box.png"); ?>" style='margin-top:-60px; height:176px; width:176px' />
</td>
<td valign="top" style="padding-top:10px; font-size:15px; text-align:justify;">
<?php
esc_html_e("Duplicator can streamline your workflow and quickly clone/migrate a WordPress site. The plugin helps admins, designers and "
. "developers speed up the migration process of moving a WordPress site. Please help us continue development by giving the plugin a "
. "5 star and consider purchasing our Pro product.", 'duplicator');
?>
<br/><br/>
<!-- PARTNER WITH US -->
<div class="dup-support-give-area">
<table class="dup-support-hlp-hdrs">
<tr >
<td style="height:30px; text-align: center;">
<span><?php esc_html_e('Rate Duplicator', 'duplicator') ?></span>
</td>
</tr>
</table>
<table style="text-align: center;width:100%; font-size:11px; font-style:italic; margin-top:35px">
<tr>
<td valign="top">
<a href="<?php echo esc_url(\Duplicator\Core\Notifications\Review::getReviewUrl()); ?>" target="vote-wp"><img id="dup-img-5stars" src="<?php echo DUPLICATOR_PLUGIN_URL ?>assets/img/5star.png" /></a>
<div style=" font-size: 16px; font-weight: bold; line-height: 22px">
<a href="<?php echo esc_url(\Duplicator\Core\Notifications\Review::getReviewUrl()); ?>" target="vote-wp">
<?php
esc_html_e('Support Duplicator', 'duplicator');
echo '<br/>';
esc_html_e('with a 5 star review!', 'duplicator')
?>
</a>
</div>
</td>
</tr>
</table>
</div>
<!-- SPREAD THE WORD -->
<div class="dup-support-give-area">
<table class="dup-support-hlp-hdrs">
<tr>
<td style="height:30px; text-align: center;">
<span><?php esc_html_e('Spread the Word', 'duplicator') ?></span>
</td>
</tr>
</table>
<div class="dup-support-hlp-txt">
<br/>
<div class="social-images">
<a href="https://www.facebook.com/sharer/sharer.php?u=https%3A//snapcreek.com/duplicator/duplicator-free/" target="_blank">
<div class="social-item"><i class="fab fa-facebook-square fa-lg"></i> <?php esc_html_e('Facebook', 'duplicator') ?></div>
</a>
<a href="https://twitter.com/home?status=Checkout%20the%20WordPress%20Duplicator%20plugin!%20%0Ahttps%3A//snapcreek.com/duplicator/duplicator-free/" target="_blank">
<div class="social-item"><i class="fab fa-twitter-square fa-lg"></i> <?php esc_html_e('Twitter', 'duplicator') ?></div>
</a>
<a href="https://www.linkedin.com/shareArticle?mini=true&url=https%3A//snapcreek.com/duplicator/duplicator-free/&title=WordPress%20Duplicator%20Plugin&summary=&source=" target="_blank">
<div class="social-item"><i class="fab fa-linkedin fa-lg"></i> <?php esc_html_e('LinkedIn', 'duplicator') ?></div>
</a>
</div>
</div>
</div>
<br style="clear:both" /><br/>
</td>
</tr>
</table>
</div>
</div><br/><br/><br/><br/>
<script>
jQuery(document).ready(function($)
{
$('input[type="checkbox"][name="privacy"]').change(function() {
if(this.checked) {
$("#mc-embedded-subscribe").prop("disabled", false);
} else {
$("#mc-embedded-subscribe").prop("disabled", true);
}
});
});
</script>

View File

@@ -0,0 +1,80 @@
<?php
use Duplicator\Core\Controllers\ControllersManager;
use Duplicator\Core\Bootstrap;
use Duplicator\Core\Views\TplMng;
defined('ABSPATH') || defined('DUPXABSPATH') || exit;
DUP_Handler::init_error_handler();
DUP_Util::hasCapability('export');
global $wpdb;
//COMMON HEADER DISPLAY
require_once(DUPLICATOR_PLUGIN_PATH . '/assets/js/javascript.php');
require_once(DUPLICATOR_PLUGIN_PATH . '/views/inc.header.php');
require_once(DUPLICATOR_PLUGIN_PATH . '/classes/ui/class.ui.dialog.php');
require_once(DUPLICATOR_PLUGIN_PATH . '/classes/ui/class.ui.messages.php');
$current_tab = isset($_REQUEST['tab']) ? sanitize_text_field($_REQUEST['tab']) : 'general';
?>
<div class="wrap dup-settings-pages">
<?php duplicator_header(__("Settings", 'duplicator')) ?>
<h2 class="nav-tab-wrapper">
<a
href="<?php echo esc_url(ControllersManager::getMenuLink(ControllersManager::SETTINGS_SUBMENU_SLUG, 'general')); ?> "
class="nav-tab <?php echo ($current_tab == 'general') ? 'nav-tab-active' : '' ?>"
>
<?php esc_html_e('General', 'duplicator'); ?>
</a>
<a
href="<?php echo esc_url(ControllersManager::getMenuLink(ControllersManager::SETTINGS_SUBMENU_SLUG, 'package')); ?> "
class="nav-tab <?php echo ($current_tab == 'package') ? 'nav-tab-active' : '' ?>"
>
<?php esc_html_e('Packages', 'duplicator'); ?>
</a>
<a
href="<?php echo esc_url(ControllersManager::getMenuLink(ControllersManager::SETTINGS_SUBMENU_SLUG, 'storage')); ?> "
class="nav-tab <?php echo ($current_tab == 'storage') ? 'nav-tab-active' : '' ?>"
>
<?php esc_html_e('Storage', 'duplicator'); ?>
</a>
<a
href="<?php echo esc_url(ControllersManager::getMenuLink(ControllersManager::SETTINGS_SUBMENU_SLUG, 'access')); ?> "
class="nav-tab <?php echo ($current_tab == 'access') ? 'nav-tab-active' : '' ?>"
>
<?php esc_html_e('Access', 'duplicator'); ?>
</a>
<a
href="<?php echo esc_url(ControllersManager::getMenuLink(ControllersManager::SETTINGS_SUBMENU_SLUG, 'license')); ?> "
class="nav-tab <?php echo ($current_tab == 'license') ? 'nav-tab-active' : '' ?>"
>
<?php esc_html_e('License', 'duplicator'); ?>
</a>
</h2>
<?php
switch ($current_tab) {
case 'general':
TplMng::getInstance()->render("admin_pages/settings/general/general");
break;
case 'package':
include(DUPLICATOR_PLUGIN_PATH . "views/settings/packages.php");
break;
case 'storage':
include(DUPLICATOR_PLUGIN_PATH . "views/settings/storage.php");
break;
case 'access':
Bootstrap::mocksStyles();
TplMng::getInstance()->render("mocks/settings/access/capabilities");
break;
case 'license':
include(DUPLICATOR_PLUGIN_PATH . "views/settings/license.php");
break;
}
do_action('duplicator_settings_page_footer');
?>
</div>

View File

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

View File

@@ -0,0 +1,93 @@
<?php
use Duplicator\Utils\Upsell;
defined('ABSPATH') || defined('DUPXABSPATH') || exit;
?>
<h3 class="title"><?php esc_html_e('Activation', 'duplicator'); ?> </h3>
<hr size="1" />
<table class="form-table licenses-table">
<tr valign="top">
<th scope="row"><?php esc_html_e('Manage', 'duplicator') ?></th>
<td>
<?php
echo sprintf(
__('%1$sManage Licenses%2$s', 'duplicator'),
'<a target="_blank" href="' . esc_url(Upsell::getCampaignUrl('license-tab', 'Manage Licenses')) . '">',
'</a>'
);
?>
</td>
</tr>
<tr valign="top">
<th scope="row"><?php esc_html_e('Type', 'duplicator') ?></th>
<td class="dpro-license-type">
<?php esc_html_e('Duplicator Lite', 'duplicator'); ?>
<div style="padding: 10px">
<i class="far fa-check-square"></i> <?php esc_html_e('Basic Features', 'duplicator'); ?> <br/>
<i class="far fa-square"></i>
<a target="_blank"
href="<?php echo esc_url(Upsell::getCampaignUrl('license-tab', 'Pro Features')); ?>"
>
<?php esc_html_e('Pro Features', 'duplicator'); ?>
</a><br>
</div>
</td>
</tr>
<tr valign="top">
<th scope="row"><label><?php esc_html_e('License Key', 'duplicator'); ?></label></th>
<td>
<div class="description" style="max-width:700px">
<p><?php esc_html_e('You\'re using Duplicator Lite - no license needed. Enjoy!', 'duplicator'); ?> 🙂</p>
<p>
<?php printf(
wp_kses(
__('To unlock more features consider <strong><a href="%s" target="_blank" rel="noopener noreferrer">upgrading to PRO</a></strong>.', 'duplicator'),
array(
'a' => array(
'href' => array(),
'class' => array(),
'target' => array(),
'rel' => array(),
),
'strong' => array(),
)
),
esc_url(Upsell::getCampaignUrl('license-tab', 'upgrading to PRO'))
); ?>
</p>
<p class="discount-note">
<?php
printf(
__(
'As a valued Duplicator Lite user you receive <strong>%1$d%% off</strong>, automatically applied at checkout!',
'duplicator'
),
DUP_Constants::UPSELL_DEFAULT_DISCOUNT
);
?>
</p>
<hr>
<p>
<?php _e('Already purchased? Simply enter your license key below to enable <b>Duplicator PRO!</b>', 'duplicator'); ?></p>
<p>
<input type="text" id="dup-settings-upgrade-license-key" placeholder="<?php echo esc_attr__('Paste license key here', 'duplicator'); ?>" value="">
<button type="button" class="dup-btn dup-btn-md dup-btn-orange" id="dup-settings-connect-btn"><?php echo esc_html__('One click Upgrade to Pro', 'duplicator'); ?></button>
</p>
</div>
</td>
</tr>
</table>
<!-- An absolute position placed invisible form element which is out of browser window -->
<form action="placeholder_will_be_replaced" method="get" id="redirect-to-remote-upgrade-endpoint">
<input type="hidden" name="oth" id="form-oth" value="">
<input type="hidden" name="license_key" id="form-key" value="">
<input type="hidden" name="version" id="form-version" value="">
<input type="hidden" name="redirect" id="form-redirect" value="">
<input type="hidden" name="endpoint" id="form-endpoint" value="">
<input type="hidden" name="siteurl" id="form-siteurl" value="">
<input type="hidden" name="homeurl" id="form-homeurl" value="">
<input type="hidden" name="file" id="form-file" value="">
</form>

View File

@@ -0,0 +1,477 @@
<?php
use Duplicator\Installer\Utils\LinkManager;
use Duplicator\Utils\Upsell;
use Duplicator\Libs\Snap\SnapIO;
use Duplicator\Libs\Snap\SnapUtil;
defined('ABSPATH') || defined('DUPXABSPATH') || exit;
global $wp_version;
global $wpdb;
$action_updated = null;
$action_response = __("Package Settings Saved", 'duplicator');
$mysqldump_exe_file = '';
//SAVE RESULTS
if (isset($_POST['action']) && $_POST['action'] == 'save') {
//Nonce Check
$nonce = sanitize_text_field($_POST['dup_settings_save_nonce_field']);
if (!isset($_POST['dup_settings_save_nonce_field']) || !wp_verify_nonce($nonce, 'dup_settings_save')) {
die('Invalid token permissions to perform this request.');
}
//Package
$mysqldump_enabled = isset($_POST['package_dbmode']) && $_POST['package_dbmode'] == 'mysql' ? "1" : "0";
if (isset($_POST['package_mysqldump_path'])) {
$mysqldump_exe_file = SnapUtil::sanitizeNSCharsNewlineTabs($_POST['package_mysqldump_path']);
$mysqldump_exe_file = preg_match('/^([A-Za-z]\:)?[\/\\\\]/', $mysqldump_exe_file) ? $mysqldump_exe_file : '';
$mysqldump_exe_file = preg_replace('/[\'";]/m', '', $mysqldump_exe_file);
$mysqldump_exe_file = SnapIO::safePathUntrailingslashit($mysqldump_exe_file);
$mysqldump_exe_file = DUP_DB::escSQL(strip_tags($mysqldump_exe_file), true);
}
DUP_Settings::Set('last_updated', date('Y-m-d-H-i-s'));
DUP_Settings::Set('package_zip_flush', isset($_POST['package_zip_flush']) ? "1" : "0");
DUP_Settings::Set('archive_build_mode', sanitize_text_field($_POST['archive_build_mode']));
DUP_Settings::Set('package_mysqldump', $mysqldump_enabled ? "1" : "0");
DUP_Settings::Set('package_phpdump_qrylimit', isset($_POST['package_phpdump_qrylimit']) ? $_POST['package_phpdump_qrylimit'] : "100");
DUP_Settings::Set('package_mysqldump_path', $mysqldump_exe_file);
DUP_Settings::Set('package_ui_created', sanitize_text_field($_POST['package_ui_created']));
switch (filter_input(INPUT_POST, 'installer_name_mode', FILTER_DEFAULT)) {
case DUP_Settings::INSTALLER_NAME_MODE_WITH_HASH:
DUP_Settings::Set('installer_name_mode', DUP_Settings::INSTALLER_NAME_MODE_WITH_HASH);
break;
case DUP_Settings::INSTALLER_NAME_MODE_SIMPLE:
default:
DUP_Settings::Set('installer_name_mode', DUP_Settings::INSTALLER_NAME_MODE_SIMPLE);
break;
}
$action_updated = DUP_Settings::Save();
DUP_Util::initSnapshotDirectory();
}
$is_shellexec_on = DUP_Util::hasShellExec();
$package_zip_flush = DUP_Settings::Get('package_zip_flush');
$phpdump_chunkopts = array("20", "100", "500", "1000", "2000");
$phpdump_qrylimit = DUP_Settings::Get('package_phpdump_qrylimit');
$package_mysqldump = DUP_Settings::Get('package_mysqldump');
$package_mysqldump_path = trim(DUP_Settings::Get('package_mysqldump_path'));
$package_ui_created = is_numeric(DUP_Settings::Get('package_ui_created')) ? DUP_Settings::Get('package_ui_created') : 1;
$mysqlDumpPath = DUP_DB::getMySqlDumpPath();
$mysqlDumpFound = ($mysqlDumpPath) ? true : false;
$archive_build_mode = DUP_Settings::Get('archive_build_mode');
$installerNameMode = DUP_Settings::Get('installer_name_mode');
?>
<style>
form#dup-settings-form input[type=text] {width:500px; }
#dup-settings-form tr td { line-height: 1.6; }
div.dup-feature-found {padding:10px 0 5px 0; color:green;}
div.dup-feature-notfound {color:maroon; width:600px; line-height: 18px}
select#package_ui_created {font-family: monospace}
div.engine-radio {float: left; min-width: 100px}
div.engine-sub-opts {padding:5px 0 10px 15px; display:none }
.dup-install-meta {display: inline-block; min-width: 50px}
</style>
<form id="dup-settings-form" action="<?php echo admin_url('admin.php?page=duplicator-settings&tab=package'); ?>" method="post">
<?php wp_nonce_field('dup_settings_save', 'dup_settings_save_nonce_field', false); ?>
<input type="hidden" name="action" value="save">
<input type="hidden" name="page" value="duplicator-settings">
<?php if ($action_updated) : ?>
<div id="message" class="notice notice-success is-dismissible dup-wpnotice-box"><p><?php echo esc_html($action_response); ?></p></div>
<?php endif; ?>
<h3 class="title"><?php esc_html_e("Database", 'duplicator') ?> </h3>
<hr size="1" />
<table class="form-table">
<tr>
<th scope="row"><label><?php esc_html_e("SQL Mode", 'duplicator'); ?></label></th>
<td>
<div class="engine-radio <?php echo ($is_shellexec_on) ? '' : 'engine-radio-disabled'; ?>">
<input type="radio" name="package_dbmode" value="mysql" id="package_mysqldump" <?php echo ($package_mysqldump) ? 'checked="checked"' : ''; ?> />
<label for="package_mysqldump"><?php esc_html_e("Mysqldump", 'duplicator'); ?></label>
</div>
<div class="engine-radio" >
<!-- PHP MODE -->
<?php if (!$mysqlDumpFound) : ?>
<input type="radio" name="package_dbmode" id="package_phpdump" value="php" checked="checked" />
<?php else : ?>
<input type="radio" name="package_dbmode" id="package_phpdump" value="php" <?php echo (!$package_mysqldump) ? 'checked="checked"' : ''; ?> />
<?php endif; ?>
<label for="package_phpdump"><?php esc_html_e("PHP Code", 'duplicator'); ?></label>
</div>
<br style="clear:both"/><br/>
<!-- SHELL EXEC -->
<div class="engine-sub-opts" id="dbengine-details-1" style="display:none">
<?php if (!$is_shellexec_on) : ?>
<p class="description" style="width:550px; margin:5px 0 0 20px">
<?php
_e("This server does not support the PHP shell_exec or exec function which is required for mysqldump to run. ", 'duplicator');
_e("Please contact the host or server administrator to enable this feature.", 'duplicator');
?>
<br/>
<small>
<i style="cursor: pointer"
data-tooltip-title="<?php esc_html_e("Host Recommendation:", 'duplicator'); ?>"
data-tooltip="<?php esc_html_e('Duplicator recommends going with the high performance pro plan or better from our recommended list', 'duplicator'); ?>">
<i class="far fa-lightbulb" aria-hidden="true"></i>
<?php
printf(
_x(
'Please visit our recommended %1$shost list%2$s for reliable access to mysqldump.',
'%1s and %2s represents the opening and closing HTML tags for an anchor or link',
'duplicator'
),
'<a target="_blank" href="'
. esc_url(LinkManager::getDocUrl('what-host-providers-are-recommended-for-duplicator', 'settings', 'host list tooltip'))
. '">',
'</a>'
);
?>
</i>
</small>
<br/><br/>
</p>
<?php else : ?>
<div style="margin:0 0 0 15px">
<?php if ($mysqlDumpFound) : ?>
<div class="dup-feature-found">
<i class="fa fa-check-circle"></i>
<?php esc_html_e("Successfully Found:", 'duplicator'); ?> &nbsp;
<i><?php echo esc_html($mysqlDumpPath); ?></i>
</div><br/>
<?php else : ?>
<div class="dup-feature-notfound">
<i class="fa fa-exclamation-triangle fa-sm"></i>
<?php
_e('Mysqldump was not found at its default location or the location provided. Please enter a custom path to a valid location where mysqldump can run. '
. 'If the problem persist contact your host or server administrator. ', 'duplicator');
printf(
_x(
'See the %1$shost list%2$s for reliable access to mysqldump.',
'%1s and %2s represents the opening and closing HTML tags for an anchor or link',
'duplicator'
),
'<a target="_blank" href="'
. esc_url(LinkManager::getDocUrl('what-host-providers-are-recommended-for-duplicator', 'settings', 'host list'))
. '">',
'</a>'
);
?>
</div><br/>
<?php endif; ?>
<label><?php esc_html_e("Custom Path", 'duplicator'); ?></label>
<i class="fas fa-question-circle fa-sm"
data-tooltip-title="<?php esc_attr_e("mysqldump path:", 'duplicator'); ?>"
data-tooltip="<?php
esc_attr_e('Add a custom path if the path to mysqldump is not properly detected. For all paths use a forward slash as the '
. 'path seperator. On Linux systems use mysqldump for Windows systems use mysqldump.exe. If the path tried does not work please contact your hosting '
. 'provider for details on the correct path.', 'duplicator');
?>"></i>
<br/>
<input
type="text" name="package_mysqldump_path"
id="package_mysqldump_path"
value="<?php echo esc_attr($package_mysqldump_path); ?>"
placeholder="<?php esc_attr_e("/usr/bin/mypath/mysqldump", 'duplicator'); ?>"
>
<div class="dup-feature-notfound">
<?php
if (!$mysqlDumpFound && strlen($mysqldump_exe_file)) {
_e('<i class="fa fa-exclamation-triangle fa-sm"></i> The custom path provided is not recognized as a valid mysqldump file:<br/>', 'duplicator');
$mysqldump_path = esc_html($package_mysqldump_path);
echo "'" . esc_html($mysqldump_path) . "'";
}
?>
</div>
<br/>
</div>
<?php endif; ?>
</div>
<!-- PHP OPTION -->
<div class="engine-sub-opts" id="dbengine-details-2" style="display:none; line-height: 35px; margin:0 0 0 15px">
<!-- PRO ONLY -->
<label><?php esc_html_e("Mode", 'duplicator'); ?>:</label>
<select name="">
<option selected="selected" value="1">
<?php esc_html_e("Single-Threaded", 'duplicator'); ?>
</option>
<option disabled="disabled" value="0">
<?php esc_html_e("Multi-Threaded (Pro)", 'duplicator'); ?>
</option>
</select>
<i style="margin-right:7px;" class="fas fa-question-circle fa-sm"
data-tooltip-title="<?php esc_attr_e("PHP Code Mode:", 'duplicator'); ?>"
data-tooltip="<?php
esc_attr_e('Single-Threaded mode attempts to create the entire database script in one request. Multi-Threaded mode allows the database script '
. 'to be chunked over multiple requests. Multi-Threaded mode is typically slower but much more reliable especially for larger databases.', 'duplicator');
esc_attr_e('<br><br><i>Multi-Threaded mode is only available in Duplicator Pro.</i>', 'duplicator');
?>"></i>
<div>
<label for="package_phpdump_qrylimit"><?php esc_html_e("Query Limit Size", 'duplicator'); ?>:</label> &nbsp;
<select name="package_phpdump_qrylimit" id="package_phpdump_qrylimit">
<?php
foreach ($phpdump_chunkopts as $value) {
$selected = ( $phpdump_qrylimit == $value ? "selected='selected'" : '' );
echo "<option {$selected} value='" . esc_attr($value) . "'>" . number_format($value) . '</option>';
}
?>
</select>
<i class="fas fa-question-circle fa-sm"
data-tooltip-title="<?php esc_attr_e("PHP Query Limit Size", 'duplicator'); ?>"
data-tooltip="<?php esc_attr_e(
'A higher limit size will speed up the database build time, however it will use more memory. ' .
'If your host has memory caps start off low.',
'duplicator'
); ?>">
</i>
</div>
</div>
</td>
</tr>
</table>
<h3 class="title"><?php esc_html_e("Archive", 'duplicator') ?> </h3>
<hr size="1" />
<table class="form-table">
<tr>
<th scope="row"><label><?php esc_html_e('Archive Engine', 'duplicator'); ?></label></th>
<td>
<div class="engine-radio">
<input type="radio" name="archive_build_mode" id="archive_build_mode1" onclick="Duplicator.Pack.ToggleArchiveEngine()"
value="<?php echo esc_attr(DUP_Archive_Build_Mode::ZipArchive); ?>" <?php echo ($archive_build_mode == DUP_Archive_Build_Mode::ZipArchive) ? 'checked="checked"' : ''; ?> />
<label for="archive_build_mode1"><?php esc_html_e('ZipArchive', 'duplicator'); ?></label>
</div>
<div class="engine-radio">
<input type="radio" name="archive_build_mode" id="archive_build_mode2" onclick="Duplicator.Pack.ToggleArchiveEngine()"
value="<?php echo esc_attr(DUP_Archive_Build_Mode::DupArchive); ?>" <?php echo ($archive_build_mode == DUP_Archive_Build_Mode::DupArchive) ? 'checked="checked"' : ''; ?> />
<label for="archive_build_mode2"><?php esc_html_e('DupArchive', 'duplicator'); ?></label> &nbsp; &nbsp;
</div>
<br style="clear:both"/>
<!-- ZIPARCHIVE -->
<div id="engine-details-1" style="display:none">
<p class="description">
<?php esc_html_e('Creates a archive format (archive.zip).', 'duplicator');?><br/>
<i>
<?php
esc_html_e('This option uses the internal PHP ZipArchive classes to create a zip file.', 'duplicator');
echo '&nbsp; ';
esc_html_e('Duplicator Lite has no fixed size constraints for zip formats. The only constraints are timeouts '
. 'on the server.', 'duplicator');
?>
</i>
</p>
</div>
<!-- DUPARCHIVE -->
<div id="engine-details-2" style="display:none">
<p class="description">
<?php esc_html_e('Creates a custom archive format (archive.daf).', 'duplicator'); ?>
<br/>
<i>
<?php esc_html_e('This option is recommended for large sites or sites on constrained servers.', 'duplicator'); ?>
<?php esc_html_e('Duplicator Lite has a fixed constraint of 500MB for daf formats.', 'duplicator'); ?>
<?php
printf(
_x(
'Consider upgrading to %1$sDuplicator Pro%2$s for unlimited large site support with DupArchive.',
'%1$s and %2$s represents the opening and closing HTML tags for an anchor or link',
'duplicator'
),
'<a href="' . esc_url(Upsell::getCampaignUrl('package_settings_daf', 'Duplicator Pro')) . '" target="_blank">',
'</a>'
);
?>
</i>
</p>
</div>
</td>
</tr>
<tr>
<th scope="row"><label><?php esc_html_e("Archive Flush", 'duplicator'); ?></label></th>
<td>
<input type="checkbox" name="package_zip_flush" id="package_zip_flush" <?php echo ($package_zip_flush) ? 'checked="checked"' : ''; ?> />
<label for="package_zip_flush"><?php esc_html_e("Attempt Network Keep Alive", 'duplicator'); ?></label>
<i style="font-size:12px">(<?php esc_html_e("enable only for large archives", 'duplicator'); ?>)</i>
<p class="description">
<?php
esc_html_e("This will attempt to keep a network connection established for large archives.", 'duplicator');
echo '&nbsp; ';
esc_html_e(' Valid only when Archive Engine for ZipArchive is enabled.', 'duplicator');
?>
</p>
</td>
</tr>
</table><br/>
<h3 class="title" id="duplicator-installer-settings"><?php esc_html_e("Installer", 'duplicator') ?> </h3>
<hr size="1" />
<table class="form-table">
<tr>
<th scope="row"><label><?php esc_html_e("File Name", 'duplicator'); ?></label></th>
<td id="installer-name-mode-option" >
<b><?php esc_html_e("Default 'Save as' name:", 'duplicator'); ?></b> <br/>
<label>
<i class="fas fa-shield-alt fa-fw shield-off"></i>
<input type="radio" name="installer_name_mode"
value="<?php echo DUP_Settings::INSTALLER_NAME_MODE_SIMPLE; ?>"
<?php checked($installerNameMode === DUP_Settings::INSTALLER_NAME_MODE_SIMPLE); ?>>
<b class="dup-install-meta"><?php esc_html_e("Basic", 'duplicator'); ?></b> &nbsp;
<?php echo DUP_Installer::DEFAULT_INSTALLER_FILE_NAME_WITHOUT_HASH . '.php'; ?>
</label>
<br/>
<label>
<i class="fas fa-shield-alt fa-fw shield-on"></i>
<input type="radio" name="installer_name_mode"
value="<?php echo DUP_Settings::INSTALLER_NAME_MODE_WITH_HASH; ?>"
<?php checked($installerNameMode === DUP_Settings::INSTALLER_NAME_MODE_WITH_HASH); ?> />
<b class="dup-install-meta"><?php esc_html_e("Secure", 'duplicator'); ?></b> &nbsp; [name]_[hash]_[time]_installer.php &nbsp;
<i>(<?php esc_html_e("recommended", 'duplicator'); ?>)</i>
</label>
<p class="description">
<?php esc_html_e("To understand the importance and usage of the installer name, please", 'duplicator') ?>
<a href="javascript:void(0)" onclick="jQuery('#dup-lite-inst-mode-details').toggle()"><?php esc_html_e("read this section", 'duplicator') ?> </a>.
</p>
<div id="dup-lite-inst-mode-details">
<p>
<?php esc_html_e("Using a 'Secure' file helps prevent unauthorized access to the installer file.", 'duplicator'); ?> <br/>
<i><b><?php esc_html_e('Example', 'duplicator'); ?>:</b> my-name_64fc6df76c17f2023225_20220815053010_installer.php</i>
</p>
<p>
<?php
esc_html_e(
'This setting specifies the name of the installer used at download-time. Independent of the value of this setting, you can '
. 'change the name of the installer in the "Save as" file dialog at download-time. If you choose to use a custom name, '
. 'use a file name that is known only to you. Installer filenames must end in "php". Changes to the archive file should not '
. 'be made.',
'duplicator'
);
?>
</p>
<p>
<?php
esc_html_e('Do not to leave any installer files on the destination server, after installing the migrated/restored site. '
. 'Logon as a WordPress administrator and follow the prompts to remove the installer files or remove them manually.', 'duplicator');
?>
</p>
<p>
<i>
<i class="fas fa-info-circle fa-sm"></i>
<?php
esc_html_e('Tip: Each row on the packages screen includes a copy button to copy the installer name to the clipboard. '
. 'Paste the installer name from the clipboard into the URL being used to install the destination site. '
. 'This feature is handy when using the secure installer name.', 'duplicator');
?>
</i>
</p>
</div>
</td>
</tr>
</table>
<h3 class="title"><?php esc_html_e("Visuals", 'duplicator') ?> </h3>
<hr size="1" />
<table class="form-table">
<tr>
<th scope="row"><label><?php esc_html_e("Created Format", 'duplicator'); ?></label></th>
<td>
<select name="package_ui_created" id="package_ui_created">
<!-- YEAR -->
<optgroup label="<?php esc_html_e("By Year", 'duplicator'); ?>">
<option value="1">Y-m-d H:i &nbsp; [2000-01-05 12:00]</option>
<option value="2">Y-m-d H:i:s [2000-01-05 12:00:01]</option>
<option value="3">y-m-d H:i &nbsp; [00-01-05 12:00]</option>
<option value="4">y-m-d H:i:s [00-01-05 12:00:01]</option>
</optgroup>
<!-- MONTH -->
<optgroup label="<?php esc_html_e("By Month", 'duplicator'); ?>">
<option value="5">m-d-Y H:i &nbsp; [01-05-2000 12:00]</option>
<option value="6">m-d-Y H:i:s [01-05-2000 12:00:01]</option>
<option value="7">m-d-y H:i &nbsp; [01-05-00 12:00]</option>
<option value="8">m-d-y H:i:s [01-05-00 12:00:01]</option>
</optgroup>
<!-- DAY -->
<optgroup label="<?php esc_html_e("By Day", 'duplicator'); ?>">
<option value="9"> d-m-Y H:i &nbsp; [05-01-2000 12:00]</option>
<option value="10">d-m-Y H:i:s [05-01-2000 12:00:01]</option>
<option value="11">d-m-y H:i &nbsp; [05-01-00 12:00]</option>
<option value="12">d-m-y H:i:s [05-01-00 12:00:01]</option>
</optgroup>
</select>
<p class="description">
<?php esc_html_e("The UTC date format shown in the 'Created' column on the Packages screen.", 'duplicator'); ?> <br/>
<i><?php esc_html_e("To use WordPress timezone formats consider an upgrade to Duplicator Pro.", 'duplicator'); ?></i>
</p>
</td>
</tr>
</table><br/>
<p class="submit" style="margin: 20px 0px 0xp 5px;">
<br/>
<input type="submit" name="submit" id="submit" class="button-primary" value="<?php esc_attr_e("Save Package Settings", 'duplicator') ?>" style="display: inline-block;" />
</p>
</form>
<script>
jQuery(document).ready(function ($)
{
Duplicator.Pack.SetDBEngineMode = function ()
{
var isMysqlDump = $('#package_mysqldump').is(':checked');
var isPHPMode = $('#package_phpdump').is(':checked');
var isPHPChunkMode = $('#package_phpchunkingdump').is(':checked');
$('#dbengine-details-1, #dbengine-details-2').hide();
switch (true) {
case isMysqlDump :
$('#dbengine-details-1').show();
break;
case isPHPMode :
case isPHPChunkMode :
$('#dbengine-details-2').show();
break;
}
};
Duplicator.Pack.ToggleArchiveEngine = function ()
{
$('#engine-details-1, #engine-details-2').hide();
if ($('#archive_build_mode1').is(':checked')) {
$('#engine-details-1').show();
$('#package_zip_flush').removeAttr('disabled');
} else {
$('#engine-details-2').show();
$('#package_zip_flush').attr('disabled', true);
}
};
Duplicator.Pack.SetDBEngineMode();
$('#package_mysqldump , #package_phpdump').change(function () {
Duplicator.Pack.SetDBEngineMode();
});
Duplicator.Pack.ToggleArchiveEngine();
$('#package_ui_created').val(<?php echo esc_js($package_ui_created); ?>);
});
</script>

View File

@@ -0,0 +1,134 @@
<?php
use Duplicator\Controllers\StorageController;
defined('ABSPATH') || defined('DUPXABSPATH') || exit;
?>
<style>
div.panel {padding: 20px 5px 10px 10px;}
div.area {font-size:16px; text-align: center; line-height: 30px; width:500px; margin:auto}
ul.li {padding:2px}
</style>
<div class="panel">
<?php
$action_updated = null;
$action_response = esc_html__("Storage Settings Saved", 'duplicator');
//SAVE RESULTS
if (filter_input(INPUT_POST, 'action', FILTER_UNSAFE_RAW) === 'save') {
//Nonce Check
if (!wp_verify_nonce(filter_input(INPUT_POST, 'dup_storage_settings_save_nonce_field', FILTER_UNSAFE_RAW), 'dup_settings_save')) {
die('Invalid token permissions to perform this request.');
}
DUP_Settings::Set('storage_htaccess_off', filter_input(INPUT_POST, 'storage_htaccess_off', FILTER_VALIDATE_BOOLEAN));
switch (filter_input(INPUT_POST, 'storage_position', FILTER_DEFAULT)) {
case DUP_Settings::STORAGE_POSITION_LEGACY:
$setPostion = DUP_Settings::STORAGE_POSITION_LEGACY;
break;
case DUP_Settings::STORAGE_POSITION_WP_CONTENT:
default:
$setPostion = DUP_Settings::STORAGE_POSITION_WP_CONTENT;
break;
}
if (DUP_Settings::setStoragePosition($setPostion) != true) {
$targetFolder = ($setPostion === DUP_Settings::STORAGE_POSITION_WP_CONTENT) ? DUP_Settings::getSsdirPathWpCont() : DUP_Settings::getSsdirPathLegacy();
?>
<div id="message" class="notice notice-error is-dismissible">
<p>
<b><?php esc_html_e('Storage folder move problem', 'duplicator'); ?></b>
</p>
<p>
<?php echo sprintf(__('Duplicator can\'t change the storage folder to <i>%s</i>', 'duplicator'), esc_html($targetFolder)); ?><br>
<?php echo sprintf(__('Check the parent folder permissions. ( <i>%s</i> )', 'duplicator'), esc_html(dirname($targetFolder))); ?>
</p>
</div>
<?php
}
DUP_Settings::Save();
$action_updated = true;
}
?>
<?php
$storage_position = DUP_Settings::Get('storage_position');
$storage_htaccess_off = DUP_Settings::Get('storage_htaccess_off');
?>
<form id="dup-settings-form" action="<?php echo admin_url('admin.php?page=duplicator-settings&tab=storage'); ?>" method="post">
<?php wp_nonce_field('dup_settings_save', 'dup_storage_settings_save_nonce_field', false); ?>
<input type="hidden" name="action" value="save">
<input type="hidden" name="page" value="duplicator-settings">
<?php if ($action_updated) : ?>
<div id="message" class="notice notice-success is-dismissible dup-wpnotice-box"><p><?php echo esc_html($action_response); ?></p></div>
<?php endif; ?>
<table class="form-table">
<tr valign="top">
<th scope="row"><label><?php esc_html_e("Location", 'duplicator'); ?></label></th>
<td>
<p>
<label>
<input type="radio" name="storage_position"
value="<?php echo DUP_Settings::STORAGE_POSITION_LEGACY; ?>"
<?php checked($storage_position === DUP_Settings::STORAGE_POSITION_LEGACY); ?> >
<span class="storage_pos_fixed_label"><?php esc_html_e('Legacy Path:', 'duplicator'); ?></span>
<i><?php echo DUP_Settings::getSsdirPathLegacy(); ?></i>
</label>
</p>
<p>
<label>
<input type="radio" name="storage_position"
value="<?php echo DUP_Settings::STORAGE_POSITION_WP_CONTENT; ?>"
<?php checked($storage_position === DUP_Settings::STORAGE_POSITION_WP_CONTENT); ?> >
<span class="storage_pos_fixed_label" ><?php esc_html_e('Contents Path:', 'duplicator'); ?></span>
<i><?php echo DUP_Settings::getSsdirPathWpCont(); ?></i>
</label>
</p>
<p class="description">
<?php
esc_html_e("The storage location is where all package files are stored to disk. If your host has troubles writing content to the 'Legacy Path' then use "
. "the 'Contents Path'. Upon clicking the save button all files are moved to the new location and the previous path is removed.", 'duplicator');
?><br/>
<i class="fas fa-server fa-sm"></i>&nbsp;
<span id="duplicator_advanced_storage_text" class="link-style">[<?php esc_html_e("More Advanced Storage Options...", 'duplicator'); ?>]</span>
</p>
</td>
</tr>
<tr valign="top">
<th scope="row"><label><?php esc_html_e("Apache .htaccess", 'duplicator'); ?></label></th>
<td>
<input type="checkbox" name="storage_htaccess_off" id="storage_htaccess_off" <?php echo ($storage_htaccess_off) ? 'checked="checked"' : ''; ?> />
<label for="storage_htaccess_off"><?php esc_html_e("Disable .htaccess file in storage directory", 'duplicator') ?> </label>
<p class="description">
<?php
esc_html_e("When checked this setting will prevent Duplicator from laying down an .htaccess file in the storage location above.", 'duplicator');
esc_html_e("Only disable this option if issues occur when downloading either the installer/archive files.", 'duplicator');
?>
</p>
</td>
</tr>
</table>
<p class="submit" style="margin: 20px 0px 0xp 5px;">
<br/>
<input type="submit" name="submit" id="submit" class="button-primary" value="<?php esc_attr_e("Save Storage Settings", 'duplicator') ?>" style="display: inline-block;" />
</p>
</form>
<br/>
</div>
<!-- ==========================================
THICK-BOX DIALOGS: -->
<?php
$storageAlert = StorageController::getDialogBox('settings-storage-tab');
?>
<script>
jQuery(document).ready(function ($) {
$("#duplicator_advanced_storage_text").click(function () {
<?php $storageAlert->showAlert(); ?>
});
});
</script>

View File

@@ -0,0 +1,43 @@
<?php
use Duplicator\Core\Views\TplMng;
defined('ABSPATH') || defined('DUPXABSPATH') || exit;
require_once(DUPLICATOR_PLUGIN_PATH . '/classes/ui/class.ui.dialog.php');
require_once(DUPLICATOR_PLUGIN_PATH . '/assets/js/javascript.php');
require_once(DUPLICATOR_PLUGIN_PATH . '/views/inc.header.php');
global $wpdb;
global $wp_version;
DUP_Handler::init_error_handler();
DUP_Util::hasCapability('manage_options');
$current_tab = isset($_REQUEST['tab']) ? esc_html($_REQUEST['tab']) : 'diagnostics';
if ('d' == $current_tab) {
$current_tab = 'diagnostics';
}
?>
<div class="wrap">
<?php duplicator_header(__("Tools", 'duplicator')) ?>
<h2 class="nav-tab-wrapper">
<a href="?page=duplicator-tools&tab=diagnostics" class="nav-tab <?php echo ($current_tab == 'diagnostics') ? 'nav-tab-active' : '' ?>"> <?php esc_html_e('General', 'duplicator'); ?></a>
<a href="?page=duplicator-tools&tab=templates" class="nav-tab <?php echo ($current_tab == 'templates') ? 'nav-tab-active' : '' ?>"> <?php esc_html_e('Templates', 'duplicator'); ?></a>
<a href="?page=duplicator-tools&tab=recovery" class="nav-tab <?php echo ($current_tab == 'recovery') ? 'nav-tab-active' : '' ?>"> <?php esc_html_e('Recovery', 'duplicator'); ?></a>
</h2>
<?php
switch ($current_tab) {
case 'diagnostics':
include(DUPLICATOR_PLUGIN_PATH . 'views/tools/diagnostics/main.php');
break;
case 'templates':
TplMng::getInstance()->render('mocks/templates/templates', array(), true);
break;
case 'recovery':
TplMng::getInstance()->render('mocks/recovery/recovery', array(), true);
break;
}
?>
</div>

View File

@@ -0,0 +1,137 @@
<?php
defined('ABSPATH') || defined('DUPXABSPATH') || exit;
$sql = "SELECT * FROM `{$wpdb->prefix}options` WHERE `option_name` LIKE '%duplicator_%' AND `option_name` NOT LIKE '%duplicator_pro%' ORDER BY option_name";
?>
<!-- ==============================
OPTIONS DATA -->
<div class="dup-box">
<div class="dup-box-title">
<i class="fa fa-th-list"></i>
<?php esc_html_e("Stored Data", 'duplicator'); ?>
<div class="dup-box-arrow"></div>
</div>
<div class="dup-box-panel" id="dup-settings-diag-opts-panel" style="<?php echo esc_html($ui_css_opts_panel); ?>">
<div style="padding-left:10px">
<h3 class="title"><?php esc_html_e('Data Cleanup', 'duplicator') ?></h3>
<table class="dup-reset-opts">
<tr style="vertical-align:text-top">
<td>
<button id="dup-remove-installer-files-btn" type="button" class="button button-small dup-fixed-btn" onclick="Duplicator.Tools.deleteInstallerFiles();">
<?php esc_html_e("Remove Installation Files", 'duplicator'); ?>
</button>
</td>
<td>
<?php esc_html_e("Removes all reserved installer files.", 'duplicator'); ?>
<a href="javascript:void(0)" onclick="jQuery('#dup-tools-delete-moreinfo').toggle()">[<?php esc_html_e("more info", 'duplicator'); ?>]</a><br/>
<div id="dup-tools-delete-moreinfo">
<?php
esc_html_e("Clicking on the 'Remove Installation Files' button will attempt to remove the installer files used by Duplicator. These files should not "
. "be left on production systems for security reasons. Below are the files that should be removed.", 'duplicator');
echo "<br/><br/>";
$installer_files = array_keys($installer_files);
array_push($installer_files, '[HASH]_archive.zip/daf');
echo '<i>' . implode('<br/>', $installer_files) . '</i>';
echo "<br/><br/>";
?>
</div>
</td>
</tr>
<tr>
<td>
<button type="button" class="button button-small dup-fixed-btn" onclick="Duplicator.Tools.ConfirmClearBuildCache()">
<?php esc_html_e("Clear Build Cache", 'duplicator'); ?>
</button>
</td>
<td><?php esc_html_e("Removes all build data from:", 'duplicator'); ?> [<?php echo DUP_Settings::getSsdirTmpPath() ?>].</td>
</tr>
</table>
</div>
<div style="padding:0px 20px 0px 25px">
<h3 class="title" style="margin-left:-15px"><?php esc_html_e("Options Values", 'duplicator') ?> </h3>
<table class="widefat" cellspacing="0">
<thead>
<tr>
<th>Key</th>
<th>Value</th>
</tr>
</thead>
<tbody>
<?php
foreach ($wpdb->get_results("{$sql}") as $key => $row) { ?>
<tr>
<td>
<?php
echo (in_array($row->option_name, $GLOBALS['DUPLICATOR_OPTS_DELETE']))
? "<a href='javascript:void(0)' onclick='Duplicator.Settings.ConfirmDeleteOption(this)'>" . esc_html($row->option_name) . "</a>"
: $row->option_name;
?>
</td>
<td><textarea class="dup-opts-read" readonly="readonly"><?php echo esc_textarea($row->option_value); ?></textarea></td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
</div>
<br/>
<!-- ==========================================
THICK-BOX DIALOGS: -->
<?php
$confirm1 = new DUP_UI_Dialog();
$confirm1->title = __('Delete Option?', 'duplicator');
$confirm1->message = __('Delete the option value just selected?', 'duplicator');
$confirm1->progressText = __('Removing Option, Please Wait...', 'duplicator');
$confirm1->jscallback = 'Duplicator.Settings.DeleteOption()';
$confirm1->initConfirm();
$confirm2 = new DUP_UI_Dialog();
$confirm2->title = __('Clear Build Cache?', 'duplicator');
$confirm2->message = __('This process will remove all build cache files. Be sure no packages are currently building or else they will be cancelled.', 'duplicator');
$confirm2->jscallback = 'Duplicator.Tools.ClearBuildCache()';
$confirm2->initConfirm();
?>
<script>
jQuery(document).ready(function($)
{
Duplicator.Settings.ConfirmDeleteOption = function (anchor)
{
var key = $(anchor).text();
var msg_id = '<?php echo esc_js($confirm1->getMessageID()); ?>';
var msg = '<?php esc_html_e('Delete the option value', 'duplicator');?>' + ' [' + key + '] ?';
jQuery('#dup-remove-options-value').val(key);
jQuery('#' + msg_id).html(msg)
<?php $confirm1->showConfirm(); ?>
}
Duplicator.Settings.DeleteOption = function ()
{
jQuery('#dup-settings-form').submit();
}
Duplicator.Tools.ConfirmClearBuildCache = function ()
{
<?php $confirm2->showConfirm(); ?>
}
Duplicator.Tools.ClearBuildCache = function ()
{
window.location = '?page=duplicator-tools&tab=diagnostics&action=tmp-cache&_wpnonce=<?php echo esc_js($nonce); ?>';
}
});
Duplicator.Tools.deleteInstallerFiles = function()
{
<?php
$url = DUP_CTRL_Tools::getCleanFilesAcrtionUrl();
echo "window.location = '{$url}';";
?>
}
</script>

View File

@@ -0,0 +1,38 @@
<?php
use Duplicator\Libs\Snap\SnapUtil;
defined('ABSPATH') || defined('DUPXABSPATH') || exit;
ob_start();
SnapUtil::phpinfo();
$serverinfo = ob_get_contents();
ob_end_clean();
if (strlen($serverinfo) < 100) {
$serverinfo = 'The <a href="https://www.php.net/manual/en/function.phpinfo.php" target="_blank">phpinfo function</a> is not supported on this server, '
. 'for more details contact your hosting provider.';
} else {
$serverinfo = preg_replace('%^.*<body>(.*)</body>.*$%ms', '$1', $serverinfo);
$serverinfo = preg_replace('%^.*<title>(.*)</title>.*$%ms', '$1', $serverinfo);
}
?>
<!-- ==============================
PHP INFORMATION -->
<div class="dup-box">
<div class="dup-box-title">
<i class="fa fa-info-circle"></i>
<?php esc_html_e("PHP Information", 'duplicator'); ?>
<div class="dup-box-arrow"></div>
</div>
<div class="dup-box-panel" style="display:none">
<div id="dup-phpinfo" style="width:95%">
<?php
echo "<div id='dup-server-info-area'>{$serverinfo}</div>";
$serverinfo = null;
?>
</div><br/>
</div>
</div>
<br/>

View File

@@ -0,0 +1,241 @@
<?php
defined('ABSPATH') || defined('DUPXABSPATH') || exit;
$dbvar_maxtime = DUP_DB::getVariable('wait_timeout');
$dbvar_maxpacks = DUP_DB::getVariable('max_allowed_packet');
$dbvar_maxtime = is_null($dbvar_maxtime) ? __("unknow", 'duplicator') : $dbvar_maxtime;
$dbvar_maxpacks = is_null($dbvar_maxpacks) ? __("unknow", 'duplicator') : $dbvar_maxpacks;
$abs_path = duplicator_get_abs_path();
$space = null;
$space_free = null;
$perc = 0;
if (function_exists('disk_total_space') && function_exists('disk_free_space')) {
$space = @disk_total_space($abs_path);
$space_free = @disk_free_space($abs_path);
$perc = @round((100 / $space) * $space_free, 2);
}
$mysqldumpPath = DUP_DB::getMySqlDumpPath();
$mysqlDumpSupport = ($mysqldumpPath) ? $mysqldumpPath : 'Path Not Found';
$client_ip_address = DUP_Server::getClientIP();
$error_log_path = ini_get('error_log');
?>
<!-- ==============================
SERVER SETTINGS -->
<div class="dup-box">
<div class="dup-box-title">
<i class="fas fa-tachometer-alt"></i>
<?php esc_html_e("Server Settings", 'duplicator') ?>
<div class="dup-box-arrow"></div>
</div>
<div class="dup-box-panel" id="dup-settings-diag-srv-panel" style="<?php echo esc_html($ui_css_srv_panel); ?>">
<table class="widefat" cellspacing="0">
<tr>
<td class='dup-settings-diag-header' colspan="2"><?php esc_html_e("General", 'duplicator'); ?></td>
</tr>
<tr>
<td><?php esc_html_e("Duplicator Version", 'duplicator'); ?></td>
<td>
<?php echo esc_html(DUPLICATOR_VERSION); ?>
</td>
</tr>
<tr>
<td><?php esc_html_e("Operating System", 'duplicator'); ?></td>
<td><?php echo esc_html(PHP_OS) ?></td>
</tr>
<?php if (function_exists('wp_timezone_string')) { ?>
<tr>
<td><?php esc_html_e("Timezone", 'duplicator'); ?></td>
<td><?php echo esc_html(wp_timezone_string()); ?> &nbsp; <small><i>This is a <a href='options-general.php'>WordPress setting</a></i></small></td>
</tr>
<?php } ?>
<tr>
<td><?php esc_html_e("Server Time", 'duplicator'); ?></td>
<td><?php echo current_time("Y-m-d H:i:s"); ?></td>
</tr>
<tr>
<td><?php esc_html_e("Web Server", 'duplicator'); ?></td>
<td><?php echo esc_html($_SERVER['SERVER_SOFTWARE']); ?></td>
</tr>
<?php
$abs_path = duplicator_get_abs_path();
?>
<tr>
<td><?php esc_html_e("Root Path", 'duplicator'); ?></td>
<td><?php echo esc_html($abs_path); ?></td>
</tr>
<tr>
<td><?php esc_html_e("ABSPATH", 'duplicator'); ?></td>
<td><?php echo esc_html($abs_path); ?></td>
</tr>
<tr>
<td><?php esc_html_e("Plugins Path", 'duplicator'); ?></td>
<td><?php echo esc_html(DUP_Util::safePath(WP_PLUGIN_DIR)); ?></td>
</tr>
<tr>
<td><?php esc_html_e("Loaded PHP INI", 'duplicator'); ?></td>
<td><?php echo esc_html(php_ini_loaded_file()); ?></td>
</tr>
<tr>
<td><?php esc_html_e("Server IP", 'duplicator'); ?></td>
<?php
if (isset($_SERVER['SERVER_ADDR'])) {
$server_address = $_SERVER['SERVER_ADDR'];
} elseif (isset($_SERVER['SERVER_NAME']) && function_exists('gethostbyname')) {
$server_address = gethostbyname($_SERVER['SERVER_NAME']);
} else {
$server_address = __("Can't detect", 'duplicator');
}
?>
<td><?php echo esc_html($server_address); ?></td>
</tr>
<tr>
<td><?php esc_html_e("Client IP", 'duplicator'); ?></td>
<td><?php echo esc_html($client_ip_address);?></td>
</tr>
<tr>
<td class='dup-settings-diag-header' colspan="2">WordPress</td>
</tr>
<tr>
<td><?php esc_html_e("Version", 'duplicator'); ?></td>
<td><?php echo esc_html($wp_version); ?></td>
</tr>
<tr>
<td><?php esc_html_e("Language", 'duplicator'); ?></td>
<td><?php bloginfo('language'); ?></td>
</tr>
<tr>
<td><?php esc_html_e("Charset", 'duplicator'); ?></td>
<td><?php bloginfo('charset'); ?></td>
</tr>
<tr>
<td><?php esc_html_e("Memory Limit ", 'duplicator'); ?></td>
<td><?php echo esc_html(WP_MEMORY_LIMIT); ?> (<?php esc_html_e("Max", 'duplicator');
echo '&nbsp;' . esc_html(WP_MAX_MEMORY_LIMIT); ?>)</td>
</tr>
<tr>
<td class='dup-settings-diag-header' colspan="2">PHP</td>
</tr>
<tr>
<td><?php esc_html_e("Version", 'duplicator'); ?></td>
<td><?php echo esc_html(phpversion()); ?></td>
</tr>
<tr>
<td>SAPI</td>
<td><?php echo esc_html(PHP_SAPI); ?></td>
</tr>
<tr>
<td><?php esc_html_e("User", 'duplicator'); ?></td>
<td><?php echo DUP_Util::getCurrentUser(); ?></td>
</tr>
<tr>
<td><?php esc_html_e("Process", 'duplicator'); ?></td>
<td><?php echo esc_html(DUP_Util::getProcessOwner()); ?></td>
</tr>
<tr>
<td><a href="http://php.net/manual/en/features.safe-mode.php" target="_blank"><?php esc_html_e("Safe Mode", 'duplicator'); ?></a></td>
<td>
<?php echo (((strtolower(@ini_get('safe_mode')) == 'on') || (strtolower(@ini_get('safe_mode')) == 'yes') ||
(strtolower(@ini_get('safe_mode')) == 'true') || (ini_get("safe_mode") == 1 )))
? esc_html__('On', 'duplicator') : esc_html__('Off', 'duplicator');
?>
</td>
</tr>
<tr>
<td><a href="http://www.php.net/manual/en/ini.core.php#ini.memory-limit" target="_blank"><?php esc_html_e("Memory Limit", 'duplicator'); ?></a></td>
<td><?php echo @ini_get('memory_limit') ?></td>
</tr>
<tr>
<td><?php esc_html_e("Memory In Use", 'duplicator'); ?></td>
<td><?php echo size_format(@memory_get_usage(true), 2) ?></td>
</tr>
<tr>
<td><a href="http://www.php.net/manual/en/info.configuration.php#ini.max-execution-time" target="_blank"><?php esc_html_e("Max Execution Time", 'duplicator'); ?></a></td>
<td>
<?php
echo @ini_get('max_execution_time');
$try_update = set_time_limit(0);
$try_update = $try_update ? 'is dynamic' : 'value is fixed';
echo " (default) - {$try_update}";
?>
<i class="fa fa-question-circle data-size-help"
data-tooltip-title="<?php esc_attr_e("Max Execution Time", 'duplicator'); ?>"
data-tooltip="<?php esc_attr_e('If the value shows dynamic then this means 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.', 'duplicator'); ?>"></i>
</td>
</tr>
<tr>
<td><a href="http://us3.php.net/shell_exec" target="_blank"><?php esc_html_e("Shell Exec", 'duplicator'); ?></a></td>
<td><?php echo (DUP_Util::hasShellExec()) ? esc_html__("Is Supported", 'duplicator') : esc_html__("Not Supported", 'duplicator'); ?></td>
</tr>
<tr>
<td><?php esc_html_e("Shell Exec Zip", 'duplicator'); ?></td>
<td><?php echo (DUP_Util::getZipPath() != null) ? esc_html__("Is Supported", 'duplicator') : esc_html__("Not Supported", 'duplicator'); ?></td>
</tr>
<tr>
<td><a href="https://suhosin.org/stories/index.html" target="_blank"><?php esc_html_e("Suhosin Extension", 'duplicator'); ?></a></td>
<td><?php echo extension_loaded('suhosin') ? esc_html__("Enabled", 'duplicator') : esc_html__("Disabled", 'duplicator'); ?></td>
</tr>
<tr>
<td><?php esc_html_e("Architecture ", 'duplicator'); ?></td>
<td>
<?php echo DUP_Util::getArchitectureString(); ?>
</td>
</tr>
<tr>
<td><?php esc_html_e("Error Log File ", 'duplicator'); ?></td>
<td><?php echo esc_html($error_log_path); ?></td>
</tr>
<tr>
<td class='dup-settings-diag-header' colspan="2">MySQL</td>
</tr>
<tr>
<td><?php esc_html_e("Version", 'duplicator'); ?></td>
<td><?php echo esc_html(DUP_DB::getVersion()); ?></td>
</tr>
<tr>
<td><?php esc_html_e("Comments", 'duplicator'); ?></td>
<td><?php echo esc_html(DUP_DB::getVariable('version_comment')); ?></td>
</tr>
<tr>
<td><?php esc_html_e("Charset", 'duplicator'); ?></td>
<td><?php echo defined('DB_CHARSET') ? DB_CHARSET : 'DB_CHARSET not set' ; ?></td>
</tr>
<tr>
<td><a href="http://dev.mysql.com/doc/refman/5.0/en/server-system-variables.html#sysvar_wait_timeout" target="_blank"><?php esc_html_e("Wait Timeout", 'duplicator'); ?></a></td>
<td><?php echo esc_html($dbvar_maxtime); ?></td>
</tr>
<tr>
<td style="white-space:nowrap"><a href="http://dev.mysql.com/doc/refman/5.0/en/server-system-variables.html#sysvar_max_allowed_packet" target="_blank"><?php esc_html_e("Max Allowed Packets", 'duplicator'); ?></a></td>
<td><?php echo esc_html($dbvar_maxpacks); ?></td>
</tr>
<tr>
<td><a href="http://dev.mysql.com/doc/refman/5.0/en/mysqldump.html" target="_blank"><?php esc_html_e("msyqldump Path", 'duplicator'); ?></a></td>
<td><?php echo esc_html($mysqlDumpSupport); ?></td>
</tr>
<tr>
<td class='dup-settings-diag-header' colspan="2"><?php esc_html_e("Server Disk", 'duplicator'); ?></td>
</tr>
<tr valign="top">
<td><?php esc_html_e('Free space', 'duplicator'); ?></td>
<td>
<?php if ($space == null || $space_free == null) : ?>
<?php esc_html_e("Unable to calculate space on this server.", 'duplicator'); ?>
<br/><br/>
<?php else : ?>
<?php echo esc_html($perc);?>% -- <?php echo esc_html(DUP_Util::byteSize($space_free));?>
from <?php echo esc_html(DUP_Util::byteSize($space));?><br/>
<small>
<?php esc_html_e("Note: This value is the physical servers hard-drive allocation.", 'duplicator'); ?> <br/>
<?php esc_html_e("On shared hosts check your control panel for the 'TRUE' disk space quota value.", 'duplicator'); ?>
</small>
<?php endif; ?>
</td>
</tr>
</table><br/>
</div> <!-- end .dup-box-panel -->
</div> <!-- end .dup-box -->
<br/>

View File

@@ -0,0 +1,161 @@
<?php
defined('ABSPATH') || defined('DUPXABSPATH') || exit;
$action = isset($_POST['action']) ? sanitize_text_field($_POST['action']) : '';
$scan_run = ($action == 'duplicator_recursion') ? true : false;
$ajax_nonce = wp_create_nonce('DUP_CTRL_Tools_runScanValidator');
?>
<style>
div#hb-result {padding: 10px 5px 0 5px; line-height:20px; font-size: 12px}
</style>
<!-- ==========================================
THICK-BOX DIALOGS: -->
<?php
$confirm1 = new DUP_UI_Dialog();
$confirm1->title = __('Run Validator', 'duplicator');
$confirm1->message = __('This will run the scan validation check. This may take several minutes. Do you want to Continue?', 'duplicator');
$confirm1->progressOn = false;
$confirm1->jscallback = 'Duplicator.Tools.runScanValidator()';
$confirm1->initConfirm();
?>
<!-- ==============================
SCAN VALIDATOR -->
<div class="dup-box">
<div class="dup-box-title">
<i class="far fa-check-square"></i>
<?php esc_html_e("Scan Validator", 'duplicator'); ?>
<div class="dup-box-arrow"></div>
</div>
<div class="dup-box-panel" style="display: <?php echo $scan_run ? 'block' : 'none'; ?>">
<?php
esc_html_e("This utility will help to find unreadable files and sys-links in your environment that can lead to issues during the scan process. ", "duplicator");
esc_html_e("The utility will also shows how many files and directories you have in your system. This process may take several minutes to run. ", "duplicator");
esc_html_e("If there is a recursive loop on your system then the process has a built in check to stop after a large set of files and directories have been scanned. ", "duplicator");
esc_html_e("A message will show indicated that that a scan depth has been reached. If you have issues with the package scanner (step 2) during the build process then try to add "
. "The paths below to your file filters to allow the scanner to finish.", "duplicator");
?>
<br/><br/>
<button id="scan-run-btn" type="button" class="button button-large button-primary" onclick="Duplicator.Tools.ConfirmScanValidator()">
<?php esc_html_e("Run Scan Integrity Validation", "duplicator"); ?>
</button>
<script id="hb-template" type="text/x-handlebars-template">
<b>Scan Path:</b> <?php echo esc_html(duplicator_get_abs_path()); ?> <br/>
<b>Scan Results</b><br/>
<table>
<tr>
<td><b>Files:</b></td>
<td>{{payload.fileCount}} </td>
<td> &nbsp; </td>
<td><b>Dirs:</b></td>
<td>{{payload.dirCount}} </td>
</tr>
</table>
<br/>
<b>Unreadable Dirs/Files:</b> <br/>
{{#if payload.unreadable}}
{{#each payload.unreadable}}
&nbsp; &nbsp; {{@index}} : {{this}}<br/>
{{/each}}
{{else}}
<i>No Unreadable items found</i> <br/>
{{/if}}
<br/>
<b>Symbolic Links:</b> <br/>
{{#if payload.symLinks}}
{{#each payload.symLinks}}
&nbsp; &nbsp; {{@index}} : {{this}}<br/>
{{/each}}
{{else}}
<i>No Sym-links found</i> <br/>
<small> <?php esc_html_e("Note: Symlinks are not discoverable on Windows OS with PHP", "duplicator"); ?></small> <br/>
{{/if}}
<br/>
<b>Directory Name Checks:</b> <br/>
{{#if payload.nameTestDirs}}
{{#each payload.nameTestDirs}}
&nbsp; &nbsp; {{@index}} : {{this}}<br/>
{{/each}}
{{else}}
<i>No name check warnings located for directory paths</i> <br/>
{{/if}}
<br/>
<b>File Name Checks:</b> <br/>
{{#if payload.nameTestFiles}}
{{#each payload.nameTestFiles}}
&nbsp; &nbsp; {{@index}} : {{this}}<br/>
{{/each}}
{{else}}
<i>No name check warnings located for directory paths</i> <br/>
{{/if}}
<br/>
</script>
<div id="hb-result"></div>
</div>
</div>
<br/>
<script>
jQuery(document).ready(function($)
{
Duplicator.Tools.ConfirmScanValidator = function()
{
<?php $confirm1->showConfirm(); ?>
}
//Run request to: admin-ajax.php?action=DUP_CTRL_Tools_runScanValidator
Duplicator.Tools.runScanValidator = function()
{
tb_remove();
var data = {
action : 'DUP_CTRL_Tools_runScanValidator',
nonce: '<?php echo esc_js($ajax_nonce); ?>',
recursive_scan: 1
};
$('#hb-result').html('<?php esc_html_e("Scanning Environment... This may take a few minutes.", "duplicator"); ?>');
$('#scan-run-btn').html('<i class="fas fa-circle-notch fa-spin fa-fw"></i> Running Please Wait...');
$.ajax({
type: "POST",
dataType: "text",
url: ajaxurl,
data: data,
success: function(respData) {
try {
var data = Duplicator.parseJSON(respData);
} catch(err) {
console.error(err);
console.error('JSON parse failed for response data: ' + respData);
console.log(respData);
return false;
}
Duplicator.Tools.IntScanValidator(data);
},
error: function(data) {console.log(data)},
done: function(data) {console.log(data)}
});
}
//Process Ajax Template
Duplicator.Tools.IntScanValidator= function(data)
{
var template = $('#hb-template').html();
var templateScript = Handlebars.compile(template);
var html = templateScript(data);
$('#hb-result').html(html);
$('#scan-run-btn').html('<?php esc_html_e("Run Scan Integrity Validation", "duplicator"); ?>');
}
});
</script>

View File

@@ -0,0 +1,87 @@
<?php
defined('ABSPATH') || defined('DUPXABSPATH') || exit;
wp_enqueue_script('dup-handlebars');
require_once(DUPLICATOR_PLUGIN_PATH . '/classes/utilities/class.u.scancheck.php');
require_once(DUPLICATOR_PLUGIN_PATH . '/classes/class.io.php');
$installer_files = DUP_Server::getInstallerFiles();
$package_name = (isset($_GET['package'])) ? esc_html($_GET['package']) : '';
$abs_path = duplicator_get_abs_path();
// For auto detect archive file name logic
if (empty($package_name)) {
$installer_file_path = $abs_path . '/' . 'installer.php';
if (file_exists($installer_file_path)) {
$installer_file_data = file_get_contents($installer_file_path);
if (preg_match("/const ARCHIVE_FILENAME = '(.*?)';/", $installer_file_data, $match)) {
$temp_archive_file = esc_html($match[1]);
$temp_archive_file_path = $abs_path . '/' . $temp_archive_file;
if (file_exists($temp_archive_file_path)) {
$package_name = $temp_archive_file;
}
}
}
}
$package_path = empty($package_name) ? '' : $abs_path . '/' . $package_name;
$txt_found = __('File Found: Unable to remove', 'duplicator');
$txt_removed = __('Removed', 'duplicator');
$nonce = wp_create_nonce('duplicator_cleanup_page');
$section = (isset($_GET['section'])) ? $_GET['section'] : '';
if ($section == "info" || $section == '') {
$_GET['action'] = isset($_GET['action']) ? $_GET['action'] : '';
switch ($_GET['action']) {
case 'tmp-cache':
if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'duplicator_cleanup_page')) {
exit; // Get out of here bad nounce!
}
DUP_Package::tempFileCleanup(true);
?>
<div id="message" class="notice notice-success is-dismissible dup-wpnotice-box">
<p><b><?php _e('Build cache removed.', 'duplicator'); ?></b></p>
</div>
<?php
break;
}
}
$remove_response = '';
if (isset($_POST['remove-options'])) {
if (!isset($_POST['_wpnonce']) || !wp_verify_nonce($_POST['_wpnonce'], 'duplicator_settings_page')) {
wp_die(__('Security check failed.', 'duplicator'));
}
$remove_options = sanitize_text_field($_POST['remove-options']);
$action_result = DUP_Settings::DeleteWPOption($remove_options);
switch ($remove_options) {
case 'duplicator_settings':
$remove_response = __('Plugin settings reset.', 'duplicator');
break;
case 'duplicator_ui_view_state':
$remove_response = __('View state settings reset.', 'duplicator');
break;
case 'duplicator_package_active':
$remove_response = __('Active package settings reset.', 'duplicator');
break;
}
}
?>
<form id="dup-settings-form" action="<?php echo admin_url('admin.php?page=duplicator-tools&tab=diagnostics&section=info'); ?>" method="post">
<?php wp_nonce_field('duplicator_settings_page', '_wpnonce', false); ?>
<input type="hidden" id="dup-remove-options-value" name="remove-options" value="">
<?php
if (! empty($remove_response)) {
echo "<div id='message' class='notice notice-success is-dismissible dup-wpnotice-box'><p>" . esc_html($remove_response) . "</p></div>";
}
include_once 'inc.data.php';
include_once 'inc.settings.php';
include_once 'inc.validator.php';
include_once 'inc.phpinfo.php';
?>
</form>

View File

@@ -0,0 +1,241 @@
<?php
use Duplicator\Installer\Utils\LinkManager;
defined('ABSPATH') || defined('DUPXABSPATH') || exit;
require_once(DUPLICATOR_PLUGIN_PATH . '/assets/js/javascript.php');
require_once(DUPLICATOR_PLUGIN_PATH . '/views/inc.header.php');
function _duplicatorSortFiles($a, $b)
{
return filemtime($b) - filemtime($a);
}
$logs = glob(DUP_Settings::getSsdirPath() . '/*.log') ;
if ($logs != false && count($logs)) {
usort($logs, '_duplicatorSortFiles');
@chmod(DUP_Util::safePath($logs[0]), 0644);
}
$logname = (isset($_GET['logname'])) ? trim(sanitize_text_field($_GET['logname'])) : "";
$refresh = (isset($_POST['refresh']) && $_POST['refresh'] == 1) ? 1 : 0;
$auto = (isset($_POST['auto']) && $_POST['auto'] == 1) ? 1 : 0;
//Check for invalid file
if (!empty($logname)) {
$validFiles = array_map('basename', $logs);
if (validate_file($logname, $validFiles) > 0) {
unset($logname);
}
unset($validFiles);
}
if (!isset($logname) || !$logname) {
$logname = (count($logs) > 0) ? basename($logs[0]) : "";
}
$logurl = DUP_Settings::getSsdirUrl() . '/' . $logname;
$logfound = (strlen($logname) > 0) ? true : false;
?>
<style>
div#dup-refresh-count {display: inline-block}
table#dup-log-panels {width:100%; }
td#dup-log-panel-left {width:75%;}
td#dup-log-panel-left div.name {float:left; margin: 0px 0px 5px 5px;}
td#dup-log-panel-left div.opts {float:right;}
td#dup-log-panel-right {vertical-align: top; padding-left:15px; max-width: 375px}
#dup-log-content {
padding:5px;
background: #fff;
min-height:500px;
width: calc(100vw - 630px);;
border:1px solid silver;
overflow:scroll;
word-wrap: break-word;
margin:0;
line-height: 2;
}
/* OPTIONS */
div.dup-log-hdr {font-weight: bold; font-size:16px; padding:2px; }
div.dup-log-hdr small{font-weight:normal; font-style: italic}
div.dup-log-file-list {font-family:monospace;}
div.dup-log-file-list a, span.dup-log{display: inline-block; white-space: nowrap; text-overflow: ellipsis; max-width: 375px; overflow:hidden}
div.dup-log-file-list span {color:green}
div.dup-opts-items {border:1px solid silver; background: #efefef; padding: 5px; border-radius: 4px; margin:2px 0px 10px -2px;}
label#dup-auto-refresh-lbl {display: inline-block;}
</style>
<script>
jQuery(document).ready(function($)
{
Duplicator.Tools.FullLog = function() {
var $panelL = $('#dup-log-panel-left');
var $panelR = $('#dup-log-panel-right');
if ($panelR.is(":visible") ) {
$panelR.hide(400);
$panelL.css({width: '100%'});
} else {
$panelR.show(200);
$panelL.css({width: '75%'});
}
}
Duplicator.Tools.Refresh = function() {
$('#refresh').val(1);
$('#dup-form-logs').submit();
}
Duplicator.Tools.RefreshAuto = function() {
if ( $("#dup-auto-refresh").is(":checked")) {
$('#auto').val(1);
startTimer();
} else {
$('#auto').val(0);
}
}
Duplicator.Tools.GetLog = function(log) {
window.location = log;
}
Duplicator.Tools.WinResize = function() {
var height = $(window).height() - 225;
$("#dup-log-content").css({height: height + 'px'});
}
Duplicator.Tools.readLogfile = function() {
$.get(<?php echo str_replace('\\/', '/', json_encode($logurl)); ?>, function(data) {
$('#dup-log-content').text(data);
}, 'text');
};
var duration = 10;
var count = duration;
var timerInterval;
function timer() {
count = count - 1;
$("#dup-refresh-count").html(count.toString());
if (! $("#dup-auto-refresh").is(":checked")) {
clearInterval(timerInterval);
$("#dup-refresh-count").text(count.toString().trim());
return;
}
if (count <= 0) {
count = duration + 1;
Duplicator.Tools.Refresh();
}
}
function startTimer() {
timerInterval = setInterval(timer, 1000);
}
//INIT Events
$(window).resize(Duplicator.Tools.WinResize);
$('#dup-options').click(Duplicator.Tools.FullLog);
$("#dup-refresh").click(Duplicator.Tools.Refresh);
$("#dup-auto-refresh").click(Duplicator.Tools.RefreshAuto);
$("#dup-refresh-count").html(duration.toString());
// READ LOG FILE
Duplicator.Tools.readLogfile();
//INIT
Duplicator.Tools.WinResize();
<?php if ($refresh) : ?>
//Scroll to Bottom
$("#dup-log-content").load(function () {
var $contents = $('#dup-log-content').contents();
$contents.scrollTop($contents.height());
});
<?php if ($auto) : ?>
$("#dup-auto-refresh").prop('checked', true);
Duplicator.Tools.RefreshAuto();
<?php endif; ?>
<?php endif; ?>
});
</script>
<form id="dup-form-logs" method="post" action="">
<input type="hidden" id="refresh" name="refresh" value="<?php echo ($refresh) ? 1 : 0 ?>" />
<input type="hidden" id="auto" name="auto" value="<?php echo ($auto) ? 1 : 0 ?>" />
<?php if (! $logfound) : ?>
<div style="padding:20px">
<h2><?php esc_html_e("Log file not found or unreadable", 'duplicator') ?>.</h2>
<?php esc_html_e("Try to create a package, since no log files were found in the snapshots directory with the extension *.log", 'duplicator') ?>.<br/><br/>
<?php esc_html_e("Reasons for log file not showing", 'duplicator') ?>: <br/>
- <?php esc_html_e("The web server does not support returning .log file extentions", 'duplicator') ?>. <br/>
- <?php esc_html_e("The snapshots directory does not have the correct permissions to write files. Try setting the permissions to 755", 'duplicator') ?>. <br/>
- <?php esc_html_e("The process that PHP runs under does not have enough permissions to create files. Please contact your hosting provider for more details", 'duplicator') ?>. <br/>
</div>
<?php else : ?>
<table id="dup-log-panels">
<tr>
<td id="dup-log-panel-left">
<div class="name">
<i class='fas fa-file-contract fa-fw'></i> <b><?php echo basename($logurl); ?></b> &nbsp; | &nbsp;
<i style="cursor: pointer"
data-tooltip-title="<?php esc_attr_e("Host Recommendation:", 'duplicator'); ?>"
data-tooltip="<?php esc_attr_e('Duplicator recommends going with the high performance pro plan or better from our recommended list', 'duplicator'); ?>">
<i class="far fa-lightbulb" aria-hidden="true"></i>
<?php
$faqUrl = esc_url(LinkManager::getDocUrl('what-host-providers-are-recommended-for-duplicator', 'tools-logging'));
printf(
_x(
'Consider our recommended %1$shost list%2$s if youre unhappy with your current provider',
'%1$s and %2$s are <a> tags',
'duplicator'
),
'<a target="_blank" href="' . $faqUrl . '">',
'</a>'
);
?>
</i>
</div>
<div class="opts"><a href="javascript:void(0)" id="dup-options"><?php esc_html_e("Options", 'duplicator') ?> <i class="fa fa-angle-double-right"></i></a> &nbsp;</div>
<br style="clear:both" />
<pre id="dup-log-content"></pre>
</td>
<td id="dup-log-panel-right">
<h2><?php esc_html_e("Options", 'duplicator') ?> </h2>
<div class="dup-opts-items">
<input type="button" class="button button-small" id="dup-refresh" value="<?php esc_attr_e("Refresh", 'duplicator') ?>" /> &nbsp;
<input type='checkbox' id="dup-auto-refresh" style="margin-top:1px" />
<label id="dup-auto-refresh-lbl" for="dup-auto-refresh">
<?php esc_attr_e("Auto Refresh", 'duplicator') ?>
[<div id="dup-refresh-count"></div>]
</label>
</div>
<div class="dup-log-hdr">
<?php esc_html_e("Package Logs", 'duplicator') ?>
<small><?php esc_html_e("Top 20", 'duplicator') ?></small>
</div>
<div class="dup-log-file-list">
<?php
$count = 0;
$active = basename($logurl);
foreach ($logs as $log) {
$time = date('m/d/y h:i:s', filemtime($log));
$name = basename($log);
$url = '?page=duplicator-tools&tab=diagnostics&section=log&logname=' . esc_html($name);
echo ($active == $name)
? "<span class='dup-log' title='" . esc_attr($name) . "'>" . esc_html($time) . "-" . esc_html($name) . "</span>"
: "<a href='javascript:void(0)' title='" . esc_attr($name) . "' onclick='Duplicator.Tools.GetLog(\"" . esc_js($url) . "\")'>" . esc_html($time) . "-" . esc_html($name) . "</a>";
if ($count > 20) {
break;
}
}
?>
</div>
</td>
</tr>
</table>
<?php endif; ?>
</form>

View File

@@ -0,0 +1,80 @@
<?php
defined('ABSPATH') || defined('DUPXABSPATH') || exit;
?>
<style>
div.success {color:#4A8254}
div.failed {color:red}
table.dup-reset-opts td:first-child {font-weight: bold}
table.dup-reset-opts td {padding:10px}
button.dup-fixed-btn {min-width: 150px; text-align: center}
div#dup-tools-delete-moreinfo {display: none; padding: 5px 0 0 20px; border:1px solid silver; background-color: #fff; border-radius:3px; padding:10px; margin:5px; width:750px }
div.dup-alert-no-files-msg {padding:10px 0 10px 0}
div.dup-alert-secure-note {font-style: italic; max-width:800px; padding:15px 0 20px 0}
div#message {margin:0px 0px 10px 0px}
div#dup-server-info-area { padding:10px 5px; }
div#dup-server-info-area table { padding:1px; background:#dfdfdf; -webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px; width:100% !important; box-shadow:0 8px 6px -6px #777; }
div#dup-server-info-area td, th {padding:3px; background:#fff; -webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;}
div#dup-server-info-area tr.h img { display:none; }
div#dup-server-info-area tr.h td{ background:none; }
div#dup-server-info-area tr.h th{ text-align:center; background-color:#efefef; }
div#dup-server-info-area td.e{ font-weight:bold }
td.dup-settings-diag-header {background-color:#D8D8D8; font-weight: bold; border-style: none; color:black}
.widefat th {font-weight:bold; }
.widefat td {padding:2px 2px 2px 8px}
.widefat td:nth-child(1) {width:10px;}
.widefat td:nth-child(2) {padding-left: 20px; width:100% !important}
textarea.dup-opts-read {width:100%; height:40px; font-size:12px}
div.lite-sub-tabs {padding: 10px 0 10px 0; font-size: 14px}
</style>
<?php
$action_response = null;
$ctrl_ui = new DUP_CTRL_UI();
$ctrl_ui->setResponseType('PHP');
$data = $ctrl_ui->GetViewStateList();
$ui_css_srv_panel = (isset($data->payload['dup-settings-diag-srv-panel']) && $data->payload['dup-settings-diag-srv-panel']) ? 'display:block' : 'display:none';
$ui_css_opts_panel = (isset($data->payload['dup-settings-diag-opts-panel']) && $data->payload['dup-settings-diag-opts-panel']) ? 'display:block' : 'display:none';
$section = isset($_GET['section']) ? $_GET['section'] : 'info';
$txt_diagnostic = __('Information', 'duplicator');
$txt_log = __('Logs', 'duplicator');
$txt_support = __('Support', 'duplicator');
;
$tools_url = 'admin.php?page=duplicator-tools&tab=diagnostics';
switch ($section) {
case 'info':
echo "<div class='lite-sub-tabs'><b>" .
esc_html($txt_diagnostic) .
"</b> &nbsp;|&nbsp; <a href='" . esc_url($tools_url . "&section=log") . "'>" .
esc_html($txt_log) . "</a> &nbsp;|&nbsp; <a href='" .
esc_url($tools_url . "&section=support") . "'>" .
esc_html($txt_support) . "</a></div>";
include(dirname(__FILE__) . '/information.php');
break;
case 'log':
echo "<div class='lite-sub-tabs'><a href='" .
esc_url($tools_url . "&section=info") . "'>" .
esc_html($txt_diagnostic) . "</a> &nbsp;|&nbsp;<b>" .
esc_html($txt_log) . "</b> &nbsp;|&nbsp; <a href='" .
esc_url($tools_url . "&section=support") . "'>" .
esc_html($txt_support) . "</a></div>";
include(dirname(__FILE__) . '/logging.php');
break;
case 'support':
echo "<div class='lite-sub-tabs'><a href='" .
esc_url($tools_url . "&section=info") . "'>" .
esc_html($txt_diagnostic) . "</a> &nbsp;|&nbsp; <a href='" .
esc_url($tools_url . "&section=log") . "'>" .
esc_html($txt_log) . "</a> &nbsp;|&nbsp; <b>" .
esc_html($txt_support) . "</b> </div>";
include(dirname(__FILE__) . '/support.php');
break;
}
?>

View File

@@ -0,0 +1,108 @@
<?php
use Duplicator\Installer\Utils\LinkManager;
defined('ABSPATH') || defined('DUPXABSPATH') || exit;
?>
<style>
div.dup-support-all {font-size:13px; line-height:20px}
div.dup-support-txts-links {width:100%;font-size:14px; font-weight:bold; line-height:26px; text-align:center}
div.dup-support-hlp-area {width:375px; height:180px; float:left; border:1px solid #dfdfdf; border-radius:4px; margin:10px; line-height:18px;box-shadow: 0 8px 6px -6px #ccc;}
table.dup-support-hlp-hdrs {border-collapse:collapse; width:100%; border-bottom:1px solid #dfdfdf}
table.dup-support-hlp-hdrs {background-color:#efefef;}
div.dup-support-hlp-hdrs {
font-weight:bold; font-size:17px; height: 35px; padding:5px 5px 5px 10px;
background-image:-ms-linear-gradient(top, #FFFFFF 0%, #DEDEDE 100%);
background-image:-moz-linear-gradient(top, #FFFFFF 0%, #DEDEDE 100%);
background-image:-o-linear-gradient(top, #FFFFFF 0%, #DEDEDE 100%);
background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0, #FFFFFF), color-stop(1, #DEDEDE));
background-image:-webkit-linear-gradient(top, #FFFFFF 0%, #DEDEDE 100%);
background-image:linear-gradient(to bottom, #FFFFFF 0%, #DEDEDE 100%);
}
div.dup-support-hlp-hdrs div {padding:5px; margin:4px 20px 0px -20px; text-align: center;}
div.dup-support-hlp-txt{padding:10px; text-align:center}
</style>
<div class="wrap dup-wrap dup-support-all">
<div style="width:800px; margin:auto; margin-top: 20px">
<table>
<tr>
<td style="width:70px"><i class="fa fa-question-circle fa-5x"></i></td>
<td valign="top" style="padding-top:10px; font-size:13px">
<?php
esc_html_e(
"Migrating WordPress is a complex process and the logic to make all the magic happen smoothly may not work quickly with every site. " .
" With over 30,000 plugins and a very complex server eco-system some migrations may run into issues. This is why the Duplicator includes a detailed knowledgebase that can help with many common issues. " .
" Resources to additional support, approved hosting, and alternatives to fit your needs can be found below.",
'duplicator'
);
?>
</td>
</tr>
</table>
<br/><br/>
<!-- HELP LINKS -->
<div class="dup-support-hlp-area">
<div class="dup-support-hlp-hdrs">
<i class="fas fa-cube fa-2x fa-pull-left"></i>
<div><?php esc_html_e('Knowledgebase', 'duplicator') ?></div>
</div>
<div class="dup-support-hlp-txt">
<?php esc_html_e('Complete Online Documentation', 'duplicator'); ?>
<br/>
<select id="dup-support-kb-lnks" style="margin-top:18px; font-size:16px; min-width: 170px">
<option disabled selected>
<?php esc_html_e('Choose A Section', 'duplicator') ?>
</option>
<option
value="<?php echo esc_url(LinkManager::getCategoryUrl(LinkManager::QUICK_START_CAT, 'tools_support', 'Quick Start')); ?>
">
<?php esc_html_e('Quick Start', 'duplicator') ?>
</option>
<option value="<?php echo esc_url(LinkManager::getDocUrl('', 'tools_support', 'User Guide')); ?>">
<?php esc_html_e('User Guide', 'duplicator'); ?>
</option>
<option
value="<?php echo esc_url(LinkManager::getCategoryUrl(LinkManager::TROUBLESHOOTING_CAT, 'tools_support', 'FAQs')); ?>
">
<?php esc_html_e('FAQs', 'duplicator'); ?>
</option>
<option value="<?php echo esc_url(LinkManager::getDocUrl('changelog', 'tools_support', 'Change Log')); ?>">
<?php esc_html_e('Change Log', 'duplicator') ?>
</option>
</select>
</div>
</div>
<!-- ONLINE SUPPORT -->
<div class="dup-support-hlp-area">
<div class="dup-support-hlp-hdrs">
<i class="far fa-lightbulb fa-2x fa-pull-left"></i>
<div><?php esc_html_e('Premium Support', 'duplicator') ?></div>
</div>
<div class="dup-support-hlp-txt">
<?php esc_html_e("Having a problem with your back up or migrations? Upgrade to get our Premium Support.", 'duplicator'); ?>
<br/>
<div class="dup-support-txts-links" style="margin:10px 0 10px 0">
<a href="<?php echo esc_url(\Duplicator\Utils\Upsell::getCampaignUrl('duplicator_tools-support_tab', 'Upgrade Now')); ?>" target="_blank" class="dup-btn dup-btn-md dup-btn-green" >
<?php esc_html_e('Upgrade Now', 'duplicator') ?>
</a> <br/>
</div>
<small>Free Users <a href="https://wordpress.org/support/plugin/duplicator/" target="_blank">Support Forum</a></small>
</div>
</div>
</div>
</div>
<script>
jQuery(document).ready(function ($) {
//ATTACHED EVENTS
jQuery('#dup-support-kb-lnks').change(function () {
if (jQuery(this).val() != "null")
window.open(jQuery(this).val())
});
});
</script>

View File

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