first commit

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

View File

@@ -0,0 +1,62 @@
<?php
/**
* Duplicator package row in table packages list
*
* @package Duplicator
* @copyright (c) 2022, Snap Creek LLC
*/
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
*/
$tooltipTitle = esc_attr__('Package creation', 'duplicator-pro');
$tooltipContent = esc_attr__(
'This will create a new package. If a package is currently running then this button will be disabled.',
'duplicator-pro'
);
?>
<div class="dup-section-package-create dup-flex-content">
<span>
<?php esc_html_e('Last backup:', 'duplicator-pro'); ?>
<span class="dup-last-backup-info">
<?php
echo wp_kses(
$tplData['lastBackupString'],
[
'b' => [],
'span' => [
'class' => [],
],
]
);
?>
</span>
</span>
<?php if (CapMng::can(CapMng::CAP_CREATE, false)) { ?>
<span
class="dup-new-package-wrapper"
data-tooltip-title="<?php echo esc_attr($tooltipTitle); ?>"
data-tooltip="<?php echo esc_attr($tooltipContent); ?>"
>
<a
id="dup-pro-create-new"
class="button button-primary <?php echo DUP_PRO_Package::isPackageRunning() ? 'disabled' : ''; ?>"
href="<?php echo esc_url(PackagesPageController::getInstance()->getPackageBuildS1Url()); ?>"
>
<?php esc_html_e('Create New', 'duplicator-pro'); ?>
</a>
</span>
<?php } ?>
</div>

View File

@@ -0,0 +1,49 @@
<?php
/**
* Duplicator package row in table packages list
*
* @package Duplicator
* @copyright (c) 2022, Snap Creek LLC
*/
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[] $packages
*/
$packages = $tplData['packages'];
?>
<hr class="separator" >
<div class="dup-section-last-packages">
<p>
<b><?php esc_html_e('Recently Packages', 'duplicator-pro'); ?></b>
</p>
<?php if (count($packages) > 0) { ?>
<ul>
<?php foreach ($packages as $package) {
$createdTime = strtotime($package->getCreated());
$createdDate = date(get_option('date_format'), $createdTime);
$createdHours = date(get_option('time_format'), $createdTime);
?>
<li>
<a href="<?php echo esc_url(PackagesPageController::getInstance()->getPackageDetailsURL($package->ID)); ?>">
<?php echo esc_html($package->Name); ?>
</a> - <i class="gary" ><?php echo esc_html($createdDate . ' ' . $createdHours); ?></i>
</li>
<?php } ?>
</ul>
<?php } ?>
<p class="dup-packages-counts">
<?php printf(esc_html__('Packages: %1$d, Failures: %2$d', 'duplicator-pro'), (int) $tplData['totalPackages'], (int) $tplData['totalFailures']); ?>
</p>
</div>

View File

@@ -0,0 +1,57 @@
<?php
/**
* Duplicator package row in table packages list
*
* @package Duplicator
* @copyright (c) 2022, Snap Creek LLC
*/
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 array{name: string,slug: string,more: string,pro: array{file: string}} $plugin
*/
$plugin = $tplData['plugin'];
/** @var string */
$installUrl = $tplData['installUrl'];
$moreUrl = $plugin['more'] . '?' . http_build_query([
'utm_medium' => 'link',
'utm_source' => 'duplicatorplugin',
'utm_campaign' => 'duplicatordashboardwidget',
]);
?>
<div class="dup-section-recommended">
<hr>
<div class="dup-flex-content" >
<div>
<span class="dup-recommended-label">
<?php esc_html_e('Recommended Plugin:', 'duplicator-pro'); ?>
</span>
<b><?php echo esc_html($plugin['name']); ?></b>
-
<span class="action-links">
<?php if (CapMng::can('install_plugins', false) && CapMng::can('activate_plugins', false)) { ?>
<a href="<?php echo esc_url($installUrl); ?>"><?php esc_html_e('Install', 'duplicator-pro'); ?></a>
<?php } ?>
<a href="<?php echo esc_url($moreUrl); ?>" target="_blank" ><?php
esc_html_e('Learn More', 'duplicator-pro');
?></a>
</span>
</div>
<div>
<button type="button" id="dup-dash-widget-section-recommended" title="<?php esc_html_e('Dismiss recommended plugin', 'duplicator-pro'); ?>">
<span class="dashicons dashicons-no-alt"></span>
</button>
</div>
</div>
</div>

View File

@@ -0,0 +1,132 @@
<?php
/**
* Duplicator package row in table packages list
*
* @package Duplicator
* @copyright (c) 2022, Snap Creek LLC
*/
use Duplicator\Controllers\ToolsPageController;
use Duplicator\Core\CapMng;
use Duplicator\Core\Controllers\ControllersManager;
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
*/
$templatesURL = ControllersManager::getMenuLink(
ControllersManager::TOOLS_SUBMENU_SLUG,
ToolsPageController::L2_SLUG_TEMPLATE
);
$recoveryURl = ControllersManager::getMenuLink(
ControllersManager::TOOLS_SUBMENU_SLUG,
ToolsPageController::L2_SLUG_RECOVERY
);
if (
!CapMng::can(CapMng::CAP_SCHEDULE, false) &&
!CapMng::can(CapMng::CAP_STORAGE, false) &&
!CapMng::can(CapMng::CAP_CREATE, false) &&
!CapMng::can(CapMng::CAP_BACKUP_RESTORE, false)
) {
return;
}
?>
<hr class="separator" >
<div class="dup-section-sections">
<ul>
<?php if (CapMng::can(CapMng::CAP_SCHEDULE, false)) { ?>
<li class="dup-flex-content">
<span class="dup-section-label-fixed-width" >
<span class="dashicons dashicons-update gary"></span>
<a href="<?php echo esc_url(ControllersManager::getMenuLink(ControllersManager::SCHEDULES_SUBMENU_SLUG)); ?>"><?php
echo esc_html(sprintf(
_n(
'%s Schedule',
'%s Schedules',
$tplData['numSchedules'],
'duplicator-pro'
),
$tplData['numSchedules']
));
?></a>
</span>
<span>
<?php esc_html_e('Enabled', 'duplicator-pro'); ?>:
<b class="<?php echo ($tplData['numSchedulesEnabled'] ? 'green' : 'maroon'); ?>">
<?php echo (int) $tplData['numSchedulesEnabled']; ?>
</b>
<?php if (strlen($tplData['nextScheduleString'])) { ?>
- <?php esc_html_e('Next', 'duplicator-pro'); ?>: <b><?php echo esc_html($tplData['nextScheduleString']); ?></b>
<?php } ?>
</span>
</li>
<?php } ?>
<?php if (CapMng::can(CapMng::CAP_STORAGE, false)) { ?>
<li>
<span class="dup-section-label-fixed-width" >
<span class="dashicons dashicons-database gary"></span>
<a href="<?php echo esc_url(ControllersManager::getMenuLink(ControllersManager::STORAGE_SUBMENU_SLUG)); ?>"><?php
echo esc_html(sprintf(
_n(
'%s Storage',
'%s Storages',
$tplData['numStorages'],
'duplicator-pro'
),
$tplData['numStorages']
));
?>
</a>
</span>
</li>
<?php } ?>
<?php if (CapMng::can(CapMng::CAP_CREATE, false)) { ?>
<li>
<span class="dup-section-label-fixed-width" >
<span class="dashicons dashicons-admin-settings gary"></span>
<a href="<?php echo esc_url($templatesURL); ?>"><?php
echo esc_html(sprintf(
_n(
'%s Template',
'%s Templates',
$tplData['numTemplates'],
'duplicator-pro'
),
$tplData['numTemplates']
));
?>
</a>
</span>
</li>
<?php } ?>
<?php if (CapMng::can(CapMng::CAP_BACKUP_RESTORE, false)) { ?>
<li class="dup-flex-content">
<span class="dup-section-label-fixed-width" >
<span class="dashicons dashicons-image-rotate gary"></span>
<a href="<?php echo esc_url($recoveryURl); ?>" ><?php
esc_html_e('Recovery Point', 'duplicator-pro');
?>
</a>
</span>
<span>
<?php if (RecoveryPackage::getRecoverPackageId() === false) { ?>
<span class="maroon"><b><?php esc_html_e('Not set', 'duplicator-pro'); ?></b></span>
<?php } else { ?>
<span class="green"><b><?php esc_html_e('Set On', 'duplicator-pro'); ?></b></span>&nbsp;
<b><?php echo esc_html($tplData['recoverDateString']); ?></b>
<?php } ?>
</span>
</li>
<?php } ?>
</ul>
</div>

View File

@@ -0,0 +1,45 @@
<?php
/**
* Admin Notifications template.
*
* Variables
*
* @var \Duplicator\Core\Views\TplMng $tplMng
* @var array<string, mixed> $tplData
*/
defined('ABSPATH') || exit;
?>
<div id="dup-notifications">
<div class="dup-notifications-header">
<div class="dup-notifications-bell">
<img src="<?php echo esc_url(DUPLICATOR_PRO_PLUGIN_URL . 'assets/img/notification-bell.svg') ?>"/>
<span class="wp-ui-notification dup-notifications-circle"></span>
</div>
<div class="dup-notifications-title"><?php esc_html_e('Notifications', 'duplicator-pro'); ?></div>
</div>
<div class="dup-notifications-body">
<a class="dismiss" title="<?php esc_attr_e('Dismiss this message', 'duplicator-pro'); ?>"><i class="fa fa-times-circle" aria-hidden="true"></i></a>
<?php if (count($tplData['notifications']) > 1) : ?>
<div class="navigation">
<a class="prev">
<span class="screen-reader-text"><?php esc_attr_e('Previous message', 'duplicator-pro'); ?></span>
<span aria-hidden="true">&lsaquo;</span>
</a>
<a class="next">
<span class="screen-reader-text"><?php esc_attr_e('Next message', 'duplicator-pro'); ?></span>
<span aria-hidden="true">&rsaquo;</span>
</a>
</div>
<?php endif; ?>
<div class="dup-notifications-messages">
<?php foreach ($tplData['notifications'] as $notification) {
$tplMng->render('parts/Notifications/single-message', $notification);
} ?>
</div>
</div>
</div>

View File

@@ -0,0 +1,26 @@
<?php
/**
* Admin Notifications content.
*
* Variables
*
* @var \Duplicator\Core\Views\TplMng $tplMng
* @var array<string, mixed> $tplData
*/
defined('ABSPATH') || exit;
?>
<div class="dup-notifications-message" data-message-id="<?php echo esc_attr($tplData['id']); ?>;">
<h3 class="dup-notifications-title"><?php echo esc_html($tplData['title']); ?></h3>
<div class="dup-notifications-content">
<?php echo $tplData['content']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
</div>
<?php foreach ($tplData['btns'] as $btn) : ?>
<a
href="<?php echo esc_attr($btn['url']); ?>"
class="button button-<?php echo esc_attr($btn['type']); ?>"
<?php echo $btn['target'] === '_blank' ? 'target="_blank"' : ''; ?>>
<?php echo esc_html($btn['text']); ?>
</a>
<?php endforeach; ?>
</div>

