first commit
This commit is contained in:
@@ -0,0 +1,975 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Duplicator
|
||||
*/
|
||||
|
||||
defined("ABSPATH") or die("");
|
||||
|
||||
use Duplicator\Addons\ProBase\License\License;
|
||||
use Duplicator\Controllers\StoragePageController;
|
||||
use Duplicator\Core\CapMng;
|
||||
use Duplicator\Installer\Package\ArchiveDescriptor;
|
||||
use Duplicator\Libs\Snap\SnapJson;
|
||||
use Duplicator\Models\Storages\AbstractStorageEntity;
|
||||
use Duplicator\Package\Create\BuildComponents;
|
||||
|
||||
/**
|
||||
* Variables
|
||||
*
|
||||
* @var Duplicator\Core\Controllers\ControllersManager $ctrlMng
|
||||
* @var Duplicator\Core\Views\TplMng $tplMng
|
||||
* @var array<string, mixed> $tplData
|
||||
* @var DUP_PRO_Package $package
|
||||
*/
|
||||
|
||||
$package = $tplData['package'];
|
||||
$global = DUP_PRO_Global_Entity::getInstance();
|
||||
|
||||
$ui_css_general = (DUP_PRO_UI_ViewState::getValue('dup-package-dtl-general-panel') ? 'display:block' : 'display:none');
|
||||
$ui_css_storage = (DUP_PRO_UI_ViewState::getValue('dup-package-dtl-storage-panel') ? 'display:block' : 'display:none');
|
||||
$ui_css_archive = (DUP_PRO_UI_ViewState::getValue('dup-package-dtl-archive-panel') ? 'display:block' : 'display:none');
|
||||
$ui_css_install = (DUP_PRO_UI_ViewState::getValue('dup-package-dtl-install-panel') ? 'display:block' : 'display:none');
|
||||
|
||||
$archiveDownloadURL = $package->getLocalPackageFileURL(DUP_PRO_Package_File_Type::Archive);
|
||||
$logDownloadURL = $package->getLocalPackageFileURL(DUP_PRO_Package_File_Type::Log);
|
||||
$installerDownloadURL = $package->getLocalPackageFileURL(DUP_PRO_Package_File_Type::Installer);
|
||||
$showLinksDialogJson = SnapJson::jsonEncodeEscAttr(array(
|
||||
"archive" => $archiveDownloadURL,
|
||||
"log" => $logDownloadURL,
|
||||
"installer" => $installerDownloadURL,
|
||||
));
|
||||
|
||||
$lang_notset = __("- not set -", 'duplicator-pro');
|
||||
|
||||
$tplMng->render('admin_pages/packages/details/details_header');
|
||||
?>
|
||||
<div class="dup-package-details-wrapper">
|
||||
<div class="toggle-box">
|
||||
<a href="javascript:void(0)" onclick="DupPro.Pack.OpenAll()">
|
||||
[<?php esc_html_e('open all', 'duplicator-pro'); ?>]
|
||||
</a>
|
||||
<a href="javascript:void(0)" onclick="DupPro.Pack.CloseAll()">
|
||||
[<?php esc_html_e('close all', 'duplicator-pro'); ?>]
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<!-- ===============================
|
||||
GENERAL -->
|
||||
<div class="dup-box dup-box-general">
|
||||
<div class="dup-box-title">
|
||||
<i class="fa fa-archive fa-sm"></i> <?php esc_html_e('General', 'duplicator-pro') ?>
|
||||
<button class="dup-box-arrow">
|
||||
<span class="screen-reader-text"><?php esc_html_e('Toggle panel:', 'duplicator-pro') ?> <?php esc_html_e('General', 'duplicator-pro') ?></span>
|
||||
</button>
|
||||
</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'>
|
||||
<tr>
|
||||
<td><?php esc_html_e("Name", 'duplicator-pro') ?>:</td>
|
||||
<td>
|
||||
<?php if (CapMng::can(CapMng::CAP_CREATE, false)) { ?>
|
||||
<a href="javascript:void(0);" onclick="jQuery(this).parent().find('.dup-link-data').toggle()" class="dup-toggle-name">
|
||||
<?php echo esc_html($package->Name) ?>
|
||||
</a>
|
||||
<div class="dup-link-data">
|
||||
<b><?php esc_html_e("ID", 'duplicator-pro') ?>:</b> <?php echo absint($package->ID); ?><br/>
|
||||
<b><?php esc_html_e("Hash", 'duplicator-pro') ?>:</b> <?php echo esc_html($package->Hash); ?><br/>
|
||||
<b><?php esc_html_e("Full Name", 'duplicator-pro') ?>:</b> <?php echo esc_html($package->NameHash); ?><br/>
|
||||
</div>
|
||||
<?php } else { ?>
|
||||
<?php echo esc_html($package->Name) ?>
|
||||
<?php } ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php esc_html_e("Notes", 'duplicator-pro') ?>:</td>
|
||||
<td><?php echo strlen($package->notes) ? esc_html($package->notes) : esc_html__("- no notes -", 'duplicator-pro') ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php esc_html_e("Created", 'duplicator-pro') ?>:</td>
|
||||
<td>
|
||||
<?php if (strlen($package->getCreated())) : ?>
|
||||
<a href="javascript:void(0);" onclick="jQuery(this).parent().find('.dup-link-data').toggle()" class="dup-toggle-created">
|
||||
<?php echo esc_html(get_date_from_gmt($package->getCreated())) ?>
|
||||
</a>
|
||||
|
||||
<div class="dup-link-data dup-link-data-created">
|
||||
<?php
|
||||
$datetime1 = new DateTime($package->getCreated());
|
||||
$datetime2 = new DateTime(date("Y-m-d H:i:s"));
|
||||
$diff = $datetime1->diff($datetime2);
|
||||
|
||||
$fulldate = $diff->y . __(' years, ', 'duplicator-pro') .
|
||||
$diff->m . __(' months, ', 'duplicator-pro') . $diff->d . __(' days', 'duplicator-pro');
|
||||
$fulldays = $diff->format('%a') . __(' days', 'duplicator-pro');
|
||||
?>
|
||||
<b><?php esc_html_e("Full Age", 'duplicator-pro'); ?>: </b> <?php echo esc_html($fulldate); ?> <br/>
|
||||
<b><?php esc_html_e("Days Old", 'duplicator-pro'); ?>: </b> <?php echo esc_html($fulldays); ?> <br/>
|
||||
</div>
|
||||
<?php else : ?>
|
||||
<?php esc_html_e("- not set in this version -", 'duplicator-pro'); ?>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php esc_html_e("Versions", 'duplicator-pro') ?>:</td>
|
||||
<td>
|
||||
<a href="javascript:void(0);" onclick="jQuery(this).parent().find('.dup-link-data').toggle()" class="dup-toggle-versions">
|
||||
<?php echo esc_html($package->getVersion()) ?>
|
||||
</a>
|
||||
<div class="dup-link-data dup-link-data-versions">
|
||||
<b><?php esc_html_e("WordPress", 'duplicator-pro') ?>:</b>
|
||||
<?php echo strlen($package->VersionWP) ? esc_html($package->VersionWP) : esc_html__("- unknown -", 'duplicator-pro') ?><br/>
|
||||
<b><?php esc_html_e("PHP", 'duplicator-pro') ?>:</b>
|
||||
<?php echo strlen($package->VersionPHP) ? esc_html($package->VersionPHP) : esc_html__("- unknown -", 'duplicator-pro') ?><br/>
|
||||
<b><?php esc_html_e("OS", 'duplicator-pro') ?>:</b>
|
||||
<?php echo strlen($package->VersionOS) ? esc_html($package->VersionOS) : esc_html__("- unknown -", 'duplicator-pro') ?><br/>
|
||||
<b><?php esc_html_e("Mysql", 'duplicator-pro') ?>:</b>
|
||||
<?php echo strlen($package->VersionDB) ? esc_html($package->VersionDB) : esc_html__("- unknown -", 'duplicator-pro') ?> |
|
||||
<?php
|
||||
echo strlen($package->Database->Comments) ?
|
||||
esc_html($package->Database->Comments) :
|
||||
esc_html__('- unknown -', 'duplicator-pro');
|
||||
?>
|
||||
<br/>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php esc_html_e("Runtime", 'duplicator-pro') ?>:</td>
|
||||
<td>
|
||||
<?php
|
||||
$search_types = array(
|
||||
'sec.',
|
||||
',',
|
||||
);
|
||||
$minute_view = trim(str_replace($search_types, '', $package->Runtime));
|
||||
if (is_numeric($minute_view)) {
|
||||
$minute_view = gmdate("H:i:s", (int) $minute_view);
|
||||
}
|
||||
echo strlen($package->Runtime) ?
|
||||
esc_html($package->Runtime) . ' <i>(' . esc_html($minute_view) . ')</i>' :
|
||||
esc_html__('error running', 'duplicator-pro');
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php esc_html_e("Type", 'duplicator-pro') ?>:</td>
|
||||
<td><?php echo esc_html($package->get_type_string()); ?></td>
|
||||
</tr>
|
||||
<?php if (CapMng::can(CapMng::CAP_EXPORT, false)) { ?>
|
||||
<tr>
|
||||
<td><?php esc_html_e("Files", 'duplicator-pro') ?>:</td>
|
||||
<td>
|
||||
<div id="dpro-downloads-area">
|
||||
<?php if ($package->Status != DUP_PRO_PackageStatus::ERROR) : ?>
|
||||
<?php if ($package->haveLocalStorage()) : ?>
|
||||
<button
|
||||
class="button dup-downloads-installer"
|
||||
onclick="DupPro.Pack.DownloadFile('<?php echo esc_attr($installerDownloadURL); ?>');return false;"
|
||||
>
|
||||
<i class="fa fa-bolt fa-sm"></i> Installer
|
||||
</button>
|
||||
<button
|
||||
class="button dup-downloads-archive"
|
||||
onclick="DupPro.Pack.DownloadFile('<?php echo esc_attr($archiveDownloadURL); ?>');return false;"
|
||||
>
|
||||
<i class="far fa-file-archive fa-sm"></i> Archive - <?php echo esc_html($package->ZipSize) ?>
|
||||
</button>
|
||||
<button
|
||||
class="button thickbox dup-downloads-share-links"
|
||||
onclick="DupPro.Pack.ShowLinksDialog(<?php echo esc_js($showLinksDialogJson); ?>);"
|
||||
>
|
||||
<i class="fas fa-share-alt fa-sm"></i>
|
||||
<?php esc_html_e("Share File Links", 'duplicator-pro') ?>
|
||||
</button>
|
||||
<table class="dup-pack-dtls-sublist">
|
||||
<tr>
|
||||
<td><?php esc_html_e("Archive", 'duplicator-pro') ?>: </td>
|
||||
<td>
|
||||
<a
|
||||
href="<?php echo esc_attr($archiveDownloadURL); ?>"
|
||||
target="file_results" class="dup-link-archive"
|
||||
download="<?php echo esc_attr($package->Archive->File) ?>"
|
||||
>
|
||||
<?php echo esc_html($package->Archive->File) ?>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php esc_html_e("Installer", 'duplicator-pro') ?>: </td>
|
||||
<td>
|
||||
<a class="dup-link-installer" href="<?php echo esc_url($installerDownloadURL); ?>">
|
||||
<?php echo esc_html($package->Installer->getInstallerName()); ?>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php esc_html_e("Build Log", 'duplicator-pro') ?>: </td>
|
||||
<td>
|
||||
<a class="dup-link-build-log" href="<?php echo esc_attr($logDownloadURL); ?>" target="file_results">
|
||||
<?php echo esc_html($package->get_log_filename()); ?>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="sub-notes">
|
||||
<i class="fas fa-download"></i> <?php esc_html_e("Click links to download", 'duplicator-pro') ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<?php else : ?>
|
||||
<!-- CLOUD ONLY FILES -->
|
||||
<div id="dpro-downloads-msg">
|
||||
<i class="fas fa-server"></i>
|
||||
<?php
|
||||
esc_html_e(
|
||||
"The package files are in remote storage location(s). Please visit the storage provider to download.",
|
||||
'duplicator-pro'
|
||||
);
|
||||
?>
|
||||
</div> <br/>
|
||||
<button class="button" disabled="true">
|
||||
<i class="fa fa-exclamation-triangle fa-sm"></i> Installer - <?php echo esc_html(DUP_PRO_U::byteSize($package->Installer->Size)) ?>
|
||||
</button>
|
||||
<button class="button" disabled="true">
|
||||
<i class="fa fa-exclamation-triangle fa-sm"></i> Archive - <?php echo esc_html($package->ZipSize) ?>
|
||||
</button>
|
||||
<div class="margin-top-1">
|
||||
<b><?php esc_html_e("Build Log", 'duplicator-pro') ?>:</b>
|
||||
<a href="<?php echo esc_url($logDownloadURL); ?>" target="file_results"><?php echo esc_html($package->get_log_filename()); ?></a>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php else : ?>
|
||||
<div class="maroon">
|
||||
<i class="fas fa-exclamation-circle"></i>
|
||||
<?php esc_html_e("Package files were not created successfully. Please see the build log for more details.", 'duplicator-pro') ?>
|
||||
</div><br/>
|
||||
<b><?php esc_html_e("Build Log", 'duplicator-pro') ?>:</b>
|
||||
<a href="<?php echo esc_attr($logDownloadURL); ?>" target="file_results"><?php echo esc_html($package->get_log_filename()); ?></a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- ==========================================
|
||||
DIALOG: SHARE LINKS -->
|
||||
<?php add_thickbox(); ?>
|
||||
<div id="dup-dlg-quick-path" title="<?php esc_attr_e('Download Links', 'duplicator-pro'); ?>" style="display:none">
|
||||
<p class="maroon">
|
||||
<i class="fa fa-lock fa-sm"></i>
|
||||
<?php esc_html_e("The following links contain sensitive data. Please share with caution!", 'duplicator-pro'); ?>
|
||||
</p>
|
||||
|
||||
<div style="padding: 0px 15px 15px 15px;">
|
||||
<a
|
||||
href="javascript:void(0)"
|
||||
style="display:inline-block; text-align:right"
|
||||
onclick="DupPro.Pack.GetLinksText()"
|
||||
>
|
||||
[<?php esc_html_e('Select & Copy', 'duplicator-pro'); ?>]
|
||||
</a><br/>
|
||||
<textarea id="dpro-dlg-quick-path-data" style='border:1px solid silver; border-radius:3px; width:99%; height:230px; font-size:11px'></textarea><br/>
|
||||
<i style='font-size:11px'>
|
||||
<?php
|
||||
printf(
|
||||
"%s <a href='" . esc_url(DUPLICATOR_PRO_DUPLICATOR_DOCS_URL . "how-to-work-with-daf-files-and-the-duparchive-extraction-tool") .
|
||||
"' target='_blank'>%s</a>",
|
||||
esc_html__(
|
||||
"An exact copy of the database SQL and installer file 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: ",
|
||||
"duplicator-pro"
|
||||
),
|
||||
esc_html__("How do I work with DAF files and the DupArchive extraction tool?", "duplicator-pro")
|
||||
);
|
||||
?>
|
||||
</i>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- ===============================
|
||||
STORAGE -->
|
||||
<div class="dup-box dup-box-storage">
|
||||
<div class="dup-box-title">
|
||||
<i class="fas fa-server fa-sm"></i> <?php esc_html_e('Storage', 'duplicator-pro') ?>
|
||||
<button class="dup-box-arrow">
|
||||
<span class="screen-reader-text">
|
||||
<?php esc_html_e('Toggle panel:', 'duplicator-pro') ?> <?php esc_html_e('Storage Options', 'duplicator-pro') ?>
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="dup-box-panel" id="dup-package-dtl-storage-panel" style="<?php echo esc_attr($ui_css_storage) ?>">
|
||||
<table class="widefat package-tbl">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style='width:175px'><?php esc_html_e('Type', 'duplicator-pro') ?></th>
|
||||
<th style='width:275px'><?php esc_html_e('Name', 'duplicator-pro') ?></th>
|
||||
<th style="white-space: nowrap"><?php esc_html_e('Location', 'duplicator-pro') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<?php
|
||||
$i = 0;
|
||||
$latest_upload_infos = $package->get_latest_upload_infos();
|
||||
foreach ($latest_upload_infos as $upload_info) :
|
||||
if ($upload_info->has_completed(true) == false) {
|
||||
// For now not displaying any cancelled or failed storages
|
||||
continue;
|
||||
}
|
||||
if (($store = AbstractStorageEntity::getById($upload_info->getStorageId())) === false) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$i++;
|
||||
$store_type = $store->getStypeName();
|
||||
$store_id = $store->getStypeName();
|
||||
$store_location = $store->getLocationString();
|
||||
$row_style = ($i % 2) ? 'alternate' : '';
|
||||
?>
|
||||
<tr class="package-row <?php echo esc_attr($row_style) ?>">
|
||||
<td>
|
||||
<?php
|
||||
echo wp_kses(
|
||||
$store->getSTypeIcon(),
|
||||
[
|
||||
'i' => [
|
||||
'class' => [],
|
||||
],
|
||||
'img' => [
|
||||
'src' => [],
|
||||
'class' => [],
|
||||
'alt' => [],
|
||||
],
|
||||
]
|
||||
),
|
||||
' ',
|
||||
esc_html($store->getName());
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
if (CapMng::can(CapMng::CAP_STORAGE, false)) {
|
||||
$editUrl = StoragePageController::getEditUrl($store)
|
||||
?>
|
||||
<a href="<?php echo esc_url($editUrl); ?>" target="_blank">
|
||||
<?php echo esc_html($store->getName()); ?>
|
||||
</a>
|
||||
<?php } else {
|
||||
echo esc_html($store->getName());
|
||||
} ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
echo wp_kses(
|
||||
$store->getHtmlLocationLink(),
|
||||
[
|
||||
'a' => [
|
||||
'href' => [],
|
||||
'target' => [],
|
||||
],
|
||||
'span' => [],
|
||||
]
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
<?php if ($i == 0) : ?>
|
||||
<tr>
|
||||
<td colspan="3" style="text-align: center">
|
||||
<?php esc_html_e('- No storage locations associated with this package -', 'duplicator-pro'); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- ===============================
|
||||
ARCHIVE -->
|
||||
<div class="dup-box dup-box-archive">
|
||||
<div class="dup-box-title">
|
||||
<i class="far fa-file-archive fa-sm"></i> <?php esc_html_e('Archive', 'duplicator-pro') ?>
|
||||
<button class="dup-box-arrow">
|
||||
<span class="screen-reader-text"><?php esc_html_e('Toggle panel:', 'duplicator-pro') ?> <?php esc_html_e('Archive', 'duplicator-pro') ?></span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="dup-box-panel" id="dup-package-dtl-archive-panel" style="<?php echo esc_attr($ui_css_archive) ?>">
|
||||
|
||||
<!-- FILES -->
|
||||
<div class="section-hdr">
|
||||
<i class="fas fa-folder-open fa-sm"></i>
|
||||
<?php esc_html_e('FILES', 'duplicator-pro'); ?>
|
||||
</div>
|
||||
<table class='dup-dtl-data'>
|
||||
<tr>
|
||||
<td><?php esc_html_e("Engine", 'duplicator-pro') ?>: </td>
|
||||
<td>
|
||||
<?php
|
||||
$zip_mode_string = __('Unknown', 'duplicator-pro');
|
||||
|
||||
if ($package->build_progress->current_build_mode == DUP_PRO_Archive_Build_Mode::ZipArchive) {
|
||||
$zip_mode_string = __("ZipArchive", 'duplicator-pro');
|
||||
|
||||
if ($package->ziparchive_mode === DUP_PRO_ZipArchive_Mode::SingleThread) {
|
||||
$zip_mode_string = __("ZipArchive ST", 'duplicator-pro');
|
||||
}
|
||||
} elseif ($package->build_progress->current_build_mode == DUP_PRO_Archive_Build_Mode::Shell_Exec) {
|
||||
$zip_mode_string = __("Shell Exec", 'duplicator-pro');
|
||||
} else {
|
||||
$zip_mode_string = __("DupArchive", 'duplicator-pro');
|
||||
}
|
||||
|
||||
echo esc_html($zip_mode_string);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php esc_html_e("Filters", 'duplicator-pro') ?>: </td>
|
||||
<td><?php echo $package->Archive->FilterOn == 1 ? 'On' : 'Off'; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
<div class="sub-filter-hdr">
|
||||
<i class="far fa-folder-open"></i>
|
||||
<?php esc_html_e("Directories", 'duplicator-pro') ?>
|
||||
</div>
|
||||
|
||||
<div class="sub-filter-data sub-filter-data-directories">
|
||||
<?php
|
||||
//CUSTOM
|
||||
$title = __("User defined filtered directories", 'duplicator-pro');
|
||||
$count = count($package->Archive->FilterInfo->Dirs->Instance);
|
||||
?>
|
||||
<a
|
||||
href="javascript:void(0)"
|
||||
onclick="jQuery(this).parent().children('.filter-info').eq(0).toggle(200)"
|
||||
title="<?php echo esc_attr($title) ?>"
|
||||
>
|
||||
<i class="fa fa-filter fa-fw fa-xs"></i><?php esc_html_e('User Defined', 'duplicator-pro') ?>
|
||||
</a>
|
||||
<sup>(<?php echo (int) $count ?>)</sup>
|
||||
<br/>
|
||||
<div class="filter-info">
|
||||
<?php
|
||||
if ($count == 0) {
|
||||
esc_html_e('- filter type not found -', 'duplicator-pro');
|
||||
} else {
|
||||
foreach ($package->Archive->FilterInfo->Dirs->Instance as $dir) {
|
||||
echo esc_html($dir) . ";<br/>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
//UNREADABLE
|
||||
$title = __("These paths are filtered because they are unreadable by the system", 'duplicator-pro');
|
||||
$count = count($package->Archive->FilterInfo->Dirs->Unreadable);
|
||||
?>
|
||||
<a
|
||||
href="javascript:void(0)"
|
||||
onclick="jQuery(this).parent().children('.filter-info').eq(1).toggle(200)"
|
||||
title="<?php esc_attr($title) ?>"
|
||||
>
|
||||
<i class="fa fa-filter fa-fw fa-xs"></i><?php esc_html_e('Unreadable', 'duplicator-pro') ?>
|
||||
</a>
|
||||
<sup>(<?php echo (int) $count ?>)</sup>
|
||||
<br/>
|
||||
<div class='filter-info'>
|
||||
<?php
|
||||
if ($count == 0) {
|
||||
esc_html_e('- filter type not found -', 'duplicator-pro');
|
||||
} else {
|
||||
foreach ($package->Archive->FilterInfo->Dirs->Unreadable as $dir) {
|
||||
echo esc_html($dir) . ";<br/>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
<div class="sub-filter-hdr">
|
||||
<i class="far fa-file"></i>
|
||||
<?php esc_html_e("Files", 'duplicator-pro') ?>
|
||||
</div>
|
||||
|
||||
<div class="sub-filter-data sub-filter-data-files">
|
||||
<?php
|
||||
//CUSTOM
|
||||
$title = __("User defined filtered files", 'duplicator-pro');
|
||||
$count = count($package->Archive->FilterInfo->Files->Instance);
|
||||
?>
|
||||
<a
|
||||
href="javascript:void(0)"
|
||||
onclick="jQuery(this).parent().children('.filter-info').eq(0).toggle(200)"
|
||||
title="<?php echo esc_attr($title) ?>"
|
||||
>
|
||||
<i class="fa fa-filter fa-fw fa-xs"></i><?php esc_html_e('User Defined', 'duplicator-pro') ?>
|
||||
</a>
|
||||
<sup>(<?php echo (int) $count ?>)</sup>
|
||||
<br/>
|
||||
|
||||
<div class="filter-info">
|
||||
<?php
|
||||
if ($count == 0) {
|
||||
esc_html_e('- filter type not found -', 'duplicator-pro');
|
||||
} else {
|
||||
foreach ($package->Archive->FilterInfo->Files->Instance as $file) {
|
||||
echo esc_html($file) . ";<br/>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
//UNREADABLE
|
||||
$title = __("These paths are filtered because they are unreadable by the system", 'duplicator-pro');
|
||||
$count = count($package->Archive->FilterInfo->Files->Unreadable);
|
||||
?>
|
||||
<a
|
||||
href="javascript:void(0)"
|
||||
onclick="jQuery(this).parent().children('.filter-info').eq(1).toggle(200)"
|
||||
title="<?php echo esc_attr($title) ?>"
|
||||
>
|
||||
<i class='fa fa-filter fa-fw fa-xs'></i><?php esc_html_e('Unreadable', 'duplicator-pro') ?>
|
||||
</a>
|
||||
<sup>(<?php echo (int) $count ?>)</sup>
|
||||
<br/>
|
||||
<div class="filter-info">
|
||||
<?php
|
||||
if ($count == 0) {
|
||||
esc_html_e('- filter type not found -', 'duplicator-pro');
|
||||
} else {
|
||||
foreach ($package->Archive->FilterInfo->Files->Unreadable as $file) {
|
||||
echo esc_html($file) . ";<br/>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
<div class="sub-filter-hdr">
|
||||
<i class="far fa-sticky-note"></i>
|
||||
<?php esc_html_e("Extensions", 'duplicator-pro') ?>
|
||||
</div>
|
||||
|
||||
<div class="sub-filter-data sub-filter-data-extensions">
|
||||
<?php
|
||||
if (count($package->Archive->FilterExtsAll) > 0) {
|
||||
$filter_ext = implode(',', $package->Archive->FilterExtsAll);
|
||||
echo esc_html($filter_ext);
|
||||
} else {
|
||||
esc_html_e('- no filters -', 'duplicator-pro');
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php esc_html_e('Components: ', 'duplicator-pro'); ?></td>
|
||||
<td>
|
||||
<?php
|
||||
echo wp_kses(
|
||||
BuildComponents::displayComponentsList($package->components, "</br>"),
|
||||
[
|
||||
'br' => [],
|
||||
]
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
</table><br/>
|
||||
|
||||
<!-- DATABASE -->
|
||||
<div class="section-hdr">
|
||||
<i class="fas fa-database"></i>
|
||||
<?php esc_html_e('DATABASE', 'duplicator-pro'); ?>
|
||||
</div>
|
||||
<?php if (!BuildComponents::isDBExcluded($package->components)) : ?>
|
||||
<table class='dup-dtl-data'>
|
||||
<tr>
|
||||
<td><?php esc_html_e("Name", 'duplicator-pro') ?>: </td>
|
||||
<td><?php echo esc_html($package->Database->info->name) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php esc_html_e("Type", 'duplicator-pro') ?>: </td>
|
||||
<td><?php echo esc_html($package->Database->Type) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php esc_html_e("Engine", 'duplicator-pro') ?>: </td>
|
||||
<td><?php echo esc_html($package->Database->info->dbEngine) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php esc_html_e("SQL Mode", 'duplicator-pro') ?>: </td>
|
||||
<td><?php echo esc_html($package->Database->DBMode) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php esc_html_e("Filters", 'duplicator-pro') ?>: </td>
|
||||
<td><?php echo $package->Database->FilterOn == 1 ? 'On' : 'Off'; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td>
|
||||
<?php
|
||||
$title = __('User defined table filters.', 'duplicator-pro');
|
||||
$count = (strlen($package->Database->FilterTables))
|
||||
? count(explode(',', $package->Database->FilterTables))
|
||||
: 0;
|
||||
?>
|
||||
|
||||
<div class="sub-filter-hdr">
|
||||
<i class="fas fa-table"></i>
|
||||
<?php esc_html_e('Tables', 'duplicator-pro'); ?>
|
||||
</div>
|
||||
|
||||
<div class="sub-filter-data sub-filter-data-tables">
|
||||
<a
|
||||
href='javascript:void(0)'
|
||||
onclick="jQuery(this).parent().children('.filter-info').eq(0).toggle(200)" title="<?php echo esc_attr($title); ?>"
|
||||
>
|
||||
<i class='fa fa-filter fa-fw fa-xs'></i><?php esc_html_e('User Defined', 'duplicator-pro'); ?></a>
|
||||
<sup>(<?php echo (int) $count; ?>)</sup>
|
||||
|
||||
<div id="dup-filter-tables" class="filter-info">
|
||||
<?php
|
||||
if (strlen($package->Database->FilterTables)) {
|
||||
$filterTables = trim(str_replace(',', "<br/>", $package->Database->FilterTables));
|
||||
echo wp_kses($filterTables, ['br' => []]);
|
||||
} else {
|
||||
esc_html_e('- no filters -', 'duplicator-pro');
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php esc_html_e('Size', 'duplicator-pro') ?>: </td>
|
||||
<td><?php echo esc_html(DUP_PRO_U::byteSize($package->Database->info->tablesSizeOnDisk));?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php esc_html_e('Collations', 'duplicator-pro') ?>: </td>
|
||||
<td>
|
||||
<?php
|
||||
foreach ($package->Database->info->collationList as $collation) {
|
||||
echo esc_html($collation) . "<br/>";
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<?php else : ?>
|
||||
<p>
|
||||
<?php esc_html_e("The Database was excluded from the package.", "duplicator-pro"); ?>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
<br/>
|
||||
|
||||
<!-- SETUP -->
|
||||
<div class="section-hdr">
|
||||
<i class="fas fa-sliders-h"></i>
|
||||
<?php esc_html_e('SETUP', 'duplicator-pro'); ?>
|
||||
</div>
|
||||
<table class='dup-dtl-data'>
|
||||
<tr>
|
||||
<td><?php esc_html_e("Security", 'duplicator-pro'); ?>:</td>
|
||||
<td>
|
||||
<?php
|
||||
switch ($package->Installer->OptsSecureOn) {
|
||||
case ArchiveDescriptor::SECURE_MODE_NONE:
|
||||
esc_html_e('None', 'duplicator-pro');
|
||||
break;
|
||||
case ArchiveDescriptor::SECURE_MODE_INST_PWD:
|
||||
esc_html_e('Installer password', 'duplicator-pro');
|
||||
break;
|
||||
case ArchiveDescriptor::SECURE_MODE_ARC_ENCRYPT:
|
||||
esc_html_e('Archive encryption', 'duplicator-pro');
|
||||
break;
|
||||
default:
|
||||
throw new Exception('Invalid secure mode');
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="sub-notes">
|
||||
<?php
|
||||
esc_html_e('Lost passwords cannot be recovered. A new archive will need to be created.', 'duplicator-pro');
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- ===============================
|
||||
INSTALLER -->
|
||||
<div class="dup-box dup-box-installer" style="margin-bottom: 50px">
|
||||
<div class="dup-box-title">
|
||||
<i class="fa fa-bolt fa-sm"></i> <?php esc_html_e('Installer', 'duplicator-pro') ?>
|
||||
<?php if ($package->Installer->isSecure()) { ?>
|
||||
<span id="dpro-install-secure-lock" title="<?php esc_attr_e('Installer password protection is on for this package.', 'duplicator-pro') ?>">
|
||||
<i class="fa fa-lock fa-sm"></i>
|
||||
</span>
|
||||
<?php } else { ?>
|
||||
<span id="dpro-install-secure-unlock" title="<?php esc_attr_e('Installer password protection is off for this package.', 'duplicator-pro') ?>">
|
||||
<i class="fa fa-unlock-alt"></i>
|
||||
</span>
|
||||
<?php } ?>
|
||||
<button class="dup-box-arrow">
|
||||
<span class="screen-reader-text">
|
||||
<?php esc_html_e('Toggle panel:', 'duplicator-pro') ?> <?php esc_html_e('Installer', 'duplicator-pro') ?>
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="dup-box-panel" id="dup-package-dtl-install-panel" style="<?php echo esc_attr($ui_css_install) ?>">
|
||||
<br/>
|
||||
|
||||
<table class='dup-dtl-data'>
|
||||
<tr>
|
||||
<td colspan="2"><div class="dup-package-hdr-1"><?php esc_html_e("SETUP", 'duplicator-pro') ?></div></td>
|
||||
</tr>
|
||||
<?php if (License::can(License::CAPABILITY_BRAND)) : ?>
|
||||
<tr>
|
||||
<td><?php esc_html_e("Brand", 'duplicator-pro'); ?>:</td>
|
||||
<td>
|
||||
<span style="color:#AF5E52; font-weight: bold">
|
||||
<?php echo esc_html($package->Brand) ?>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
<tr>
|
||||
<td><?php esc_html_e("Security", 'duplicator-pro'); ?>:</td>
|
||||
<td>
|
||||
<?php echo $package->Installer->isSecure() ? esc_html__("On", 'duplicator-pro') : esc_html__("Off", 'duplicator-pro'); ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table><br/><br/>
|
||||
|
||||
<table style="width:100%">
|
||||
<tr>
|
||||
<td colspan="2"><div class="dup-package-hdr-1"><?php esc_html_e("PREFILLS", 'duplicator-pro') ?></div></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<!-- ===================
|
||||
STEP1 TABS -->
|
||||
<div data-dpro-tabs="true">
|
||||
<ul>
|
||||
<li> <?php esc_html_e('Basic', 'duplicator-pro') ?> </li>
|
||||
<li id="dpro-cpnl-tab-lbl"><?php esc_html_e('cPanel', 'duplicator-pro') ?></li>
|
||||
</ul>
|
||||
|
||||
<!-- ===================
|
||||
TAB1: Basic -->
|
||||
<div>
|
||||
<table class='dup-dtl-data dup-dtl-basic'>
|
||||
<tr>
|
||||
<td><?php esc_html_e("Host", 'duplicator-pro') ?>:</td>
|
||||
<td><?php echo strlen($package->Installer->OptsDBHost) ? esc_html($package->Installer->OptsDBHost) : esc_html($lang_notset) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php esc_html_e("Database", 'duplicator-pro') ?>:</td>
|
||||
<td>
|
||||
<?php
|
||||
echo strlen($package->Installer->OptsDBName) ?
|
||||
esc_html($package->Installer->OptsDBName) :
|
||||
esc_html($lang_notset);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php esc_html_e("User", 'duplicator-pro') ?>:</td>
|
||||
<td><?php echo strlen($package->Installer->OptsDBUser) ? esc_html($package->Installer->OptsDBUser) : esc_html($lang_notset) ?></td>
|
||||
</tr>
|
||||
</table><br/>
|
||||
</div>
|
||||
|
||||
<!-- ===================
|
||||
TAB2: cPanel -->
|
||||
<div style="max-height: 250px" class="dup-dtl-cpanel">
|
||||
<table class='dup-dtl-data'>
|
||||
<tr>
|
||||
<td colspan="2" class="sub-section"> <b><?php esc_html_e("cPanel Login", 'duplicator-pro') ?></b> </td>
|
||||
</tr>
|
||||
<tr class="sub-item">
|
||||
<td><?php esc_html_e("Automation", 'duplicator-pro') ?>:</td>
|
||||
<td><?php echo ($package->Installer->OptsCPNLEnable) ? 'On' : 'Off' ?></td>
|
||||
</tr>
|
||||
<tr class="sub-item">
|
||||
<td><?php esc_html_e("Host", 'duplicator-pro') ?>:</td>
|
||||
<td>
|
||||
<?php
|
||||
echo strlen($package->Installer->OptsCPNLHost) ?
|
||||
esc_html($package->Installer->OptsCPNLHost) :
|
||||
esc_html($lang_notset);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="sub-item">
|
||||
<td><?php esc_html_e("User", 'duplicator-pro') ?>:</td>
|
||||
<td>
|
||||
<?php
|
||||
echo strlen($package->Installer->OptsCPNLUser) ?
|
||||
esc_html($package->Installer->OptsCPNLUser) :
|
||||
esc_html($lang_notset);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" class="sub-section"><b><?php esc_html_e("MySQL Server", 'duplicator-pro') ?></b></td>
|
||||
</tr>
|
||||
<tr class="sub-item">
|
||||
<td><?php esc_html_e("Action", 'duplicator-pro') ?>:</td>
|
||||
<td>
|
||||
<?php
|
||||
echo ($package->Installer->OptsCPNLDBAction == 'create') ?
|
||||
esc_html__("Create A New Database", 'duplicator-pro') :
|
||||
esc_html__("Connect to Existing Database and Remove All Data", 'duplicator-pro');
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="sub-item">
|
||||
<td><?php esc_html_e("Host", 'duplicator-pro') ?>:</td>
|
||||
<td>
|
||||
<?php
|
||||
echo strlen($package->Installer->OptsCPNLDBHost) ?
|
||||
esc_html($package->Installer->OptsCPNLDBHost) :
|
||||
esc_html($lang_notset);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="sub-item">
|
||||
<td><?php esc_html_e("Database", 'duplicator-pro') ?>:</td>
|
||||
<td>
|
||||
<?php
|
||||
echo strlen($package->Installer->OptsCPNLDBName) ?
|
||||
esc_html($package->Installer->OptsCPNLDBName) :
|
||||
esc_html($lang_notset);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="sub-item">
|
||||
<td><?php esc_html_e("User", 'duplicator-pro') ?>:</td>
|
||||
<td>
|
||||
<?php
|
||||
echo strlen($package->Installer->OptsCPNLDBUser) ?
|
||||
esc_html($package->Installer->OptsCPNLDBUser) :
|
||||
esc_html($lang_notset);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
</table><br/>
|
||||
|
||||
</div>
|
||||
</div><br/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
jQuery(document).ready(function ($)
|
||||
{
|
||||
/* Shows the Share 'Download Links' dialog
|
||||
* @param json JSON containing all links
|
||||
*/
|
||||
DupPro.Pack.ShowLinksDialog = function(json)
|
||||
{
|
||||
var url = '#TB_inline?width=650&height=400&inlineId=dup-dlg-quick-path';
|
||||
tb_show("<?php esc_html_e('Package File Links', 'duplicator-pro') ?>", url);
|
||||
|
||||
var msg = <?php printf(
|
||||
'"%s" + "\n\n%s:\n" + json.archive + "\n\n%s:\n" + json.installer + "\n\n%s:\n" + json.log + "\n\n%s";',
|
||||
'=========== SENSITIVE INFORMATION START ===========',
|
||||
esc_html__("ARCHIVE", 'duplicator-pro'),
|
||||
esc_html__("INSTALLER", 'duplicator-pro'),
|
||||
esc_html__("LOG", 'duplicator-pro'),
|
||||
'=========== SENSITIVE INFORMATION END ==========='
|
||||
);
|
||||
?>
|
||||
$("#dpro-dlg-quick-path-data").val(msg);
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Open all Panels */
|
||||
DupPro.Pack.OpenAll = function () {
|
||||
DupPro.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
|
||||
});
|
||||
});
|
||||
DupPro.UI.SaveMulViewStatesByPost(states);
|
||||
DupPro.UI.IsSaveViewState = true;
|
||||
};
|
||||
|
||||
/* Close all Panels */
|
||||
DupPro.Pack.CloseAll = function () {
|
||||
DupPro.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
|
||||
});
|
||||
});
|
||||
DupPro.UI.SaveMulViewStatesByPost(states);
|
||||
DupPro.UI.IsSaveViewState = true;
|
||||
};
|
||||
|
||||
/**
|
||||
* Submits the password for validation
|
||||
*/
|
||||
DupPro.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-sm"></i>');
|
||||
} else {
|
||||
$input.attr('type', 'text');
|
||||
$button.html('<i class="fas fa-eye-slash fa-sm"></i>');
|
||||
}
|
||||
}
|
||||
|
||||
/* Selects all text in share dialog */
|
||||
DupPro.Pack.GetLinksText = function () {
|
||||
$('#dpro-dlg-quick-path-data').select();
|
||||
document.execCommand('copy');
|
||||
};
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,88 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Duplicator
|
||||
*/
|
||||
|
||||
use Duplicator\Controllers\PackagesPageController;
|
||||
use Duplicator\Core\CapMng;
|
||||
|
||||
defined("ABSPATH") or die("");
|
||||
|
||||
/**
|
||||
* Variables
|
||||
*
|
||||
* @var Duplicator\Core\Controllers\ControllersManager $ctrlMng
|
||||
* @var Duplicator\Core\Views\TplMng $tplMng
|
||||
* @var array<string, mixed> $tplData
|
||||
* @var DUP_PRO_Package $package
|
||||
*/
|
||||
|
||||
$package = $tplData['package'];
|
||||
/** @var string */
|
||||
$innerPage = $tplData['currentInnerPage'];
|
||||
$enable_transfer_tab = (
|
||||
$package->getLocalPackageFilePath(DUP_PRO_Package_File_Type::Installer) !== false &&
|
||||
$package->getLocalPackageFilePath(DUP_PRO_Package_File_Type::Archive) !== false
|
||||
);
|
||||
|
||||
$packagesListUrl = PackagesPageController::getInstance()->getMenuLink();
|
||||
$packgeDefailsUrl = PackagesPageController::getInstance()->getPackageDetailsUrl($package->ID);
|
||||
$packgeTransferUrl = PackagesPageController::getInstance()->getPackageTransferUrl($package->ID);
|
||||
?>
|
||||
<h2 class="nav-tab-wrapper">
|
||||
<a
|
||||
href="<?php echo esc_url($packgeDefailsUrl); ?>"
|
||||
class="nav-tab <?php echo ($innerPage == PackagesPageController::LIST_INNER_PAGE_DETAILS) ? 'nav-tab-active' : '' ?>"
|
||||
>
|
||||
<?php esc_html_e('Details', 'duplicator-pro'); ?>
|
||||
</a>
|
||||
<?php if (CapMng::can(CapMng::CAP_CREATE, false)) { ?>
|
||||
<a
|
||||
href="<?php echo esc_url($packgeTransferUrl); ?>"
|
||||
class="nav-tab <?php echo ($innerPage == PackagesPageController::LIST_INNER_PAGE_TRANSFER) ? 'nav-tab-active' : '' ?>"
|
||||
<?php if ($enable_transfer_tab === false) { ?>
|
||||
onclick="DupPro.Pack.TransferDisabled(); return false;"
|
||||
<?php } ?>
|
||||
>
|
||||
<?php esc_html_e('Transfer', 'duplicator-pro'); ?>
|
||||
</a>
|
||||
<?php } ?>
|
||||
</h2>
|
||||
<div class="dup-details-packages-list">
|
||||
<a href="<?php echo esc_url($packagesListUrl); ?>">[<?php esc_html_e('Packages', 'duplicator-pro'); ?>]</a>
|
||||
</div>
|
||||
|
||||
<?php if ($package->Status == DUP_PRO_PackageStatus::ERROR) { ?>
|
||||
<div id='dpro-error' class="error">
|
||||
<p>
|
||||
<b>
|
||||
<?php
|
||||
echo esc_html__('Error encountered building package, please review ', 'duplicator-pro') .
|
||||
'<a target="_blank" href="' . esc_url($package->get_log_url()) . '">' . esc_html__('package log', 'duplicator-pro') . '</a>' .
|
||||
esc_html__(' for details.', 'duplicator-pro');
|
||||
?>
|
||||
</b>
|
||||
<br/>
|
||||
<?php
|
||||
echo esc_html__('For more help read the ', 'duplicator-pro') .
|
||||
'<a target="_blank" href="' . esc_url(DUPLICATOR_PRO_TECH_FAQ_URL) . '">' . esc_html__('FAQ pages', 'duplicator-pro') . '</a>' .
|
||||
esc_html__(' or submit a ', 'duplicator-pro') .
|
||||
'<a target="_blank" href="' . esc_url(DUPLICATOR_PRO_BLOG_URL . 'my-account/support/') . '">' .
|
||||
esc_html__('help ticket', 'duplicator-pro') . '</a>';
|
||||
?>.
|
||||
</p>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
$alertTransferDisabled = new DUP_PRO_UI_Dialog();
|
||||
$alertTransferDisabled->title = __('Transfer Error', 'duplicator-pro');
|
||||
$alertTransferDisabled->message = __('No package in default location so transfer is disabled.', 'duplicator-pro');
|
||||
$alertTransferDisabled->initAlert();
|
||||
?>
|
||||
<script>
|
||||
DupPro.Pack.TransferDisabled = function() {
|
||||
<?php $alertTransferDisabled->showAlert(); ?>
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Duplicator
|
||||
*/
|
||||
|
||||
defined("ABSPATH") or die("");
|
||||
|
||||
/**
|
||||
* Variables
|
||||
*
|
||||
* @var Duplicator\Core\Controllers\ControllersManager $ctrlMng
|
||||
* @var Duplicator\Core\Views\TplMng $tplMng
|
||||
* @var array<string, mixed> $tplData
|
||||
*/
|
||||
?>
|
||||
<br/><br/>
|
||||
<div id='dpro-error' class="error">
|
||||
<p>
|
||||
<?php echo sprintf(
|
||||
esc_html__(
|
||||
"Unable to find package id %d. The package does not exist or was deleted.",
|
||||
'duplicator-pro'
|
||||
),
|
||||
esc_html($tplData['packageId'])
|
||||
); ?>
|
||||
<br/>
|
||||
</p>
|
||||
</div>
|
||||
@@ -0,0 +1,590 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Duplicator
|
||||
*/
|
||||
|
||||
use Duplicator\Controllers\StoragePageController;
|
||||
use Duplicator\Core\CapMng;
|
||||
use Duplicator\Libs\Snap\SnapJson;
|
||||
use Duplicator\Libs\Snap\SnapWP;
|
||||
use Duplicator\Models\Storages\AbstractStorageEntity;
|
||||
use Duplicator\Models\Storages\StoragesUtil;
|
||||
|
||||
defined("ABSPATH") or die("");
|
||||
|
||||
/**
|
||||
* Variables
|
||||
*
|
||||
* @var Duplicator\Core\Controllers\ControllersManager $ctrlMng
|
||||
* @var Duplicator\Core\Views\TplMng $tplMng
|
||||
* @var array<string, mixed> $tplData
|
||||
* @var bool $blur
|
||||
*/
|
||||
|
||||
$blur = $tplData['blur'];
|
||||
/** @var DUP_PRO_Package */
|
||||
$package = $tplData['package'];
|
||||
$storage_list = AbstractStorageEntity::getAll(0, 0, [StoragesUtil::class, 'sortByPriority']);
|
||||
|
||||
$newStorageEditUrl = StoragePageController::getEditUrl();
|
||||
|
||||
$transfer_occurring = (($package->Status >= DUP_PRO_PackageStatus::STORAGE_PROCESSING) && ($package->Status < DUP_PRO_PackageStatus::COMPLETE));
|
||||
|
||||
$view_state = DUP_PRO_UI_ViewState::getArray();
|
||||
$ui_css_transfer_log = (isset($view_state['dup-transfer-transfer-log']) && $view_state['dup-transfer-transfer-log']) ? 'display:block' : 'display:none';
|
||||
|
||||
$installer_name = $package->Installer->getInstallerName();
|
||||
$archive_name = (isset($package->Archive->File)) ? $package->Archive->File : __('Unable to locate file', 'duplicator-pro');
|
||||
|
||||
$tplMng->render('admin_pages/packages/details/details_header');
|
||||
?>
|
||||
<div class="transfer-panel <?php echo ($blur ? 'dup-mock-blur' : ''); ?>">
|
||||
<div class="transfer-hdr">
|
||||
<h2 class="title">
|
||||
<i class="fas fa-exchange-alt"></i> <?php esc_html_e('Manual Transfer', 'duplicator-pro'); ?>
|
||||
<button id="dup-trans-ovr" type="button" class="dup-btn-borderless"
|
||||
title="<?php esc_html_e('Show file details', 'duplicator-pro'); ?>"
|
||||
onclick="DupPro.Pack.Transfer.toggleOverview()">
|
||||
<i class="fas fa-chevron-left fa-fw fa-sm"></i> Details
|
||||
</button>
|
||||
</h2>
|
||||
<hr/>
|
||||
</div>
|
||||
|
||||
<!-- ===================
|
||||
OVERVIEW -->
|
||||
<div id="step1-ovr">
|
||||
<h3><?php esc_html_e('File Overview', 'duplicator-pro'); ?></h3>
|
||||
<small>
|
||||
<?php esc_html_e('These files will be transferred to the selected storage locations. Links are sensitive. Keep them safe!', 'duplicator-pro'); ?>
|
||||
</small>
|
||||
<label>
|
||||
<i class="far fa-file-archive fa-fw"></i>
|
||||
<b><?php esc_html_e('Archive File', 'duplicator-pro'); ?></b>
|
||||
<?php echo ' (' . esc_html(DUP_PRO_U::byteSize($package->Archive->Size)) . ')'; ?><br/>
|
||||
<input type="text" value="<?php echo esc_attr($archive_name) ?>" readonly="readonly" />
|
||||
<span onclick="jQuery(this).parent().find('input').select();">
|
||||
<span class="copy-button" data-dup-copy-value="<?php echo esc_attr($archive_name); ?>">
|
||||
<i class='far fa-copy dup-cursor-pointer'></i> <?php esc_html_e('Copy Name', 'duplicator-pro'); ?>
|
||||
</span>
|
||||
</span>
|
||||
</label>
|
||||
|
||||
<label>
|
||||
<i class="fa fa-bolt fa-fw"></i>
|
||||
<b><?php esc_html_e('Archive Installer', 'duplicator-pro'); ?></b>
|
||||
<?php echo ' (' . esc_html(DUP_PRO_U::byteSize($package->Installer->Size)) . ')'; ?><br/>
|
||||
<input type="text" value="<?php echo esc_attr($installer_name) ?>" readonly="readonly" />
|
||||
<span onclick="jQuery(this).parent().find('input').select();">
|
||||
<span class="copy-button" data-dup-copy-value="<?php echo esc_attr($installer_name); ?>">
|
||||
<i class='far fa-copy dup-cursor-pointer'></i> <?php esc_html_e('Copy Name', 'duplicator-pro'); ?>
|
||||
</span>
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<!-- ===================
|
||||
STEP 1 -->
|
||||
<div id="step2-section">
|
||||
<div style="margin:0px 0 0px 0">
|
||||
<h3><?php esc_html_e('Step 1: Choose Location', 'duplicator-pro') ?></h3>
|
||||
<input style="display:none" type="radio" name="location" id="location-storage" checked="checked" onclick="DupPro.Pack.Transfer.ToggleLocation()" />
|
||||
<label style="display:none" for="location-storage"><?php esc_html_e('Storage', 'duplicator-pro'); ?></label>
|
||||
<input style="display:none" type="radio" name="location" id="location-quick" onclick="DupPro.Pack.Transfer.ToggleLocation()" />
|
||||
<label style="display:none" for="location-quick"><?php esc_html_e('Quick FTP Connect', 'duplicator-pro'); ?></label>
|
||||
</div>
|
||||
|
||||
<!-- STEP 1: STORAGE -->
|
||||
<table id="location-storage-opts" class="widefat">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style='white-space: nowrap; width:10px;'></th>
|
||||
<th style='width:175px'><?php esc_html_e('Type', 'duplicator-pro') ?></th>
|
||||
<th style='width:275px'><?php esc_html_e('Name', 'duplicator-pro') ?></th>
|
||||
<th style="white-space: nowrap"><?php esc_html_e('Location', 'duplicator-pro') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$i = 0;
|
||||
$localStorageIds = array_map(function ($storage) {
|
||||
return $storage->getId();
|
||||
}, $package->getLocalStorages());
|
||||
foreach ($storage_list as $storage) :
|
||||
if ($storage->isDefault() || in_array($storage->getId(), $localStorageIds)) {
|
||||
// Skip for default storage
|
||||
continue;
|
||||
}
|
||||
|
||||
$i++;
|
||||
|
||||
$is_valid = $storage->isValid();
|
||||
$mincheck = ($i == 1) ? 'data-parsley-mincheck="1" data-parsley-required="true"' : '';
|
||||
$row_style = ($i % 2) ? 'alternate' : '';
|
||||
$row_style .= ($is_valid) ? '' : ' storage-missing';
|
||||
$row_chkid = "dup-chkbox-{$storage->getId()}";
|
||||
$storageEditUrl = StoragePageController::getEditUrl($storage);
|
||||
|
||||
?>
|
||||
<tr class="package-row <?php echo esc_attr($row_style) ?>">
|
||||
<td>
|
||||
<input name="edit_id" type="hidden" value="<?php echo (int) $i ?>" />
|
||||
<input class="duppro-storage-input"
|
||||
<?php disabled($is_valid == false); ?>
|
||||
id="<?php echo esc_attr($row_chkid); ?>"
|
||||
name="_storage_ids[]"
|
||||
data-parsley-errors-container="#storage_error_container" <?php echo esc_attr($mincheck); ?>
|
||||
type="checkbox"
|
||||
value="<?php echo (int) $storage->getId(); ?>"
|
||||
<?php disabled($is_valid, false); ?>
|
||||
>
|
||||
</td>
|
||||
<td>
|
||||
<label for="<?php echo esc_attr($row_chkid); ?>" class="dup-store-lbl">
|
||||
<?php
|
||||
echo wp_kses(
|
||||
$storage::getStypeIcon(),
|
||||
[
|
||||
'i' => [
|
||||
'class' => [],
|
||||
],
|
||||
'img' => [
|
||||
'src' => [],
|
||||
'class' => [],
|
||||
'alt' => [],
|
||||
],
|
||||
]
|
||||
),
|
||||
' ',
|
||||
esc_html($storage->getStypeName());
|
||||
?>
|
||||
</label>
|
||||
</td>
|
||||
<td>
|
||||
<a href="<?php echo esc_url($storageEditUrl); ?>" target="_blank">
|
||||
<?php
|
||||
echo ($is_valid == false) ? '<i class="fa fa-exclamation-triangle fa-sm"></i>' : '';
|
||||
echo " " . esc_html($storage->getName());
|
||||
?>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
echo wp_kses(
|
||||
$storage->getHtmlLocationLink(),
|
||||
[
|
||||
'a' => [
|
||||
'href' => [],
|
||||
'target' => [],
|
||||
],
|
||||
]
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
endforeach; ?>
|
||||
|
||||
<?php if ($i == 0) : ?>
|
||||
<tr class="package-row">
|
||||
<td colspan="4" style="text-align: center">- <?php esc_html_e('No Storage Items Found', 'duplicator-pro') ?> -</td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
</tbody>
|
||||
<tr class="dup-choose-loc-new-pack">
|
||||
<td colspan="4">
|
||||
<?php if (CapMng::can(CapMng::CAP_STORAGE, false)) { ?>
|
||||
<a href="<?php echo esc_url($newStorageEditUrl); ?>" target="_blank">
|
||||
[<?php esc_html_e('Create New Storage', 'duplicator-pro') ?>]
|
||||
</a>
|
||||
<?php } else { ?>
|
||||
|
||||
<?php } ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- ===================
|
||||
STEP 2 -->
|
||||
<div id="step3-section">
|
||||
<h3>
|
||||
<?php esc_html_e('Step 2: Transfer Files', 'duplicator-pro') ?>
|
||||
<button style="<?php echo ($transfer_occurring ? 'none' : 'default'); ?>"
|
||||
id="dup-pro-transfer-btn" type="button"
|
||||
class="button button-large button-primary"
|
||||
onclick="DupPro.Pack.Transfer.StartTransfer();">
|
||||
<?php esc_attr_e('Start Transfer', 'duplicator-pro') ?> <i class="fas fa-upload"></i>
|
||||
|
||||
</button>
|
||||
</h3>
|
||||
|
||||
<div style="width:700px; text-align: center; margin-left: auto; margin-right: auto" class="dpro-active-status-area">
|
||||
<div style="display:none; font-size:20px; font-weight:bold" id="dpro-progress-bar-percent"></div>
|
||||
<div style="font-size:14px" id="dpro-progress-bar-text"><?php esc_html_e('Processing', 'duplicator-pro') ?></div>
|
||||
<div id="dpro-progress-bar-percent-help">
|
||||
<small><?php esc_html_e('Full package percentage shown on packages screen', 'duplicator-pro'); ?></small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="dpro-progress-bar-container">
|
||||
<div id="dpro-progress-bar-area" class="dpro-active-status-area">
|
||||
<div class="dup-pro-meter-wrapper">
|
||||
<div class="dup-pro-meter blue dup-pro-fullsize">
|
||||
<span></span>
|
||||
</div>
|
||||
<span class="text"></span>
|
||||
</div>
|
||||
<button disabled id="dup-pro-stop-transfer-btn" type="button" class="button button-large button-primarybutton dpro-btn-stop" value=""
|
||||
onclick="DupPro.Pack.Transfer.StopBuild();">
|
||||
<i class="fa fa-times fa-sm"></i> <?php esc_html_e('Stop Transfer', 'duplicator-pro'); ?>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- ===============================
|
||||
TRANSFER LOG -->
|
||||
<div class="dup-box">
|
||||
<div class="dup-box-title">
|
||||
<i class="fas fa-file-contract fa-fw fa-sm"></i>
|
||||
<?php esc_html_e('Transfer Log', 'duplicator-pro') ?>
|
||||
<button class="dup-box-arrow">
|
||||
<span class="screen-reader-text">
|
||||
<?php esc_html_e('Toggle panel:', 'duplicator-pro') ?> <?php esc_html_e('Transfer Log', 'duplicator-pro') ?>
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="dup-box-panel" id="dup-transfer-transfer-log" style="<?php echo esc_attr($ui_css_transfer_log) ?>">
|
||||
<table class="widefat package-tbl">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style='width:150px'><?php esc_html_e('Started', 'duplicator-pro') ?></th>
|
||||
<th style='width:150px'><?php esc_html_e('Stopped', 'duplicator-pro') ?></th>
|
||||
<th style="white-space: nowrap"><?php esc_html_e('Status', 'duplicator-pro') ?></th>
|
||||
<th style="white-space: nowrap"><?php esc_html_e('Type', 'duplicator-pro') ?></th>
|
||||
<th style="width: 60%; white-space: nowrap"><?php esc_html_e('Description', 'duplicator-pro') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="5" id="dup-pack-details-trans-log-count"></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<?php
|
||||
$alert1 = new DUP_PRO_UI_Dialog();
|
||||
$alert1->title = __('Storage Warning!', 'duplicator-pro');
|
||||
$alert1->message = __('At least one storage location must be checked.', 'duplicator-pro');
|
||||
$alert1->initAlert();
|
||||
|
||||
$alert2 = new DUP_PRO_UI_Dialog();
|
||||
$alert2->title = __('Transfer Failure!', 'duplicator-pro');
|
||||
$alert2->message = __('Transfer failure when calling duplicator_pro_manual_transfer_storage.', 'duplicator-pro');
|
||||
$alert2->initAlert();
|
||||
|
||||
$alert3 = new DUP_PRO_UI_Dialog();
|
||||
$alert3->title = __('Build Error', 'duplicator-pro');
|
||||
$alert3->message = __('Failed to stop build', 'duplicator-pro');
|
||||
$alert3->initAlert();
|
||||
|
||||
$alert4 = new DUP_PRO_UI_Dialog();
|
||||
$alert4->title = $alert3->title;
|
||||
$alert4->message = __('Failed to stop build due to ajax error.', 'duplicator-pro');
|
||||
$alert4->initAlert();
|
||||
|
||||
$alert5 = new DUP_PRO_UI_Dialog();
|
||||
$alert5->title = 'INFO!';
|
||||
$alert5->message = ''; // javascript inserted message
|
||||
$alert5->initAlert();
|
||||
|
||||
$alert6 = new DUP_PRO_UI_Dialog();
|
||||
$alert6->title = 'INFO!';
|
||||
$alert6->message = ''; // javascript inserted message
|
||||
$alert6->initAlert();
|
||||
?>
|
||||
<script>
|
||||
DupPro.Pack.Transfer = {};
|
||||
jQuery(document).ready(function ($) {
|
||||
|
||||
var transferRequestedTimestamp = 0;
|
||||
var activePackageId = -1;
|
||||
|
||||
DupPro.Pack.Transfer.toggleOverview = function () {
|
||||
$('div#step1-ovr').toggle();
|
||||
var $i = $('#dup-trans-ovr i');
|
||||
|
||||
if ($($i).hasClass('fa-chevron-left')) {
|
||||
$($i).removeClass('fa-chevron-left').addClass('fa-chevron-down');
|
||||
} else {
|
||||
$($i).removeClass('fa-chevron-down').addClass('fa-chevron-left');
|
||||
}
|
||||
}
|
||||
|
||||
DupPro.Pack.Transfer.GetTimeStamp = function () {
|
||||
return Math.floor(Date.now() / 1000);
|
||||
}
|
||||
|
||||
/* METHOD: Starts the data transfer */
|
||||
DupPro.Pack.Transfer.StartTransfer = function () {
|
||||
|
||||
if (jQuery('#location-storage-opts input[type=checkbox]:checked').length == 0) {
|
||||
<?php $alert1->showAlert(); ?>
|
||||
} else {
|
||||
$(".dpro-active-status-area").show(500);
|
||||
var selected_storage_ids = $.map($(':checkbox[name=_storage_ids\\[\\]]:checked'), function (n, i) {
|
||||
return n.value;
|
||||
});
|
||||
var data = {
|
||||
action: 'duplicator_pro_manual_transfer_storage',
|
||||
package_id: <?php echo (int) $package->ID; ?>,
|
||||
storage_ids: selected_storage_ids,
|
||||
nonce: '<?php echo esc_js(wp_create_nonce('duplicator_pro_manual_transfer_storage')); ?>'
|
||||
}
|
||||
|
||||
console.log("sending to selected storages " + selected_storage_ids);
|
||||
|
||||
transferRequestedTimestamp = DupPro.Pack.Transfer.GetTimeStamp();
|
||||
|
||||
$("#dpro-progress-bar-text").text("<?php echo esc_html__('Initiating transfer. Please wait.', 'duplicator-pro') ?>");
|
||||
$("#dpro-progress-bar-percent").text('');
|
||||
DupPro.Pack.Transfer.SetUIState(true);
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: ajaxurl,
|
||||
cache: false,
|
||||
timeout: 10000000,
|
||||
data: data,
|
||||
success: function (respData) {
|
||||
try {
|
||||
var parsedData = DupPro.parseJSON(respData);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
console.error('JSON parse failed for response data: ' + respData);
|
||||
<?php $alert2->showAlert(); ?>
|
||||
transferRequestedTimestamp = 0;
|
||||
DupPro.Pack.Transfer.SetUIState(false);
|
||||
console.log(respData);
|
||||
return false;
|
||||
}
|
||||
if (!parsedData.success)
|
||||
{
|
||||
if (parsedData.message != '') {
|
||||
<?php $alert5->showAlert(); ?>
|
||||
$("#<?php echo esc_js($alert5->getID()); ?>_message").html(parsedData.message);
|
||||
}
|
||||
transferRequestedTimestamp = 0;
|
||||
DupPro.Pack.Transfer.SetUIState(false);
|
||||
DupPro.Pack.Transfer.GetPackageState();
|
||||
}
|
||||
},
|
||||
error: function (respData) {
|
||||
<?php $alert2->showAlert(); ?>
|
||||
transferRequestedTimestamp = 0;
|
||||
DupPro.Pack.Transfer.SetUIState(false);
|
||||
console.log(respData);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/* METHOD: Starts the data transfer */
|
||||
DupPro.Pack.Transfer.StopBuild = function () {
|
||||
|
||||
var data = {
|
||||
action: 'duplicator_pro_package_stop_build',
|
||||
package_id: activePackageId,
|
||||
nonce: '<?php echo esc_js(wp_create_nonce('duplicator_pro_package_stop_build')); ?>'
|
||||
}
|
||||
$("#dup-pro-stop-transfer-btn").prop("disabled", true);
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: ajaxurl,
|
||||
timeout: 10000000,
|
||||
data: data,
|
||||
success: function (respData) {
|
||||
try {
|
||||
var parsedData = DupPro.parseJSON(respData);
|
||||
} catch(err) {
|
||||
console.error(err);
|
||||
console.error('JSON parse failed for response data: ' + respData);
|
||||
<?php $alert4->showAlert(); ?>
|
||||
$("#dup-pro-stop-transfer-btn").prop("disabled", false);
|
||||
return false;
|
||||
}
|
||||
if (!parsedData.success) {
|
||||
<?php $alert3->showAlert(); ?>
|
||||
$("#dup-pro-stop-transfer-btn").prop("disabled", false);
|
||||
}
|
||||
console.log(parsedData.message);
|
||||
},
|
||||
error: function (respData) {
|
||||
<?php $alert4->showAlert(); ?>
|
||||
$("#dup-pro-stop-transfer-btn").prop("disabled", false);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/* METHOD: Progress bar display state*/
|
||||
DupPro.Pack.Transfer.SetUIState = function (activeProcessing) {
|
||||
if (activeProcessing)
|
||||
{
|
||||
$(".dpro-active-status-area").show(500);
|
||||
$("#dup-pro-transfer-btn").hide();
|
||||
$("#location-storage input").prop("disabled", true);
|
||||
$("#location-storage-opts input").prop("disabled", true);
|
||||
} else {
|
||||
$("#dup-pro-stop-transfer-btn").prop("disabled", true);
|
||||
// Only allow to revert after enough time has past since the last transfer request
|
||||
currentTimestamp = DupPro.Pack.Transfer.GetTimeStamp();
|
||||
if ((currentTimestamp - transferRequestedTimestamp) > 10)
|
||||
{
|
||||
$("#location-storage input").prop("disabled", false);
|
||||
$("#location-storage-opts input").prop("disabled", false);
|
||||
$("#dup-pro-transfer-btn").show();
|
||||
$(".dpro-active-status-area").hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* METHOD: Retreive package state */
|
||||
DupPro.Pack.Transfer.GetPackageState = function () {
|
||||
|
||||
var package_id = <?php echo (int) $package->ID; ?>;
|
||||
var data = {
|
||||
action: 'duplicator_pro_packages_details_transfer_get_package_vm',
|
||||
package_id: package_id,
|
||||
nonce: '<?php echo esc_js(wp_create_nonce('duplicator_pro_packages_details_transfer_get_package_vm')); ?>'
|
||||
};
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: ajaxurl,
|
||||
timeout: 10000000,
|
||||
data: data,
|
||||
success: function (respData) {
|
||||
try {
|
||||
var parsedData = DupPro.parseJSON(respData);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
console.error('JSON parse failed for response data: ' + respData);
|
||||
console.log("Transfer failure.");
|
||||
DupPro.Pack.Transfer.SetUIState(false);
|
||||
console.log(respData);
|
||||
return false;
|
||||
}
|
||||
|
||||
console.log(parsedData);
|
||||
if (parsedData.success)
|
||||
{
|
||||
var vm = parsedData.vm;
|
||||
|
||||
// vm - view model for this screen
|
||||
// vm.active_package_id: Active package id (-1 for none)
|
||||
// vm.percent_text: Percent through the current transfer
|
||||
// vm.text: Text to display
|
||||
// vm.transfer_logs: array of transfer request vms (start, stop, status, message)
|
||||
|
||||
if (activePackageId != vm.active_package_id)
|
||||
{
|
||||
// Once we have an active package ID allow the stop button to be clicked
|
||||
$("#dup-pro-stop-transfer-btn").prop("disabled", false);
|
||||
}
|
||||
|
||||
activePackageId = vm.active_package_id;
|
||||
if (vm.active_package_id == -1)
|
||||
{
|
||||
// No packages are running
|
||||
DupPro.Pack.Transfer.SetUIState(false);
|
||||
|
||||
} else if (vm.active_package_id == package_id) {
|
||||
|
||||
// This package is running
|
||||
if (vm.percent_text != '')
|
||||
{
|
||||
$("#dpro-progress-bar-percent").text(vm.percent_text);
|
||||
} else
|
||||
{
|
||||
$("#dpro-progress-bar-percent").text('');
|
||||
}
|
||||
|
||||
$("#dpro-progress-bar-text").html(vm.text);
|
||||
DupPro.Pack.Transfer.SetUIState(true);
|
||||
} else {
|
||||
|
||||
// A package other than this one is running
|
||||
$("#dpro-progress-bar-text").html(vm.text);
|
||||
DupPro.Pack.Transfer.SetUIState(true);
|
||||
}
|
||||
DupPro.Pack.Transfer.UpdateTransferLog(vm);
|
||||
} else {
|
||||
if (parsedData.message != '') {
|
||||
<?php $alert6->showAlert(); ?>
|
||||
$("#<?php echo esc_js($alert6->getID()); ?>_message").html(parsedData.message);
|
||||
}
|
||||
DupPro.Pack.Transfer.SetUIState(false);
|
||||
console.log(data);
|
||||
}
|
||||
},
|
||||
error: function (data) {
|
||||
console.log("Transfer failure.");
|
||||
DupPro.Pack.Transfer.SetUIState(false);
|
||||
console.log(data);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/* METHOD: Updates the transfer log with the information from the view model */
|
||||
DupPro.Pack.Transfer.UpdateTransferLog = function (vm) {
|
||||
$("#dup-transfer-transfer-log table tbody").empty();
|
||||
var row_style, row_html;
|
||||
for (var i = 0; i < vm.transfer_logs.length; i++) {
|
||||
|
||||
var transfer_log = vm.transfer_logs[i];
|
||||
console.log(transfer_log);
|
||||
|
||||
row_style = (i % 2) ? ' alternate' : '';
|
||||
switch(transfer_log.status_text) {
|
||||
case 'Pending': row_style += ' status-pending'; break;
|
||||
case 'Running': row_style += ' status-running'; break;
|
||||
case 'Failed': row_style += ' status-failed'; break;
|
||||
default: row_style += ' status-normal'; break;
|
||||
}
|
||||
|
||||
row_html =
|
||||
`<tr class="package-row ${row_style}">
|
||||
<td>${transfer_log.started}</td>
|
||||
<td>${transfer_log.stopped}</td>
|
||||
<td>${transfer_log.status_text}</td>
|
||||
<td>${transfer_log.storage_type_text}</td>
|
||||
<td>${transfer_log.message}</td>
|
||||
</tr>`;
|
||||
|
||||
$("#dup-transfer-transfer-log table tbody").append(row_html);
|
||||
$('#dup-pack-details-trans-log-count').html('<?php esc_html_e('Log Items:', 'duplicator-pro') ?> ' + (i + 1) );
|
||||
}
|
||||
|
||||
if (i == 0)
|
||||
{
|
||||
var row_html = '<tr><td colspan="5" style="text-align:center">' +
|
||||
'<?php esc_html_e('- No transactions found for this package -', 'duplicator-pro'); ?></td></tr>';
|
||||
$("#dup-transfer-transfer-log table tbody").append(row_html);
|
||||
}
|
||||
};
|
||||
|
||||
//INIT
|
||||
DupPro.Pack.Transfer.GetPackageState();
|
||||
setInterval(DupPro.Pack.Transfer.GetPackageState, 8000);
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Duplicator package row in table packages list
|
||||
*
|
||||
* @package Duplicator
|
||||
* @copyright (c) 2022, Snap Creek LLC
|
||||
*/
|
||||
|
||||
defined("ABSPATH") or die("");
|
||||
|
||||
/**
|
||||
* Variables
|
||||
*
|
||||
* @var \Duplicator\Core\Controllers\ControllersManager $ctrlMng
|
||||
* @var \Duplicator\Core\Views\TplMng $tplMng
|
||||
* @var array<string, mixed> $tplData
|
||||
*/
|
||||
|
||||
?>
|
||||
<tr class="dpro-nopackages">
|
||||
<td colspan="11" class="dup-list-nopackages">
|
||||
<br />
|
||||
<i class="fa fa-archive fa-sm"></i>
|
||||
<?php esc_html_e("No Packages Found", 'duplicator-pro'); ?><br />
|
||||
<i><?php esc_html_e("Click 'Create New' to Archive Site", 'duplicator-pro'); ?></i>
|
||||
<div class="dup-quick-start">
|
||||
<b><?php esc_html_e("New to Duplicator?", 'duplicator-pro'); ?></b><br />
|
||||
<span class="dup-open-details link-style" onclick="DupPro.Pack.openLinkDetails()">
|
||||
<?php esc_html_e("Learn Duplicator in a few minutes!", 'duplicator-pro'); ?>
|
||||
</span><br/>
|
||||
<a
|
||||
class="dup-quick-start-link"
|
||||
href="<?php echo esc_url(DUPLICATOR_PRO_BLOG_URL . 'knowledge-base-article-categories/quick-start/'); ?>"
|
||||
target="_blank">
|
||||
<?php esc_html_e("Visit the 'Quick Start' guide!", 'duplicator-pro'); ?>
|
||||
</a>
|
||||
</div>
|
||||
<div style="height:75px"> </div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Duplicator
|
||||
*/
|
||||
|
||||
defined("ABSPATH") or die("");
|
||||
|
||||
/**
|
||||
* Variables
|
||||
*
|
||||
* @var Duplicator\Core\Controllers\ControllersManager $ctrlMng
|
||||
* @var Duplicator\Core\Views\TplMng $tplMng
|
||||
* @var array<string, mixed> $tplData
|
||||
* @var ?DUP_PRO_Package $package
|
||||
*/
|
||||
$package = $tplData['package'];
|
||||
|
||||
global $packagesViewData;
|
||||
|
||||
// If its in the pending cancels consider it stopped
|
||||
if (in_array($package->ID, $packagesViewData['pending_cancelled_package_ids'])) {
|
||||
$status = DUP_PRO_PackageStatus::PENDING_CANCEL;
|
||||
} else {
|
||||
$status = $package->Status;
|
||||
}
|
||||
|
||||
if ($package->Status >= DUP_PRO_PackageStatus::COMPLETE) {
|
||||
$tplMng->render('admin_pages/packages/package_row_complete', ['status' => $status]);
|
||||
} else {
|
||||
$tplMng->render('admin_pages/packages/package_row_incomplete', ['status' => $status]);
|
||||
}
|
||||
$tplMng->render('admin_pages/packages/package_row_building', ['status' => $status]);
|
||||
|
||||
$packagesViewData['rowCount']++;
|
||||
@@ -0,0 +1,83 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Duplicator
|
||||
*/
|
||||
|
||||
use Duplicator\Core\CapMng;
|
||||
|
||||
defined("ABSPATH") or die("");
|
||||
|
||||
/**
|
||||
* Variables
|
||||
*
|
||||
* @var Duplicator\Core\Controllers\ControllersManager $ctrlMng
|
||||
* @var Duplicator\Core\Views\TplMng $tplMng
|
||||
* @var array<string, mixed> $tplData
|
||||
* @var ?DUP_PRO_Package $package
|
||||
*/
|
||||
$package = $tplData['package'];
|
||||
|
||||
/** @var int */
|
||||
$status = $tplData['status'];
|
||||
|
||||
if ($status <= DUP_PRO_PackageStatus::PRE_PROCESS || $status >= DUP_PRO_PackageStatus::COMPLETE) {
|
||||
return;
|
||||
}
|
||||
?>
|
||||
<tr class="dup-row-progress">
|
||||
<td colspan="11">
|
||||
<div class="wp-filter dup-build-msg">
|
||||
<?php if ($status < DUP_PRO_PackageStatus::STORAGE_PROCESSING) : ?>
|
||||
<!-- BUILDING PROGRESS-->
|
||||
<div id='dpro-progress-status-message-build'>
|
||||
<div class='status-hdr'>
|
||||
<?php esc_html_e('Building Package', 'duplicator-pro'); ?>
|
||||
<i class="fa fa-cog fa-sm fa-spin"></i>
|
||||
<span id="status-<?php echo (int) $package->ID; ?>"><?php echo (int) $status; ?></span>%
|
||||
</div>
|
||||
<small>
|
||||
<?php esc_html_e('Please allow it to finish before creating another one.', 'duplicator-pro'); ?>
|
||||
</small>
|
||||
</div>
|
||||
<?php else : ?>
|
||||
<!-- TRANSFER PROGRESS -->
|
||||
<div id='dpro-progress-status-message-transfer'>
|
||||
<div class='status-hdr'>
|
||||
<?php esc_html_e('Transferring Package', 'duplicator-pro'); ?>
|
||||
<i class="fa fa-sync fa-sm fa-spin"></i>
|
||||
<span id="status-progress-<?php echo (int) $package->ID; ?>">0</span>%
|
||||
<span id="status-<?php echo (int) $package->ID; ?>" class="no-display" >
|
||||
<?php echo (int) $status; ?>
|
||||
</span>
|
||||
</div>
|
||||
<small id="dpro-progress-status-message-transfer-msg">
|
||||
<?php esc_html_e('Getting Transfer State...', 'duplicator-pro'); ?>
|
||||
</small>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div id="dup-progress-bar-area">
|
||||
<div class="dup-pro-meter-wrapper">
|
||||
<div class="dup-pro-meter blue dup-pro-fullsize">
|
||||
<span></span>
|
||||
</div>
|
||||
<span class="text"></span>
|
||||
</div>
|
||||
</div>
|
||||
<?php if (CapMng::can(CapMng::CAP_CREATE, false)) { ?>
|
||||
<button onclick="DupPro.Pack.StopBuild(<?php echo (int) $package->ID; ?>); return false;" class="button button-large dup-build-stop-btn">
|
||||
<i class="fa fa-times fa-sm"></i>
|
||||
<?php
|
||||
if ($status >= 75) {
|
||||
esc_html_e('Stop Transfer', 'duplicator-pro');
|
||||
} elseif ($status > 0) {
|
||||
esc_html_e('Stop Build', 'duplicator-pro');
|
||||
} else {
|
||||
esc_html_e('Cancel Pending', 'duplicator-pro');
|
||||
}
|
||||
?>
|
||||
</button>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -0,0 +1,135 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Duplicator
|
||||
*/
|
||||
|
||||
use Duplicator\Controllers\PackagesPageController;
|
||||
use Duplicator\Package\Recovery\RecoveryPackage;
|
||||
use Duplicator\Views\UserUIOptions;
|
||||
|
||||
defined("ABSPATH") or die("");
|
||||
|
||||
/**
|
||||
* Variables
|
||||
*
|
||||
* @var Duplicator\Core\Controllers\ControllersManager $ctrlMng
|
||||
* @var Duplicator\Core\Views\TplMng $tplMng
|
||||
* @var array<string, mixed> $tplData
|
||||
* @var ?DUP_PRO_Package $package
|
||||
*/
|
||||
$package = $tplData['package'];
|
||||
|
||||
/** @var int */
|
||||
$status = $tplData['status'];
|
||||
|
||||
if ($status < DUP_PRO_PackageStatus::COMPLETE) {
|
||||
return;
|
||||
}
|
||||
|
||||
$global = DUP_PRO_Global_Entity::getInstance();
|
||||
global $packagesViewData;
|
||||
|
||||
|
||||
$isRecoveable = RecoveryPackage::isPackageIdRecoveable($package->ID);
|
||||
$isRecoverPoint = (RecoveryPackage::getRecoverPackageId() === $package->ID);
|
||||
$pack_name = $package->Name;
|
||||
$pack_archive_size = $package->Archive->Size;
|
||||
$pack_dbonly = $package->isDBOnly();
|
||||
$brand = $package->Brand;
|
||||
|
||||
//Links
|
||||
$uniqueid = $package->NameHash;
|
||||
$archive_exists = ($package->getLocalPackageFilePath(DUP_PRO_Package_File_Type::Archive) != false);
|
||||
$installer_exists = ($package->getLocalPackageFilePath(DUP_PRO_Package_File_Type::Installer) != false);
|
||||
$progress_error = '';
|
||||
|
||||
//ROW CSS
|
||||
$rowClasses = array('');
|
||||
$rowClasses[] = 'dup-row';
|
||||
$rowClasses[] = 'dup-row-complete';
|
||||
$rowClasses[] = ($packagesViewData['rowCount'] % 2 == 0) ? 'dup-row-alt-dark' : 'dup-row-alt-light';
|
||||
$rowClasses[] = ($isRecoverPoint) ? 'dup-recovery-package' : '';
|
||||
$rowCSS = trim(implode(' ', $rowClasses));
|
||||
|
||||
|
||||
//ArchiveInfo
|
||||
$archive_name = $package->Archive->File;
|
||||
$archiveDownloadURL = $package->getLocalPackageFileURL(DUP_PRO_Package_File_Type::Archive);
|
||||
$installerDownloadURL = $package->getLocalPackageFileURL(DUP_PRO_Package_File_Type::Installer);
|
||||
$installerFullName = $package->Installer->getInstallerName();
|
||||
|
||||
//Lang Values
|
||||
$txt_DatabaseOnly = __('Database Only', 'duplicator-pro');
|
||||
|
||||
switch ($package->Type) {
|
||||
case DUP_PRO_PackageType::MANUAL:
|
||||
$package_type_string = __('Manual', 'duplicator-pro');
|
||||
break;
|
||||
case DUP_PRO_PackageType::SCHEDULED:
|
||||
$package_type_string = __('Schedule', 'duplicator-pro');
|
||||
break;
|
||||
case DUP_PRO_PackageType::RUN_NOW:
|
||||
$lang_schedule = __('Schedule', 'duplicator-pro');
|
||||
$lang_title = __('This package was started manually from the schedules page.', 'duplicator-pro');
|
||||
$package_type_string = "{$lang_schedule}<span><sup> <i class='fas fa-cog fa-sm pointer' title='{$lang_title}'></i> </sup><span>";
|
||||
break;
|
||||
default:
|
||||
$package_type_string = __('Unknown', 'duplicator-pro');
|
||||
break;
|
||||
}
|
||||
|
||||
$packageDetailsURL = PackagesPageController::getInstance()->getPackageDetailsURL($package->ID);
|
||||
$createdFormat = UserUIOptions::getInstance()->get(UserUIOptions::VAL_CREATED_DATE_FORMAT);
|
||||
|
||||
?>
|
||||
<tr
|
||||
id="dup-row-pack-id-<?php echo (int) $package->ID; ?>"
|
||||
data-package-id="<?php echo (int) $package->ID; ?>"
|
||||
class="<?php echo esc_attr($rowCSS); ?>" >
|
||||
<td class="dup-check-column dup-cell-chk">
|
||||
<label for="<?php echo (int) $package->ID; ?>">
|
||||
<input
|
||||
name="delete_confirm"
|
||||
type="checkbox"
|
||||
id="<?php echo (int) $package->ID; ?>"
|
||||
data-archive-name="<?php echo esc_attr($archive_name); ?>"
|
||||
data-installer-name="<?php echo esc_attr($installerFullName); ?>" />
|
||||
</label>
|
||||
</td>
|
||||
<td class="dup-name-column dup-cell-name">
|
||||
<?php echo esc_html($pack_name); ?>
|
||||
</td>
|
||||
<td class="dup-note-column">
|
||||
<?php echo esc_html($package->notes); ?>
|
||||
</td>
|
||||
<td class="dup-storages-column">
|
||||
</td>
|
||||
<td class="dup-flags-column">
|
||||
<?php $tplMng->render('admin_pages/packages/row_parts/falgs_cell'); ?>
|
||||
</td>
|
||||
<td class="dup-created-column" >
|
||||
<?php echo esc_html(DUP_PRO_Package::format_and_get_local_date_time($package->getCreated(), $createdFormat)); ?>
|
||||
</td>
|
||||
<td class="dup-age-column">
|
||||
<?php echo esc_html($package->getPackageLife('human')); ?>
|
||||
</td>
|
||||
<td class="dup-size-column" >
|
||||
<?php echo esc_html(DUP_PRO_U::byteSize($pack_archive_size)); ?>
|
||||
</td>
|
||||
<td class="dup-cell-btns dup-download-column">
|
||||
<?php $tplMng->render('admin_pages/packages/row_parts/download_buttons'); ?>
|
||||
</td>
|
||||
<td class="dup-cell-btns dup-restore-column" >
|
||||
<?php $tplMng->render('admin_pages/packages/row_parts/restore_backup_button'); ?>
|
||||
</td>
|
||||
<td class="dup-cell-btns dup-cell-toggle-btn dup-toggle-details dup-details-column">
|
||||
<span class="button button-link">
|
||||
<i class="fas fa-chevron-left"></i>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="dup-row-pack-id-<?php echo (int) $package->ID; ?>-details" class="dup-row-details">
|
||||
<?php $tplMng->render('admin_pages/packages/row_parts/details_package'); ?>
|
||||
</tr>
|
||||
|
||||
@@ -0,0 +1,159 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Duplicator
|
||||
*/
|
||||
|
||||
use Duplicator\Controllers\PackagesPageController;
|
||||
use Duplicator\Package\Recovery\RecoveryPackage;
|
||||
use Duplicator\Views\UserUIOptions;
|
||||
|
||||
defined("ABSPATH") or die("");
|
||||
|
||||
/**
|
||||
* Variables
|
||||
*
|
||||
* @var Duplicator\Core\Controllers\ControllersManager $ctrlMng
|
||||
* @var Duplicator\Core\Views\TplMng $tplMng
|
||||
* @var array<string, mixed> $tplData
|
||||
* @var ?DUP_PRO_Package $package
|
||||
*/
|
||||
$package = $tplData['package'];
|
||||
$global = DUP_PRO_Global_Entity::getInstance();
|
||||
|
||||
/** @var int */
|
||||
$status = $tplData['status'];
|
||||
|
||||
if ($status >= DUP_PRO_PackageStatus::COMPLETE) {
|
||||
return;
|
||||
}
|
||||
|
||||
global $packagesViewData;
|
||||
|
||||
|
||||
$isRecoveable = RecoveryPackage::isPackageIdRecoveable($package->ID);
|
||||
$isRecoverPoint = (RecoveryPackage::getRecoverPackageId() === $package->ID);
|
||||
$pack_name = $package->Name;
|
||||
$pack_archive_size = $package->Archive->Size;
|
||||
$pack_namehash = $package->NameHash;
|
||||
$pack_dbonly = $package->isDBOnly();
|
||||
$brand = $package->Brand;
|
||||
|
||||
//Links
|
||||
$uniqueid = $package->NameHash;
|
||||
$archive_exists = ($package->getLocalPackageFilePath(DUP_PRO_Package_File_Type::Archive) != false);
|
||||
$installer_exists = ($package->getLocalPackageFilePath(DUP_PRO_Package_File_Type::Installer) != false);
|
||||
$progress_error = '';
|
||||
|
||||
//ROW CSS
|
||||
$rowClasses = array('');
|
||||
$rowClasses[] = 'dup-row';
|
||||
$rowClasses[] = 'dup-row-incomplete';
|
||||
$rowClasses[] = ($packagesViewData['rowCount'] % 2 == 0) ? 'dup-row-alt-dark' : 'dup-row-alt-light';
|
||||
$rowClasses[] = ($isRecoverPoint) ? 'dup-recovery-package' : '';
|
||||
$rowCSS = trim(implode(' ', $rowClasses));
|
||||
|
||||
|
||||
//ArchiveInfo
|
||||
$archive_name = $package->Archive->File;
|
||||
$archiveDownloadURL = $package->getLocalPackageFileURL(DUP_PRO_Package_File_Type::Archive);
|
||||
$installerDownloadURL = $package->getLocalPackageFileURL(DUP_PRO_Package_File_Type::Installer);
|
||||
$installerFullName = $package->Installer->getInstallerName();
|
||||
|
||||
$createdFormat = UserUIOptions::getInstance()->get(UserUIOptions::VAL_CREATED_DATE_FORMAT);
|
||||
|
||||
//Lang Values
|
||||
$txt_DatabaseOnly = __('Database Only', 'duplicator-pro');
|
||||
|
||||
$cellErrCSS = '';
|
||||
|
||||
if ($status < DUP_PRO_PackageStatus::COPIEDPACKAGE) {
|
||||
// In the process of building
|
||||
$size = 0;
|
||||
$tmpSearch = glob(DUPLICATOR_PRO_SSDIR_PATH_TMP . "/{$pack_namehash}_*");
|
||||
|
||||
if (is_array($tmpSearch)) {
|
||||
$result = @array_map('filesize', $tmpSearch);
|
||||
$size = array_sum($result);
|
||||
}
|
||||
$pack_archive_size = $size;
|
||||
}
|
||||
|
||||
$packageDetailsURL = PackagesPageController::getInstance()->getPackageDetailsURL($package->ID);
|
||||
|
||||
$progress_html = "<span style='display:none' id='status-{$package->ID}'>{$status}</span>";
|
||||
$stop_button_text = __('Stop', 'duplicator-pro');
|
||||
|
||||
if ($status >= 0) {
|
||||
if ($status >= 75) {
|
||||
$stop_button_text = __('Stop Transfer', 'duplicator-pro');
|
||||
$progress_html = "<i class='fa fa-sync fa-sm fa-spin'></i> <span id='status-progress-{$package->ID}'>0</span>%"
|
||||
. "<span style='display:none' id='status-{$package->ID}'>{$status}</span>";
|
||||
} elseif ($status > 0) {
|
||||
$stop_button_text = __('Stop Build', 'duplicator-pro');
|
||||
$progress_html = "<i class='fa fa-cog fa-sm fa-spin'></i> <span id='status-{$package->ID}'>{$status}</span>%";
|
||||
} else {
|
||||
// In a pending state
|
||||
$stop_button_text = __('Cancel Pending', 'duplicator-pro');
|
||||
$progress_html = "<span style='display:none' id='status-{$package->ID}'>{$status}</span>";
|
||||
}
|
||||
} else {
|
||||
//FAILURES AND CANCELLATIONS
|
||||
switch ($status) {
|
||||
case DUP_PRO_PackageStatus::ERROR:
|
||||
$cellErrCSS = 'dup-cell-err';
|
||||
break;
|
||||
case DUP_PRO_PackageStatus::BUILD_CANCELLED:
|
||||
case DUP_PRO_PackageStatus::STORAGE_CANCELLED:
|
||||
$cellErrCSS = 'dup-cell-cancelled';
|
||||
break;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<tr id="dup-row-pack-id-<?php echo (int) $package->ID; ?>" data-package-id="<?php echo (int) $package->ID; ?>" class="<?php echo esc_attr($rowCSS); ?>" >
|
||||
<td class="dup-check-column dup-cell-chk">
|
||||
<label for="<?php echo (int) $package->ID; ?>">
|
||||
<input name="delete_confirm"
|
||||
type="checkbox" id="<?php echo (int) $package->ID;?>"
|
||||
<?php echo ($status >= DUP_PRO_PackageStatus::PRE_PROCESS) ? 'disabled="disabled"' : ''; ?> />
|
||||
</label>
|
||||
</td>
|
||||
<td class="dup-name-column dup-cell-name">
|
||||
<?php echo esc_html($pack_name); ?>
|
||||
</td>
|
||||
<td class="dup-note-column">
|
||||
</td>
|
||||
<td class="dup-storages-column">
|
||||
</td>
|
||||
<td class="dup-flags-column">
|
||||
<?php $tplMng->render('admin_pages/packages/row_parts/falgs_cell'); ?>
|
||||
</td>
|
||||
<td class="dup-created-column" >
|
||||
<?php echo esc_html(DUP_PRO_Package::format_and_get_local_date_time($package->getCreated(), $createdFormat)); ?>
|
||||
</td>
|
||||
<td class="dup-age-column">
|
||||
<?php echo esc_html($package->getPackageLife('human')); ?>
|
||||
</td>
|
||||
<td class="dup-size-column" >
|
||||
<?php if ($status >= DUP_PRO_PackageStatus::PRE_PROCESS) {
|
||||
$package->get_display_size();
|
||||
} else {
|
||||
esc_html_e('N/A', 'duplicator-pro');
|
||||
}?>
|
||||
</td>
|
||||
<td class="dup-cell-incomplete <?php echo esc_attr($cellErrCSS); ?> no-select" colspan="3">
|
||||
<?php if ($status >= DUP_PRO_PackageStatus::PRE_PROCESS) { ?>
|
||||
<i><?php esc_html_e('Building Package Files...', 'duplicator-pro'); ?></i>
|
||||
<?php } else {
|
||||
$tplMng->render(
|
||||
'admin_pages/packages/row_parts/package_progress_error',
|
||||
[
|
||||
'package' => $package,
|
||||
'status' => $status,
|
||||
]
|
||||
);
|
||||
}?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -0,0 +1,702 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Duplicator package row in table packages list
|
||||
*
|
||||
* @package Duplicator
|
||||
* @copyright (c) 2022, Snap Creek LLC
|
||||
*/
|
||||
|
||||
/**
|
||||
* Variables
|
||||
*
|
||||
* @var \Duplicator\Core\Views\TplMng $tplMng
|
||||
* @var array<string, mixed> $tplData
|
||||
*/
|
||||
|
||||
defined("ABSPATH") or die("");
|
||||
$lang_wppathinfo = __('This site\'s root path is:', 'duplicator-pro') . '<br/><i>' . duplicator_pro_get_home_path() . '</i>';
|
||||
?>
|
||||
|
||||
<div class="dup-dlg-links-subtxt">
|
||||
<?php esc_html_e("Learn how Duplicator works in just a few minutes...", 'duplicator-pro'); ?>
|
||||
</div>
|
||||
|
||||
<div id="dup-ovr-hlp-tabs" class="dup-tabs-flat">
|
||||
<div class="data-tabs">
|
||||
<a href="javascript:void(0)" class="tab active"><i class="fas fa-archive fa-fw"></i> <?php esc_html_e('Create Backups', 'duplicator-pro'); ?></a>
|
||||
<a href="javascript:void(0)" class="tab"><i class="fas fa-bolt fa-fw"></i> <?php esc_html_e('Install Backups', 'duplicator-pro'); ?></a>
|
||||
</div>
|
||||
|
||||
<!-- =================
|
||||
TAB1: OVERVIEW HELP -->
|
||||
<div class="data-panels">
|
||||
<div class="panel">
|
||||
|
||||
<div id="dup-link-spinner-1" class="dup-spinner">
|
||||
<div class="area-left">
|
||||
<i class="fas fa-chevron-circle-left area-arrow"></i>
|
||||
</div>
|
||||
<!-- DATA -->
|
||||
<div class="area-data">
|
||||
|
||||
<!-- =====================
|
||||
SPIN-1: INTRO -->
|
||||
<div class="item active dup-spin-hlp">
|
||||
<h3>
|
||||
<i class="fab fa-wordpress-simple" style="font-weight: normal"></i>
|
||||
<?php esc_html_e('Create Backups', 'duplicator-pro'); ?>
|
||||
</h3>
|
||||
<div class="sub-head">
|
||||
<?php esc_html_e('Backups are the heart of Duplicator, and driven by these points!', 'duplicator-pro'); ?>
|
||||
</div>
|
||||
|
||||
<ol>
|
||||
<li>
|
||||
<?php echo sprintf(
|
||||
esc_html_x('In Duplicator Backups refer to %1$s Packages', 'Archive icon', 'duplicator-pro'),
|
||||
'<i class="fas fa-archive fa-fw fa-sm"></i>'
|
||||
); ?>.
|
||||
</li>
|
||||
<li><?php esc_html_e('Packages can be manually created or scheduled', 'duplicator-pro'); ?>.</li>
|
||||
<li>
|
||||
<?php
|
||||
printf(
|
||||
esc_html_x(
|
||||
'Packages contain two files: %1$sThe Archive & Installer%2$s',
|
||||
'%1$s and %2$s are opening and closing italic tags (<i> and </i>)',
|
||||
'duplicator-pro'
|
||||
),
|
||||
'<i>',
|
||||
'</i>'
|
||||
);
|
||||
?>.
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
<!-- =====================
|
||||
SPIN-2: PACKAGE OVERVIEW -->
|
||||
<div class="item dup-spin-hlp">
|
||||
<h3>
|
||||
<i class="fas fa-archive fa-fw"></i>
|
||||
<?php esc_html_e('Package Overview', 'duplicator-pro'); ?>
|
||||
</h3>
|
||||
<div class="sub-head">
|
||||
<?php esc_html_e('A package is a customizable backup of your site with these two files:', 'duplicator-pro'); ?>
|
||||
</div>
|
||||
|
||||
<div class="title">
|
||||
<i class="far fa-file-archive fa-fw"></i> <?php esc_html_e('Archive File', 'duplicator-pro'); ?>
|
||||
<?php
|
||||
$tipContent = __(
|
||||
'Archive files can be created in either .zip or .daf file formats.',
|
||||
'duplicator-pro'
|
||||
) . ' ' .
|
||||
__('The Duplicator archive format (daf) is a custom format designed for large sites on budget hosts', 'duplicator-pro');
|
||||
?>
|
||||
<i class="fas fa-question-circle"
|
||||
data-tooltip-title="<?php esc_html_e("Archive File", 'duplicator-pro'); ?>"
|
||||
data-tooltip="<?php echo esc_attr($tipContent); ?>">
|
||||
</i>
|
||||
</div>
|
||||
<?php
|
||||
printf(
|
||||
esc_html_x(
|
||||
' The %1$sarchive.zip/daf%2$s file contains your WordPress files and database',
|
||||
'%1$s and %2$s are opening and closing italic tags (<i> and </i>)',
|
||||
'duplicator-pro'
|
||||
),
|
||||
'<i>',
|
||||
'</i>'
|
||||
);
|
||||
?>.
|
||||
<br/><br/>
|
||||
|
||||
<div class="title">
|
||||
<i class="fas fa-bolt fa-fw"></i> <?php esc_html_e('Installer File', 'duplicator-pro'); ?>
|
||||
<?php
|
||||
$tipContent = __(
|
||||
'In case you lose this file an exact copy of this file is also stored inside the archive named installer-backup.php',
|
||||
'duplicator-pro'
|
||||
); ?>
|
||||
<i class="fas fa-question-circle"
|
||||
data-tooltip-title="<?php esc_html_e("Archive Installer", 'duplicator-pro'); ?>"
|
||||
data-tooltip="<?php echo esc_attr($tipContent); ?>"></i>
|
||||
</div>
|
||||
<?php
|
||||
printf(
|
||||
esc_html_x(
|
||||
'The %1$sinstaller.php%2$s file helps to deploy the contents of the archive file',
|
||||
'%1$s and %2$s are opening and closing italic tags (<i> and </i>)',
|
||||
'duplicator-pro'
|
||||
),
|
||||
'<i>',
|
||||
'</i>'
|
||||
);
|
||||
?>.
|
||||
</div>
|
||||
|
||||
<!-- =====================
|
||||
SPIN-3: ARCHIVE FILE -->
|
||||
<div class="item dup-spin-hlp">
|
||||
<h3><i class="far fa-file-archive fa-fw"></i> <?php esc_html_e('Package: Archive File', 'duplicator-pro'); ?></h3>
|
||||
<div class="sub-head">
|
||||
<?php esc_html_e('An archive.zip/daf file contains your WordPress site with the following assets:', 'duplicator-pro'); ?>
|
||||
</div>
|
||||
|
||||
<div class="title">
|
||||
<i class="fas fa-folder-open fa-fw"></i> <?php esc_html_e('Site Files', 'duplicator-pro'); ?>
|
||||
<i class="fas fa-question-circle"
|
||||
data-tooltip-title="<?php esc_html_e("WordPress Site Info", 'duplicator-pro'); ?>"
|
||||
data-tooltip="<?php echo esc_attr($lang_wppathinfo) ?>"></i>
|
||||
</div>
|
||||
<?php esc_html_e(
|
||||
'All site files including the WordPress core files, plugins, themes and files starting at the WordPress root folder.',
|
||||
'duplicator-pro'
|
||||
); ?>
|
||||
<br/><br/>
|
||||
|
||||
<div class="title">
|
||||
<i class="fas fa-database fa-fw"></i> <?php esc_html_e('Database', 'duplicator-pro'); ?>
|
||||
</div>
|
||||
<?php esc_html_e('The database is stored in a single SQL file named database.sql.', 'duplicator-pro'); ?>
|
||||
<br/><br/>
|
||||
<small class="grey">
|
||||
<?php esc_html_e('By default all files/database tables are included unless filters are set.', 'duplicator-pro'); ?>
|
||||
</small>
|
||||
</div>
|
||||
|
||||
<!-- =====================
|
||||
SPIN-4: INSTALLER FILE -->
|
||||
<div class="item dup-spin-hlp">
|
||||
<h3><i class="fas fa-bolt fa-fw"></i> <?php esc_html_e('Package: Installer File', 'duplicator-pro'); ?></h3>
|
||||
<div class="sub-head">
|
||||
<?php esc_html_e('The installer.php is a PHP script that does the following:', 'duplicator-pro'); ?>
|
||||
</div>
|
||||
|
||||
<div class="title">
|
||||
<i class="fas fa-file-export fa-fw"></i> <?php esc_html_e('Extracts Archive', 'duplicator-pro'); ?>
|
||||
</div>
|
||||
<?php esc_html_e('Helps to restores your WordPress files at a location of your choice.', 'duplicator-pro'); ?>
|
||||
<br/><br/>
|
||||
|
||||
<div class="title">
|
||||
<i class="fas fa-database fa-fw"></i> <?php esc_html_e('Installs Database ', 'duplicator-pro'); ?>
|
||||
</div>
|
||||
|
||||
<?php esc_html_e('Restores database and properly updates all URL/paths.', 'duplicator-pro'); ?>
|
||||
<br/><br/>
|
||||
|
||||
<small class="grey">
|
||||
<?php esc_html_e('The installer file is only used for classic & overwrite standard install modes', 'duplicator-pro'); ?>.
|
||||
</small>
|
||||
</div>
|
||||
|
||||
<!-- =====================
|
||||
SPIN-5: INSTALLER SECURE -->
|
||||
<div class="item dup-spin-hlp">
|
||||
<h3><i class="fas fa-bolt fa-fw"></i> <?php esc_html_e('Secure Installer', 'duplicator-pro'); ?></h3>
|
||||
<div class="sub-head">
|
||||
<?php esc_html_e('A secure installer keeps the location of your install process hidden.', 'duplicator-pro'); ?>
|
||||
</div>
|
||||
|
||||
<ol>
|
||||
<li>
|
||||
<b><i class="fas fa-lock-open fa-fw"></i> <?php esc_html_e('Unsecured', 'duplicator-pro'); ?></b><br/>
|
||||
<?php
|
||||
esc_html_e(
|
||||
'An unsecured installer is named "installer.php". This mode should only be used when outside users cannot access your server.',
|
||||
'duplicator-pro'
|
||||
); ?>
|
||||
</li>
|
||||
<li>
|
||||
<b><i class="fas fa-lock fa-fw"></i> <?php esc_html_e('Secured', 'duplicator-pro'); ?></b><br/>
|
||||
<?php
|
||||
echo esc_html__(
|
||||
'A secure installer is named "[name]_[hash]_[date]_installer.php" and is only known by you.',
|
||||
'duplicator-pro'
|
||||
) . ' ' .
|
||||
esc_html__('This keeps it safe from outside threats.', 'duplicator-pro');
|
||||
?>
|
||||
</li>
|
||||
</ol>
|
||||
<br/><br/>
|
||||
|
||||
<div class="dup-ovr-continue">
|
||||
<a href="javascript:void(0)" id="dup-ovr-next-exe">
|
||||
<?php esc_html_e('Install Backups', 'duplicator-pro'); ?>
|
||||
<i class="fas fa-chevron-circle-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="area-right">
|
||||
<i class="fas fa-chevron-circle-right"></i>
|
||||
</div>
|
||||
|
||||
<!-- Progress -->
|
||||
<div class="area-nav">
|
||||
<span class="num"></span>
|
||||
<progress class="progress"></progress>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- ******************************************************
|
||||
TAB-2: INSTALLER RESOURCES -->
|
||||
<div class="panel" data-panel="2">
|
||||
<div id="dup-link-spinner-2" class="dup-spinner">
|
||||
|
||||
<div class="area-left">
|
||||
<i class="fas fa-chevron-circle-left area-arrow"></i>
|
||||
</div>
|
||||
|
||||
<!-- Data -->
|
||||
<div class="area-data">
|
||||
<!-- =====================
|
||||
SPIN-1: INTRO -->
|
||||
<div class="item dup-spin-hlp active">
|
||||
<h3>
|
||||
<i class="fab fa-wordpress-simple" style="font-weight: normal"></i>
|
||||
<?php esc_html_e('Install Backups', 'duplicator-pro'); ?>
|
||||
</h3>
|
||||
<div class="sub-head">
|
||||
<?php esc_html_e('With Duplicator there are several ways to restore/install a backup', 'duplicator-pro'); ?>
|
||||
</div>
|
||||
|
||||
<ol>
|
||||
<li>
|
||||
<?php
|
||||
printf(
|
||||
esc_html_x(
|
||||
'Install modes consist of two groups %1$sStandard & Custom%2$s',
|
||||
'%1$s and %2$s are opening and closing italic tags (<i> and </i>)',
|
||||
'duplicator-pro'
|
||||
),
|
||||
'<i>',
|
||||
'</i>'
|
||||
);
|
||||
?>
|
||||
</li>
|
||||
<li>
|
||||
<?php
|
||||
printf(
|
||||
esc_html_x(
|
||||
'%1$sStandard Modes include: %2$s %3$sImport, Overwrite & Classic%4$s',
|
||||
'%1$s and %2$s are bold tags and %3$s and %4$s are italic tags',
|
||||
'duplicator-pro'
|
||||
),
|
||||
'<b>',
|
||||
'</b>',
|
||||
'<i>',
|
||||
'</i>'
|
||||
);
|
||||
?>
|
||||
</li>
|
||||
<li>
|
||||
<?php
|
||||
printf(
|
||||
esc_html_x(
|
||||
'%1$sCustom Modes include: %2$s %3$sRecovery, Database, Two-Part%4$s',
|
||||
'%1$s and %2$s are bold tags and %3$s and %4$s are italic tags',
|
||||
'duplicator-pro'
|
||||
),
|
||||
'<b>',
|
||||
'</b>',
|
||||
'<i>',
|
||||
'</i>'
|
||||
);
|
||||
?>
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
<!-- =====================
|
||||
SPIN-2: STANDARD INSTALL MODES -->
|
||||
<div class="item dup-spin-hlp">
|
||||
<h3>
|
||||
<i class="fas fa-bolt fa-fw"></i>
|
||||
<?php esc_html_e('Standard Install Modes', 'duplicator-pro'); ?>
|
||||
</h3>
|
||||
<div class="sub-head">
|
||||
<?php esc_html_e('Standard install modes are the most popular and support these 3 modes.', 'duplicator-pro'); ?>
|
||||
</div>
|
||||
|
||||
<div class="title">
|
||||
<i class="fas fa-arrow-alt-circle-down fa-fw"></i>
|
||||
<a href="<?php echo esc_url(DUPLICATOR_PRO_DUPLICATOR_DOCS_URL . 'import-install') ?>" target="_blank">
|
||||
<b><?php esc_html_e('Import Install', 'duplicator-pro'); ?></b>
|
||||
</a>
|
||||
</div>
|
||||
<?php esc_html_e('Drag-n-drop or link an archive file to any destination WordPress site', 'duplicator-pro'); ?>.
|
||||
<br/><br/>
|
||||
|
||||
<div class="title">
|
||||
<i class="far fa-window-close fa-fw"></i>
|
||||
<a href="<?php echo esc_url(DUPLICATOR_PRO_DUPLICATOR_DOCS_URL . 'overwrite-install') ?>" target="_blank">
|
||||
<b><?php esc_html_e('Overwrite Install', 'duplicator-pro'); ?></b>
|
||||
</a>
|
||||
</div>
|
||||
<?php esc_html_e('Quickly overwrite an existing WordPress site in a few clicks', 'duplicator-pro'); ?>.
|
||||
<br/><br/>
|
||||
|
||||
<div class="title">
|
||||
<i class="far fa-save fa-fw"></i>
|
||||
<a href="<?php echo esc_url(DUPLICATOR_PRO_DUPLICATOR_DOCS_URL . 'classic-install') ?>" target="_blank">
|
||||
<b><?php esc_html_e('Classic Install', 'duplicator-pro'); ?></b>
|
||||
</a>
|
||||
</div>
|
||||
<?php esc_html_e('Install to an empty server directory like a new WordPress install does', 'duplicator-pro'); ?>.<br/>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- =====================
|
||||
SPIN-3: STANDARD: IMPORT INSTALL -->
|
||||
<div class="item dup-spin-hlp">
|
||||
<h3>
|
||||
<i class="fas fa-arrow-alt-circle-down"></i>
|
||||
<?php esc_html_e('Standard: Import Install', 'duplicator-pro'); ?>
|
||||
</h3>
|
||||
<div class="sub-head">
|
||||
<?php esc_html_e('Quick steps to import archive into an existing WordPress site and overwrite it.', 'duplicator-pro'); ?>
|
||||
</div>
|
||||
|
||||
<div id="dup-ovr-hlp-vert-tabs-1" class="dup-tabs-vert">
|
||||
<div class="data-tabs">
|
||||
<div class="void"><i class="fab fa-wordpress-simple"></i> <?php esc_html_e('Source Site', 'duplicator-pro'); ?></div>
|
||||
<div class="tab active">1. <?php esc_html_e('Create Package', 'duplicator-pro'); ?></div>
|
||||
<div class="tab">2. <?php esc_html_e('Choose Import', 'duplicator-pro'); ?></div>
|
||||
|
||||
<div class="void"><i class="fab fa-wordpress-simple"></i> <?php esc_html_e('Destination Site', 'duplicator-pro'); ?></div>
|
||||
<div class="tab">3. <?php esc_html_e('Check WordPress', 'duplicator-pro'); ?></div>
|
||||
<div class="tab">4. <?php esc_html_e('Import Archive', 'duplicator-pro'); ?></div>
|
||||
</div>
|
||||
<div class="data-panels dup-tabvert-hlp">
|
||||
<div class="panel">
|
||||
<div class="title">
|
||||
<i class="fas fa-archive fa-fw"></i> <?php esc_html_e('Create a Package', 'duplicator-pro'); ?><br/>
|
||||
<small><?php esc_html_e('Pro ❯ Packages ❯ Create New', 'duplicator-pro'); ?></small>
|
||||
</div>
|
||||
<?php esc_html_e('On any WordPress site with Duplicator create a package', 'duplicator-pro'); ?>.
|
||||
</div>
|
||||
|
||||
<div class="panel">
|
||||
<div class="title">
|
||||
<i class="fas fa-link fa-fw"></i> <?php esc_html_e('Choose An Import Method', 'duplicator-pro'); ?> <br/>
|
||||
<small><?php esc_html_e('Pro ❯ Packages ❯ Package Overview', 'duplicator-pro'); ?></small>
|
||||
</div>
|
||||
<b><?php esc_html_e('URL Import', 'duplicator-pro'); ?></b> <br/>
|
||||
<?php
|
||||
esc_html_e('Use', 'duplicator-pro');
|
||||
echo ' <i><i class="far fa-copy fa-xs"></i> ' . esc_html__('Copy Link', 'duplicator-pro') . '</i> ';
|
||||
esc_html_e('to run import link install', 'duplicator-pro');
|
||||
?>.
|
||||
<br/><br/>
|
||||
|
||||
<b><?php esc_html_e('File Import', 'duplicator-pro'); ?></b> <br/>
|
||||
<?php
|
||||
esc_html_e('Use', 'duplicator-pro');
|
||||
echo ' <i><i class="fas fa-download fa-xs"></i> ' . esc_html__('Download', 'duplicator-pro') . '</i> ';
|
||||
esc_html_e('to run import file install', 'duplicator-pro');
|
||||
?>.
|
||||
</div>
|
||||
|
||||
<div class="panel">
|
||||
<div class="title">
|
||||
<?php esc_html_e('Install WordPress', 'duplicator-pro'); ?>
|
||||
</div>
|
||||
<?php esc_html_e('Install WordPress if not already installed', 'duplicator-pro'); ?>.<br/>
|
||||
<small>
|
||||
<?php esc_html_e(
|
||||
'Most Hosting platforms have a one click WordPress install, this will be the quickest method to get WordPress on your host or have you host do it for you', // phpcs:ignore Generic.Files.LineLength
|
||||
'duplicator-pro'
|
||||
); ?> .
|
||||
</small>
|
||||
</div>
|
||||
|
||||
<div class="panel">
|
||||
<div class="title">
|
||||
<?php esc_html_e('Import Archive ', 'duplicator-pro'); ?><br/>
|
||||
<small><?php esc_html_e('Pro ❯ Import ', 'duplicator-pro'); ?></small>
|
||||
</div>
|
||||
|
||||
<b><?php esc_html_e('URL Import', 'duplicator-pro'); ?></b> <br/>
|
||||
<i><i class="far fa-copy fa-xs"></i> <?php esc_html_e('Paste Link', 'duplicator-pro'); ?></i>
|
||||
<?php esc_html_e('from source site', 'duplicator-pro'); ?>.
|
||||
<br/><br/>
|
||||
|
||||
<b><?php esc_html_e('File Import', 'duplicator-pro'); ?></b> <br/>
|
||||
<i><i class="fas fa-download fa-xs"></i> <?php esc_html_e('Drag-n-drop', 'duplicator-pro'); ?></i>
|
||||
<?php esc_html_e('archive file from source site', 'duplicator-pro'); ?>.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- =====================
|
||||
SPIN-4: OVERWRITE INSTALL -->
|
||||
<div class="item dup-spin-hlp">
|
||||
<h3>
|
||||
<i class="far fa-window-close fa-fw"></i>
|
||||
<?php esc_html_e('Standard: Overwrite Install', 'duplicator-pro'); ?>
|
||||
</h3>
|
||||
<div class="sub-head">
|
||||
<?php esc_html_e('Quick steps to overwrite an existing WordPress site.', 'duplicator-pro'); ?>
|
||||
</div>
|
||||
<ol>
|
||||
<li>
|
||||
<b><?php esc_html_e('Create package', 'duplicator-pro'); ?>:</b>
|
||||
<?php esc_html_e(' Create package on source site', 'duplicator-pro'); ?>.
|
||||
</li>
|
||||
<li>
|
||||
<b><?php esc_html_e('Transfer package', 'duplicator-pro'); ?>:</b>
|
||||
<?php esc_html_e('Use FTP or cPanel to copy installer & archive to destination WordPress site folder', 'duplicator-pro'); ?>.
|
||||
</li>
|
||||
<li>
|
||||
<b><?php esc_html_e('Run Installer', 'duplicator-pro'); ?>:</b>
|
||||
<?php esc_html_e(
|
||||
'On destination server browse to URL of installer.php and follow install steps to overwrite site',
|
||||
'duplicator-pro'
|
||||
); ?>.
|
||||
</li>
|
||||
</ol>
|
||||
|
||||
<small>
|
||||
<?php esc_html_e('Overwrite mode uses the existing wp-config.php to pre-fill database settings ', 'duplicator-pro'); ?>.
|
||||
</small>
|
||||
</div>
|
||||
|
||||
<!-- =====================
|
||||
SPIN-5: CLASSIC INSTALL -->
|
||||
<div class="item dup-spin-hlp">
|
||||
<h3>
|
||||
<i class="far fa-save fa-fw"></i>
|
||||
<?php esc_html_e('Standard: Classic Install', 'duplicator-pro'); ?>
|
||||
</h3>
|
||||
<div class="sub-head">
|
||||
<?php esc_html_e('Quick steps to install a WordPress site.', 'duplicator-pro'); ?>
|
||||
</div>
|
||||
<ol>
|
||||
<li>
|
||||
<b><?php esc_html_e('Create package', 'duplicator-pro'); ?>:</b>
|
||||
<?php esc_html_e(' Create package on source site', 'duplicator-pro'); ?>.
|
||||
</li>
|
||||
<li>
|
||||
<b><?php esc_html_e('Transfer package', 'duplicator-pro'); ?>:</b>
|
||||
<?php
|
||||
printf(
|
||||
esc_html_x(
|
||||
'Use FTP, cPanel or host utilities to copy installer & archive to %1$sempty directory%2$s on destination server.',
|
||||
'%1$s and %2$s are opening and closing underline tags (<u> and </u>)',
|
||||
'duplicator-pro'
|
||||
),
|
||||
'<u>',
|
||||
'</u>'
|
||||
);
|
||||
?>
|
||||
</li>
|
||||
<li>
|
||||
<b><?php esc_html_e('Run Installer', 'duplicator-pro'); ?>:</b>
|
||||
<?php esc_html_e(
|
||||
'On destination server browse to URL of installer.php and follow the install steps',
|
||||
'duplicator-pro'
|
||||
); ?>.
|
||||
</li>
|
||||
</ol>
|
||||
<small>
|
||||
<?php esc_html_e('Classic install works simular to installing a brand new WordPress site', 'duplicator-pro'); ?>.
|
||||
</small>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- =====================
|
||||
SPIN-6: CUSTOM INSTALL MODES -->
|
||||
<div class="item dup-spin-hlp">
|
||||
<h3>
|
||||
<i class="fas fa-bolt fa-fw"></i>
|
||||
<?php esc_html_e('Custom Install Modes', 'duplicator-pro'); ?>
|
||||
</h3>
|
||||
<div class="sub-head">
|
||||
<?php esc_html_e('There are 3 custom install modes for site re-deployment.', 'duplicator-pro'); ?>
|
||||
</div>
|
||||
|
||||
<div class="title">
|
||||
<i class="fa fa-undo fa-fw"></i>
|
||||
<a href="<?php echo esc_url(DUPLICATOR_PRO_DUPLICATOR_DOCS_URL . 'recover-a-backup') ?>" target="_blank">
|
||||
<b><?php esc_html_e('Recovery Point', 'duplicator-pro'); ?></b>
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<?php esc_html_e('Restore the current site to a specific snapshot in time.', 'duplicator-pro'); ?>
|
||||
<br/><br/>
|
||||
|
||||
<div class="title">
|
||||
<i class="fas fa-database fa-fw"></i>
|
||||
<a href="<?php echo esc_url(DUPLICATOR_PRO_DUPLICATOR_DOCS_URL . 'database-install') ?>" target="_blank">
|
||||
<b><?php esc_html_e('Database Install', 'duplicator-pro'); ?></b>
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<?php esc_html_e('Backup and restore only the database', 'duplicator-pro'); ?>.
|
||||
<br/><br/>
|
||||
|
||||
<div class="title">
|
||||
<i class="fa fa-random fa-fw"></i>
|
||||
<a href="<?php echo esc_url(DUPLICATOR_PRO_DUPLICATOR_DOCS_URL . 'two-part-install') ?>" target="_blank">
|
||||
<b><?php esc_html_e('Two-Part', 'duplicator-pro'); ?></b>
|
||||
</a>
|
||||
</div>
|
||||
<?php esc_html_e('Run the install process by manually moving some of the site files', 'duplicator-pro'); ?>.
|
||||
<br/><br/>
|
||||
|
||||
<small>
|
||||
<?php esc_html_e('Custom Install Modes are not shown in detail in this tutorial', 'duplicator-pro'); ?>.
|
||||
</small>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- =====================
|
||||
SPIN-7: INSTALL RESOURCES -->
|
||||
<div class="item dup-spin-hlp">
|
||||
<h3>
|
||||
<i class="fas fa-link fa-fw"></i>
|
||||
<?php esc_html_e('Install Resources', 'duplicator-pro'); ?>
|
||||
</h3>
|
||||
<div class="sub-head">
|
||||
<?php esc_html_e('Look for the Install Resources to aid with the install process.', 'duplicator-pro'); ?>
|
||||
</div>
|
||||
|
||||
<div class="title">
|
||||
<i class="far fa-file-archive fa-fw"></i>
|
||||
<?php esc_html_e('Archive File', 'duplicator-pro'); ?>
|
||||
<i class="fas fa-question-circle"
|
||||
data-tooltip-title="<?php esc_attr_e("Archive File", 'duplicator-pro'); ?>"
|
||||
data-tooltip="<?php esc_attr_e(
|
||||
'An import install only requires the archive file and can be from many different remote locations',
|
||||
'duplicator-pro'
|
||||
); ?>">
|
||||
</i>
|
||||
</div>
|
||||
<ol style="margin-top:2px">
|
||||
<li>
|
||||
<?php
|
||||
printf(
|
||||
esc_html_x(
|
||||
'Use %1$s%2$s Copy Link%3$s to run a remote import install.',
|
||||
'%1$s and %3$s represent opening and closing bold (<b>) tags, %2$s represents an icon',
|
||||
'duplicator-pro'
|
||||
),
|
||||
'<b>',
|
||||
'<i class="far fa-copy fa-xs"></i>',
|
||||
'</b>'
|
||||
);
|
||||
?>
|
||||
</li>
|
||||
<li>
|
||||
<?php
|
||||
printf(
|
||||
esc_html_x(
|
||||
'Use %1$s%2$s Download%3$s to run a import/overwrite/classic install.',
|
||||
'%1$s and %3$s represent bold (<b>) tags, %2$s represents an icon',
|
||||
'duplicator-pro'
|
||||
),
|
||||
'<b>',
|
||||
'<i class="fas fa-download fa-xs"></i>',
|
||||
'</b>'
|
||||
);
|
||||
?>
|
||||
</li>
|
||||
</ol>
|
||||
|
||||
<div class="title">
|
||||
<i class="fas fa-bolt fa-fw"></i>
|
||||
<?php esc_html_e('Archive Installer', 'duplicator-pro'); ?>
|
||||
<i class="fas fa-question-circle"
|
||||
data-tooltip-title="<?php esc_attr_e("Archive Installer", 'duplicator-pro'); ?>"
|
||||
data-tooltip="<?php esc_attr_e(
|
||||
'Secure install names are complex, quickly copy the name to improve your workflow.',
|
||||
'duplicator-pro'
|
||||
); ?>">
|
||||
</i>
|
||||
</div>
|
||||
<?php esc_html_e('The installer.php file can be used for overwrite/classic install modes.', 'duplicator-pro');?>
|
||||
</div>
|
||||
|
||||
<!-- =====================
|
||||
SPIN-8: MORE INFO -->
|
||||
<div class="item dup-spin-hlp">
|
||||
<h3>
|
||||
<i class="fas fa-info-circle"></i>
|
||||
<?php esc_html_e('More information', 'duplicator-pro'); ?>
|
||||
</h3>
|
||||
<div class="sub-head">
|
||||
<?php esc_html_e('For additional detailed information checkout our online resources', 'duplicator-pro'); ?>.
|
||||
</div>
|
||||
<ul>
|
||||
<li>
|
||||
<i class="far fa-file-alt fa-fw"></i>
|
||||
<?php $url = DUPLICATOR_PRO_BLOG_URL . 'knowledge-base-article-categories/quick-start';?>
|
||||
<a href="<?php echo esc_attr($url); ?>" class='dup-knowledge-base' target='_sc-home'>
|
||||
<?php esc_html_e('Quick Start', 'duplicator-pro'); ?>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<i class='fa fa-book fa-fw'></i>
|
||||
<a href='<?php echo esc_url(DUPLICATOR_PRO_USER_GUIDE_URL); ?>' class='dup-full-guide' target='_sc-guide'>
|
||||
<?php esc_html_e('Full User Guide', 'duplicator-pro'); ?>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<i class='far fa-file-code fa-fw'></i>
|
||||
<a href='<?php echo esc_url(DUPLICATOR_PRO_TECH_FAQ_URL); ?>' class='dup-faqs' target='_sc-faq'>
|
||||
<?php esc_html_e('Technical FAQs', 'duplicator-pro'); ?>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="area-right">
|
||||
<i class="fas fa-chevron-circle-right"></i>
|
||||
</div>
|
||||
|
||||
<!-- Progress -->
|
||||
<div class="area-nav">
|
||||
<span class="num"></span>
|
||||
<progress class="progress"></progress>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
jQuery(document).ready(function($) {
|
||||
|
||||
var spin1 = new Duplicator.UI.Ctrl.Spinner('dup-link-spinner-1');
|
||||
var spin2 = new Duplicator.UI.Ctrl.Spinner('dup-link-spinner-2');
|
||||
|
||||
//INIT
|
||||
$("a#dup-ovr-next-exe").on("click", function() {
|
||||
$($('#dup-ovr-hlp-tabs div.data-tabs a.tab').get(1)).trigger("click");
|
||||
spin2.setPanel(0);
|
||||
});
|
||||
|
||||
Duplicator.UI.Ctrl.tabsFlat('dup-ovr-hlp-tabs');
|
||||
Duplicator.UI.Ctrl.tabsVert('dup-ovr-hlp-vert-tabs-1');
|
||||
|
||||
// //DEBUG Package Overview Area & Dialog
|
||||
// setTimeout(function(){
|
||||
// DupPro.Pack.openLinkDetails();
|
||||
// $($('div#dup-ovr-hlp-tabs a.tab').get(1)).trigger("click");
|
||||
// $('div#dup-link-spinner-2 div.area-right').trigger("click");
|
||||
// }, 1);
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@@ -0,0 +1,711 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Duplicator package row in table packages list
|
||||
*
|
||||
* @package Duplicator
|
||||
* @copyright (c) 2022, Snap Creek LLC
|
||||
*/
|
||||
|
||||
defined("ABSPATH") or die("");
|
||||
|
||||
use Duplicator\Controllers\PackagesPageController;
|
||||
use Duplicator\Controllers\StoragePageController;
|
||||
use Duplicator\Controllers\ToolsPageController;
|
||||
use Duplicator\Core\Controllers\ControllersManager;
|
||||
use Duplicator\Libs\Snap\SnapJson;
|
||||
|
||||
/**
|
||||
* Variables
|
||||
*
|
||||
* @var \Duplicator\Core\Controllers\ControllersManager $ctrlMng
|
||||
* @var \Duplicator\Core\Views\TplMng $tplMng
|
||||
* @var array<string, mixed> $tplData
|
||||
*/
|
||||
|
||||
$perPage = $tplData['perPage'];
|
||||
$offset = $tplData['offset'];
|
||||
$currentPage = $tplData['currentPage'];
|
||||
|
||||
require_once DUPLICATOR____PATH . '/views/tools/recovery/widget/recovery-widget-scripts.php';
|
||||
|
||||
$transferBaseUrl = PackagesPageController::getInstance()->getPackageTransferUrl();
|
||||
$reloadPackagesURL = $ctrlMng->getCurrentLink(
|
||||
['paged' => $currentPage]
|
||||
);
|
||||
?>
|
||||
|
||||
<!-- ==========================================
|
||||
THICK-BOX DIALOGS: -->
|
||||
<?php
|
||||
/* ------------------------------------------
|
||||
* ALERT: Remote > Storage items */
|
||||
$remoteDlg = new DUP_PRO_UI_Dialog();
|
||||
$remoteDlg->width = 750;
|
||||
$remoteDlg->height = 475;
|
||||
$remoteDlg->title = __('Storage Locations', 'duplicator-pro');
|
||||
$remoteDlg->message = __('Loading Please Wait...', 'duplicator-pro');
|
||||
$remoteDlg->boxClass = 'dup-packs-remote-store-dlg';
|
||||
$remoteDlg->initAlert();
|
||||
|
||||
/* ------------------------------------------
|
||||
* ALERT: Bulk action > no selection */
|
||||
$alert1 = new DUP_PRO_UI_Dialog();
|
||||
$alert1->title = __('Bulk Action Required', 'duplicator-pro');
|
||||
$alert1->message = '<i class="fa fa-exclamation-triangle fa-sm"></i> ';
|
||||
$alert1->message .= __('No selections made! Please select an action from the "Bulk Actions" drop down menu!', 'duplicator-pro');
|
||||
$alert1->initAlert();
|
||||
|
||||
/* ------------------------------------------
|
||||
* ALERT: Bulk action > no package selected */
|
||||
$alert2 = new DUP_PRO_UI_Dialog();
|
||||
$alert2->title = __('Selection Required', 'duplicator-pro');
|
||||
$alert2->wrapperClassButtons = 'dpro-dlg-nopackage-sel-bulk-action-btns';
|
||||
$alert2->message = '<i class="fa fa-exclamation-triangle fa-sm"></i> ';
|
||||
$alert2->message .= __('No selections made! Please select at least one package to delete!', 'duplicator-pro');
|
||||
$alert2->initAlert();
|
||||
|
||||
/* ------------------------------------------
|
||||
* ALERT: Process > Error undefined */
|
||||
$alert4 = new DUP_PRO_UI_Dialog();
|
||||
$alert4->title = __('ERROR!', 'duplicator-pro');
|
||||
$alert4->message = __('Got an error or a warning: undefined', 'duplicator-pro');
|
||||
$alert4->initAlert();
|
||||
|
||||
/* ------------------------------------------
|
||||
* ALERT: Process > Error no details */
|
||||
$alert5 = new DUP_PRO_UI_Dialog();
|
||||
$alert5->title = $alert4->title;
|
||||
$alert5->message = __('Failed to get details.', 'duplicator-pro');
|
||||
$alert5->initAlert();
|
||||
|
||||
/* ------------------------------------------
|
||||
* ALERT: Download > No storage items */
|
||||
$alert6 = new DUP_PRO_UI_Dialog();
|
||||
$alert6->height = 350;
|
||||
$alert6->width = 600;
|
||||
$alert6->title = __('Download Status', 'duplicator-pro');
|
||||
$alert6->message = sprintf(
|
||||
'%s <br/><br/> <i class="fas fa-server fa-xs"></i> <b>%s:</b> %s <br/><br/> '
|
||||
. '<i class="far fa-hdd"></i> <b>%s:</b> %s <br/><br/> <small><i>%s</i></small><br/>',
|
||||
__('No package files found at the \'Default\' storage location on this server.', 'duplicator-pro'),
|
||||
__('Remote', 'duplicator-pro'),
|
||||
__('For packages stored remotely check the remote storage button next to the download button.', 'duplicator-pro'),
|
||||
__('Local', 'duplicator-pro'),
|
||||
__(
|
||||
'To enable the direct download button be sure the local \'Default\' or a non-default, but \'Local\' storage type is enabled when creating a package.',
|
||||
'duplicator-pro'
|
||||
),
|
||||
__(
|
||||
"Note: If the Storage ❯ Default ❯ 'Max Packages' is set then packages will be removed but the entry will still be visible on the packages screen.", // phpcs:ignore Generic.Files.LineLength
|
||||
'duplicator-pro'
|
||||
)
|
||||
);
|
||||
$alert6->initAlert();
|
||||
|
||||
/* ------------------------------------------
|
||||
* CONFIRM: Delete packages? */
|
||||
$confirm1 = new DUP_PRO_UI_Dialog();
|
||||
$confirm1->height = 280;
|
||||
$confirm1->title = __('Delete Packages?', 'duplicator-pro');
|
||||
$confirm1->wrapperClassButtons = 'dpro-dlg-detete-packages-btns';
|
||||
$confirm1->message = __('Are you sure you want to delete the selected package(s)?', 'duplicator-pro');
|
||||
$confirm1->message .= '<br/><br/>';
|
||||
$confirm1->message .= '<small><i>' . __(
|
||||
'Note: This action removes only packages located on this server. If a remote package was created then it will not be removed or affected.',
|
||||
'duplicator-pro'
|
||||
) . '</i></small>';
|
||||
$confirm1->progressText = __('Removing Packages, Please Wait...', 'duplicator-pro');
|
||||
$confirm1->jsCallback = 'DupPro.Pack.Delete()';
|
||||
$confirm1->initConfirm();
|
||||
|
||||
/* ------------------------------------------
|
||||
* ALERT: Recovery > toolbar button */
|
||||
$toolBarRecoveryButtonInfo = new DUP_PRO_UI_Dialog();
|
||||
$toolBarRecoveryButtonInfo->showButtons = false;
|
||||
$toolBarRecoveryButtonInfo->height = 600;
|
||||
$toolBarRecoveryButtonInfo->width = 600;
|
||||
$toolBarRecoveryButtonInfo->title = __('Disaster Recovery', 'duplicator-pro');
|
||||
$toolBarRecoveryButtonInfo->message = $tplMng->render('admin_pages/packages/recovery_info/info', array(), false);
|
||||
$toolBarRecoveryButtonInfo->initAlert();
|
||||
|
||||
/* ------------------------------------------
|
||||
* ALERT: Recovery */
|
||||
$availableRecoveryBox = new DUP_PRO_UI_Dialog();
|
||||
$availableRecoveryBox->title = __('Disaster Recovery Available', 'duplicator-pro');
|
||||
$availableRecoveryBox->boxClass = 'dup-recovery-box-info';
|
||||
$availableRecoveryBox->showButtons = false;
|
||||
$availableRecoveryBox->width = 600;
|
||||
$availableRecoveryBox->height = 400;
|
||||
$availableRecoveryBox->message = '';
|
||||
$availableRecoveryBox->initAlert();
|
||||
|
||||
$unavailableRecoveryBox = new DUP_PRO_UI_Dialog();
|
||||
$unavailableRecoveryBox->title = __('Disaster Recovery Unavailable', 'duplicator-pro');
|
||||
$unavailableRecoveryBox->boxClass = 'dup-recovery-box-info';
|
||||
$unavailableRecoveryBox->showButtons = false;
|
||||
$unavailableRecoveryBox->width = 600;
|
||||
$unavailableRecoveryBox->height = 700;
|
||||
$unavailableRecoveryBox->message = '';
|
||||
$unavailableRecoveryBox->initAlert();
|
||||
|
||||
/* ------------------------------------------
|
||||
* ALERT: Package overeview > Help */
|
||||
$linkInfoDlg = new DUP_PRO_UI_Dialog();
|
||||
$linkInfoDlg->width = 700;
|
||||
$linkInfoDlg->height = 550;
|
||||
$linkInfoDlg->title = __('Duplicator Pro Tutorial', 'duplicator-pro');
|
||||
$linkInfoDlg->message = $tplMng->render('admin_pages/packages/packages_overview_help', array(), false);
|
||||
$linkInfoDlg->initAlert();
|
||||
|
||||
$baseStorageEditURL = StoragePageController::getInstance()->getMenuLink(
|
||||
null,
|
||||
null,
|
||||
[
|
||||
ControllersManager::QUERY_STRING_INNER_PAGE => StoragePageController::INNER_PAGE_EDIT,
|
||||
]
|
||||
);
|
||||
?>
|
||||
<script>
|
||||
jQuery(document).ready(function($) {
|
||||
|
||||
DupPro.Pack.RestorePackageId = null;
|
||||
DupPro.PackagesTable = $('.dup-packtbl');
|
||||
|
||||
/**
|
||||
* Click event to expands each row and show package details
|
||||
*
|
||||
* @returns void
|
||||
*/
|
||||
$('th#dup-header-chkall').on('click', function() {
|
||||
var $this = $(this);
|
||||
var $icon = $this.find('i');
|
||||
if ($icon.hasClass('fa-chevron-left')) {
|
||||
$icon.attr('class', 'fas fa-chevron-down');
|
||||
$("tr.dup-row-complete").each(function() {
|
||||
$icon = $(this).find('td.dup-cell-toggle-btn i');
|
||||
$icon.attr('class', 'fas fa-chevron-down');
|
||||
$(this).next('tr').show();
|
||||
});
|
||||
} else {
|
||||
$icon.attr('class', 'fas fa-chevron-left');
|
||||
$("tr.dup-row-complete").each(function() {
|
||||
$icon = $(this).find('td.dup-cell-toggle-btn i');
|
||||
$icon.attr('class', 'fas fa-chevron-left');
|
||||
});
|
||||
$('tr.dup-row-details').hide();
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Click event to expands each row and show package details
|
||||
*
|
||||
* @returns void
|
||||
*/
|
||||
$('td.dup-cell-toggle-btn').on('click', function(e) {
|
||||
var $this = $(this);
|
||||
var $icon = $this.find('i');
|
||||
if ($icon.hasClass('fa-chevron-left')) {
|
||||
$icon.attr('class', 'fas fa-chevron-down');
|
||||
$(this).parent().next('tr').show();
|
||||
} else {
|
||||
$icon.attr('class', 'fas fa-chevron-left');
|
||||
$(this).parent().next('tr').hide();
|
||||
}
|
||||
});
|
||||
|
||||
$('.dup-pro-quick-fix-notice').on('click', '.dup-pro-quick-fix', function() {
|
||||
var $this = $(this),
|
||||
params = JSON.parse($this.attr('data-param')),
|
||||
toggle = $this.attr('data-toggle'),
|
||||
id = $this.attr('data-id'),
|
||||
fix = $(toggle),
|
||||
button = {
|
||||
loading: function() {
|
||||
$this.prop('disabled', true)
|
||||
.addClass('disabled')
|
||||
.html('<i class="fas fa-circle-notch fa-spin fa-fw"></i> <?php esc_html_e('Please Wait...', 'duplicator-pro') ?>');
|
||||
},
|
||||
reset: function() {
|
||||
$this.prop('disabled', false)
|
||||
.removeClass('disabled')
|
||||
.html("<i class='fa fa-wrench' aria-hidden='true'></i> <?php esc_html_e('Resolve This', 'duplicator-pro') ?>");
|
||||
}
|
||||
},
|
||||
error = {
|
||||
message: function(text) {
|
||||
fix.append(
|
||||
" <span style='color:#cc0000' id='" +
|
||||
toggle.replace('#', '') +
|
||||
"-error'><i class='fa fa-exclamation-triangle'></i> " + text + "</span>"
|
||||
);
|
||||
},
|
||||
remove: function() {
|
||||
if ($(toggle + "-error"))
|
||||
$(toggle + "-error").remove();
|
||||
}
|
||||
};
|
||||
|
||||
error.remove();
|
||||
button.loading();
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: ajaxurl,
|
||||
data: {
|
||||
action: 'duplicator_pro_quick_fix',
|
||||
setup: params,
|
||||
id: id,
|
||||
nonce: '<?php echo esc_js(wp_create_nonce('duplicator_pro_quick_fix')); ?>'
|
||||
}
|
||||
}).done(function(respData, x) {
|
||||
try {
|
||||
var parsedData = DupPro.parseJSON(respData);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
console.error('JSON parse failed for response data: ' + respData);
|
||||
|
||||
button.reset();
|
||||
error.message('<?php esc_html_e('Unexpected Error!', 'duplicator-pro') ?>');
|
||||
console.log(respData);
|
||||
console.log(x);
|
||||
return false;
|
||||
}
|
||||
|
||||
console.log(parsedData);
|
||||
if (parsedData.success) {
|
||||
fix.remove();
|
||||
|
||||
// If there is no fixes and notifications - remove container
|
||||
if (typeof parsedData.recommended_fixes != 'undefined') {
|
||||
if (parsedData.recommended_fixes == 0) {
|
||||
$('.dup-pro-quick-fix-notice').remove();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
button.reset();
|
||||
error.message(parsedData.message);
|
||||
}
|
||||
}).fail(function(data, x) {
|
||||
button.reset();
|
||||
error.message('<?php esc_html_e('Unexpected Error!', 'duplicator-pro') ?>');
|
||||
console.log(data);
|
||||
console.log(x);
|
||||
});
|
||||
});
|
||||
|
||||
DupPro.Pack.DownloadNotice = function() {
|
||||
<?php $alert6->showAlert(); ?>
|
||||
return false;
|
||||
};
|
||||
|
||||
$('.dpro-toolbar-recovery-info').click(function () {
|
||||
if ($(this).hasClass('dup-recovery-unset')) {
|
||||
<?php $toolBarRecoveryButtonInfo->showAlert(); ?>
|
||||
} else {
|
||||
let openUrl = <?php echo json_encode($ctrlMng->getMenuLink($ctrlMng::TOOLS_SUBMENU_SLUG, ToolsPageController::L2_SLUG_RECOVERY)); ?>;
|
||||
window.open(openUrl,"_self");
|
||||
}
|
||||
});
|
||||
|
||||
//DOWNLOAD MENU
|
||||
$('button.dup-dnload-btn').click(function(e) {
|
||||
var $menu = $(this).parent().find('nav.dup-dnload-menu-items');
|
||||
|
||||
if ($menu.is(':visible')) {
|
||||
$menu.hide();
|
||||
} else {
|
||||
$('nav.dup-dnload-menu-items').hide();
|
||||
$menu.show(200);
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
$(document).click(function(e) {
|
||||
var className = e.target.className;
|
||||
if (className != 'dpro-menu-x') {
|
||||
$('nav.dup-dnload-menu-items').hide();
|
||||
}
|
||||
});
|
||||
|
||||
$("nav.dup-dnload-menu-items button").each(function() {
|
||||
$(this).addClass('dpro-menu-x');
|
||||
});
|
||||
$("nav.dup-dnload-menu-items button span").each(function() {
|
||||
$(this).addClass('dpro-menu-x');
|
||||
});
|
||||
|
||||
/* Creats a comma seperate list of all selected package ids */
|
||||
DupPro.Pack.GetDeleteList = function() {
|
||||
var arr = [];
|
||||
$("input[name=delete_confirm]:checked").each(function() {
|
||||
arr.push(this.id);
|
||||
});
|
||||
return arr;
|
||||
}
|
||||
|
||||
DupPro.Pack.openLinkDetails = function() {
|
||||
<?php $linkInfoDlg->showAlert(); ?>
|
||||
}
|
||||
|
||||
DupPro.Pack.BackupRestore = function() {
|
||||
Duplicator.Util.ajaxWrapper({
|
||||
action: 'duplicator_pro_restore_backup_prepare',
|
||||
packageId: DupPro.Pack.RestorePackageId,
|
||||
nonce: '<?php echo esc_js(wp_create_nonce('duplicator_pro_restore_backup_prepare')); ?>'
|
||||
},
|
||||
function(result, data, funcData, textStatus, jqXHR) {
|
||||
window.location.href = data.funcData;
|
||||
},
|
||||
function(result, data, funcData, textStatus, jqXHR) {
|
||||
alert('FAIL');
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
/* Provides the correct confirmation items when deleting packages */
|
||||
DupPro.Pack.ConfirmDelete = function() {
|
||||
$('#dpro-dlg-confirm-delete-btns input').removeAttr('disabled');
|
||||
if ($("#dup-pack-bulk-actions").val() != "delete") {
|
||||
<?php $alert1->showAlert(); ?>
|
||||
return;
|
||||
}
|
||||
|
||||
var list = DupPro.Pack.GetDeleteList();
|
||||
if (list.length == 0) {
|
||||
<?php $alert2->showAlert(); ?>
|
||||
return;
|
||||
}
|
||||
<?php $confirm1->showConfirm(); ?>
|
||||
}
|
||||
|
||||
/* Removes all selected package sets with ajax call */
|
||||
DupPro.Pack.Delete = function() {
|
||||
var packageIds = DupPro.Pack.GetDeleteList();
|
||||
var pageCount = $('#current-page-selector').val();
|
||||
var pageItems = $('input[name="delete_confirm"]');
|
||||
var data = {
|
||||
action: 'duplicator_pro_package_delete',
|
||||
package_ids: packageIds,
|
||||
nonce: '<?php echo esc_js(wp_create_nonce('duplicator_pro_package_delete')); ?>'
|
||||
};
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: ajaxurl,
|
||||
data: data,
|
||||
success: function(respData) {
|
||||
try {
|
||||
var parsedData = DupPro.parseJSON(respData);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
console.error('JSON parse failed for response data: ' + respData);
|
||||
alert('Failed to delete package with AJAX resp: ' + respData);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (parsedData.error.length > 0) {
|
||||
alert("Ajax error: " + parsedData.error);
|
||||
return false;
|
||||
}
|
||||
|
||||
//Increment back a page-set if no items are left
|
||||
if ($('#form-duplicator-nav').length) {
|
||||
if (pageItems.length == packageIds.length)
|
||||
$('#current-page-selector').val(pageCount - 1);
|
||||
$('#form-duplicator-nav').submit();
|
||||
} else {
|
||||
$('#form-duplicator').submit();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/* Toogles the Bulk Action Check boxes */
|
||||
DupPro.Pack.SetDeleteAll = function() {
|
||||
var state = $('input#dup-chk-all').is(':checked') ? 1 : 0;
|
||||
$("input[name=delete_confirm]").each(function() {
|
||||
this.checked = (state) ? true : false;
|
||||
});
|
||||
}
|
||||
|
||||
/* Stops the build from running */
|
||||
DupPro.Pack.StopBuild = function(packageID) {
|
||||
$('#action').val('stop-build');
|
||||
$('#action-parameter').val(packageID);
|
||||
$('#form-duplicator').submit();
|
||||
|
||||
$('.dup-build-stop-btn').html('<?php esc_html_e("Cancelling...", 'duplicator-pro'); ?>');
|
||||
$('.dup-build-stop-btn').prop('disabled', true);
|
||||
}
|
||||
|
||||
/* Redirects to the packages detail screen using the package id */
|
||||
DupPro.Pack.OpenPackTransfer = function(id) {
|
||||
window.location.href = '<?php echo esc_url_raw(SnapJson::jsonEncode($transferBaseUrl)) ?>' + '&id=' + id;
|
||||
}
|
||||
|
||||
/* Shows remote storage location dialogs */
|
||||
DupPro.Pack.ShowRemote = function(package_id, name) {
|
||||
<?php $remoteDlg->showAlert(); ?>
|
||||
|
||||
Duplicator.Util.ajaxWrapper(
|
||||
{
|
||||
action: 'duplicator_pro_get_storage_details',
|
||||
package_id: package_id,
|
||||
nonce: '<?php echo esc_js(wp_create_nonce('duplicator_pro_get_storage_details')); ?>'
|
||||
},
|
||||
function (result, data, funcData, textStatus, jqXHR) {
|
||||
if (!funcData.success) {
|
||||
var text = "<?php esc_html_e('Got an error or a warning', 'duplicator-pro'); ?>: " + funcData.message;
|
||||
$('#TB_window .dpro-dlg-alert-txt').html(text);
|
||||
return false;
|
||||
}
|
||||
|
||||
var info = '<div class="dup-dlg-store-remote">';
|
||||
for (storage_provider_key in funcData.storage_providers) {
|
||||
var store = funcData.storage_providers[storage_provider_key];
|
||||
info += store.infoHTML;
|
||||
}
|
||||
info += '</div>';
|
||||
info += "<a href='" + funcData.logURL + "' class='dup-dlg-store-log-link' target='_blank'>" +
|
||||
'<?php echo esc_html__('[Package Build Log]', 'duplicator-pro'); ?>' + "</a>";
|
||||
$('#TB_window .dpro-dlg-alert-txt').html(info);
|
||||
},
|
||||
function(data) {
|
||||
<?php $alert5->showAlert(); ?>
|
||||
console.log(data);
|
||||
return '';
|
||||
}
|
||||
);
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
$('.dup-restore-backup').click(function(event) {
|
||||
event.preventDefault();
|
||||
|
||||
let packageId = $(this).data('package-id');
|
||||
Duplicator.Util.ajaxWrapper(
|
||||
{
|
||||
action: 'duplicator_pro_backup_redirect',
|
||||
packageId: packageId,
|
||||
nonce: '<?php echo esc_js(wp_create_nonce('duplicator_pro_backup_redirect')); ?>'
|
||||
},
|
||||
function (result, data, funcData, textStatus, jqXHR) {
|
||||
if (funcData.success) {
|
||||
let box = new DuplicatorModalBox({
|
||||
url: data.funcData.redirect_url,
|
||||
openCallback: function (iframe, modalObj) {
|
||||
let body = $(iframe.contentWindow.document.body);
|
||||
// For old packages
|
||||
body.find("#content").css('background-color', 'white');
|
||||
|
||||
body.on( "click", "#s1-deploy-btn", function() {
|
||||
modalObj.disableClose();
|
||||
});
|
||||
}
|
||||
});
|
||||
box.open();
|
||||
//window.location.href = data.funcData.redirect_url;
|
||||
} else {
|
||||
DupPro.addAdminMessage(funcData.message, 'error');
|
||||
}
|
||||
return '';
|
||||
},
|
||||
function(data) {
|
||||
<?php $alert5->showAlert(); ?>
|
||||
console.log(data);
|
||||
return '';
|
||||
}
|
||||
);
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
/* Virtual states that UI uses for easier tracking of the three general states a package can be in*/
|
||||
DupPro.Pack.ProcessingStats = {
|
||||
PendingCancellation: -3,
|
||||
Pending: 0,
|
||||
Building: 1,
|
||||
Storing: 2,
|
||||
Finished: 3,
|
||||
}
|
||||
|
||||
DupPro.Pack.setIntervalID = -1;
|
||||
|
||||
DupPro.Pack.SetUpdateInterval = function(period) {
|
||||
if (DupPro.Pack.setIntervalID != -1) {
|
||||
clearInterval(DupPro.Pack.setIntervalID);
|
||||
DupPro.Pack.setIntervalID = -1
|
||||
}
|
||||
DupPro.Pack.setIntervalID = setInterval(DupPro.Pack.UpdateUnfinishedPackages, period * 1000);
|
||||
}
|
||||
|
||||
DupPro.Pack.UpdateUnfinishedPackages = function() {
|
||||
let packagesTables = $('.dup-packtbl');
|
||||
|
||||
var data = {
|
||||
action: 'duplicator_pro_get_package_statii',
|
||||
nonce: '<?php echo esc_js(wp_create_nonce('duplicator_pro_get_package_statii')); ?>',
|
||||
offset: <?php echo (int) $offset; ?>,
|
||||
limit: <?php echo (int) $perPage; ?>,
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: ajaxurl,
|
||||
dataType: "text",
|
||||
timeout: 10000000,
|
||||
data: data,
|
||||
complete: function() {},
|
||||
success: function(respData) {
|
||||
try {
|
||||
var data = DupPro.parseJSON(respData);
|
||||
} catch (err) {
|
||||
// console.error(err);
|
||||
console.error('JSON parse failed for response data: ' + respData);
|
||||
DupPro.Pack.SetUpdateInterval(60);
|
||||
console.log(respData);
|
||||
return false;
|
||||
}
|
||||
|
||||
let currentFirstPackageId = -1;
|
||||
let statiiFistPackageId = -1;
|
||||
if (packagesTables.find('.dup-row').length) {
|
||||
currentFirstPackageId = packagesTables.find('.dup-row').first().data('package-id');
|
||||
}
|
||||
if (data.length) {
|
||||
statiiFistPackageId = data[0].ID;
|
||||
}
|
||||
if (currentFirstPackageId != statiiFistPackageId) {
|
||||
window.location = <?php echo SnapJson::jsonEncode($reloadPackagesURL); ?>;
|
||||
}
|
||||
|
||||
|
||||
var activePackagePresent = false;
|
||||
|
||||
for (package_info_key in data) {
|
||||
var package_info = data[package_info_key];
|
||||
var statusSelector = '#status-' + package_info.ID;
|
||||
var packageRowSelector = '#dup-row-pack-id-' + package_info.ID;
|
||||
var packageSizeSelector = packageRowSelector + ' .dup-size-column';
|
||||
var current_value_string = $(statusSelector).text();
|
||||
var current_value = parseInt(current_value_string);
|
||||
var currentProcessingState;
|
||||
|
||||
if (current_value == -3) {
|
||||
currentProcessingState = DupPro.Pack.ProcessingStats.PendingCancellation;
|
||||
} else if (current_value == 0) {
|
||||
currentProcessingState = DupPro.Pack.ProcessingStats.Pending;
|
||||
} else if ((current_value >= 0) && (current_value < 75)) {
|
||||
currentProcessingState = DupPro.Pack.ProcessingStats.Building;
|
||||
} else if ((current_value >= 75) && (current_value < 100)) {
|
||||
currentProcessingState = DupPro.Pack.ProcessingStats.Storing;
|
||||
} else {
|
||||
// Has to be negative(error) or 100 - both mean complete
|
||||
currentProcessingState = DupPro.Pack.ProcessingStats.Finished;
|
||||
}
|
||||
if (currentProcessingState == DupPro.Pack.ProcessingStats.Pending) {
|
||||
if (package_info.status != 0) {
|
||||
window.location = window.location.href;
|
||||
}
|
||||
} else if (currentProcessingState == DupPro.Pack.ProcessingStats.Building) {
|
||||
if ((package_info.status >= 75) || (package_info.status < 0)) {
|
||||
// Transitioned to storing so refresh
|
||||
window.location = window.location.href;
|
||||
break;
|
||||
} else {
|
||||
|
||||
activePackagePresent = true;
|
||||
$(statusSelector).text(package_info.status);
|
||||
$(packageSizeSelector).hide().fadeIn(1000).text(package_info.size);
|
||||
}
|
||||
} else if (currentProcessingState == DupPro.Pack.ProcessingStats.Storing) {
|
||||
if ((package_info.status == 100) || (package_info.status < 0)) {
|
||||
// Transitioned to storing so refresh
|
||||
window.location = window.location.href;
|
||||
break;
|
||||
} else {
|
||||
activePackagePresent = true;
|
||||
$('#dpro-progress-status-message-transfer-msg').html(package_info.status_progress_text);
|
||||
var statusProgressSelector = '#status-progress-' + package_info.ID;
|
||||
$(statusProgressSelector).text(package_info.status_progress);
|
||||
console.log("status progress: " + package_info.status_progress);
|
||||
}
|
||||
} else if (currentProcessingState == DupPro.Pack.ProcessingStats.PendingCancellation) {
|
||||
if ((package_info.status == -2) || (package_info.status == -4)) {
|
||||
// refresh when its gone to cancelled
|
||||
window.location = window.location.href;
|
||||
} else {
|
||||
activePackagePresent = true;
|
||||
}
|
||||
} else if (currentProcessingState == DupPro.Pack.ProcessingStats.Finished) {
|
||||
// IF something caused the package to come out of finished refresh everything (has to be out of finished or error state)
|
||||
if ((package_info.status != 100) && (package_info.status > 0)) {
|
||||
// wait one miutes to prevent a realod loop
|
||||
setTimeout(function() {
|
||||
window.location = window.location.href;
|
||||
}, 60000);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (activePackagePresent) {
|
||||
$('#dup-pro-create-new').addClass('disabled');
|
||||
DupPro.Pack.SetUpdateInterval(10);
|
||||
} else {
|
||||
$('#dup-pro-create-new').removeClass('disabled');
|
||||
// Kick refresh down to 60 seconds if nothing is being actively worked on
|
||||
DupPro.Pack.SetUpdateInterval(60);
|
||||
}
|
||||
},
|
||||
error: function(data) {
|
||||
DupPro.Pack.SetUpdateInterval(60);
|
||||
console.log(data);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
//Init
|
||||
DupPro.UI.Clock(DupPro._WordPressInitTime);
|
||||
DupPro.Pack.UpdateUnfinishedPackages();
|
||||
|
||||
$('.dpro-btn-open-recovery-box').click(function(event) {
|
||||
event.preventDefault();
|
||||
|
||||
let packageId = $(this).data('package-id');
|
||||
|
||||
Duplicator.Util.ajaxWrapper(
|
||||
{
|
||||
action: 'duplicator_pro_get_recovery_box_content',
|
||||
packageId: packageId,
|
||||
nonce: '<?php echo esc_js(wp_create_nonce('duplicator_pro_get_recovery_box_content')); ?>'
|
||||
},
|
||||
function (result, data, funcData, textStatus, jqXHR) {
|
||||
if (funcData.success) {
|
||||
let boxContent = funcData.content;
|
||||
if (funcData.isRecoveable) {
|
||||
<?php
|
||||
$availableRecoveryBox->updateMessage('boxContent');
|
||||
$availableRecoveryBox->showAlert();
|
||||
?>
|
||||
$('.dup-pro-recovery-download-launcher').off().click(function () {
|
||||
DupPro.Pack.downloadLauncher();
|
||||
});
|
||||
} else {
|
||||
<?php
|
||||
$unavailableRecoveryBox->updateMessage('boxContent');
|
||||
$unavailableRecoveryBox->showAlert();
|
||||
?>
|
||||
}
|
||||
} else {
|
||||
DupPro.addAdminMessage(funcData.message, 'error');
|
||||
}
|
||||
return '';
|
||||
}
|
||||
);
|
||||
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Duplicator package row in table packages list
|
||||
*
|
||||
* @package Duplicator
|
||||
* @copyright (c) 2022, Snap Creek LLC
|
||||
*/
|
||||
|
||||
use Duplicator\Models\Storages\StoragesUtil;
|
||||
|
||||
defined("ABSPATH") or die("");
|
||||
|
||||
/**
|
||||
* Variables
|
||||
*
|
||||
* @var \Duplicator\Core\Controllers\ControllersManager $ctrlMng
|
||||
* @var \Duplicator\Core\Views\TplMng $tplMng
|
||||
* @var array<string, mixed> $tplData
|
||||
*/
|
||||
|
||||
$global = DUP_PRO_Global_Entity::getInstance();
|
||||
$maxDefaultPackages = StoragesUtil::getDefaultStorage()->getMaxPackages();
|
||||
$toolTipContent = sprintf(
|
||||
esc_attr__(
|
||||
'The number of packages to keep is set at [%d]. To change this setting go to
|
||||
Duplicator Pro > Storage > Default > Max Packages and change the value, otherwise this note can be ignored.',
|
||||
'duplicator-pro'
|
||||
),
|
||||
$maxDefaultPackages
|
||||
);
|
||||
?>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th colspan="11">
|
||||
<div class="dup-pack-status-info">
|
||||
<?php if ($maxDefaultPackages < $tplData['totalElements'] && $maxDefaultPackages != 0) { ?>
|
||||
<?php echo esc_html__("Note: max package retention enabled", 'duplicator-pro'); ?>
|
||||
<i
|
||||
class="fas fa-question-circle fa-sm"
|
||||
data-tooltip-title="<?php esc_attr_e("Storage Packages", 'duplicator-pro'); ?>"
|
||||
data-tooltip="<?php echo esc_attr($toolTipContent); ?>"
|
||||
>
|
||||
</i>
|
||||
<?php } else { ?>
|
||||
|
||||
<?php } ?>
|
||||
</div>
|
||||
</th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
@@ -0,0 +1,89 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Duplicator package row in table packages list
|
||||
*
|
||||
* @package Duplicator
|
||||
* @copyright (c) 2022, Snap Creek LLC
|
||||
*/
|
||||
|
||||
use Duplicator\Addons\ProBase\License\License;
|
||||
|
||||
defined("ABSPATH") or die("");
|
||||
|
||||
/**
|
||||
* Variables
|
||||
*
|
||||
* @var \Duplicator\Core\Controllers\ControllersManager $ctrlMng
|
||||
* @var \Duplicator\Core\Views\TplMng $tplMng
|
||||
* @var array<string, mixed> $tplData
|
||||
*/
|
||||
|
||||
$global = DUP_PRO_Global_Entity::getInstance();
|
||||
|
||||
if ($global->installer_name_mode == DUP_PRO_Global_Entity::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-pro'
|
||||
);
|
||||
} else {
|
||||
$packageExeNameModeMsg = __(
|
||||
"When clicking the Installer download button, the 'Save as' dialog is defaulting the name to '[name]_[hash]_[date]_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-pro'
|
||||
);
|
||||
}
|
||||
|
||||
global $packagesViewData;
|
||||
|
||||
$tooltipContent = $tplMng->render('admin_pages/packages/packages_table_head_status_icons', [], false);
|
||||
?>
|
||||
<h2 class="screen-reader-text">Packages list</h2>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="dup-check-column" style="width:10px;">
|
||||
<input
|
||||
type="checkbox"
|
||||
id="dup-chk-all"
|
||||
title="<?php esc_attr_e("Select all packages", 'duplicator-pro') ?>"
|
||||
style="margin-left:15px" onclick="DupPro.Pack.SetDeleteAll()" />
|
||||
</th>
|
||||
<th class="dup-name-column" >
|
||||
<?php esc_html_e("Backup Name", 'duplicator-pro') ?>
|
||||
</th>
|
||||
<th class="dup-note-column">
|
||||
<?php esc_html_e("Note", 'duplicator-pro') ?>
|
||||
</th>
|
||||
<th class="dup-storages-column">
|
||||
<?php esc_html_e("Storages", 'duplicator-pro') ?>
|
||||
</th>
|
||||
<th class="dup-flags-column">
|
||||
<?php esc_html_e("Status", 'duplicator-pro') ?>
|
||||
<i
|
||||
class="fa-solid fa-circle-info"
|
||||
data-tooltip-title="<?php esc_attr_e("Status Icons", 'duplicator-pro'); ?>"
|
||||
data-tooltip="<?php echo esc_attr($tooltipContent); ?>"
|
||||
></i>
|
||||
</th>
|
||||
<th class="dup-created-column">
|
||||
<?php esc_html_e("Created", 'duplicator-pro') ?>
|
||||
</th>
|
||||
<th class="dup-age-column">
|
||||
<?php esc_html_e("Age", 'duplicator-pro') ?>
|
||||
</th>
|
||||
<th class="dup-size-column">
|
||||
<?php esc_html_e("Size", 'duplicator-pro') ?>
|
||||
</th>
|
||||
<th class="dup-download-column" style="width:75px;"></th>
|
||||
<th class="dup-restore-column" style="width:25px;"></th>
|
||||
<th id="dup-header-chkall" class="dup-details-column" >
|
||||
<?php if ($tplData['totalElements'] > 0) { ?>
|
||||
<a href="javascript:void(0)" class="button button-link"><i class="fas fa-chevron-left"></i></a>
|
||||
<?php } ?>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -0,0 +1,80 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Duplicator package row in table packages list
|
||||
*
|
||||
* @package Duplicator
|
||||
* @copyright (c) 2022, Snap Creek LLC
|
||||
*/
|
||||
|
||||
use Duplicator\Addons\ProBase\License\License;
|
||||
use Duplicator\Views\ViewHelper;
|
||||
|
||||
defined("ABSPATH") or die("");
|
||||
|
||||
/**
|
||||
* Variables
|
||||
*
|
||||
* @var \Duplicator\Core\Controllers\ControllersManager $ctrlMng
|
||||
* @var \Duplicator\Core\Views\TplMng $tplMng
|
||||
* @var array<string, mixed> $tplData
|
||||
*/
|
||||
?>
|
||||
<ul class="dup-status-icons-list" >
|
||||
<li>
|
||||
<span class="icon-wrapper" ><i class="fa-solid fa-hand" ></i></span>
|
||||
<?php esc_html_e('Manual Backup', 'duplicator-pro'); ?>
|
||||
</li>
|
||||
<li>
|
||||
<span class="icon-wrapper" ><i class="fa-solid fa-clock" ></i></span>
|
||||
<?php esc_attr_e('Schedule Backup', 'duplicator-pro') ?>
|
||||
</li>
|
||||
<li>
|
||||
<span class="icon-wrapper" ><i class="fa-solid fa-hard-drive"></i></span>
|
||||
<?php
|
||||
echo wp_kses(
|
||||
__('The Backup is in a Local Storage <b>[clickable]</b>', 'duplicator-pro'),
|
||||
ViewHelper::GEN_KSES_TAGS
|
||||
);
|
||||
?>
|
||||
</li>
|
||||
<li>
|
||||
<span class="icon-wrapper" ><i class="fa-solid fa-cloud"></i></span>
|
||||
<?php
|
||||
echo wp_kses(
|
||||
__('The Backup is in a Remote Storage <b>[clickable]</b>', 'duplicator-pro'),
|
||||
ViewHelper::GEN_KSES_TAGS
|
||||
);
|
||||
?>
|
||||
</li>
|
||||
<li>
|
||||
<span class="icon-wrapper" ><i class="fa-solid fa-database"></i></span>
|
||||
<?php esc_attr_e('Database Only Backup', 'duplicator-pro') ?>
|
||||
</li>
|
||||
<li>
|
||||
<span class="icon-wrapper" ><i class="fa-solid fa-images"></i></span>
|
||||
<?php esc_attr_e('Media Only Backup', 'duplicator-pro') ?>
|
||||
</li>
|
||||
<li>
|
||||
<span class="icon-wrapper" ><?php ViewHelper::disasterIcon(true, 'link-style no-decoration'); ?></span>
|
||||
<?php
|
||||
echo wp_kses(
|
||||
__('This Backup is available for Disaster Recovery <b>[clickable]</b>', 'duplicator-pro'),
|
||||
ViewHelper::GEN_KSES_TAGS
|
||||
);
|
||||
?>
|
||||
</li>
|
||||
<li>
|
||||
<span class="icon-wrapper" ><?php ViewHelper::disasterIcon(true, 'green'); ?></span>
|
||||
<?php
|
||||
echo wp_kses(
|
||||
__('Disaster Recovery URL is set on this Backup <b>[clickable]</b>', 'duplicator-pro'),
|
||||
ViewHelper::GEN_KSES_TAGS
|
||||
);
|
||||
?>
|
||||
</li>
|
||||
<li>
|
||||
<span class="icon-wrapper" ><i class="fa-solid fa-clock-rotate-left maroon"></i></span>
|
||||
<?php esc_attr_e('This Backup is created after the Last Restored Backup', 'duplicator-pro') ?>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Duplicator package row in table packages list
|
||||
*
|
||||
* @package Duplicator
|
||||
* @copyright (c) 2022, Snap Creek LLC
|
||||
*/
|
||||
|
||||
use Duplicator\Controllers\RecoveryController;
|
||||
use Duplicator\Package\Recovery\RecoveryPackage;
|
||||
|
||||
defined("ABSPATH") or die("");
|
||||
|
||||
/**
|
||||
* Variables
|
||||
*
|
||||
* @var \Duplicator\Core\Controllers\ControllersManager $ctrlMng
|
||||
* @var \Duplicator\Core\Views\TplMng $tplMng
|
||||
* @var array<string, mixed> $tplData
|
||||
*/
|
||||
?>
|
||||
<div class="dup-pro-toolbar-recovery-info margin-bottom-1">
|
||||
<?php
|
||||
if (RecoveryPackage::getRecoverPackageId() === false) {
|
||||
$tplMng->render('admin_pages/packages/recovery_info/no_recovery_set');
|
||||
} else {
|
||||
RecoveryController::renderRecoveryWidged(
|
||||
array(
|
||||
'selector' => false,
|
||||
'subtitle' => '',
|
||||
'copyLink' => true,
|
||||
'copyButton' => true,
|
||||
'launch' => true,
|
||||
'download' => true,
|
||||
'info' => true,
|
||||
)
|
||||
);
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
@@ -0,0 +1,88 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Duplicator package row in table packages list
|
||||
*
|
||||
* @package Duplicator
|
||||
* @copyright (c) 2022, Snap Creek LLC
|
||||
*/
|
||||
|
||||
use Duplicator\Views\ViewHelper;
|
||||
|
||||
defined("ABSPATH") or die("");
|
||||
|
||||
/**
|
||||
* Variables
|
||||
*
|
||||
* @var \Duplicator\Core\Controllers\ControllersManager $ctrlMng
|
||||
* @var \Duplicator\Core\Views\TplMng $tplMng
|
||||
* @var array<string, mixed> $tplData
|
||||
*/
|
||||
?>
|
||||
<h3 class="dup-title maroon">
|
||||
<?php ViewHelper::disasterIcon(); ?> <?php esc_html_e('Disaster Recovery - None Set', 'duplicator-pro'); ?>
|
||||
</h3>
|
||||
<?php
|
||||
esc_html_e(
|
||||
'The recovery point can quickly restore a site to a prior state for any reason. To activate a recovery point follow these steps:',
|
||||
'duplicator-pro'
|
||||
);
|
||||
?>
|
||||
<ol>
|
||||
<li>
|
||||
<?php
|
||||
printf(
|
||||
esc_html__('Select a recovery package with the icon %s displayed*.', 'duplicator-pro'),
|
||||
wp_kses(
|
||||
ViewHelper::disasterIcon(false),
|
||||
['i' => ['class' => []]]
|
||||
)
|
||||
);
|
||||
?>
|
||||
</li>
|
||||
<li>
|
||||
<?php
|
||||
printf(
|
||||
esc_html_x(
|
||||
'Open details area %1$s and click the "Recover Package..." buttton.',
|
||||
'%1$s represents an icon',
|
||||
'duplicator-pro'
|
||||
),
|
||||
'<i class="fas fa-chevron-left fa-sm fa-fw"></i>'
|
||||
);
|
||||
?>
|
||||
</li>
|
||||
<li>
|
||||
<?php esc_html_e('Follow the prompts and choose the action to perform.', 'duplicator-pro'); ?>
|
||||
</li>
|
||||
</ol>
|
||||
<hr/>
|
||||
<p>
|
||||
<b><?php esc_html_e('Additional Details:', 'duplicator-pro'); ?></b>
|
||||
<?php
|
||||
esc_html_e(
|
||||
'Once a recovery point is set you can save the "Recovery Key" URL in a safe place for restoration later in the event your site goes down, gets
|
||||
hacked or basically any reason you need to restore a site. In the event you still have access to your site you can also launch the recover
|
||||
wizard from the details menu.',
|
||||
'duplicator-pro'
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
<small>
|
||||
<i>
|
||||
<?php
|
||||
printf(
|
||||
esc_html__(
|
||||
'*Note: If you do not see a recovery package %s icon in the packages list.
|
||||
Then be sure to build a full package that does not exclude any of the core WordPress files or database tables.
|
||||
These core files and tables are required to build a valid recovery point.',
|
||||
'duplicator-pro'
|
||||
),
|
||||
wp_kses(
|
||||
ViewHelper::disasterIcon(false),
|
||||
['i' => ['class' => []]]
|
||||
)
|
||||
);
|
||||
?>
|
||||
</i>
|
||||
</small>
|
||||
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Duplicator package row in table packages list
|
||||
*
|
||||
* @package Duplicator
|
||||
* @copyright (c) 2022, Snap Creek LLC
|
||||
*/
|
||||
|
||||
use Duplicator\Package\Recovery\RecoveryPackage;
|
||||
use Duplicator\Views\ViewHelper;
|
||||
|
||||
defined("ABSPATH") or die("");
|
||||
|
||||
/**
|
||||
* Variables
|
||||
*
|
||||
* @var \Duplicator\Core\Controllers\ControllersManager $ctrlMng
|
||||
* @var \Duplicator\Core\Views\TplMng $tplMng
|
||||
* @var array<string, mixed> $tplData
|
||||
* @var \DUP_PRO_Package $package
|
||||
*/
|
||||
|
||||
$package = $tplData['package'];
|
||||
$isRecoveable = RecoveryPackage::isPackageIdRecoveable($package->ID);
|
||||
|
||||
if ($isRecoveable) {
|
||||
$tplMng->render('admin_pages/packages/recovery_info/row_recovery_box_available');
|
||||
} else {
|
||||
$tplMng->render('admin_pages/packages/recovery_info/row_recovery_box_unavailable');
|
||||
}
|
||||
?>
|
||||
<hr class="margin-top-1 margin-bottom-1" >
|
||||
<small><i>
|
||||
<?php
|
||||
echo wp_kses(
|
||||
__(
|
||||
'The <b>Disaster Recovery</b> is a streamlined Restore Backup system used to rapidly restore your site from a disaster.
|
||||
A functioning <b>WordPress backend is not required</b>, only the LINK or the Launcher provided with the Disaster Recovery
|
||||
is needed to restore the Backup.',
|
||||
'duplicator-pro'
|
||||
),
|
||||
ViewHelper::GEN_KSES_TAGS
|
||||
);
|
||||
?>
|
||||
<br>
|
||||
<?php
|
||||
printf(
|
||||
wp_kses(
|
||||
_x(
|
||||
'Backups that are not Disaster Recovery eligible will can to use the <b>Restore Backup button</b>
|
||||
or %1$sstandard install modes%2$s for re-deployment.',
|
||||
'%1$s and %2$s represents the opening and closing HTML tags for an anchor or link',
|
||||
'duplicator-pro'
|
||||
),
|
||||
ViewHelper::GEN_KSES_TAGS
|
||||
),
|
||||
'<a href="' . esc_url(DUPLICATOR_PRO_DUPLICATOR_DOCS_URL . 'recover-a-backup') . '" target="_blank">',
|
||||
'</a>'
|
||||
);
|
||||
?>
|
||||
</i></small>
|
||||
@@ -0,0 +1,81 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Duplicator package row in table packages list
|
||||
*
|
||||
* @package Duplicator
|
||||
* @copyright (c) 2022, Snap Creek LLC
|
||||
*/
|
||||
|
||||
use Duplicator\Controllers\PackagesPageController;
|
||||
use Duplicator\Controllers\RecoveryController;
|
||||
use Duplicator\Core\Controllers\ControllersManager;
|
||||
use Duplicator\Core\Views\TplMng;
|
||||
use Duplicator\Package\Recovery\RecoveryPackage;
|
||||
use Duplicator\Views\ViewHelper;
|
||||
|
||||
/**
|
||||
* Variables
|
||||
*
|
||||
* @var ControllersManager $ctrlMng
|
||||
* @var TplMng $tplMng
|
||||
* @var array<string, mixed> $tplData
|
||||
* @var DUP_PRO_Package $package
|
||||
*/
|
||||
$package = $tplData['package'];
|
||||
$isRecoverPoint = (RecoveryPackage::getRecoverPackageId() === $package->ID);
|
||||
|
||||
$colorClass = ($isRecoverPoint ? 'green' : '');
|
||||
?>
|
||||
<h3 class="dup-title margin-top-0">
|
||||
<?php ViewHelper::disasterIcon(true, $colorClass); ?>
|
||||
<?php
|
||||
if ($isRecoverPoint) {
|
||||
esc_html_e('Disaster Recovery - Is Set on this Backup', 'duplicator-pro');
|
||||
} else {
|
||||
esc_html_e('Disaster Recovery - Is Available for this Backup', 'duplicator-pro');
|
||||
}
|
||||
?>
|
||||
</h3>
|
||||
|
||||
<?php $tplMng->render('parts/recovery/package_info_mini'); ?>
|
||||
<hr class="margin-top-1 margin-bottom-1" >
|
||||
|
||||
<?php if ($isRecoverPoint) {
|
||||
RecoveryController::renderRecoveryWidged([
|
||||
'details' => false,
|
||||
'selector' => false,
|
||||
'subtitle' => '',
|
||||
'copyLink' => false,
|
||||
'copyButton' => true,
|
||||
'launch' => false,
|
||||
'download' => true,
|
||||
'info' => true,
|
||||
]);
|
||||
} else {
|
||||
$setRecoveryLink = PackagesPageController::getInstance()->getActionByKey(PackagesPageController::ACTION_SET_RECOVERY_POINT)->getUrl(
|
||||
['recovery_package' => $package->ID]
|
||||
);
|
||||
?>
|
||||
<div class="dup-pro-recovery-widget-wrapper" >
|
||||
<div class="dup-pro-recovery-point-actions" >
|
||||
<div class="dup-pro-recovery-buttons">
|
||||
<a
|
||||
href="<?php echo esc_url($setRecoveryLink); ?>"
|
||||
class="button button-primary dpro-btn-set-recovery"
|
||||
data-package-id="<?php echo (int) $package->ID; ?>"
|
||||
>
|
||||
<span><?php ViewHelper::disasterIcon(); ?>
|
||||
<?php esc_html_e("Set Disaster Recovery", 'duplicator-pro'); ?></span>
|
||||
<i
|
||||
class="fas fa-question-circle fa-sm dup-base-color white"
|
||||
data-tooltip-title="<?php esc_attr_e("Activate Recovery", 'duplicator-pro'); ?>"
|
||||
data-tooltip="<?php esc_attr_e("This action will set this package as the active Disaster Recovery Backup.", 'duplicator-pro'); ?>"
|
||||
aria-expanded="false"
|
||||
>
|
||||
</i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php }
|
||||
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Duplicator package row in table packages list
|
||||
*
|
||||
* @package Duplicator
|
||||
* @copyright (c) 2022, Snap Creek LLC
|
||||
*/
|
||||
|
||||
use Duplicator\Package\Recovery\RecoveryStatus;
|
||||
use Duplicator\Views\ViewHelper;
|
||||
|
||||
defined("ABSPATH") or die("");
|
||||
|
||||
/**
|
||||
* Variables
|
||||
*
|
||||
* @var \Duplicator\Core\Controllers\ControllersManager $ctrlMng
|
||||
* @var \Duplicator\Core\Views\TplMng $tplMng
|
||||
* @var array<string, mixed> $tplData
|
||||
* @var \DUP_PRO_Package $package
|
||||
*/
|
||||
$package = $tplData['package'];
|
||||
|
||||
$tooltipContent = __('A package recovery point status is not required to be enabled and in some cases is desirable.', 'duplicator-pro') . ' ' .
|
||||
__('For example you may want to backup only your database.', 'duplicator-pro') . ' ' .
|
||||
__(
|
||||
'In this case you can still run a database only install, however the ability to use the recovery point installer will be unavailable.',
|
||||
'duplicator-pro'
|
||||
);
|
||||
?>
|
||||
|
||||
<h3 class="dup-title margin-top-0">
|
||||
<?php ViewHelper::disasterIcon(true, 'maroon'); ?>
|
||||
<?php esc_html_e('Disaster Recovery - Isn\'t Available for this Backup', 'duplicator-pro'); ?>
|
||||
<sup>
|
||||
<i class="fas fa-question-circle fa-xs"
|
||||
data-tooltip-title="<?php esc_attr_e('Recovery', 'duplicator-pro'); ?>"
|
||||
data-tooltip="<?php echo esc_attr($tooltipContent); ?>">
|
||||
</i>
|
||||
</sup>
|
||||
</h3>
|
||||
|
||||
<?php $tplMng->render('parts/recovery/package_info_mini'); ?>
|
||||
<hr class="margin-top-1 margin-bottom-1" >
|
||||
|
||||
<?php
|
||||
$recoverStatus = new RecoveryStatus($package);
|
||||
$tplMng->render('parts/recovery/exclude_data_box', array('recoverStatus' => $recoverStatus));
|
||||
@@ -0,0 +1,206 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Duplicator package row in table packages list
|
||||
*
|
||||
* @package Duplicator
|
||||
* @copyright (c) 2022, Snap Creek LLC
|
||||
*/
|
||||
|
||||
use Duplicator\Controllers\ImportPageController;
|
||||
use Duplicator\Controllers\SettingsPageController;
|
||||
use Duplicator\Controllers\StoragePageController;
|
||||
use Duplicator\Core\CapMng;
|
||||
|
||||
defined("ABSPATH") or die("");
|
||||
|
||||
/**
|
||||
* Variables
|
||||
*
|
||||
* @var \Duplicator\Core\Controllers\ControllersManager $ctrlMng
|
||||
* @var \Duplicator\Core\Views\TplMng $tplMng
|
||||
* @var array<string, mixed> $tplData
|
||||
* @var ?DUP_PRO_Package $package
|
||||
*/
|
||||
|
||||
$global = DUP_PRO_Global_Entity::getInstance();
|
||||
$package = $tplData['package'];
|
||||
$archive_exists = ($package->getLocalPackageFilePath(DUP_PRO_Package_File_Type::Archive) != false);
|
||||
$installer_exists = ($package->getLocalPackageFilePath(DUP_PRO_Package_File_Type::Installer) != false);
|
||||
$archiveDownloadURL = $package->getLocalPackageFileURL(DUP_PRO_Package_File_Type::Archive);
|
||||
$installerDownloadURL = $package->getLocalPackageFileURL(DUP_PRO_Package_File_Type::Installer);
|
||||
$defaultStorageUrl = StoragePageController::getEditDefaultUrl();
|
||||
|
||||
$txt_RequiresRemote = sprintf(
|
||||
"%s <a href='{$defaultStorageUrl}' target='_blank'>%s <i class='far fa-hdd fa-fw fa-sm'></i></a>",
|
||||
__('This option requires the package to use the built-in default', 'duplicator-pro'),
|
||||
__('storage location', 'duplicator-pro')
|
||||
);
|
||||
|
||||
?>
|
||||
<div class="dup-ovr-ctrls-hdrs">
|
||||
<i class="fas fa-link fa-fw"></i>
|
||||
<b><?php esc_html_e('Install Resources', 'duplicator-pro');?> <br/></b>
|
||||
<span class="dup-info-msg01">
|
||||
<?php esc_html_e('Links are sensitive. Keep them safe!', 'duplicator-pro');?>
|
||||
</span>
|
||||
|
||||
<?php if (CapMng::can(CapMng::CAP_STORAGE, false)) { ?>
|
||||
<a class="dup-ovr-ref-links-more no-outline" href="javascript:void(0)"
|
||||
onclick="DupPro.Pack.ShowRemote(<?php echo (int) $package->ID; ?>, '<?php echo esc_js($package->NameHash); ?>');">
|
||||
<i class="fas fa-server fa-xs"></i>
|
||||
<?php esc_html_e('Storages ...', 'duplicator-pro');?>
|
||||
</a>
|
||||
<?php } ?>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<!-- =======================
|
||||
ARCHIVE FILE: -->
|
||||
<div class="dup-ovr-copy-flex-box">
|
||||
<div class="flex-item">
|
||||
<i class="far fa-file-archive fa-fw"></i>
|
||||
<b><?php esc_html_e('Archive File', 'duplicator-pro');?></b>
|
||||
<sup>
|
||||
<?php
|
||||
$archiveFileToolTipTitle = sprintf(
|
||||
__('This link is used with the <a href=\'%1$s\'>%2$s</a> %3$s', 'duplicator-pro'),
|
||||
esc_url(ImportPageController::getInstance()->getMenuLink()),
|
||||
__('Import Link Install', 'duplicator-pro'),
|
||||
__(
|
||||
'feature. Use the Copy Link button to copy this URL archive file link to import on another WordPress site.',
|
||||
'duplicator-pro'
|
||||
)
|
||||
);?>
|
||||
<i class="fas fa-question-circle fa-xs fa-fw dup-archive-help"
|
||||
data-tooltip-title="<?php esc_attr_e("Archive File", 'duplicator-pro'); ?>"
|
||||
data-tooltip="<?php echo esc_attr($archiveFileToolTipTitle);?>"></i>
|
||||
</sup>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="flex-item"></div>
|
||||
</div>
|
||||
|
||||
<div class="dup-ovr-copy-flex-box dup-box-file">
|
||||
<?php if ($archive_exists) : ?>
|
||||
<div class="flex-item">
|
||||
<input type="text" class="dup-ovr-ref-links" readonly="readonly"
|
||||
value="<?php echo esc_attr($archiveDownloadURL); ?>"
|
||||
title="<?php echo esc_attr($archiveDownloadURL); ?>"
|
||||
onfocus="jQuery(this).select();" />
|
||||
<span class="fas fa-arrow-alt-circle-down dup-ovr-ref-links-icon"
|
||||
title="<?php esc_attr_e('Archive Import Link (URL)', 'duplicator-pro');?>"></span>
|
||||
</div>
|
||||
<div class="flex-item">
|
||||
<span onclick="jQuery(this).parent().parent().find('.dup-ovr-ref-links').select();">
|
||||
<span data-dup-copy-value="<?php echo esc_attr($archiveDownloadURL); ?>"
|
||||
class="dup-ovr-ref-copy no-select">
|
||||
<i class='far fa-copy dup-cursor-pointer'></i>
|
||||
<?php esc_html_e('Copy Link', 'duplicator-pro');?>
|
||||
</span>
|
||||
</span>
|
||||
<span class="dup-ovr-ref-dwnld"
|
||||
aria-label="<?php esc_html_e("Download Archive", 'duplicator-pro') ?>"
|
||||
onclick="DupPro.Pack.DownloadFile('<?php echo esc_attr($archiveDownloadURL); ?>',
|
||||
'<?php echo esc_attr($package->get_archive_filename()); ?>');">
|
||||
<i class="fas fa-download"></i> <?php esc_html_e('Download', 'duplicator-pro');?>
|
||||
</span>
|
||||
</div>
|
||||
<?php else : ?>
|
||||
<div class="flex-item maroon">
|
||||
<?php
|
||||
echo wp_kses(
|
||||
$txt_RequiresRemote,
|
||||
[
|
||||
'a' => [
|
||||
'href' => [],
|
||||
'target' => [],
|
||||
],
|
||||
'i' => [
|
||||
'class' => [],
|
||||
],
|
||||
]
|
||||
);
|
||||
?>.
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div><br/>
|
||||
|
||||
<!-- =======================
|
||||
ARCHIVE INSTALLER: -->
|
||||
<?php
|
||||
switch ($global->installer_name_mode) {
|
||||
case DUP_PRO_Global_Entity::INSTALLER_NAME_MODE_SIMPLE:
|
||||
$settingsPackageUrl = SettingsPageController::getInstance()->getMenuLink(SettingsPageController::L2_SLUG_PACKAGE);
|
||||
$lockIcon = 'fa-lock-open';
|
||||
$installerToolTipTitle = sprintf(
|
||||
__(
|
||||
'Using standard installer name. To improve security, switch to hashed change in %1$sSettings%2$s',
|
||||
'duplicator-pro'
|
||||
),
|
||||
'<a href="' . esc_url($settingsPackageUrl) . '" >',
|
||||
'</a>'
|
||||
);
|
||||
break;
|
||||
|
||||
case DUP_PRO_Global_Entity::INSTALLER_NAME_MODE_WITH_HASH:
|
||||
default:
|
||||
$lockIcon = 'fa-lock';
|
||||
$installerToolTipTitle = __('Using more secure, hashed installer name.', 'duplicator-pro');
|
||||
break;
|
||||
}
|
||||
$installerName = $package->Installer->getDownloadName();
|
||||
?>
|
||||
|
||||
<i class="fas fa-bolt fa-fw"></i>
|
||||
<b><?php esc_html_e('Archive Installer', 'duplicator-pro');?></b>
|
||||
<sup>
|
||||
<i class="fas <?php echo esc_attr($lockIcon); ?> dup-cursor-pointer fa-fw fa-xs dup-installer-help"
|
||||
style="padding-left:3px"
|
||||
data-tooltip="<?php echo esc_html($installerToolTipTitle); ?>"></i>
|
||||
</sup>
|
||||
<div class="dup-ovr-copy-flex-box dup-box-installer">
|
||||
<?php if ($installer_exists) : ?>
|
||||
<div class="flex-item">
|
||||
<input type="text" class="dup-ovr-ref-links" readonly="readonly"
|
||||
value="<?php echo esc_attr($installerName); ?>"
|
||||
title="<?php echo esc_attr($installerName); ?>"
|
||||
onfocus="jQuery(this).select();" /><br/>
|
||||
<span class="dup-info-msg01">
|
||||
<?php esc_html_e('These links contain highly sensitive data. Share with extra caution!', 'duplicator-pro');?>
|
||||
</span>
|
||||
</div>
|
||||
<div class="flex-item">
|
||||
<span onclick="jQuery(this).parent().parent().find('.dup-ovr-ref-links').select();">
|
||||
<span data-dup-copy-value="<?php echo esc_attr($installerName); ?>" class="dup-ovr-ref-copy no-select">
|
||||
<i class='far fa-copy dup-cursor-pointer'></i>
|
||||
<?php esc_html_e('Copy Name', 'duplicator-pro');?>
|
||||
</span>
|
||||
</span>
|
||||
<span class="dup-ovr-ref-dwnld"
|
||||
aria-label="<?php esc_html_e("Download Installer", 'duplicator-pro') ?>"
|
||||
onclick="DupPro.Pack.DownloadFile('<?php echo esc_attr($installerDownloadURL); ?>');">
|
||||
<i class="fas fa-download"></i> <?php esc_html_e('Download', 'duplicator-pro');?>
|
||||
</span>
|
||||
</div>
|
||||
<?php else : ?>
|
||||
<div class="flex-item maroon">
|
||||
<?php
|
||||
echo wp_kses(
|
||||
$txt_RequiresRemote,
|
||||
[
|
||||
'a' => [
|
||||
'href' => [],
|
||||
'target' => [],
|
||||
],
|
||||
'i' => [
|
||||
'class' => [],
|
||||
],
|
||||
]
|
||||
);
|
||||
?>.
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
@@ -0,0 +1,120 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Duplicator
|
||||
*/
|
||||
|
||||
use Duplicator\Controllers\PackagesPageController;
|
||||
use Duplicator\Core\CapMng;
|
||||
use Duplicator\Package\Recovery\RecoveryPackage;
|
||||
use Duplicator\Views\ViewHelper;
|
||||
|
||||
defined("ABSPATH") or die("");
|
||||
|
||||
/**
|
||||
* Variables
|
||||
*
|
||||
* @var Duplicator\Core\Controllers\ControllersManager $ctrlMng
|
||||
* @var Duplicator\Core\Views\TplMng $tplMng
|
||||
* @var array<string, mixed> $tplData
|
||||
* @var ?DUP_PRO_Package $package
|
||||
*/
|
||||
|
||||
$package = $tplData['package'];
|
||||
|
||||
$pack_dbonly = $package->isDBOnly();
|
||||
$pack_format = strtolower($package->Archive->Format);
|
||||
$packageDetailsURL = PackagesPageController::getInstance()->getPackageDetailsURL($package->ID);
|
||||
$txt_DBOnly = __('DB Only', 'duplicator-pro');
|
||||
$archive_exists = ($package->getLocalPackageFilePath(DUP_PRO_Package_File_Type::Archive) != false);
|
||||
$isRecoveable = RecoveryPackage::isPackageIdRecoveable($package->ID);
|
||||
|
||||
?>
|
||||
<td colspan="8">
|
||||
<div class="dup-package-row-details-wrapper" >
|
||||
<div class="dup-ovr-hdr">
|
||||
<label onclick="DupPro.Pack.openLinkDetails()">
|
||||
<i class="fas fa-archive"></i>
|
||||
<?php esc_html_e('Package Overview', 'duplicator-pro'); ?>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="dup-ovr-bar-flex-box">
|
||||
<div class="divider">
|
||||
<label><?php esc_html_e('WordPress', 'duplicator-pro');?></label><br/>
|
||||
<?php echo esc_html($package->VersionWP); ?>
|
||||
</div>
|
||||
<div>
|
||||
<label><?php esc_html_e('Format', 'duplicator-pro');?></label><br/>
|
||||
<?php echo esc_html(strtoupper($pack_format)); ?>
|
||||
</div>
|
||||
<div>
|
||||
<label><?php esc_html_e('Files', 'duplicator-pro');?></label><br/>
|
||||
<?php echo ($pack_dbonly)
|
||||
? '<i>' . esc_html($txt_DBOnly) . '</i>'
|
||||
: number_format($package->Archive->FileCount); ?>
|
||||
</div>
|
||||
<div class="divider">
|
||||
<label><?php esc_html_e('Folders', 'duplicator-pro');?></label><br/>
|
||||
<?php echo ($pack_dbonly)
|
||||
? '<i>' . esc_html($txt_DBOnly) . '</i>'
|
||||
: number_format($package->Archive->DirCount) ?>
|
||||
</div>
|
||||
<div class="divider">
|
||||
<label><?php esc_html_e('Tables', 'duplicator-pro');?></label><br/>
|
||||
<?php echo (int) $package->Database->info->tablesFinalCount . 'of' . (int) $package->Database->info->tablesBaseCount; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="dup-ovr-ctrls-flex-box">
|
||||
|
||||
<div class="flex-item">
|
||||
<?php
|
||||
if (CapMng::can(CapMng::CAP_EXPORT, false)) {
|
||||
$tplMng->render('admin_pages/packages/row_parts/details_download_block');
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
<!-- OPTIONS -->
|
||||
<div class="flex-item dup-ovr-opts">
|
||||
<div class="dup-ovr-ctrls-hdrs">
|
||||
<br/><b><?php esc_html_e('Options', 'duplicator-pro');?></b>
|
||||
</div>
|
||||
<a
|
||||
aria-label="<?php esc_attr_e("Go to package details screen", 'duplicator-pro') ?>"
|
||||
class="button dup-details"
|
||||
href="<?php echo esc_url($packageDetailsURL); ?>"
|
||||
>
|
||||
<span><i class="fas fa-search"></i> <?php esc_html_e("View Details", 'duplicator-pro') ?></span>
|
||||
</a>
|
||||
<?php if (CapMng::can(CapMng::CAP_STORAGE, false)) { ?>
|
||||
<?php if ($archive_exists) : ?>
|
||||
<button class="button dup-transfer"
|
||||
aria-label="<?php esc_attr_e('Go to package transfer screen', 'duplicator-pro') ?>"
|
||||
onclick="DupPro.Pack.OpenPackTransfer(<?php echo (int) $package->ID; ?>); return false;">
|
||||
<span><i class="fa fa-exchange-alt fa-fw"></i> <?php esc_html_e("Transfer Package", 'duplicator-pro') ?></span>
|
||||
</button>
|
||||
<?php else : ?>
|
||||
<span title="<?php esc_attr_e('Transfer packages requires the use of built-in default storage!', 'duplicator-pro') ?>">
|
||||
<button class="button disabled" >
|
||||
<span><i class="fa fa-exchange-alt fa-fw"></i> <?php esc_html_e("Transfer Package", 'duplicator-pro') ?></span>
|
||||
</button>
|
||||
</span>
|
||||
<?php endif; ?>
|
||||
<?php } ?>
|
||||
|
||||
<?php if (CapMng::can(CapMng::CAP_BACKUP_RESTORE, false)) { ?>
|
||||
<button
|
||||
aria-label="<?php esc_attr_e("Recover this Package", 'duplicator-pro') ?>"
|
||||
class="button dpro-btn-open-recovery-box <?php echo ($isRecoveable) ? '' : 'maroon'?>"
|
||||
data-package-id="<?php echo (int) $package->ID; ?>"
|
||||
>
|
||||
<?php ViewHelper::disasterIcon(true); ?>
|
||||
<?php esc_html_e("Disaster Recovery", 'duplicator-pro'); ?>
|
||||
</button>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
@@ -0,0 +1,85 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Duplicator
|
||||
*/
|
||||
|
||||
use Duplicator\Core\CapMng;
|
||||
|
||||
defined("ABSPATH") or die("");
|
||||
|
||||
/**
|
||||
* Variables
|
||||
*
|
||||
* @var Duplicator\Core\Controllers\ControllersManager $ctrlMng
|
||||
* @var Duplicator\Core\Views\TplMng $tplMng
|
||||
* @var array<string, mixed> $tplData
|
||||
* @var ?DUP_PRO_Package $package
|
||||
*/
|
||||
|
||||
$package = $tplData['package'];
|
||||
$archive_exists = ($package->getLocalPackageFilePath(DUP_PRO_Package_File_Type::Archive) != false);
|
||||
$installer_exists = ($package->getLocalPackageFilePath(DUP_PRO_Package_File_Type::Installer) != false);
|
||||
$archiveDownloadURL = $package->getLocalPackageFileURL(DUP_PRO_Package_File_Type::Archive);
|
||||
$installerDownloadURL = $package->getLocalPackageFileURL(DUP_PRO_Package_File_Type::Installer);
|
||||
$pack_format = strtolower($package->Archive->Format);
|
||||
|
||||
if (!CapMng::can(CapMng::CAP_EXPORT, false)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($archive_exists) : ?>
|
||||
<nav class="dup-dnload-menu">
|
||||
<button
|
||||
class="dup-dnload-btn button no-select"
|
||||
type="button" aria-haspopup="true">
|
||||
<i class="fa fa-download"></i>
|
||||
<span><?php esc_html_e("Download", 'duplicator-pro'); ?></span>
|
||||
</button>
|
||||
|
||||
<nav class="dup-dnload-menu-items">
|
||||
<button
|
||||
aria-label="<?php esc_html_e("Download Installer and Archive", 'duplicator-pro') ?>"
|
||||
title="<?php echo ($installer_exists ? '' : esc_html__("Unable to locate both package files!", 'duplicator-pro')); ?>"
|
||||
onclick="DupPro.Pack.DownloadFile('<?php echo esc_attr($archiveDownloadURL); ?>',
|
||||
'<?php echo esc_attr($package->get_archive_filename()); ?>');
|
||||
setTimeout(function () {DupPro.Pack.DownloadFile('<?php echo esc_attr($installerDownloadURL); ?>');}, 700);
|
||||
jQuery(this).parent().hide();
|
||||
return false;"
|
||||
class="dup-dnload-both"
|
||||
>
|
||||
<i class="fa fa-fw <?php echo ($installer_exists ? 'fa-download' : 'fa-exclamation-triangle') ?>"></i>
|
||||
<?php esc_html_e("Both Files", 'duplicator-pro') ?>
|
||||
</button>
|
||||
<button
|
||||
aria-label="<?php esc_html_e("Download Installer", 'duplicator-pro') ?>"
|
||||
title="<?php echo ($installer_exists) ? '' : esc_html__("Unable to locate installer package file!", 'duplicator-pro'); ?>"
|
||||
onclick="DupPro.Pack.DownloadFile('<?php echo esc_attr($installerDownloadURL); ?>');
|
||||
jQuery(this).parent().hide();
|
||||
return false;"
|
||||
class="dup-dnload-installer">
|
||||
<i class="fa fa-fw <?php echo ($installer_exists ? 'fa-bolt' : 'fa-exclamation-triangle') ?>"></i>
|
||||
<?php esc_html_e("Installer", 'duplicator-pro') ?>
|
||||
</button>
|
||||
<button
|
||||
aria-label="<?php esc_html_e("Download Archive", 'duplicator-pro') ?>"
|
||||
onclick="DupPro.Pack.DownloadFile('<?php echo esc_attr($archiveDownloadURL); ?>',
|
||||
'<?php echo esc_attr($package->get_archive_filename()); ?>');
|
||||
jQuery(this).parent().hide();
|
||||
return false;"
|
||||
|
||||
class="dup-dnload-archive">
|
||||
<i class="fa-fw far fa-file-archive"></i>
|
||||
<?php echo esc_html__('Archive', 'duplicator-pro') . ' (' . esc_html($pack_format) . ')'; ?>
|
||||
</button>
|
||||
</nav>
|
||||
</nav>
|
||||
<?php else : ?>
|
||||
<div
|
||||
class="dup-dnload-btn-disabled"
|
||||
title="<?php esc_attr_e("No local files found for this package!", 'duplicator-pro'); ?>"
|
||||
onclick="DupPro.Pack.DownloadNotice()"
|
||||
>
|
||||
<i class="fas fa-download fa-fw"></i> <?php esc_html_e("Download", 'duplicator-pro'); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
@@ -0,0 +1,89 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Duplicator
|
||||
*/
|
||||
|
||||
use Duplicator\Core\CapMng;
|
||||
use Duplicator\Package\Recovery\RecoveryPackage;
|
||||
use Duplicator\Views\ViewHelper;
|
||||
|
||||
defined("ABSPATH") or die("");
|
||||
|
||||
/**
|
||||
* Variables
|
||||
*
|
||||
* @var Duplicator\Core\Controllers\ControllersManager $ctrlMng
|
||||
* @var Duplicator\Core\Views\TplMng $tplMng
|
||||
* @var array<string, mixed> $tplData
|
||||
* @var ?DUP_PRO_Package $package
|
||||
*/
|
||||
|
||||
$package = $tplData['package'];
|
||||
|
||||
?>
|
||||
<div class="dup-package-flags" >
|
||||
<?php if ($package->hasFlag(DUP_PRO_Package::FLAG_MANUAL) || $package->hasFlag(DUP_PRO_Package::FLAG_SCHEDULE_RUN_NOW)) { ?>
|
||||
<span class="icon-wrapper" title="<?php esc_attr_e('Manual Backup', 'duplicator-pro') ?>" >
|
||||
<i class="fa-solid fa-hand" ></i>
|
||||
</span>
|
||||
<?php } ?>
|
||||
<?php if ($package->hasFlag(DUP_PRO_Package::FLAG_SCHEDULE)) { ?>
|
||||
<span class="icon-wrapper" title="<?php esc_attr_e('Schedule Backup', 'duplicator-pro') ?>" >
|
||||
<i class="fa-solid fa-clock" ></i>
|
||||
</span>
|
||||
<?php } ?>
|
||||
<?php if ($package->hasFlag(DUP_PRO_Package::FLAG_HAVE_LOCAL)) { ?>
|
||||
<span
|
||||
class="icon-wrapper cursor-pointer"
|
||||
title="<?php esc_attr_e('The Backup is in Local Storage', 'duplicator-pro') ?>"
|
||||
onclick="DupPro.Pack.ShowRemote(<?php echo (int) $package->ID; ?>, '<?php echo esc_js($package->NameHash); ?>');"
|
||||
>
|
||||
<i class="fa-solid fa-hard-drive"></i>
|
||||
</span>
|
||||
<?php } ?>
|
||||
<?php if ($package->hasFlag(DUP_PRO_Package::FLAG_HAVE_REMOTE)) { ?>
|
||||
<span
|
||||
class="icon-wrapper cursor-pointer"
|
||||
title="<?php esc_attr_e('The Backup is in Remote Storage', 'duplicator-pro') ?>"
|
||||
onclick="DupPro.Pack.ShowRemote(<?php echo (int) $package->ID; ?>, '<?php echo esc_js($package->NameHash); ?>');"
|
||||
>
|
||||
<i class="fa-solid fa-cloud"></i>
|
||||
</span>
|
||||
<?php } ?>
|
||||
<?php if ($package->hasFlag(DUP_PRO_Package::FLAG_DB_ONLY)) { ?>
|
||||
<span class="icon-wrapper" title="<?php esc_attr_e('Database Only Backup', 'duplicator-pro') ?>" >
|
||||
<i class="fa-solid fa-database"></i>
|
||||
</span>
|
||||
<?php } ?>
|
||||
<?php if ($package->hasFlag(DUP_PRO_Package::FLAG_MEDIA_ONLY)) { ?>
|
||||
<span class="icon-wrapper" title="<?php esc_attr_e('Media Only Backup', 'duplicator-pro') ?>" >
|
||||
<i class="fa-solid fa-images"></i>
|
||||
</span>
|
||||
<?php } ?>
|
||||
<?php if (CapMng::can(CapMng::CAP_BACKUP_RESTORE, false)) { ?>
|
||||
<?php if ($package->hasFlag(DUP_PRO_Package::FLAG_DISASTER_AVAIABLE) || $package->hasFlag(DUP_PRO_Package::FLAG_DISASTER_SET)) {
|
||||
if ($package->hasFlag(DUP_PRO_Package::FLAG_DISASTER_SET)) {
|
||||
$title = __("Disaster Recovery URL is set on this Backup", 'duplicator-pro');
|
||||
$colorClass = 'green';
|
||||
} else {
|
||||
$colorClass = '';
|
||||
$title = __('This Backup is available for Disaster Recovery', 'duplicator-pro');
|
||||
}
|
||||
?>
|
||||
<span
|
||||
class="dpro-btn-open-recovery-box icon-wrapper link-style no-decoration>"
|
||||
aria-label="<?php echo esc_attr($title); ?>"
|
||||
title="<?php echo esc_attr($title); ?>"
|
||||
data-package-id="<?php echo (int) $package->ID; ?>"
|
||||
>
|
||||
<?php ViewHelper::disasterIcon(true, $colorClass); ?>
|
||||
</span>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php if ($package->hasFlag(DUP_PRO_Package::FLAG_CREATED_AFTER_RESTORE)) { ?>
|
||||
<span class="icon-wrapper" title="<?php esc_attr_e('This Backup is created after the Last Restored Backup', 'duplicator-pro') ?>" >
|
||||
<i class="fa-solid fa-clock-rotate-left maroon"></i>
|
||||
</span>
|
||||
<?php } ?>
|
||||
</div>
|
||||
@@ -0,0 +1,72 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Duplicator
|
||||
*/
|
||||
|
||||
use Duplicator\Controllers\PackagesPageController;
|
||||
|
||||
defined("ABSPATH") or die("");
|
||||
|
||||
/**
|
||||
* Variables
|
||||
*
|
||||
* @var Duplicator\Core\Controllers\ControllersManager $ctrlMng
|
||||
* @var Duplicator\Core\Views\TplMng $tplMng
|
||||
* @var array<string, mixed> $tplData
|
||||
* @var ?DUP_PRO_Package $package
|
||||
*/
|
||||
$package = $tplData['package'];
|
||||
/** @var int */
|
||||
$status = $tplData['status'];
|
||||
?>
|
||||
<div class="progress-error">
|
||||
<?php
|
||||
switch ($status) {
|
||||
case DUP_PRO_PackageStatus::ERROR:
|
||||
$packageDetailsURL = PackagesPageController::getInstance()->getPackageDetailsURL($package->ID);
|
||||
?>
|
||||
<a type="button" class="dup-cell-err-btn button" href="<?php echo esc_url($packageDetailsURL) ?>">
|
||||
<i class="fa fa-exclamation-triangle fa-xs"></i>
|
||||
<?php esc_html_e('Error Processing', 'duplicator-pro') ?>
|
||||
</a>
|
||||
<?php
|
||||
break;
|
||||
case DUP_PRO_PackageStatus::BUILD_CANCELLED:
|
||||
?>
|
||||
<i class="fas fa-info-circle fa-sm"></i>
|
||||
<?php esc_html_e('Build Cancelled', 'duplicator-pro') ?>
|
||||
<?php
|
||||
break;
|
||||
case DUP_PRO_PackageStatus::PENDING_CANCEL:
|
||||
?>
|
||||
<i class="fas fa-info-circle fa-sm"></i>
|
||||
<?php esc_html_e('Cancelling Build', 'duplicator-pro') ?>
|
||||
<?php
|
||||
break;
|
||||
case DUP_PRO_PackageStatus::STORAGE_CANCELLED:
|
||||
?>
|
||||
<i class="fas fa-info-circle fa-sm"></i>
|
||||
<?php esc_html_e('Storage Cancelled', 'duplicator-pro') ?>
|
||||
<?php
|
||||
break;
|
||||
case DUP_PRO_PackageStatus::REQUIREMENTS_FAILED:
|
||||
$packageLogFile = dirname($package->StorePath) . '/' . $package->NameHash . '_log.txt';
|
||||
if (file_exists($packageLogFile)) {
|
||||
$link_log = $package->StoreURL . $package->NameHash . "_log.txt";
|
||||
} else {
|
||||
// .log is for backward compatibility
|
||||
$link_log = $package->StoreURL . $package->NameHash . ".log";
|
||||
}
|
||||
?>
|
||||
<a href="<?php echo esc_url($link_log) ?>" target="_blank">
|
||||
<i class="fas fa-info-circle"></i> <?php esc_html_e('Requirements Failed', 'duplicator-pro') ?>
|
||||
</a>
|
||||
<?php
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<span style='display:none' id='status-<?php echo (int) $package->ID ?>'><?php echo (int) $status ?></span>
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Duplicator
|
||||
*/
|
||||
|
||||
use Duplicator\Core\CapMng;
|
||||
use Duplicator\Package\Recovery\BackupPackage;
|
||||
use Duplicator\Views\ViewHelper;
|
||||
|
||||
defined("ABSPATH") or die("");
|
||||
|
||||
/**
|
||||
* Variables
|
||||
*
|
||||
* @var Duplicator\Core\Controllers\ControllersManager $ctrlMng
|
||||
* @var Duplicator\Core\Views\TplMng $tplMng
|
||||
* @var array<string, mixed> $tplData
|
||||
* @var ?DUP_PRO_Package $package
|
||||
*/
|
||||
|
||||
$package = $tplData['package'];
|
||||
$storage_problem = $package->transferWasInterrupted();
|
||||
|
||||
if (!CapMng::can(CapMng::CAP_BACKUP_RESTORE, false)) {
|
||||
return;
|
||||
}
|
||||
|
||||
?>
|
||||
<button
|
||||
type="button" class="button button-link dup-restore-backup"
|
||||
data-package-id="<?php echo (int) $package->ID; ?>"
|
||||
<?php disabled($package->haveLocalStorage(), false); ?>
|
||||
aria-label="<?php esc_attr_e("Restore backup", 'duplicator-pro') ?>"
|
||||
title="<?php esc_attr_e("Restore backup.", 'duplicator-pro') ?>"
|
||||
>
|
||||
<?php ViewHelper::restoreIcon(); ?> <?php esc_html_e("Restore", 'duplicator-pro'); ?>
|
||||
</button>
|
||||
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Duplicator
|
||||
*/
|
||||
|
||||
use Duplicator\Core\CapMng;
|
||||
|
||||
defined("ABSPATH") or die("");
|
||||
|
||||
/**
|
||||
* Variables
|
||||
*
|
||||
* @var Duplicator\Core\Controllers\ControllersManager $ctrlMng
|
||||
* @var Duplicator\Core\Views\TplMng $tplMng
|
||||
* @var array<string, mixed> $tplData
|
||||
* @var ?DUP_PRO_Package $package
|
||||
*/
|
||||
|
||||
$package = $tplData['package'];
|
||||
$storage_problem = $package->transferWasInterrupted();
|
||||
$remote_style = ($storage_problem) ? 'remote-data-fail' : '';
|
||||
|
||||
if (!CapMng::can(CapMng::CAP_STORAGE, false)) {
|
||||
?>
|
||||
<td></td>
|
||||
<?php
|
||||
return;
|
||||
}
|
||||
|
||||
if ($storage_problem) { ?>
|
||||
<td class="dup-cell-btns dup-cell-store-btn"
|
||||
aria-label="<?php esc_attr_e("Remote Storages", 'duplicator-pro') ?>"
|
||||
onclick="DupPro.Pack.ShowRemote(<?php echo (int) $package->ID; ?>, '<?php echo esc_js($package->NameHash); ?>');"
|
||||
title="<?php esc_attr_e("Error during storage transfer.", 'duplicator-pro') ?>">
|
||||
<span class="button button-link">
|
||||
<i class="fas fa-server <?php echo esc_attr($remote_style); ?>"></i>
|
||||
</span>
|
||||
</td>
|
||||
<?php } else { ?>
|
||||
<td class="dup-cell-btns dup-cell-store-btn"
|
||||
onclick="DupPro.Pack.ShowRemote(<?php echo (int) $package->ID; ?>, '<?php echo esc_js($package->NameHash); ?>');"
|
||||
aria-label="<?php esc_attr_e("Remote Storages", 'duplicator-pro') ?>">
|
||||
<span class="button button-link">
|
||||
<i class="fas fa-server <?php echo esc_attr($remote_style); ?>"></i>
|
||||
</span>
|
||||
</td>
|
||||
<?php } ?>
|
||||
</td>
|
||||
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Duplicator
|
||||
*/
|
||||
|
||||
defined("ABSPATH") or die("");
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Variables
|
||||
*
|
||||
* @var Duplicator\Core\Controllers\ControllersManager $ctrlMng
|
||||
* @var Duplicator\Core\Views\TplMng $tplMng
|
||||
* @var array<string, mixed> $tplData
|
||||
*/
|
||||
|
||||
?>
|
||||
<br>
|
||||
<b><?php esc_html_e('Please Retry:', 'duplicator-pro'); ?></b><br>
|
||||
<?php esc_html_e('Unable to perform a full scan and read JSON file, please try the following actions.', 'duplicator-pro'); ?><br>
|
||||
<?php esc_html_e('1. Go back and create a root path directory filter to validate the site is scan-able.', 'duplicator-pro'); ?><br>
|
||||
<?php esc_html_e('2. Continue to add/remove filters to isolate which path is causing issues.', 'duplicator-pro'); ?><br>
|
||||
<?php esc_html_e('3. This message will go away once the correct filters are applied.', 'duplicator-pro'); ?><br>
|
||||
<br>
|
||||
<b><?php esc_html_e('Common Issues:', 'duplicator-pro'); ?></b><br>
|
||||
<?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-pro'
|
||||
);
|
||||
?><br>
|
||||
<?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-pro'
|
||||
); ?><br>
|
||||
<br>
|
||||
<b><?php esc_html_e('Details:', 'duplicator-pro'); ?></b><br>
|
||||
<?php esc_html_e('JSON Service:', 'duplicator-pro'); ?> /wp-admin/admin-ajax.php?action=duplicator_pro_package_scan<br>
|
||||
<?php esc_html_e('Scan Path:', 'duplicator-pro'); ?> [<?php echo duplicator_pro_get_home_path(); ?>]<br><br>
|
||||
|
||||
<b><?php esc_html_e('More Information:', 'duplicator-pro'); ?></b><br>
|
||||
<?php
|
||||
printf(
|
||||
__(
|
||||
'Please see the online FAQ titled %1$s"How to resolve scanner warnings/errors and timeout issues?"%2$s',
|
||||
'duplicator-pro'
|
||||
),
|
||||
'<a href="' . DUPLICATOR_PRO_DUPLICATOR_DOCS_URL . 'how-to-resolve-scanner-warnings-errors-and-timeout-issues" target="_blank">',
|
||||
'</a>'
|
||||
);
|
||||
@@ -0,0 +1,140 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Duplicator
|
||||
*/
|
||||
|
||||
use Duplicator\Views\UserUIOptions;
|
||||
|
||||
defined("ABSPATH") or die("");
|
||||
|
||||
/**
|
||||
* Variables
|
||||
*
|
||||
* @var Duplicator\Core\Controllers\ControllersManager $ctrlMng
|
||||
* @var Duplicator\Core\Views\TplMng $tplMng
|
||||
* @var array<string, mixed> $tplData
|
||||
*/
|
||||
|
||||
$uiOpts = UserUIOptions::getInstance();
|
||||
|
||||
$perPage = $uiOpts->get(UserUIOptions::VAL_PACKAGES_PER_PAGE);
|
||||
$dateFormat = $uiOpts->get(UserUIOptions::VAL_CREATED_DATE_FORMAT);
|
||||
$showNote = $uiOpts->get(UserUIOptions::VAL_SHOW_COL_NOTE);
|
||||
$showSize = $uiOpts->get(UserUIOptions::VAL_SHOW_COL_SIZE);
|
||||
$showCreated = $uiOpts->get(UserUIOptions::VAL_SHOW_COL_CREATED);
|
||||
$showAge = $uiOpts->get(UserUIOptions::VAL_SHOW_COL_AGE);
|
||||
?>
|
||||
<fieldset class="metabox-prefs">
|
||||
<legend>Columns</legend>
|
||||
<label>
|
||||
<input
|
||||
class="dup-hide-column-tog"
|
||||
name="dup-note-hide"
|
||||
type="checkbox"
|
||||
id="dup-note-hide"
|
||||
value="1"
|
||||
<?php checked($showNote); ?>
|
||||
data-target-colum="dup-note-column"
|
||||
>
|
||||
<?php esc_html_e('Note', 'duplicator-pro'); ?>
|
||||
</label>
|
||||
<label>
|
||||
<input
|
||||
class="dup-hide-column-tog"
|
||||
name="dup-size-hide"
|
||||
type="checkbox"
|
||||
id="dup-size-hide"
|
||||
value="1" <?php checked($showSize); ?>
|
||||
data-target-colum="dup-size-column"
|
||||
>
|
||||
<?php esc_html_e('Size', 'duplicator-pro'); ?>
|
||||
</label>
|
||||
<label>
|
||||
<input
|
||||
class="dup-hide-column-tog"
|
||||
name="dup-created-hide"
|
||||
type="checkbox"
|
||||
id="dup-created-hide"
|
||||
value="1"
|
||||
<?php checked($showCreated); ?>
|
||||
data-target-colum="dup-created-column"
|
||||
>
|
||||
<?php esc_html_e('Created', 'duplicator-pro'); ?>
|
||||
</label>
|
||||
<label>
|
||||
<input
|
||||
class="dup-hide-column-tog"
|
||||
name="dup-age-hide"
|
||||
type="checkbox"
|
||||
id="dup-age-hide"
|
||||
value="1"
|
||||
<?php checked($showAge); ?>
|
||||
data-target-colum="dup-age-column"
|
||||
>
|
||||
<?php esc_html_e('Age', 'duplicator-pro'); ?>
|
||||
</label>
|
||||
</fieldset>
|
||||
<fieldset class="screen-options" >
|
||||
<legend>Pagination</legend>
|
||||
<label for="duplicator_pro_opts_per_page">Packages Per Page</label>
|
||||
<input
|
||||
type="number"
|
||||
step="1"
|
||||
min="1"
|
||||
max="999"
|
||||
class="screen-per-page"
|
||||
name="duplicator_pro_opts_per_page"
|
||||
id="duplicator_pro_opts_per_page"
|
||||
maxlength="3"
|
||||
value="<?php echo esc_html($perPage); ?>"
|
||||
>
|
||||
</fieldset>
|
||||
<fieldset class="screen-options">
|
||||
<legend>Created Format</legend>
|
||||
<div class="metabox-prefs">
|
||||
<input type="hidden" name="wp_screen_options[option]" value="package_screen_options">
|
||||
<input type="hidden" name="wp_screen_options[value]" value="val">
|
||||
<div class="created-format-wrapper">
|
||||
<select name="duplicator_pro_created_format">
|
||||
<!-- YEAR -->
|
||||
<optgroup label="By Year">
|
||||
<option value="1" <?php selected($dateFormat, 1); ?> >Y-m-d H:i [2000-01-05 12:00]</option>
|
||||
<option value="2" <?php selected($dateFormat, 2); ?> >Y-m-d H:i:s [2000-01-05 12:00:01]</option>
|
||||
<option value="3" <?php selected($dateFormat, 3); ?> >y-m-d H:i [00-01-05 12:00]</option>
|
||||
<option value="4" <?php selected($dateFormat, 4); ?> >y-m-d H:i:s [00-01-05 12:00:01]</option>
|
||||
</optgroup>
|
||||
<!-- MONTH -->
|
||||
<optgroup label="By Month">
|
||||
<option value="5" <?php selected($dateFormat, 5); ?> >m-d-Y H:i [01-05-2000 12:00]</option>
|
||||
<option value="6" <?php selected($dateFormat, 6); ?> >m-d-Y H:i:s [01-05-2000 12:00:01]</option>
|
||||
<option value="7" <?php selected($dateFormat, 7); ?> >m-d-y H:i [01-05-00 12:00]</option>
|
||||
<option value="8" <?php selected($dateFormat, 8); ?> >m-d-y H:i:s [01-05-00 12:00:01]</option>
|
||||
</optgroup>
|
||||
<!-- DAY -->
|
||||
<optgroup label="By Day">
|
||||
<option value="9" <?php selected($dateFormat, 9); ?> > d-m-Y H:i [05-01-2000 12:00]</option>
|
||||
<option value="10" <?php selected($dateFormat, 10); ?> >d-m-Y H:i:s [05-01-2000 12:00:01]</option>
|
||||
<option value="11" <?php selected($dateFormat, 11); ?> >d-m-y H:i [05-01-00 12:00]</option>
|
||||
<option value="12" <?php selected($dateFormat, 12); ?> >d-m-y H:i:s [05-01-00 12:00:01]</option>
|
||||
</optgroup>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
<p class="submit">
|
||||
<input type="submit" name="screen-options-apply" id="screen-options-apply" class="button button-primary" value="Apply">
|
||||
</p>
|
||||
<script>
|
||||
jQuery(document).ready(function($) {
|
||||
$('.dup-hide-column-tog').on('change', function() {
|
||||
let node = $(this);
|
||||
let columns = $('.' + node.data('target-colum'));
|
||||
if (node.is(':checked')) {
|
||||
columns.show();
|
||||
} else {
|
||||
columns.hide();
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,105 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Duplicator
|
||||
*/
|
||||
|
||||
use Duplicator\Controllers\SettingsPageController;
|
||||
|
||||
defined("ABSPATH") or die("");
|
||||
|
||||
/**
|
||||
* Variables
|
||||
*
|
||||
* @var \Duplicator\Core\Controllers\ControllersManager $ctrlMng
|
||||
* @var \Duplicator\Core\Views\TplMng $tplMng
|
||||
* @var array<string, mixed> $tplData
|
||||
*/
|
||||
|
||||
$dbbuild_mode = DUP_PRO_DB::getBuildMode();
|
||||
$settingsPackageUrl = SettingsPageController::getInstance()->getMenuLink(SettingsPageController::L2_SLUG_PACKAGE);
|
||||
?>
|
||||
<div class="filter-db-tab-content">
|
||||
<?php $tplMng->render('parts/filters/tables_list_filter'); ?>
|
||||
<br/><br/>
|
||||
|
||||
<div class="dup-package-hdr-1">
|
||||
<?php esc_html_e("Configuration", 'duplicator-pro') ?>
|
||||
</div>
|
||||
|
||||
<div class="dup-form-item">
|
||||
<span class="title"><?php esc_html_e("SQL Mode", 'duplicator-pro') ?>:</span>
|
||||
<span class="input">
|
||||
<a href="<?php echo esc_url($settingsPackageUrl); ?>" target="settings">
|
||||
<?php echo esc_html($dbbuild_mode); ?>
|
||||
</a>
|
||||
</span>
|
||||
</div>
|
||||
<div class="dup-form-item">
|
||||
<span class="title">
|
||||
<?php esc_html_e("Compatibility Mode", 'duplicator-pro') ?>:
|
||||
<?php
|
||||
$tipCont = __(
|
||||
'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-pro'
|
||||
);
|
||||
?>
|
||||
<i class="fas fa-question-circle fa-sm"
|
||||
data-tooltip-title="<?php esc_attr_e("Compatibility Mode", 'duplicator-pro'); ?>"
|
||||
data-tooltip="<?php echo esc_attr($tipCont); ?>">
|
||||
</i>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
if ($dbbuild_mode == 'MYSQLDUMP') :?>
|
||||
<?php
|
||||
$modes = isset($Package) ? explode(',', $Package->Database->Compatible) : array();
|
||||
$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);
|
||||
?>
|
||||
<div class="dup-form-horiz-opts">
|
||||
<span>
|
||||
<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-pro') ?></label>
|
||||
</span>
|
||||
<span>
|
||||
<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-pro') ?></label>
|
||||
</span>
|
||||
<span>
|
||||
<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-pro') ?></label>
|
||||
</span>
|
||||
<span>
|
||||
<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-pro') ?></label>
|
||||
</span>
|
||||
</div>
|
||||
<div class="dup-tabs-opts-help">
|
||||
<?php esc_html_e("Compatibility mode settings are not persistent. They must be enabled with every new build.", 'duplicator-pro'); ?>
|
||||
<a href="<?php echo esc_url(DUPLICATOR_PRO_DUPLICATOR_DOCS_URL . 'how-to-fix-database-write-issues');?>" target="_blank">
|
||||
[<?php esc_html_e('full overview', 'duplicator-pro'); ?>]
|
||||
</a>
|
||||
</div>
|
||||
<?php else :?>
|
||||
<i><?php esc_html_e("This option is only available with mysqldump mode.", 'duplicator-pro'); ?></i>
|
||||
<?php endif; ?>
|
||||
<br/>
|
||||
</div>
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Duplicator
|
||||
*/
|
||||
|
||||
use Duplicator\Libs\Snap\SnapIO;
|
||||
|
||||
defined("ABSPATH") or die("");
|
||||
|
||||
/**
|
||||
* Variables
|
||||
*
|
||||
* @var \Duplicator\Core\Controllers\ControllersManager $ctrlMng
|
||||
* @var \Duplicator\Core\Views\TplMng $tplMng
|
||||
* @var array<string, mixed> $tplData
|
||||
*/
|
||||
?>
|
||||
<div class="filter-files-tab-content">
|
||||
<?php
|
||||
$uploads = wp_upload_dir();
|
||||
$upload_dir = SnapIO::safePath($uploads['basedir']);
|
||||
$content_path = defined('WP_CONTENT_DIR') ? SnapIO::safePath(WP_CONTENT_DIR) : '';
|
||||
?>
|
||||
|
||||
<?php $tplMng->render('parts/filters/package_components'); ?>
|
||||
</div>
|
||||
@@ -0,0 +1,118 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Duplicator
|
||||
*/
|
||||
|
||||
use Duplicator\Addons\ProBase\License\License;
|
||||
|
||||
defined("ABSPATH") or die("");
|
||||
|
||||
/**
|
||||
* Variables
|
||||
*
|
||||
* @var \Duplicator\Core\Controllers\ControllersManager $ctrlMng
|
||||
* @var \Duplicator\Core\Views\TplMng $tplMng
|
||||
* @var array<string, mixed> $tplData
|
||||
*/
|
||||
|
||||
if (!is_multisite()) {
|
||||
return;
|
||||
}
|
||||
?>
|
||||
<div class="filter-mu-tab-content <?php echo (License::can(License::CAPABILITY_MULTISITE_PLUS) ? '' : 'disabled');?>" >
|
||||
<div style="max-width:900px">
|
||||
<?php if (!License::can(License::CAPABILITY_MULTISITE_PLUS)) { ?>
|
||||
<div class="dpro-panel-optional-txt alert-disabled" style="text-align: center">
|
||||
<b><?php esc_html_e("Notice:", 'duplicator-pro'); ?></b>
|
||||
<?php
|
||||
printf(
|
||||
esc_html__(
|
||||
'This option isn\'t available at the %1$s license level.',
|
||||
'duplicator-pro'
|
||||
),
|
||||
esc_html(License::getLicenseToString())
|
||||
);
|
||||
?>
|
||||
<br>
|
||||
<?php
|
||||
printf(
|
||||
esc_html_x(
|
||||
'To enable this option %1$supgrade%2$s the License.',
|
||||
'%1$s and %2$s represents the opening and closing HTML tags for an anchor or link',
|
||||
'duplicator-pro'
|
||||
),
|
||||
'<a href="' . esc_url(License::getUpsellURL()) . '" target="_blank">',
|
||||
'</a>'
|
||||
);
|
||||
?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<?php
|
||||
echo '<b>' . esc_html__("Overview:", 'duplicator-pro') . '</b><br/>';
|
||||
esc_html_e(
|
||||
"When you want to move a full multisite network or convert a subsite to a standalone site just
|
||||
create a standard package like you would with a single site.
|
||||
Then browse to the installer and choose either 'Restore entire multisite network' or 'Convert subsite into a standalone site'.
|
||||
These options will be present on Step 1 of the installer when restoring a Multisite package.",
|
||||
'duplicator-pro'
|
||||
);
|
||||
?>
|
||||
</div>
|
||||
<table class="mu-opts">
|
||||
<tr>
|
||||
<td>
|
||||
<b><?php esc_html_e("Included Sub-Sites", 'duplicator-pro'); ?>:</b><br/>
|
||||
<select name="mu-include[]" id="mu-include" multiple="true" class="mu-selector">
|
||||
<?php
|
||||
$subsites = License::can(License::CAPABILITY_MULTISITE_PLUS) ? DUP_PRO_MU::getSubsites() : array();
|
||||
foreach ($subsites as $site) {
|
||||
echo "<option value='" . (int) $site->id . "'>" . esc_html($site->domain . $site->path) . "</option>";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<button type="button" id="mu-exclude-btn" class="mu-push-btn"><i class="fa fa-chevron-right"></i></button>
|
||||
<br/>
|
||||
<button type="button" id="mu-include-btn" class="mu-push-btn"><i class="fa fa-chevron-left"></i></button>
|
||||
</td>
|
||||
<td>
|
||||
<b><?php esc_html_e("Excluded Sub-Sites", 'duplicator-pro'); ?>:</b><br/>
|
||||
<select name="mu-exclude[]" id="mu-exclude" multiple="true" class="mu-selector"></select>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<div class="dpro-panel-optional-txt" style="text-align: left">
|
||||
<?php
|
||||
echo wp_kses(
|
||||
__(
|
||||
"<u><b>Important:</b></u> Full network restoration is an installer option only if you include <b>all</b> subsites.
|
||||
If any subsites are filtered then you may only restore individual subsites as standalones sites at install-time.",
|
||||
'duplicator-pro'
|
||||
),
|
||||
array(
|
||||
'b' => array(),
|
||||
'u' => array(),
|
||||
)
|
||||
);
|
||||
?>
|
||||
<br/>
|
||||
<br/>
|
||||
<?php
|
||||
esc_html_e(
|
||||
"This section allows you to control which sub-sites of a multisite network you want to include within your package.
|
||||
The 'Included Sub-Sites' will also be available to choose from at install time.",
|
||||
'duplicator-pro'
|
||||
);
|
||||
?>
|
||||
<br/>
|
||||
<?php
|
||||
esc_html_e(
|
||||
"By default all packages are included. The ability to exclude sub-sites are intended to help shrink your package if needed.",
|
||||
'duplicator-pro'
|
||||
);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,163 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Duplicator
|
||||
*/
|
||||
|
||||
use Duplicator\Installer\Package\ArchiveDescriptor;
|
||||
use Duplicator\Package\SettingsUtils;
|
||||
|
||||
defined("ABSPATH") or die("");
|
||||
|
||||
/**
|
||||
* Variables
|
||||
*
|
||||
* @var \Duplicator\Core\Controllers\ControllersManager $ctrlMng
|
||||
* @var \Duplicator\Core\Views\TplMng $tplMng
|
||||
* @var array<string, mixed> $tplData
|
||||
*/
|
||||
|
||||
$secureOn = (isset($tplData['secureOn']) ? $tplData['secureOn'] : ArchiveDescriptor::SECURE_MODE_NONE);
|
||||
$securePass = (isset($tplData['securePass']) ? $tplData['securePass'] : '');
|
||||
|
||||
$unavaliableMessage = '';
|
||||
$encryptAvaliable = SettingsUtils::isArchiveEncryptionAvailable($unavaliableMessage);
|
||||
|
||||
?>
|
||||
<div class="archive-setup-tab" >
|
||||
<div class="dup-package-hdr-1">
|
||||
<?php esc_html_e('Security', 'duplicator-pro'); ?>
|
||||
</div>
|
||||
|
||||
<div class="dup-form-item">
|
||||
<span class="title">
|
||||
<?php esc_html_e('Mode', 'duplicator-pro') ?>:
|
||||
</span>
|
||||
<div class="input">
|
||||
<span class="secure-on-input-wrapper">
|
||||
<label class="margin-right-1" >
|
||||
<input
|
||||
type="radio"
|
||||
name="secure-on"
|
||||
id="secure-on-none"
|
||||
onclick="DupPro.EnableInstallerPassword()"
|
||||
required
|
||||
value="<?php echo (int) ArchiveDescriptor::SECURE_MODE_NONE; ?>"
|
||||
<?php checked($secureOn, ArchiveDescriptor::SECURE_MODE_NONE); ?>
|
||||
data-parsley-multiple="secure-on-mltiple-error"
|
||||
data-parsley-errors-container="#secure-on-parsely-error"
|
||||
>
|
||||
<?php esc_html_e('None', 'duplicator-pro') ?>
|
||||
</label>
|
||||
<label class="margin-right-1" >
|
||||
<input
|
||||
type="radio"
|
||||
name="secure-on"
|
||||
id="secure-on-inst-pwd"
|
||||
value="<?php echo (int) ArchiveDescriptor::SECURE_MODE_INST_PWD; ?>"
|
||||
<?php checked($secureOn, ArchiveDescriptor::SECURE_MODE_INST_PWD); ?>
|
||||
onclick="DupPro.EnableInstallerPassword()"
|
||||
data-parsley-multiple="secure-on-mltiple-error"
|
||||
>
|
||||
<?php esc_html_e('Installer password', 'duplicator-pro') ?>
|
||||
</label>
|
||||
<label <?php echo ($encryptAvaliable ? '' : 'class="silver"'); ?>>
|
||||
<input
|
||||
type="radio"
|
||||
name="secure-on"
|
||||
id="secure-on-arc-encrypt"
|
||||
value="<?php echo (int) ArchiveDescriptor::SECURE_MODE_ARC_ENCRYPT; ?>"
|
||||
<?php echo ($encryptAvaliable ? checked($secureOn, ArchiveDescriptor::SECURE_MODE_ARC_ENCRYPT, false) : ''); ?>
|
||||
onclick="DupPro.EnableInstallerPassword()"
|
||||
<?php disabled(!$encryptAvaliable); ?>
|
||||
data-parsley-multiple="secure-on-mltiple-error"
|
||||
>
|
||||
<?php esc_html_e('Archive encryption', 'duplicator-pro') ?>
|
||||
</label>
|
||||
<i class="fas fa-question-circle fa-sm"
|
||||
data-tooltip-title="<?php esc_attr_e('Security', 'duplicator-pro'); ?>"
|
||||
data-tooltip="<?php $tplMng->renderEscAttr('admin_pages/packages/setup/security-tooltip-content'); ?>">
|
||||
</i>
|
||||
</span>
|
||||
<div id="secure-on-parsely-error"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="dup-form-item">
|
||||
<span class="title">
|
||||
<?php esc_html_e('Password', 'duplicator-pro') ?>:
|
||||
</span>
|
||||
<div class="input">
|
||||
<span class="dup-password-toggle">
|
||||
<input
|
||||
id="secure-pass"
|
||||
type="password"
|
||||
name="secure-pass"
|
||||
required="required"
|
||||
size="50"
|
||||
maxlength="150"
|
||||
value="<?php echo esc_attr($securePass); ?>"
|
||||
>
|
||||
<button type="button" >
|
||||
<i class="fas fa-eye fa-sm"></i>
|
||||
</button>
|
||||
</span>
|
||||
<div class="input dup-tabs-opts-help-secure-pass">
|
||||
<?php
|
||||
esc_html_e(
|
||||
'Caution: Passwords are case-sensitive and if lost cannot be recovered. Please keep passwords in a safe place!',
|
||||
'duplicator-pro'
|
||||
);
|
||||
echo '<br/>';
|
||||
esc_html_e(
|
||||
'If this password is lost then a new archive file will need to be created.',
|
||||
'duplicator-pro'
|
||||
);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if (!$encryptAvaliable) { ?>
|
||||
<div class="dup-form-item">
|
||||
<span class="title">
|
||||
|
||||
</span>
|
||||
<span class="input dup-tabs-opts-notice">
|
||||
<i>
|
||||
<i class="fas fa-exclamation-triangle fa-xs"></i>
|
||||
<?php
|
||||
echo esc_html__("The security mode 'Archive encryption' option above is currently disabled on this server.", 'duplicator-pro') . '<br>'
|
||||
. esc_html($unavaliableMessage);
|
||||
?>
|
||||
</i>
|
||||
</span>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
jQuery(function($) {
|
||||
DupPro.EnableInstallerPassword = function () {
|
||||
let $button = $('#secure-btn');
|
||||
let secureOnVal = $('.secure-on-input-wrapper input:checked').val();
|
||||
|
||||
if (secureOnVal == <?php echo json_encode(ArchiveDescriptor::SECURE_MODE_NONE); ?>) {
|
||||
$('#secure-pass').removeAttr('required');
|
||||
$('#secure-pass').attr('readonly', true);
|
||||
$('#dpro-install-secure-lock').hide();
|
||||
$button.prop('disabled', true);
|
||||
} else {
|
||||
$('#secure-pass').attr('readonly', false);
|
||||
$('#secure-pass').attr('required', 'true').focus();
|
||||
$('#dpro-install-secure-lock').show();
|
||||
$button.prop('disabled', false);
|
||||
}
|
||||
};
|
||||
|
||||
$('#secure-on-none').parsley().on('field:error', function() {
|
||||
$('.archive-setup-tab button').trigger('click');
|
||||
$('html,body').animate({scrollTop: $(".archive-setup-tab").offset().top - 30},'slow');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Duplicator
|
||||
*/
|
||||
|
||||
use Duplicator\Installer\Core\Descriptors\ArchiveConfig;
|
||||
|
||||
defined("ABSPATH") or die("");
|
||||
|
||||
/**
|
||||
* Variables
|
||||
*
|
||||
* @var \Duplicator\Core\Controllers\ControllersManager $ctrlMng
|
||||
* @var \Duplicator\Core\Views\TplMng $tplMng
|
||||
* @var array<string, mixed> $tplData
|
||||
*/
|
||||
|
||||
echo esc_html(
|
||||
__('When enabled the archive file will be encrypted with a password that is required to open.', 'duplicator-pro') . ' ' .
|
||||
__('The installer will also prompt for the password at install time.', 'duplicator-pro') . ' ' .
|
||||
__('Encryption is a general deterrent and should not be substituted for properly keeping your files secure.', 'duplicator-pro') . ' ' .
|
||||
__('Be sure to remove all installer files when the install process is completed.', 'duplicator-pro')
|
||||
);
|
||||
?>
|
||||
<ul>
|
||||
<li>
|
||||
<b>
|
||||
<?php esc_html_e('None:', 'duplicator-pro'); ?>
|
||||
</b>
|
||||
<?php esc_html_e(
|
||||
"No protection system activated! The installer or archive files can be accessed by any resource that knows the full URL to either file.",
|
||||
'duplicator-pro'
|
||||
); ?>
|
||||
</li>
|
||||
<li>
|
||||
<b>
|
||||
<?php esc_html_e('Installer password:', 'duplicator-pro'); ?>
|
||||
</b>
|
||||
<?php esc_html_e(
|
||||
'The archive is NOT encrypted. When the installer starts, it will prompt for a password to prevent anyone from running the installer.',
|
||||
'duplicator-pro'
|
||||
); ?>
|
||||
</li>
|
||||
<li>
|
||||
<b>
|
||||
<?php esc_html_e('Archive encryption:', 'duplicator-pro'); ?>
|
||||
</b>
|
||||
<?php
|
||||
esc_html_e(
|
||||
'The archive IS encrypted with a password, and the installer will ask for a password when started.',
|
||||
'duplicator-pro'
|
||||
);
|
||||
esc_html_e(
|
||||
'This option is the recommended maximum level of security.',
|
||||
'duplicator-pro'
|
||||
);
|
||||
?>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -0,0 +1,123 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Duplicator package row in table packages list
|
||||
*
|
||||
* @package Duplicator
|
||||
* @copyright (c) 2022, Snap Creek LLC
|
||||
*/
|
||||
|
||||
use Duplicator\Controllers\ImportPageController;
|
||||
use Duplicator\Controllers\PackagesPageController;
|
||||
use Duplicator\Controllers\SettingsPageController;
|
||||
use Duplicator\Controllers\ToolsPageController;
|
||||
use Duplicator\Core\CapMng;
|
||||
use Duplicator\Package\Recovery\RecoveryPackage;
|
||||
use Duplicator\Views\ViewHelper;
|
||||
|
||||
defined("ABSPATH") or die("");
|
||||
|
||||
/**
|
||||
* Variables
|
||||
*
|
||||
* @var \Duplicator\Core\Controllers\ControllersManager $ctrlMng
|
||||
* @var \Duplicator\Core\Views\TplMng $tplMng
|
||||
* @var array<string, mixed> $tplData
|
||||
*/
|
||||
|
||||
$settingsUrl = esc_url($ctrlMng->getMenuLink($ctrlMng::SETTINGS_SUBMENU_SLUG, SettingsPageController::L2_SLUG_PACKAGE));
|
||||
$templateUrl = esc_url($ctrlMng->getMenuLink($ctrlMng::TOOLS_SUBMENU_SLUG, ToolsPageController::L2_SLUG_TEMPLATE));
|
||||
$recoveryUrl = esc_url($ctrlMng->getMenuLink($ctrlMng::TOOLS_SUBMENU_SLUG, ToolsPageController::L2_SLUG_RECOVERY));
|
||||
?>
|
||||
<input type="hidden" id="action" name="action" />
|
||||
<input type="hidden" id="action-parameter" name="action-parameter" />
|
||||
|
||||
<!-- ====================
|
||||
TOOL-BAR -->
|
||||
<table class="dpro-edit-toolbar">
|
||||
<tr>
|
||||
<td>
|
||||
<label for="dup-pack-bulk-actions" class="screen-reader-text">Select bulk action</label>
|
||||
<select id="dup-pack-bulk-actions">
|
||||
<option value="-1" selected="selected">
|
||||
<?php esc_html_e("Bulk Actions", 'duplicator-pro') ?>
|
||||
</option>
|
||||
<?php if (CapMng::can(CapMng::CAP_CREATE, false)) { ?>
|
||||
<option value="delete" title="<?php esc_attr_e("Delete selected package(s)", 'duplicator-pro') ?>">
|
||||
<?php esc_html_e("Delete", 'duplicator-pro') ?>
|
||||
</option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
<input type="button" id="dup-pack-bulk-apply" class="button action"
|
||||
value="<?php esc_attr_e("Apply", 'duplicator-pro') ?>"
|
||||
onclick="DupPro.Pack.ConfirmDelete()" />
|
||||
|
||||
<span class="btn-separator"></span>
|
||||
|
||||
<span class="button grey-icon dup-contextual-help"
|
||||
title="<?php esc_attr_e("Tutorial", 'duplicator-pro') ?>"
|
||||
onclick="DupPro.Pack.openLinkDetails()">
|
||||
<i class="far fa-lightbulb fa-fw"></i>
|
||||
</span>
|
||||
|
||||
<?php if (CapMng::can(CapMng::CAP_SETTINGS, false)) { ?>
|
||||
<a href="<?php echo esc_url($settingsUrl); ?>"
|
||||
class="button grey-icon dpro-toolbar-settings"
|
||||
title="<?php esc_attr_e("Package Settings", 'duplicator-pro') ?>" >
|
||||
<i class="fas fa-sliders-h fa-fw"></i>
|
||||
</a>
|
||||
<?php } ?>
|
||||
<?php if (CapMng::can(CapMng::CAP_CREATE, false)) { ?>
|
||||
<a href="<?php echo esc_url($templateUrl); ?>"
|
||||
class="button dpro-toolbar-templates"
|
||||
title="<?php esc_attr_e("Templates", 'duplicator-pro') ?>" >
|
||||
<i class="far fa-clone fa-fw"></i>
|
||||
</a>
|
||||
<?php } ?>
|
||||
|
||||
<span class="btn-separator"></span>
|
||||
|
||||
<?php if (CapMng::can(CapMng::CAP_IMPORT, false)) { ?>
|
||||
<a href="<?php echo esc_url(ImportPageController::getImportPageLink()); ?>"
|
||||
id="btn-logs-dialog"
|
||||
class="button dpro-toolbar-import"
|
||||
title="<?php esc_attr_e("Import", 'duplicator-pro') ?>">
|
||||
<i class="fas fa-arrow-alt-circle-down fa-fw"></i>
|
||||
</a>
|
||||
<?php } ?>
|
||||
<?php if (CapMng::can(CapMng::CAP_BACKUP_RESTORE, false)) { ?>
|
||||
<span
|
||||
class="dpro-toolbar-recovery-info button <?php echo (RecoveryPackage::getRecoverPackageId() === false ? 'dup-recovery-unset' : ''); ?>"
|
||||
title="<?php esc_attr_e("Disaster Recovery", 'duplicator-pro') ?>"
|
||||
>
|
||||
<?php ViewHelper::disasterIcon(); ?>
|
||||
</span>
|
||||
<?php } ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
if (CapMng::can(CapMng::CAP_CREATE, false)) {
|
||||
$tipContent = __(
|
||||
'This will create a new package. If a package is currently running then this button will be disabled.',
|
||||
'duplicator-pro'
|
||||
);
|
||||
?>
|
||||
<div class="btnnav">
|
||||
<span
|
||||
class="dup-new-package-wrapper"
|
||||
data-tooltip-title="<?php esc_attr_e('Package creation', 'duplicator-pro'); ?>"
|
||||
data-tooltip="<?php echo esc_attr($tipContent); ?>"
|
||||
>
|
||||
<a
|
||||
href="<?php echo esc_url(PackagesPageController::getInstance()->getPackageBuildS1Url()); ?>"
|
||||
id="dup-pro-create-new"
|
||||
class="button <?php echo DUP_PRO_Package::isPackageRunning() ? 'disabled' : ''; ?>"
|
||||
>
|
||||
<?php esc_html_e('Create New', 'duplicator-pro'); ?>
|
||||
</a>
|
||||
</span>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
Reference in New Issue
Block a user