View File

@@ -0,0 +1,38 @@
<?php
/**
* @package Duplicator
*/
use Duplicator\Utils\Help\Help;
use Duplicator\Libs\Snap\SnapJson;
defined("ABSPATH") || exit;
/**
* Variables
*
* @var \Duplicator\Core\Views\TplMng $tplMng
* @var array<string, mixed> $tplData
*/
$helpPageUrl = SnapJson::jsonEncode(Help::getHelpPageUrl());
?>
<script>
jQuery(document).ready(function ($) {
$('.duplicator-pro-help-open').click(function () {
if (Duplicator.Help.isDataLoaded()) {
Duplicator.Help.Display();
} else {
Duplicator.Help.Load('<?php echo esc_url_raw($helpPageUrl); ?>');
}
});
});
</script>
<div id="dup-meta-screen"></div>
<div class="dup-header">
<img src="<?php echo esc_url(DUPLICATOR_PRO_PLUGIN_URL . 'assets/img/duplicator-header-logo.svg'); ?>" alt="Duplicator Logo" >
<button class="duplicator-pro-help-open">
<i class="fa-regular fa-question-circle"></i>
</button>
</div>

View File

@@ -0,0 +1,467 @@
<?php
/**
* Duplicator package row in table packages list
*
* @package Duplicator
* @copyright (c) 2022, Snap Creek LLC
*/
use Duplicator\Libs\Snap\SnapIO;
use Duplicator\Addons\ProBase\License\License;
use Duplicator\Package\Create\BuildComponents;
defined("ABSPATH") or die("");
/**
* Variables
*
* @var \Duplicator\Core\Controllers\ControllersManager $ctrlMng
* @var \Duplicator\Core\Views\TplMng $tplMng
* @var array<string, mixed> $tplData
*/
$activeComponents = isset($tplData['components']) ? $tplData['components'] : [];
$archiveFilterOn = isset($tplData['archiveFilterOn']) ? $tplData['archiveFilterOn'] : false;
$archiveFilterDirs = isset($tplData['archiveFilterDirs']) ? $tplData['archiveFilterDirs'] : '';
$archiveFilterFiles = isset($tplData['archiveFilterFiles']) ? $tplData['archiveFilterFiles'] : '';
$archiveFilterPaths = strlen($archiveFilterDirs) > 0 && strlen($archiveFilterFiles) > 0
? $archiveFilterDirs . ';' . $archiveFilterFiles : $archiveFilterDirs . $archiveFilterFiles;
$archiveFilterPaths = str_replace(';', ";\n", $archiveFilterPaths);
$archiveFilterExtensions = isset($tplData['archiveFilterExtensions']) ? $tplData['archiveFilterExtensions'] : '';
$licenseDisabledClass = License::can(License::CAPABILITY_PACKAGE_COMPONENTS_PLUS) ? '' : 'disabled';
$pathFiltersTooltip = __('File filters allow you to exclude files and folders from the package.', 'duplicator-pro') . ' ' .
__('To enable path and extension filters check the checkbox.', 'duplicator-pro') . ' ' .
__('Enter the full path of the files and folders you want to exclude from the package as a semicolon (;) seperated list.', 'duplicator-pro');
$extensionFilterTooltip = __(
"File extension filters allow you to exclude files with certain file extensions from the package e.g. zip;rar;pdf etc.",
'duplicator-pro'
) . ' ' . __("Enter the file extensions you want to exclude from the package as a semicolon (;) seperated list.", 'duplicator-pro');
?>
<div class="dup-package-components">
<div class="component-section">
<div class="section-title">
<span>
<?php esc_html_e('Components', 'duplicator-pro'); ?>
<i class="fas fa-question-circle fa-sm"
data-tooltip-title="<?php esc_attr_e('Package Components', 'duplicator-pro'); ?>"
data-tooltip="<?php $tplMng->render('parts/filters/package_components_tootip'); ?>"
aria-expanded="false"></i>
</span>
</div>
<div class="components-shortcut-select">
<div class="dup-radio-button-group-wrapper" >
<?php foreach (BuildComponents::COMPONENTS_ACTIONS as $action) {
$inputId = 'dup-component-shortcut-action-' . $action;
?>
<input
type="radio"
id="<?php echo esc_attr($inputId); ?>"
name="auto-select-components"
class="dup-components-shortcut-radio"
value="<?php echo esc_html($action); ?>"
<?php checked($action === BuildComponents::getActionFromComponents($activeComponents)); ?>
>
<label
<?php echo in_array($action, BuildComponents::COMPONENTS_PLUS_ACTIONS) ? 'class="' . esc_attr($licenseDisabledClass) . '"' : ''; ?>
for="<?php echo esc_attr($inputId); ?>"
>
<?php echo esc_html(BuildComponents::getActionLabel($action)); ?>
</label>
<?php } ?>
</div>
</div>
<ul class="custom-components-select">
<?php foreach (BuildComponents::COMPONENTS as $component) { ?>
<li>
<label class="<?php echo in_array($component, BuildComponents::SUB_OPTIONS) ? 'secondary license-disabled' : 'license-disabled' ?>">
<input
type="checkbox"
<?php echo !in_array($component, BuildComponents::SUB_OPTIONS) ? 'data-parsley-multiple="package_components"' : '' ?>
name="<?php echo esc_attr($component) ?>"
id="<?php echo esc_attr($component) ?>"
class="dup-components-checkbox"
<?php checked(in_array($component, $activeComponents)); ?>
> <?php echo esc_html(BuildComponents::getLabel($component)); ?>
</label>
</li>
<?php } ?>
</ul>
<span id="components_error_container" class="duplicator-error-container" ></span>
</div>
<div class="filter-section">
<div class="filters">
<div class="section-title">
<span><?php esc_html_e('Filters', 'duplicator-pro'); ?> (&nbsp;<label>
<input id="filter-on"
name="filter-on"
type="checkbox" <?php checked($archiveFilterOn); ?>
> Enable
</label>&nbsp;)
<i
class="fas fa-question-circle fa-sm"
data-tooltip-title="<?php esc_attr_e('File Filters', 'duplicator-pro'); ?>"
data-tooltip="<?php echo esc_attr($pathFiltersTooltip); ?>""
aria-expanded="false"
>
</i>
</span>
<div class="filter-links">
<a href="#" data-filter-path="<?php echo esc_attr(SnapIO::trailingslashit(DUP_PRO_Archive::getOriginalPaths('home'))); ?>">
[root path]
</a>
<a href="#" data-filter-path="<?php echo esc_attr(SnapIO::trailingslashit(DUP_PRO_Archive::getOriginalPaths('wpcontent'))); ?>">
[wp-content]
</a>
<a href="#" data-filter-path="<?php echo esc_attr(SnapIO::trailingslashit(DUP_PRO_Archive::getOriginalPaths('uploads'))); ?>">
[wp-uploads]
</a>
<a href="#" data-filter-path="<?php echo esc_attr(SnapIO::trailingslashit(DUP_PRO_Archive::getOriginalPaths('wpcontent')) . 'cache/'); ?>">
[cache]
</a>
<a href="#" id="clear-path-filters">(clear)</a>
</div>
</div>
<textarea
id="filter-paths"
name="filter-paths"
placeholder="/full_path/dir/;&#10;/full_path/file;"
readonly><?php echo esc_html($archiveFilterPaths); ?></textarea>
<div class="section-title">
<span>
<?php esc_html_e('File Extensions', 'duplicator-pro'); ?>
<i class="fas fa-question-circle fa-sm"
data-tooltip-title="<?php esc_attr_e('File Extensions', 'duplicator-pro'); ?>"
data-tooltip="<?php echo esc_attr($extensionFilterTooltip); ?>"
aria-expanded="false"></i>
</span>
<div class="filter-links">
<a href="#" data-filter-exts="avi;mov;mp4;mpeg;mpg;swf;wmv;aac;m3u;mp3;mpa;wav;wma">[media]</a>
<a href="#" data-filter-exts="zip;rar;tar;gz;bz2;7z">[archive]</a>
<a href="#" id="clear-extension-filters">(clear)</a>
</div>
</div>
<textarea id="filter-exts" name="filter-exts" placeholder="ext1;ext2;ext3;" readonly><?php echo esc_html($archiveFilterExtensions); ?></textarea>
</div>
<div class="db-only-message">
<?php
echo wp_kses(
__(
"<b>Overview:</b><br> This advanced option excludes all files from the archive.
Only the database and a copy of the installer.php will be included in the archive.zip file.
The option can be used for backing up and moving only the database.",
'duplicator-pro'
),
array(
'b' => array(),
'br' => array(),
)
);
echo '<br/><br/>';
echo wp_kses(
__(
"<b><i class='fa fa-exclamation-circle'></i> Notice:</b><br/>
Installing only the database over an existing site may have unintended consequences.
Be sure to know the state of your system before installing the database without the associated files.",
'duplicator-pro'
),
array(
'b' => array(),
'i' => array('class'),
'br' => array(),
)
);
echo ' ';
esc_html_e(
"For example, if you have WordPress 5.6 on this site and you copy this site's database to a host that has WordPress 5.8 files
then the source code of the files will not be in sync with the database causing possible errors.
This can also be true of plugins and themes.
When moving only the database be sure to know the database will be compatible with ALL source code files.
Please use this advanced feature with caution!",
'duplicator-pro'
);
echo '<br/><br/>';
echo wp_kses(
__("<b>Install Time:</b><br> When installing a database only package please visit the ", 'duplicator-pro'),
array(
'b' => array(),
'br' => array(),
)
);
?>
<a href="<?php echo esc_url(DUPLICATOR_PRO_DUPLICATOR_DOCS_URL . 'database-install') ?>" target="_blank">
<?php esc_html_e('database only quick start', 'duplicator-pro'); ?>
</a>
</div>
</div>
</div>
<div class="dup-tabs-opts-help">
<?php
esc_html_e("The directories, extensions and files above will be be exclude from the archive file if enable is checked.", "duplicator-pro");
echo "<br/>";
esc_html_e("Use full path for directories or specific files.", "duplicator-pro");
echo " <b>";
esc_html_e("Use filenames without paths to filter same-named files across multiple directories.", "duplicator-pro");
echo "</b>";
echo "<br/>";
esc_html_e("Use semicolons to separate all items. Use # to comment a line.", "duplicator-pro");
if (!License::can(License::CAPABILITY_PACKAGE_COMPONENTS_PLUS)) { ?>
<div id="dup-upgrade-license-info" class="margin-top-1" >
<?php
printf(
esc_html_x(
'The %1$s and %2$s options are not included in your license plan.',
'%1$s and %2$s are the options not included in the license.',
'duplicator-pro'
),
'<b>' . esc_html(BuildComponents::getActionLabel(BuildComponents::COMP_ACTION_MEDIA)) . '</b>',
'<b>' . esc_html(BuildComponents::getActionLabel(BuildComponents::COMP_ACTION_CUSTOM)) . '</b>'
);
?>
<br>
<?php
printf(
esc_html_x(
'To enable advanced options please %1$supgrade your license%2$s.',
'%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 } ?>
</div>
<script>
jQuery(document).ready(function($)
{
$('#package_component_db').attr('data-parsley-required', 'true');
$('#package_component_db').attr('data-parsley-mincheck', '1');
$('#package_component_db').attr('data-parsley-errors-container', '#components_error_container');
$('#package_component_db')
.attr('data-parsley-required-message', '<?php echo esc_js(__("Please select at least one component.", "duplicator-pro")); ?>');
$('.dup-package-components .component-section input[type=checkbox]').on('change', function () {
$('#package_component_db').parsley().validate();
});
DupPro.Pack.ToggleFileFilters = function ()
{
if ($("#filter-on").is(':checked')) {
$('#dup-archive-filter-file').show();
$('#filter-exts, #filter-paths').prop('readonly', false);
} else {
$('#dup-archive-filter-file').hide();
$('#filter-exts, #filter-paths').prop('readonly', true);
}
};
DupPro.Pack.ToggleDBExcluded = function () {
if (!$('#package_component_db').is(":checked")) {
$('.filter-db-tab').hide()
} else {
$('.filter-db-tab').show()
}
}
DupPro.Pack.ToggleDBOnly = function () {
let allComponentCheckboxes = $('.dup-package-components .component-section input[type=checkbox]');
if (allComponentCheckboxes.filter(':checked').length === 1 && $('#package_component_db').is(":checked")) {
$("#dup-archive-db-only").show();
$('.filters').hide();
$('.db-only-message').show();
} else {
$("#dup-archive-db-only").hide();
$('.filters').show();
$('.db-only-message').hide();
}
}
DupPro.Pack.ToggleMediaOnly = function () {
let allComponentCheckboxes = $('.dup-package-components .component-section input[type=checkbox]');
if (allComponentCheckboxes.filter(':checked').length === 1 && $('#package_component_uploads').is(":checked")) {
$("#dup-archive-media-only").show();
} else {
$("#dup-archive-media-only").hide();
}
}
DupPro.Pack.SetDBOnly = function () {
$('.dup-components-checkbox').prop('checked', false);
$('.custom-components-select label').addClass('disabled');
$('#package_component_db').prop('checked', true);
}
DupPro.Pack.SetMediaOnly = function () {
$('.dup-components-checkbox').prop('checked', false);
$('.custom-components-select label').addClass('disabled');
$('#package_component_uploads').prop('checked', true);
}
DupPro.Pack.SetDefault = function () {
$('.dup-components-checkbox').prop('checked', false);
$('label:not(.secondary) .dup-components-checkbox').prop('checked', true);
$('.custom-components-select label').addClass('disabled');
}
DupPro.Pack.SetCustom = function () {
$('.custom-components-select label').removeClass('disabled');
}
DupPro.Pack.ToggleComponentsSelect = function () {
let checkedSelect = $('.dup-components-shortcut-radio:checked').val();
console.log(checkedSelect);
switch (checkedSelect) {
case 'all':
DupPro.Pack.SetDefault();
break;
case 'database':
DupPro.Pack.SetDBOnly();
break;
case 'media':
DupPro.Pack.SetMediaOnly();
break;
case 'custom':
DupPro.Pack.SetCustom();
break;
}
$('.dup-components-checkbox').trigger('change');
}
DupPro.Pack.SetComponentsSelect = function () {
let allComponentCheckboxes = $('.dup-components-checkbox');
let checkedComponentsCount = allComponentCheckboxes.filter(':checked').length;
let activeOnlyDisabled = (!$('#package_component_plugins_active').is(":checked") && !$('#package_component_themes_active').is(":checked"));
if ( checkedComponentsCount === (allComponentCheckboxes.length - 2) && activeOnlyDisabled) {
$('#dup-component-shortcut-action-all').prop('checked', true);
} else if (checkedComponentsCount === 1 && $('#package_component_db').is(":checked")) {
$('#dup-component-shortcut-action-database').prop('checked', true);
} else if (checkedComponentsCount === 1 && $('#package_component_uploads').is(":checked")) {
$('#dup-component-shortcut-action-media').prop('checked', true);
} else {
$('#dup-component-shortcut-action-custom').prop('checked', true);
}
DupPro.Pack.ToggleComponentsSelect();
}
DupPro.Pack.ToggleActivePlugins = function () {
let activePluginsInput = $('#package_component_plugins_active');
if (activePluginsInput.parent().hasClass('disabled')) {
activePluginsInput.prop('disabled', true);
return;
}
if (!$('#package_component_plugins').is(':checked')) {
activePluginsInput.prop('disabled', true);
activePluginsInput.prop('checked', false);
} else {
activePluginsInput.prop('disabled', false);
}
}
DupPro.Pack.ToggleActiveThemes = function () {
let activeThemesInput = $('#package_component_themes_active');
if (activeThemesInput.parent().hasClass('disabled')) {
activeThemesInput.prop('disabled', true);
return;
}
if (!$('#package_component_themes').is(':checked')) {
activeThemesInput.prop('disabled', true);
activeThemesInput.prop('checked', false);
} else {
activeThemesInput.prop('disabled', false);
}
}
DupPro.Pack.ToggleFileFilters();
DupPro.Pack.ToggleActiveThemes();
DupPro.Pack.ToggleActivePlugins();
DupPro.Pack.ToggleDBExcluded();
DupPro.Pack.ToggleDBOnly()
DupPro.Pack.SetComponentsSelect();
$('a[data-filter-path]').click(function (e) {
e.preventDefault()
if ($('#filter-paths').is("[readonly]")) {
return;
}
let currentVal = $('#filter-paths').val()
let newVal = currentVal.length > 0 ? currentVal + ";\n" + $(this).data('filter-path') : $(this).data('filter-path')
$('#filter-paths').val(newVal)
})
$('#clear-path-filters').click(function (e) {
e.preventDefault()
if ($('#filter-paths').is("[readonly]")) {
return;
}
$('#filter-paths').val('')
})
$('a[data-filter-exts]').click(function (e) {
e.preventDefault()
if ($('#filter-exts').is("[readonly]")) {
return;
}
let currentVal = $('#filter-exts').val()
let newVal = currentVal.length > 0 ? currentVal + ";" + $(this).data('filter-exts') : $(this).data('filter-exts')
$('#filter-exts').val(newVal)
})
$('#clear-extension-filters').click(function (e) {
e.preventDefault()
if ($('#filter-exts').is("[readonly]")) {
return;
}
$('#filter-exts').val('')
})
$('#filter-on').change(DupPro.Pack.ToggleFileFilters)
$('#package_component_db').change(function () {
DupPro.Pack.ToggleDBExcluded();
})
$('.dup-components-shortcut-radio').change(function () {
DupPro.Pack.ToggleComponentsSelect();
})
$('.dup-components-checkbox').change(function(){
DupPro.Pack.ToggleDBOnly()
DupPro.Pack.ToggleMediaOnly()
})
$('#package_component_plugins').change(function () {
DupPro.Pack.ToggleActivePlugins();
});
$('#package_component_themes').change(function () {
DupPro.Pack.ToggleActiveThemes();
});
});
</script>

View File

@@ -0,0 +1,70 @@
<?php
/**
* Duplicator package row in table packages list
*
* @package Duplicator
* @copyright (c) 2022, Snap Creek LLC
*/
use Duplicator\Package\Create\BuildComponents;
defined("ABSPATH") or die("");
/**
* Variables
*
* @var \Duplicator\Core\Controllers\ControllersManager $ctrlMng
* @var \Duplicator\Core\Views\TplMng $tplMng
* @var array<string, mixed> $tplData
*/
?>
<p>
<?php esc_html_e('Package components allow you to include/exclude differents part of your WordPress installation in the package.', 'duplicator-pro'); ?>
</p>
<ul>
<li>
<b><?php echo esc_html(BuildComponents::getLabel(BuildComponents::COMP_DB)); ?></b>:
<?php esc_html_e('Include the database in the package.', 'duplicator-pro'); ?>
</li>
<li>
<b><?php echo esc_html(BuildComponents::getLabel(BuildComponents::COMP_CORE)); ?></b>:
<?php esc_html_e('Includes WordPress core files in the package (e.g. wp-include, wp-admin wp-login.php and other.', 'duplicator-pro'); ?>
</li>
<li>
<b><?php echo esc_html(BuildComponents::getLabel(BuildComponents::COMP_PLUGINS)); ?></b>:
<?php
printf(
esc_html_x(
'Include the plugins in the package. With the %1$sactive only%2$s option enabled, only active plugins will be included in the package.',
'%1$s and %2$s represent opening and closing bold (<b> and </b>) tags',
'duplicator-pro'
),
'<b>',
'</b>'
);
?>
</li>
<li>
<b><?php echo esc_html(BuildComponents::getLabel(BuildComponents::COMP_THEMES)); ?></b>:
<?php
printf(
esc_html_x(
'Include the themes in the package. With the %1$sactive only%2$s option enabled, only active themes will be included in the package.',
'%1$s and %2$s represent opening and closing bold (<b> and </b>) tags',
'duplicator-pro'
),
'<b>',
'</b>'
);
?>
</li>
<li>
<b><?php echo esc_html(BuildComponents::getLabel(BuildComponents::COMP_UPLOADS)); ?></b>:
<?php esc_html_e('Include the \'uploads\' folder.', 'duplicator-pro'); ?>
</li>
<li>
<b><?php echo esc_html(BuildComponents::getLabel(BuildComponents::COMP_OTHER)); ?></b>:
<?php esc_html_e('Include non-WordPress files and folders in the root directory.', 'duplicator-pro'); ?>
</li>
</ul>

View File

@@ -0,0 +1,325 @@
<?php
/**
* Duplicator package row in table packages list
*
* @package Duplicator
* @copyright (c) 2022, Snap Creek LLC
*/
use Duplicator\Libs\Snap\SnapWP;
defined("ABSPATH") or die("");
/**
* Variables
*
* @var \Duplicator\Core\Controllers\ControllersManager $ctrlMng
* @var \Duplicator\Core\Views\TplMng $tplMng
* @var array<string, mixed> $tplData
* @var \wpdb $wpdb
*/
$dbFilterOn = isset($tplData['dbFilterOn']) ? $tplData['dbFilterOn'] : false;
$dbPrefixFilter = isset($tplData['dbPrefixFilter']) ? $tplData['dbPrefixFilter'] : false;
$dbPrefixSubFilter = isset($tplData['dbPrefixSubFilter']) ? $tplData['dbPrefixSubFilter'] : false;
$tSelected = isset($tplData['tablesSlected']) ? $tplData['tablesSlected'] : array();
$dbTableCount = 1;
global $wpdb;
$toolTipPrefixFilterContent = sprintf(
__(
'By enabling this option all tables that do not start with the prefix <b>"%s"</b> are excluded from the package.',
'duplicator-pro'
),
esc_html($wpdb->prefix)
) . ' ' .
__(
'This option is useful for multiple WordPress installs in the same database or if several applications are installed in the same database.',
'duplicator-pro'
);
$toolTipSubsiteFilterContent =
__('Enabling this option excludes all tables associated with deleted sites from the package.', 'duplicator-pro') . '<br><br>' .
__(
'When deleting a site in a multisite; WordPress deletes the tables of items related to the core, however it is not assumed that the tables of third party plugins are removed.', // phpcs:ignore Generic.Files.LineLength
'duplicator-pro'
) . ' ' .
__('With a multisite with a large number of deleted sites the database may be full of unused tables.', 'duplicator-pro') . ' ' .
__('With this option only the tables of currently existing sites will be included in the backup.', 'duplicator-pro');
?>
<div class="dup-package-hdr-1">
<?php esc_html_e("Filters", 'duplicator-pro') ?>
</div>
<div class="dup-form-item">
<span class="title">
<?php esc_html_e("Enable Filters", 'duplicator-pro') ?>:
</span>
<span class="input">
<label>
<input type="checkbox" id="dbfilter-on" name="dbfilter-on" <?php checked($dbFilterOn); ?> >
<?php esc_html_e("Allow database tables to be excluded", 'duplicator-pro') ?>
</label>
<?php
$tipCont = __(
'Table filters allow you to ignore specific tables from a database.
When creating a package only include the data you want and need.
This helps to speed up the build process and keep your backups simple and clean.
Tables that are checked will be excluded.
Tables with an * in red are core WordPress tables and should typically not be excluded.',
'duplicator-pro'
);
?>
<i class="fas fa-question-circle fa-sm"
data-tooltip-title="<?php esc_attr_e("Database Table Filters", 'duplicator-pro'); ?>"
data-tooltip="<?php echo esc_attr($tipCont); ?>"
>
</i>
</span>
</div>
<div class="dup-form-item">
<span class="title">
<?php esc_html_e("Table Prefixes", 'duplicator-pro') ?>:
</span>
<span class="input">
<label>
<input
type="checkbox"
id="db-prefix-filter"
name="db-prefix-filter"
<?php checked($dbPrefixFilter); ?>
<?php disabled(!$dbFilterOn); ?>
data-prefix-value="<?php echo esc_attr($wpdb->prefix); ?>" />
<?php
esc_html_e('Filter tables without current WordPress prefix', 'duplicator-pro');
echo isset($wpdb->prefix) ? '&nbsp;<i>(' . esc_html($wpdb->prefix) . ')</i>&nbsp;' : '';
?>
</label>
<i class="fas fa-question-circle fa-sm"
data-tooltip-title="<?php esc_attr_e("WordPress Prefix Filters", 'duplicator-pro'); ?>"
data-tooltip="<?php echo esc_attr($toolTipPrefixFilterContent); ?>"> <br/>
</i>
</span>
</div>
<?php if (is_multisite()) { ?>
<div class="dup-form-item">
<span class="title">
<?php esc_html_e("Subsites", 'duplicator-pro') ?>:
</span>
<span class="input">
<label>
<input
type="checkbox"
id="db-prefix-sub-filter"
name="db-prefix-sub-filter"
<?php checked($dbPrefixSubFilter); ?>
<?php disabled(!$dbFilterOn); ?>
>
<?php esc_html_e("Filter/Hide Tables of Deleted Multisite-Subsites", 'duplicator-pro') ?>
</label>
<i class="fas fa-question-circle fa-sm"
data-tooltip-title="<?php esc_attr_e("Multisite-Subsite Filters", 'duplicator-pro'); ?>"
data-tooltip="<?php echo esc_attr($toolTipSubsiteFilterContent); ?>">
</i>
</span>
</div>
<?php } ?>
<div id="dup-db-filter-items" >
<div class="dup-db-filter-buttons" >
<span id="dbnone" class="link-style dup-db-filter-none">
<i class="far fa-minus-square fa-lg" title="<?php esc_html_e('Uncheck All Checkboxes', 'duplicator-pro'); ?>"></i>
</span>&nbsp;
<span id="dball" class="link-style dup-db-filter-all">
<i class="far fa-check-square fa-lg" title="<?php esc_html_e('Check All Checkboxes', 'duplicator-pro'); ?>"></i>
</span>
</div>
<div id="dup-db-tables-exclude-wrapper" >
<div id="dup-db-tables-exclude" >
<input type="hidden" id="dup-db-tables-lists" name="dbtables-list" value="" >
<?php
$substesIds = SnapWP::getSitesIds();
foreach (DUP_PRO_DB::getTablesList() as $table) {
$info = SnapWP::getTableInfoByName($table, $wpdb->prefix);
$classes = array('table-item');
if ($info['isCore']) {
$classes[] = 'core-table';
$core_note = '*';
if ($info['subsiteId'] > 0) {
$classes[] = ' subcore-table-' . ($info['subsiteId'] % 2);
}
} else {
$core_note = '';
}
$dbTableCount++;
$cboxClasses = array('dup-pseudo-checkbox');
$checked = in_array($table, $tSelected);
if ($info['subsiteId'] > 1 && !in_array($info['subsiteId'], $substesIds)) {
$classes[] = 'no-subsite-exists';
if ($dbPrefixSubFilter) {
$cboxClasses[] = 'disabled';
$checked = true;
}
}
if ($info['havePrefix'] == false) {
$classes[] = 'no-prefix-table';
if ($dbPrefixFilter) {
$cboxClasses[] = 'disabled';
$checked = true;
}
}
if ($checked) {
$cboxClasses[] = 'checked';
}
?>
<label class="<?php echo esc_attr(implode(' ', $classes)); ?>">
<span
class="<?php echo esc_attr(implode(' ', $cboxClasses)); ?>"
aria-checked="<?php echo $checked ? "true" : "false";?>"
role="checkbox"
data-value="<?php echo esc_attr($table); ?>">
</span>
&nbsp;<span><?php echo esc_html($table . $core_note); ?></span>
</label>
<?php } ?>
</div>
<div id="dup-db-filter-items-no-filters">
<div>
<?php esc_html_e('- Table Filters Disabled -', 'duplicator-pro'); ?><br>
<?php printf(esc_html_x('All %d tables will be included in this build.', '%d = number of tables', 'duplicator-pro'), (int) $dbTableCount); ?>
</div>
</div>
</div>
<div class="dup-tabs-opts-help">
<?php
echo wp_kses(__("Checked tables will be <u>excluded</u> from the database script. ", 'duplicator-pro'), array('u' => array()));
esc_html_e("Excluding certain tables can cause your site or plugins to not work correctly after install!", 'duplicator-pro');
echo '<br>';
echo '<i class="core-table-info"> ';
esc_html_e(
"Use caution when excluding tables! It is highly recommended to not exclude WordPress core tables in red with an *,
unless you know the impact.",
'duplicator-pro'
);
echo '</i>';
?>
</div>
</div>
<script>
jQuery(function($)
{
/* METHOD: Toggle Database table filter red icon */
DupPro.Pack.ToggleDBFiltersRedIcon = function() {
if (
$("#dbfilter-on").is(':checked')
) {
$('#dup-archive-filter-db').show();
$('#db-prefix-filter').prop('disabled', false);
$('#db-prefix-sub-filter').prop('disabled', false);
} else {
$('#dup-archive-filter-db').hide();
$('#db-prefix-filter').prop('disabled', true);
$('#db-prefix-sub-filter').prop('disabled', true);
}
}
DupPro.Pack.ToggleDBFilters = function ()
{
var filterItems = $('#dup-db-filter-items');
if (
$("#dbfilter-on").is(':checked')
) {
filterItems.removeClass('disabled');
$('#dup-db-filter-items-no-filters').hide();
} else {
filterItems.addClass('disabled');
$('#dup-db-filter-items-no-filters').show();
}
DupPro.Pack.ToggleDBFiltersRedIcon();
};
DupPro.Pack.FillExcludeTablesList = function () {
let values = $("#dup-db-tables-exclude .dup-pseudo-checkbox.checked")
.map(function() {
return this.getAttribute('data-value');
})
.get()
.join();
$('#dup-db-tables-lists').val(values);
};
DupPro.Pack.ToggleNoPrefixTables = function (removeCheckOnEnable = true) {
let checkNode = $('#db-prefix-filter');
let display = !checkNode.is(":checked");
$("#dup-db-tables-exclude .no-prefix-table").each(function() {
let checkBox = $(this).find(".dup-pseudo-checkbox").first();
if (display) {
checkBox.removeClass('disabled');
if(removeCheckOnEnable) {
checkBox.removeClass("checked");
}
} else {
checkBox
.addClass('disabled')
.addClass("checked");
}
});
DupPro.Pack.ToggleDBFiltersRedIcon();
}
DupPro.Pack.ToggleNoSubsiteExistsTables = function (removeCheckOnEnable = true) {
let checkNode = $('#db-prefix-sub-filter');
let display = !checkNode.is(":checked");
$("#dup-db-tables-exclude .no-subsite-exists").each(function() {
let checkBox = $(this).find(".dup-pseudo-checkbox").first();
if (display) {
checkBox.removeClass('disabled');
if(removeCheckOnEnable) {
checkBox.removeClass("checked");
}
} else {
checkBox
.addClass('disabled')
.addClass("checked");
}
});
DupPro.Pack.ToggleDBFiltersRedIcon();
}
});
jQuery(document).ready(function($)
{
let tablesToExclude = $("#dup-db-tables-exclude");
$('.dup-db-filter-none').click(function () {
tablesToExclude.find(".dup-pseudo-checkbox.checked").removeClass("checked");
});
$('.dup-db-filter-all').click(function () {
tablesToExclude.find(".dup-pseudo-checkbox:not(.checked)").addClass("checked");
});
$('#db-prefix-sub-filter').change(DupPro.Pack.ToggleNoSubsiteExistsTables);
$('#db-prefix-filter').change(DupPro.Pack.ToggleNoPrefixTables);
$('#dbfilter-on').change(DupPro.Pack.ToggleDBFilters);
DupPro.Pack.ToggleDBFilters();
});
</script>

View File

@@ -0,0 +1,33 @@
<?php
/**
* @package Duplicator
* @copyright (c) 2022, Snap Creek LLC
*/
use Duplicator\Utils\Help\Article;
defined("ABSPATH") or die("");
/**
* Variables
*
* @var \Duplicator\Core\Controllers\ControllersManager $ctrlMng
* @var \Duplicator\Core\Views\TplMng $tplMng
* @var array<string, mixed> $tplData
*/
/** @var Article[] $articles p*/
$articles = $tplData['articles'];
$listClass = isset($tplData['list_class']) ? 'class="' . $tplData['list_class'] . '"' : '';
?>
<?php if (count($articles) > 0) : ?>
<ul <?php echo $listClass; ?>>
<?php foreach ($articles as $article) : ?>
<li class="duplicator-pro-help-article" data-id="<?php echo (int) $article->getId(); ?>">
<i aria-hidden="true" class="fa fa-file-alt"></i>
<a href="<?php echo esc_url($article->getLink()); ?>" target="_blank"><?php echo esc_html($article->getTitle()); ?></a>
</li>
<?php endforeach; ?>
</ul>
<?php endif; ?>

View File

@@ -0,0 +1,61 @@
<?php
/**
* @package Duplicator
* @copyright (c) 2022, Snap Creek LLC
*/
use Duplicator\Utils\Help\Category;
use Duplicator\Utils\Help\Help;
defined("ABSPATH") or die("");
/**
* Variables
*
* @var \Duplicator\Core\Controllers\ControllersManager $ctrlMng
* @var \Duplicator\Core\Views\TplMng $tplMng
* @var array<string, mixed> $tplData
*/
/** @var Category[] $categories */
$categories = $tplData['categories'];
if (empty($categories)) : ?>
<p>
<?php
printf(
esc_html_x(
'Could not fetch help information. Please try again later or visit the %1$sonline docs%2$s.',
'%1$s and %2$s are the opening and closing tags for the link to the online docs.',
'duplicator-pro'
),
'<a href="' . esc_url(DUPLICATOR_PRO_BLOG_URL . 'docs') . '" target="_blank">',
'</a>'
);
?>
</p>
<?php else : ?>
<ul class="duplicator-pro-help-category-list">
<?php foreach ($categories as $category) : ?>
<li class="duplicator-pro-help-category">
<header>
<i class="fa fa-folder-open"></i>
<span><?php echo esc_html($category->getName()); ?></span>
<i class="fa fa-angle-right"></i>
</header>
<?php if (count($category->getChildren()) > 0) { ?>
<?php $tplMng->render('parts/help/category-list', ['categories' => $category->getChildren()]);
} ?>
<?php if ($category->getArticleCount() > 0) : ?>
<?php $tplMng->render(
'parts/help/article-list',
[
'articles' => Help::getInstance()->getArticlesByCategory($category->getId()),
'list_class' => 'duplicator-pro-help-article-list',
]
); ?>
<?php endif; ?>
</li>
<?php endforeach; ?>
</ul>
<?php endif; ?>

View File

@@ -0,0 +1,245 @@
<?php
/**
* @package Duplicator
* @copyright (c) 2022, Snap Creek LLC
*/
use Duplicator\Utils\Help\Help;
defined("ABSPATH") or die("");
/**
* Variables
*
* @var \Duplicator\Core\Controllers\ControllersManager $ctrlMng
* @var \Duplicator\Core\Views\TplMng $tplMng
* @var array<string, mixed> $tplData
*/
?>
<style>
/* Dynamic Help Style */
#duplicator-pro-help-wrapper {
display: block;
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
background-color: #fff;
overflow-y: auto;
box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.1);
-webkit-font-smoothing: antialiased !important;
-moz-osx-font-smoothing: grayscale !important;
}
#duplicator-pro-help-header {
position: fixed;
display: flex;
flex-direction: row;
justify-content: space-between;
width: 90%;
top: 30px;
left: 5%;
}
#duplicator-pro-help-content {
width: 700px;
margin: 150px auto 50px;
}
@media only screen and (max-width: 700px) {
#duplicator-pro-help-content {
width: 90%;
}
}
#duplicator-pro-help-search {
margin-bottom: 30px;
}
#duplicator-pro-help-search-results-empty {
display: none;
}
#duplicator-pro-help-search-results,
#duplicator-pro-help-search-results-empty {
margin-top: 50px;
}
#duplicator-pro-help-search input {
border: 1px solid #999999;
border-radius: 25px;
color: #444444;
font-size: 20px;
letter-spacing: 0;
line-height: 20px;
min-height: 48px;
padding: 10px 10px 10px 25px;
text-align: left;
width: 100%;
}
#duplicator-pro-help-categories > ul > li ul {
display: none;
margin-left: 30px;
}
#duplicator-pro-help-categories > ul > li .duplicator-pro-help-category:last-of-type {
border-bottom: 0;
}
.duplicator-pro-help-category {
border-top: 1px solid #dddddd;
margin: 0;
width: 100%;
}
.duplicator-pro-help-category:last-of-type {
border-bottom: 1px solid #dddddd;
}
.duplicator-pro-help-category header {
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
cursor: pointer;
padding: 20px 0;
}
.duplicator-pro-help-category header span {
color: #444444;
font-size: 16px;
font-weight: 600;
}
.duplicator-pro-help-category header .fa-folder-open {
color: #999999;
font-size: 21px;
margin-right: 10px;
}
.duplicator-pro-help-category header .fa-angle-right {
color: #cccccc;
font-size: 24px;
margin-left: auto;
transition-property: transform;
transition-duration: 0.25s;
transition-timing-function: ease-out;
}
.duplicator-pro-help-article-list {
display: none;
margin-top: 20px;
}
.duplicator-pro-help-article {
margin: 0;
padding: 0 0 14px 4px;
}
.duplicator-pro-help-article .fa-file-alt {
color: #b6b6b6;
font-size: 16px;
margin: 0 14px 0 0;
}
.duplicator-pro-help-article a {
border-bottom: 1px solid transparent;
color: #666;
font-size: 15px;
text-decoration: none;
}
#duplicator-pro-help-footer {
display: flex;
flex-direction: row;
justify-content: space-between;
margin-top: 50px;
}
.duplicator-pro-help-footer-block {
border: 1px solid #ddd;
border-radius: 6px;
box-sizing: border-box;
max-width: 340px;
padding: 25px;
text-align: center;
}
.duplicator-pro-help-footer-block i {
color: #999;
font-size: 48px;
margin: 0 0 20px 0;
}
.duplicator-pro-help-footer-block h3 {
color: #444;
font-size: 16px;
margin: 0 0 10px 0;
font-weight: bold;
}
.duplicator-pro-help-footer-block p {
color: #777777;
font-size: 14px;
margin: 0 0 20px 0;
}
.duplicator-pro-help-footer-block .button {
border: 1px solid #af9ca6 !important;
color: #4f394d !important;
background: transparent !important;
font-size: 15px !important;
}
</style>
<div id="duplicator-pro-help-wrapper">
<div id="duplicator-pro-help-header">
<img src="<?php echo esc_url(DUPLICATOR_PRO_PLUGIN_URL . 'assets/img/duplicator-header-logo.svg'); ?>" />
</div>
<div id="duplicator-pro-help-content">
<div id="duplicator-pro-help-search">
<input type="text" placeholder="<?php esc_attr_e("Search", "duplicator-pro"); ?>" />
<ul id="duplicator-pro-help-search-results"></ul>
<div id="duplicator-pro-help-search-results-empty"><?php esc_html_e("No results found", "duplicator-pro"); ?></div>
</div>
<div id="duplicator-pro-context-articles">
<?php if (count(Help::getInstance()->getArticlesByTag($tplData['tag'])) > 0) : ?>
<h2><?php esc_html_e("Related Articles", "duplicator-pro"); ?></h2>
<?php $tplMng->render('parts/help/article-list', ['articles' => Help::getInstance()->getArticlesByTag($tplData['tag'])]); ?>
<?php endif; ?>
</div>
<div id="duplicator-pro-help-categories">
<?php $tplMng->render('parts/help/category-list', ['categories' => Help::getInstance()->getTopLevelCategories()]); ?>
</div>
<div id="duplicator-pro-help-footer">
<div class="duplicator-pro-help-footer-block">
<i aria-hidden="true" class="fa fa-file-alt"></i>
<h3><?php esc_html_e("View Documentation", "duplicator-pro"); ?></h3>
<p>
<?php esc_html_e("Browse documentation, reference material, and tutorials for Duplicator.", "duplicator-pro"); ?>
</p>
<a
href="<?php echo esc_url(DUPLICATOR_PRO_BLOG_URL . 'docs'); ?>"
rel="noopener noreferrer"
target="_blank"
class="button">
<?php esc_html_e("View All Documentation", "duplicator-pro"); ?>
</a>
</div>
<div class="duplicator-pro-help-footer-block">
<i aria-hidden="true" class="fa fa-life-ring"></i>
<h3><?php esc_html_e("Get Support", "duplicator-pro"); ?></h3>
<p><?php esc_html_e("You can access our world-class support below.", "duplicator-pro"); ?></p>
<a
href="<?php echo esc_url(DUPLICATOR_PRO_BLOG_URL . 'my-account/support/'); ?>"
rel="noopener noreferrer"
target="_blank"
class="button">
<?php esc_html_e("Get Support", "duplicator-pro"); ?>
</a>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,56 @@
<?php
/**
* Duplicator messages sections
*
* @package Duplicator
* @copyright (c) 2022, Snap Creek LLC
*/
use Duplicator\Views\AdminNotices;
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-messages-section" >
<?php
if (isset($tplData['errorMessage']) && strlen($tplData['errorMessage']) > 0) {
AdminNotices::displayGeneralAdminNotice(
$tplData['errorMessage'],
AdminNotices::GEN_ERROR_NOTICE,
true
);
}
if (DUPLICATOR_PRO_DEBUG_TPL_OUTPUT_INVALID && isset($tplData['invalidOutput']) && strlen($tplData['invalidOutput']) > 0) { // @phpstan-ignore-line
AdminNotices::displayGeneralAdminNotice(
'<b>Invalid output on actions execution</b><hr>' . $tplData['invalidOutput'],
AdminNotices::GEN_ERROR_NOTICE,
true
);
}
if (isset($tplData['successMessage']) && strlen($tplData['successMessage']) > 0) {
AdminNotices::displayGeneralAdminNotice(
$tplData['successMessage'],
AdminNotices::GEN_SUCCESS_NOTICE,
true
);
}
?>
</div>
<?php
if (DUPLICATOR_PRO_DEBUG_TPL_DATA) { // @phpstan-ignore-line
?>
<pre style="font-size: 12px; max-height: 300px; overflow: auto; border: 1px solid black; padding: 10px;"><?php
var_dump($tplData);
?></pre>
<?php
}

View File

@@ -0,0 +1,68 @@
<?php
/**
* @package Duplicator
* @copyright (c) 2022, Snap Creek LLC
*/
use Duplicator\Controllers\ToolsPageController;
use Duplicator\Core\Controllers\ControllersManager;
use Duplicator\Core\MigrationMng;
defined("ABSPATH") or die("");
/**
* Variables
*
* @var \Duplicator\Core\Controllers\ControllersManager $ctrlMng
* @var \Duplicator\Core\Views\TplMng $tplMng
* @var array<string, mixed> $tplData
*/
$safeMsg = MigrationMng::getSaveModeWarning();
$url = $ctrlMng->getMenuLink(ControllersManager::TOOLS_SUBMENU_SLUG, ToolsPageController::L2_SLUG_DISAGNOSTIC);
;
?>
<div class="notice notice-success dpro-admin-notice dup-migration-pass-wrapper" >
<p>
<b><?php
if (MigrationMng::getMigrationData()->restoreBackupMode) {
esc_html_e('Restore Backup Almost Complete!', 'duplicator-pro');
} else {
esc_html_e('Migration Almost Complete!', 'duplicator-pro');
}
?></b>
</p>
<p>
<?php
esc_html_e(
'Reserved Duplicator Pro installation files have been detected in the root directory.
Please delete these installation files to avoid security issues.',
'duplicator-pro'
);
?>
<br/>
<?php esc_html_e('Go to: Tools > General > Information > Stored Data > and click the "Remove Installation Files" button', 'duplicator-pro'); ?><br>
<a id="dpro-notice-action-general-site-page" href="<?php echo esc_url($url); ?>">
<?php esc_html_e('Take me there now!', 'duplicator-pro'); ?>
</a>
</p>
<?php if (strlen($safeMsg) > 0) { ?>
<div class="notice-safemode">
<?php echo esc_html($safeMsg); ?>
</div>
<?php } ?>
<p class="sub-note">
<i><?php
esc_html_e(
'If an archive.zip/daf file was intentially added to the root directory
to perform an overwrite install of this site then you can ignore this message.',
'duplicator-pro'
);
?>
</i>
</p>
<?php echo apply_filters(MigrationMng::HOOK_BOTTOM_MIGRATION_MESSAGE, ''); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
</div>

View File

@@ -0,0 +1,113 @@
<?php
/**
* @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
*/
$fileRemoved = $tplData['installerCleanupFiles'];
$removeError = $tplData['installerCleanupError'];
$purgeCaches = $tplData['installerCleanupPurge'];
?>
<div class="dpro-diagnostic-action-installer">
<p>
<b><?php esc_html_e('Installation cleanup ran!', 'duplicator-pro'); ?></b>
</p>
<?php
if (count($fileRemoved) === 0) {
?>
<p>
<b><?php esc_html_e('No Duplicator files were found on this WordPress Site.', 'duplicator-pro'); ?></b>
</p> <?php
} else {
foreach ($fileRemoved as $path => $success) {
if ($success) {
?><div class="success">
<i class="fa fa-check"></i> <?php esc_html_e("Removed", 'duplicator-pro'); ?> - <?php echo esc_html($path); ?>
</div><?php
} else {
?><div class="failed">
<i class='fa fa-exclamation-triangle'></i> <?php esc_html_e("Found", 'duplicator-pro'); ?> - <?php echo esc_html($path); ?>
</div>
<?php
}
}
}
foreach ($purgeCaches as $message) {
?><div class="success">
<i class="fa fa-check"></i> <?php echo wp_kses($message, ViewHelper::GEN_KSES_TAGS); ?>
</div>
<?php
}
if ($removeError) {
?>
<p>
<?php esc_html_e('Some of the installer files did not get removed, ', 'duplicator-pro'); ?>
<span class="link-style" onclick="DupPro.Tools.removeInstallerFiles();">
<?php esc_html_e('please retry the installer cleanup process', 'duplicator-pro'); ?>
</span><br>
<?php esc_html_e(' If this process continues please see the previous FAQ link.', 'duplicator-pro'); ?>
</p>
<?php
}
?>
<div style="font-style: italic; max-width:900px; padding:10px 0 25px 0;">
<p>
<b><i class="fa fa-shield-alt"></i> <?php esc_html_e('Security Notes', 'duplicator-pro'); ?>:</b>
<?php
esc_html_e(
'If the installer files do not successfully get removed with this action,
then they WILL need to be removed manually through your hosts control panel or FTP.
Please remove all installer files to avoid any security issues on this site.',
'duplicator-pro'
);
?><br>
<?php
printf(
esc_html_x(
'For more details please visit the FAQ link %1$sWhich files need to be removed after an install?%2$s',
'%1$s and %2$s represents the opening and closing HTML tags for an anchor or link',
'duplicator-pro'
),
'<a href="' . esc_url(DUPLICATOR_PRO_DUPLICATOR_DOCS_URL . 'which-files-need-to-be-removed-after-an-install') . '" target="_blank">',
'</a>'
);
?>
</p>
<p>
<b><i class="fa fa-thumbs-up"></i> <?php esc_html_e('Help Support Duplicator', 'duplicator-pro'); ?>:</b>
<?php
esc_html_e(
'The Duplicator team has worked many years to make moving a WordPress site a much easier process. ',
'duplicator-pro'
);
?>
<br>
<?php
printf(
esc_html_x(
'Show your support with a %1$s5 star review%2$s! We would be thrilled if you could!',
'%1$s and %2$s represents the opening and closing HTML tags for an anchor or link',
'duplicator-pro'
),
'<a href="https://wordpress.org/support/plugin/duplicator/reviews/?filter=5" target="_blank">',
'</a>'
);
?>
</p>
</div>
</div>

View File

@@ -0,0 +1,111 @@
<?php
/**
* @package Duplicator
* @copyright (c) 2022, Snap Creek LLC
*/
use Duplicator\Core\MigrationMng;
defined("ABSPATH") or die("");
/**
* Variables
*
* @var \Duplicator\Core\Controllers\ControllersManager $ctrlMng
* @var \Duplicator\Core\Views\TplMng $tplMng
* @var array<string, mixed> $tplData
*/
if (!isset($tplData['isMigrationSuccessNotice']) || !$tplData['isMigrationSuccessNotice']) {
$tplMng->render('parts/migration/tool-cleanup-installer-files');
return;
}
$safeMsg = MigrationMng::getSaveModeWarning();
$cleanupReport = MigrationMng::getCleanupReport();
?>
<div class="notice notice-success dpro-admin-notice dup-migration-pass-wrapper">
<div class="dup-migration-pass-title">
<i class="fa fa-check-circle"></i> <?php
if (MigrationMng::getMigrationData()->restoreBackupMode) {
esc_html_e('This site has been successfully restored!', 'duplicator-pro');
} else {
esc_html_e('This site has been successfully migrated!', 'duplicator-pro');
}
?>
</div>
<p>
<?php
printf(
esc_html__(
'The following installation files are stored in the folder %s',
'duplicator-pro'
),
'<b>' . esc_html(DUPLICATOR_PRO_SSDIR_PATH_INSTALLER) . '</b>'
);
?>
</p>
<ul class="dup-stored-minstallation-files">
<?php foreach (MigrationMng::getStoredMigrationLists() as $path => $label) { ?>
<li>
- <?php echo esc_html($label); ?>
</li>
<?php } ?>
</ul>
<?php
if (isset($tplData['isInstallerCleanup']) && $tplData['isInstallerCleanup']) {
$tplMng->render('parts/migration/clean-installation-files');
} else {
if (count($cleanupReport['instFile']) > 0) { ?>
<p>
<?php esc_html_e('Security actions:', 'duplicator-pro'); ?>
</p>
<ul class="dup-stored-minstallation-files">
<?php
foreach ($cleanupReport['instFile'] as $html) { ?>
<li>
<?php echo $html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
</li>
<?php } ?>
</ul>
<?php } ?>
<p>
<b><?php esc_html_e('Final step:', 'duplicator-pro'); ?></b><br>
<span id="dpro-notice-action-remove-installer-files" class="link-style" onclick="DupPro.Tools.removeInstallerFiles();">
<?php esc_html_e('Remove Installation Files Now!', 'duplicator-pro'); ?>
</span>
</p>
<?php if (strlen($safeMsg) > 0) { ?>
<div class="notice-safemode">
<?php echo esc_html($safeMsg); ?>
</div>
<?php } ?>
<p class="sub-note">
<i><?php
esc_html_e(
'Note: This message will be removed after all installer files are removed.
Installer files must be removed to maintain a secure site.
Click the link above to remove all installer files and complete the migration.',
'duplicator-pro'
);
?><br>
<i class="fas fa-info-circle"></i>
<?php
esc_html_e(
'If an archive.zip/daf file was intentially added to the root directory to perform an overwrite install
of this site then you can ignore this message.',
'duplicator-pro'
)
?>
</i>
</p>
<?php
}
echo apply_filters(MigrationMng::HOOK_BOTTOM_MIGRATION_MESSAGE, ''); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
?>
</div>

View File

@@ -0,0 +1,24 @@
<?php
/**
* @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
*/
if (!isset($tplData['isInstallerCleanup']) || !$tplData['isInstallerCleanup']) {
return;
}
?>
<div id="message" class="notice notice-success">
<?php $tplMng->render('parts/migration/clean-installation-files'); ?>
</div>

View File

@@ -0,0 +1,316 @@
<?php
/**
* Duplicator package row in table packages list
*
* @package Duplicator
* @copyright (c) 2022, Snap Creek LLC
*/
use Duplicator\Controllers\RecoveryController;
use Duplicator\Controllers\StoragePageController;
use Duplicator\Core\Controllers\ControllersManager;
use Duplicator\Core\Views\TplMng;
use Duplicator\Package\Create\BuildComponents;
use Duplicator\Package\Recovery\RecoveryStatus;
use Duplicator\Views\ViewHelper;
defined("ABSPATH") or die("");
/**
* Variables
*
* @var ControllersManager $ctrlMng
* @var TplMng $tplMng
* @var array<string, mixed> $tplData
* @var RecoveryStatus $recoverStatus
*/
$recoverStatus = $tplData['recoverStatus'];
$filteredData = $recoverStatus->getFilteredData();
$activeType = $recoverStatus->getType();
$activeLabel = strtolower($recoverStatus->getTypeLabel());
$isLocalStorageSafe = $recoverStatus->isLocalStorageEnabled();
$isWordPressCoreSafe = $recoverStatus->isWordPressCoreComplete();
$isDatabaseSafe = $recoverStatus->isDatabaseComplete();
$isMultisiteComplete = $recoverStatus->isMultisiteComplete();
$editDefaultStorageURL = StoragePageController::getEditDefaultUrl();
//echo '<pre>';var_export($isWordPressCoreSafe); echo '</pre>';
//echo '<pre>';var_export($recoverStatus->activeTemplate); echo '</pre>';
/**
* @var wpdb $wpdb
*/
global $wpdb;
?>
<div class="dup-recover-dlg-notice-box">
<div class="title-area">
<div class="title">
<?php esc_html_e("REQUIREMENTS", 'duplicator-pro'); ?>:
</div>
</div>
<!-- ===============
LOCAL SERVER STORAGE -->
<div class="req-data">
<?php
if ($activeType == $recoverStatus::TYPE_TEMPLATE) {
echo '<i class="far fa-question-circle fa-fw pass"></i>';
} else {
echo $isLocalStorageSafe
? '<i class="far fa-check-circle fa-fw pass"></i>'
: '<i class="far fa-times-circle fa-fw fail"></i>';
}
?>
<a class="req-title" href="javascript:void(0)" onclick="jQuery(this).parent().children('div.req-info').toggle();">
<?php esc_html_e("Local Server Storage", 'duplicator-pro'); ?>
</a>
<div class="req-info">
<i class="fas fa-server fa-fw fa-lg"></i>
<?php esc_html_e("Recovery points require one of the following 'Local Server' storage types:", 'duplicator-pro'); ?>
<ul class="req-info-list">
<li>
<?php
echo sprintf(
"<i class='far fa-hdd fa-fw'></i><sup>"
. wp_kses(ViewHelper::disasterIcon(false), ['i' => ['class' => []]])
. "</sup>&nbsp; "
. "<b><a href='" . esc_url($editDefaultStorageURL) . "' target='_blank'>%s</a></b> %s",
esc_html__('[Local Default]', 'duplicator-pro'),
esc_html__('This is the default built-in local storage type.', 'duplicator-pro')
);
?>
</li>
<li>
<?php
echo sprintf(
"<i class='fas fa-hdd'></i><sup>"
. wp_kses(ViewHelper::disasterIcon(false), ['i' => ['class' => []]])
. "</sup>&nbsp; <b>%s</b> %s",
esc_html__('[Local Non-Default]', 'duplicator-pro'),
esc_html__('This is a custom directory on this server.', 'duplicator-pro')
);
?>
</li>
</ul>
<div class="req-status">
<b><?php esc_html_e("STATUS", 'duplicator-pro'); ?>:</b><br/>
<?php
if ($activeType == $recoverStatus::TYPE_TEMPLATE) {
esc_html_e(
"Templates do not control storage locations, only schedules and new package creation control this process.",
'duplicator-pro'
);
echo ' ';
esc_html_e('No changes can be made to affect this test.', 'duplicator-pro');
} elseif ($isLocalStorageSafe) {
echo '<span class="darkgreen">';
echo esc_html__("At least one local server storage is associated with this ", 'duplicator-pro') . esc_html($activeLabel) . '.';
echo '</span>';
} else {
echo '<span class="maroon">';
echo esc_html__("No local server storage found for this ", 'duplicator-pro') . esc_html($activeLabel) . '.';
echo '</span>';
}
?>
</div>
</div>
</div>
<!-- ===============
WordPress CORE -->
<div class="req-data">
<?php
echo $isWordPressCoreSafe
? '<i class="far fa-check-circle fa-fw pass"></i>'
: '<i class="far fa-times-circle fa-fw fail"></i>';
?>
<a class="req-title" href="javascript:void(0)" onclick="jQuery(this).parent().children('div.req-info').toggle();">
<?php esc_html_e("WordPress Core Folders", 'duplicator-pro'); ?>
</a>
<div class="req-info">
<i class="fab fa-wordpress-simple fa-fw fa-lg"></i>
<?php esc_html_e(
"A recovery point needs all WordPress core folders included in the package (wp-admin, wp-content &amp; wp-includes).",
'duplicator-pro'
); ?>
<div class="req-status">
<b><?php esc_html_e("STATUS", 'duplicator-pro'); ?>:</b><br/>
<?php if (($filteredData['dbonly'])) : ?>
<span class="maroon">
<?php esc_html_e(
"Package is setup as a database only configuration, the core WordPress folders have been excluded automatically.",
'duplicator-pro'
); ?>
</span>
<?php elseif (count($filteredData['filterDirs']) > 0) : ?>
<span class="maroon">
<?php esc_html_e("WordPress core folders being filtered.", 'duplicator-pro'); ?>
<?php foreach ($filteredData['filterDirs'] as $path) { ?>
<small class="req-paths-data"><?php echo esc_html($path); ?></small>
<?php } ?>
</span>
<?php else : ?>
<span class="darkgreen">
<?php esc_html_e("No WordPress core folder filters set", 'duplicator-pro'); ?>.
</span>
<?php endif; ?>
</div>
</div>
</div>
<?php if (is_multisite()) { ?>
<!-- ===============
Multisite complete-->
<div class="req-data">
<?php
echo $isMultisiteComplete
? '<i class="far fa-check-circle fa-fw pass"></i>'
: '<i class="far fa-times-circle fa-fw fail"></i>';
?>
<a class="req-title" href="javascript:void(0)" onclick="jQuery(this).parent().children('div.req-info').toggle();">
<?php esc_html_e("Multisite", 'duplicator-pro'); ?>
</a>
<div class="req-info">
<?php esc_html_e(
"Some subisites are filterd.",
'duplicator-pro'
); ?>
</div>
</div>
<?php } ?>
<!-- ===============
DATABASE TABLES -->
<div class="req-data">
<?php
echo $isDatabaseSafe
? '<i class="far fa-check-circle fa-fw pass"></i>'
: '<i class="far fa-times-circle fa-fw fail"></i>';
?>
<a class="req-title" href="javascript:void(0)" onclick="jQuery(this).parent().children('div.req-info').toggle();">
<?php esc_html_e("Primary Database Tables", 'duplicator-pro'); ?>
</a>
<div class="req-info">
<i class="fas fa-database fa-fw fa-lg"></i>
<?php
echo sprintf(
"%s <i>'%s'</i> %s %s %s",
esc_html__('All database tables with the prefix', 'duplicator-pro'),
esc_html($wpdb->prefix),
esc_html__('must be included in the', 'duplicator-pro'),
esc_html($activeLabel),
esc_html__('for this to be an eligible recovery point.', 'duplicator-pro')
);
?>
<div class="req-status">
<b><?php esc_html_e("STATUS", 'duplicator-pro'); ?>:</b><br/>
<?php if (count($filteredData['filterTables']) > 0) : ?>
<?php esc_html_e("Filtered table list", 'duplicator-pro'); ?>:
<?php
foreach ($filteredData['filterTables'] as $table) {
if (strpos($table, $wpdb->prefix) !== false) {
echo '<small class="req-paths-data maroon">' . esc_html($table) . '</small>';
} else {
echo '<small class="req-paths-data darkgreen">' . esc_html($table) . '</small>';
}
}
?>
<?php else : ?>
<span class="darkgreen">
<?php esc_html_e("No table filters set on this package.", 'duplicator-pro'); ?>
</span>
<?php endif; ?>
</div>
</div>
</div>
<!-- ===============
PACKAGE COMPONENTS-->
<div class="req-data">
<?php if ($recoverStatus->hasRequiredComponents()) { ?>
<i class="far fa-check-circle fa-fw pass"></i>
<?php } else { ?>
<i class="far fa-times-circle fa-fw fail"></i>
<?php } ?>
<a class="req-title" href="javascript:void(0)" onclick="jQuery(this).parent().children('div.req-info').toggle();">
<?php esc_html_e("Package Components", 'duplicator-pro'); ?>
</a>
<div class="req-info">
<b><?php esc_html_e('Required components:', 'duplicator-pro'); ?>:</b>
<ul class="dup-recovery-package-components-required">
<?php foreach (RecoveryStatus::COMPONENTS_REQUIRED as $component) { ?>
<li>
<span class="label"><?php echo esc_html(BuildComponents::getLabel($component)); ?></span>
<span class="value">
<?php if ($recoverStatus->hasComponent($component)) { ?>
<i class="fas fa-check-circle green"></i> <?php esc_html_e('included', 'duplicator-pro'); ?>
<?php } else { ?>
<i class="fas fa-times-circle maroon"></i> <?php esc_html_e('excluded', 'duplicator-pro'); ?>
<?php } ?>
</span>
</li>
<?php } ?>
</ul>
</div>
</div><br/>
<div class="title-area">
<div class="title">
<?php esc_html_e("NOTES", 'duplicator-pro'); ?>:
</div>
</div>
<div class="req-notes">
<?php
switch ($recoverStatus->getType()) {
case $recoverStatus::TYPE_PACKAGE:
esc_html_e(
'To create a recovery-point enabled package change the conditions of the package build or template to meet the requirements listed above.',
'duplicator-pro'
);
echo ' ';
printf(
esc_html_x(
'Then use either the %1$sRecovery Point%2$s tool or the Recovery Point button to set which package you would like as the active recovery-point.', // phpcs:ignore Generic.Files.LineLength
'%1$s and %2$s represents the opening and closing HTML tags for an anchor or link',
'duplicator-pro'
),
'<a href="' . esc_url(RecoveryController::getRecoverPageLink()) . '" target="_blank" >',
'</a>'
);
break;
case $recoverStatus::TYPE_SCHEDULE:
esc_html_e(
'To change the recovery status visit the template link above and make sure that it passes the recovery status test.',
'duplicator-pro'
);
esc_html_e(
'If the local storage test does not pass check the schedule storage types and make sure the local server storage type is selected.',
'duplicator-pro'
);
esc_html_e(
'These steps are optional and only required if you want to enable this schedule as an active recovery point.',
'duplicator-pro'
);
break;
case $recoverStatus::TYPE_TEMPLATE:
esc_html_e(
'To change a template recovery point status to enabled, edit the template and make sure that it passes the recovery status test.',
'duplicator-pro'
);
break;
}
?>
</div>
</div>

View File

@@ -0,0 +1,48 @@
<?php
/**
* Duplicator package row in table packages list
*
* @package Duplicator
* @copyright (c) 2022, Snap Creek LLC
*/
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
* @var RecoveryPackage $recoverPackage
*/
$recoverPackage = $tplData['recoverPackage'];
?><!DOCTYPE html>
<html lang="en-US" >
<head>
<title><?php esc_html_e('Recovery package launcher', 'duplicator-pro'); ?></title>
</head>
<body>
<h2><?php printf(esc_html__('Recovery package launcher created on %s', 'duplicator-pro'), esc_html($recoverPackage->getCreated())); ?></h2>
<p>
<?php
printf(
esc_html_x(
'If the installer does not start automatically, you can click on this %1$slink and start it manually%2$s.',
'%1$s and %2$s represent the opening and closing link tags (<a> and </a>)',
'duplicator-pro'
),
'<a href="' . esc_url($recoverPackage->getInstallLink()) . '">',
'</a>'
);
?>
</p>
<script>
window.location.href = <?php echo json_encode($recoverPackage->getInstallLink()); ?>;
</script>
</body>
</html>

View File

@@ -0,0 +1,39 @@
<?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
* @var \DUP_PRO_Package $package
*/
$package = $tplData['package'];
$timeDiff = sprintf(
_x('%s ago', '%s represents the time diff, eg. 2 days', 'duplicator-pro'),
$package->getPackageLife('human')
);
?>
<table>
<tr>
<td><b><?php esc_html_e('Package', 'duplicator-pro'); ?>:</b></td>
<td><?php echo esc_html($package->Name); ?></td>
</tr>
<tr>
<td><b><?php esc_html_e('Created', 'duplicator-pro'); ?>:</b>&nbsp; </td>
<td>
<?php echo esc_html($package->getCreated()); ?>&nbsp;-&nbsp;<i><?php echo esc_html($timeDiff); ?></i>
</td>
</tr>
</table>

View File

@@ -0,0 +1,79 @@
<?php
/**
* Admin Notifications content.
*
* Variables
*
* @var \Duplicator\Core\Views\TplMng $tplMng
* @var array<string, mixed> $tplData
*/
use Duplicator\Utils\Email\EmailSummary;
defined('ABSPATH') || exit;
$global = DUP_PRO_Global_Entity::getInstance();
?>
<h3 class="title"><?php esc_html_e('Email Summary', 'duplicator-pro') ?></h3>
<hr size="1" />
<table class="dup-capabilities-selector-wrapper form-table">
<tr valign="top">
<th scope="row"><label><?php esc_html_e('Frequency', 'duplicator-pro'); ?></label></th>
<td>
<select id="email-summary-frequency" name="_email_summary_frequency">
<?php foreach (EmailSummary::getAllFrequencyOptions() as $key => $label) : ?>
<option value="<?php echo esc_attr((string) $key); ?>" <?php selected($global->getEmailSummaryFrequency(), $key); ?>>
<?php echo esc_html($label); ?>
</option>
<?php endforeach; ?>
</select>
<p class="description">
<?php
printf(
esc_html_x(
'You can view the email summary example %1$shere%2$s.',
'%1$s and %2$s are the opening and close <a> tags to the summary preview link',
'duplicator-pro'
),
'<a href="' . esc_url(EmailSummary::getPreviewLink()) . '" target="_blank">',
'</a>'
);
?>
</p>
</td>
</tr>
<tr valign="top">
<th scope="row"><label><?php esc_html_e('Recipients', 'duplicator-pro'); ?></label></th>
<td>
<select id="email-summary-recipients" name="_email_summary_recipients[]" multiple>
<?php foreach ($global->getEmailSummaryRecipients() as $email) : ?>
<option value="<?php echo esc_attr($email); ?>" selected><?php echo esc_html($email); ?></option>
<?php endforeach; ?>
<?php foreach (EmailSummary::getRecipientSuggestions() as $email) : ?>
<option value="<?php echo esc_attr($email); ?>"><?php echo esc_html($email); ?></option>
<?php endforeach; ?>
</select>
<?php if (count($global->getEmailSummaryRecipients()) === 0) : ?>
<p class="descriptionred">
<em>
<span class="maroon">
<?php esc_html_e('No recipients entered. Email summary won\'t be send.', 'duplicator-pro') ?>
</span>
</em>
</p>
<?php endif; ?>
</td>
</tr>
</table>
<script type="text/javascript">
jQuery(document).ready(function ($) {
$('#email-summary-recipients').select2({
tags: true,
tokenSeparators: [',', ' '],
placeholder: '<?php esc_attr_e('Enter email addresses', 'duplicator-pro'); ?>',
minimumInputLength: 3,
});
});
</script>

View File

@@ -0,0 +1,74 @@
<?php
defined("ABSPATH") or die("");
/**
* Settings > Packages, shell zip message
*
* Variables
*
* @var Duplicator\Core\Views\TplMng $tplMng
* @var array<string, mixed> $tplData
* @var bool $hasShellZip
*/
$hasShellZip = $tplData['hasShellZip'];
if ($hasShellZip) {
esc_html_e('The "Shell Zip" mode allows Duplicator to use the server\'s internal zip command.', 'duplicator-pro');
?>
<br/>
<?php
esc_html_e('When available this mode is recommended over the PHP "ZipArchive" mode.', 'duplicator-pro');
} else {
$scanPath = DUP_PRO_Archive::getScanPaths();
if (count($scanPath) > 1) {
?>
<i style='color:maroon'>
<i class='fa fa-exclamation-triangle'></i>
<?php esc_html_e("This server is not configured for the Shell Zip engine - please use a different engine mode.", 'duplicator-pro'); ?>
</i>
<?php } else { ?>
<i style='color:maroon'>
<i class='fa fa-exclamation-triangle'></i>
<?php esc_html_e("This server is not configured for the Shell Zip engine - please use a different engine mode.", 'duplicator-pro'); ?>
<br/>
<?php
printf(
esc_html_x(
'Shell Zip is %1$srecommended%2$s when available. ',
'%1$s and %2$s are html anchor tags or link',
'duplicator-pro'
),
'<a href="' . esc_url(DUPLICATOR_PRO_DUPLICATOR_DOCS_URL . 'how-to-work-with-the-different-zip-engines') . '" target="_blank">',
'</a> '
);
printf(
esc_html_x(
'For a list of supported hosting providers %1$sclick here%2$s.',
'%1$s and %2$s are html anchor tags or link',
'duplicator-pro'
),
'<a href="' . esc_url(DUPLICATOR_PRO_DUPLICATOR_DOCS_URL . 'what-host-providers-are-recommended-for-duplicator/') . '" target="_blank">',
'</a> '
);
?>
</i>
<?php
// Show possible solutions for some linux setups
$problem_fixes = DUP_PRO_Zip_U::getShellExecZipProblems();
if (count($problem_fixes) > 0 && ((strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN'))) {
$shell_tooltip = ' ';
$shell_tooltip .= __("To make 'Shell Zip' available, ask your host to:", 'duplicator-pro');
echo '<br/>';
$i = 1;
foreach ($problem_fixes as $problem_fix) {
$shell_tooltip .= "{$i}. {$problem_fix->fix}<br/>";
$i++;
}
$shell_tooltip .= '<br/>';
echo wp_kses($shell_tooltip, ['br' => []]);
}
}
}
?>

View File

@@ -0,0 +1,46 @@
<?php
/**
* Duplicator messages sections
*
* @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>
<th scope="row">
<?php echo esc_html($tplData['fieldLabel']); ?>
</th>
<td>
<fieldset>
<legend class="screen-reader-text">
<span><?php echo esc_html($tplData['fieldLabel']); ?></span>
</legend>
<label>
<input
id="<?php echo esc_attr('dup-id-' . $tplData['fieldName']); ?>"
name="<?php echo esc_attr($tplData['fieldName']); ?>"
type="checkbox"
value="1"
<?php checked($tplData['fieldChecked']); ?>
>
<?php echo esc_html($tplData['fieldCheckboxLabel']); ?>
</label>
<?php if (!empty($tplData['fieldDescription'])) { ?>
<p class="description">
<?php echo esc_html($tplData['fieldDescription']); ?>
</p>
<?php } ?>
</fieldset>
</td>
</tr>

View File

@@ -0,0 +1,45 @@
<?php
/**
* Duplicator page header
*
* @package Duplicator
* @copyright (c) 2022, Snap Creek LLC
*/
use Duplicator\Core\Controllers\SubMenuItem;
defined("ABSPATH") or die("");
/**
* Variables
*
* @var \Duplicator\Core\Controllers\ControllersManager $ctrlMng
* @var \Duplicator\Core\Views\TplMng $tplMng
* @var array<string, mixed> $tplData
*/
if (empty($tplData['menuItemsL2'])) {
return;
}
/** @var SubMenuItem[] */
$items = $tplData['menuItemsL2'];
?>
<h2 class="nav-tab-wrapper">
<?php
foreach ($items as $item) {
$id = 'dup-submenu-l2-' . $tplData['currentLevelSlugs'][0] . '-' . $item->slug;
$classes = array(
'nav-tab',
'dup-submenu-l2',
);
if ($item->active) {
$classes[] = 'nav-tab-active';
}
?>
<a href="<?php echo esc_url($item->link); ?>" id="<?php echo esc_attr($id); ?>" class="<?php echo esc_attr(implode(' ', $classes)); ?>" >
<?php echo esc_html($item->label); ?>
</a>
<?php } ?>
</h2>

View File

@@ -0,0 +1,45 @@
<?php
/**
* Duplicator page header
*
* @package Duplicator
* @copyright (c) 2022, Snap Creek LLC
*/
use Duplicator\Core\Controllers\SubMenuItem;
defined("ABSPATH") or die("");
/**
* Variables
*
* @var \Duplicator\Core\Controllers\ControllersManager $ctrlMng
* @var \Duplicator\Core\Views\TplMng $tplMng
* @var array<string, mixed> $tplData
*/
if (empty($tplData['menuItemsL3'])) {
return;
}
/** @var SubMenuItem[] */
$items = $tplData['menuItemsL3'];
?>
<div class="dup-sub-tabs">
<?php
foreach ($items as $item) {
$nodeId = 'dup-submenu-l3-' . $tplData['currentLevelSlugs'][0] . '-' . $tplData['currentLevelSlugs'][1] . '-' . $item->slug;
$classes = array('dup-submenu-l3');
?>
<span id="<?php echo esc_attr($nodeId); ?>" class="dup-sub-tab-item <?php echo ($item->active ? 'dup-sub-tab-active' : ''); ?>" >
<?php if ($item->active) { ?>
<b><?php echo esc_html($item->label); ?></b>
<?php } else { ?>
<a href="<?php echo esc_url($item->link); ?>" class="<?php echo esc_attr(implode(' ', $classes)); ?>" >
<span><?php echo esc_html($item->label); ?></span>
</a>
<?php } ?>
</span>
<?php } ?>
</div>

View File

@@ -0,0 +1,21 @@
<?php
/**
* Duplicator page header
*
* @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
*/
?>
<p>TEMPLATE <?php echo __FILE__; ?></p>
<pre><?php var_dump($tplData); ?></pre>