first commit

This commit is contained in:
Roman Pyrih
2026-04-21 15:48:41 +02:00
commit 7483681901
10216 changed files with 3236626 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
<?php
/**
* @package Duplicator
*/
use Duplicator\Addons\ProBase\License\License;
use Duplicator\Models\DynamicGlobalEntity;
defined("ABSPATH") or die("");
/**
* Variables
*
* @var Duplicator\Core\Controllers\ControllersManager $ctrlMng
* @var Duplicator\Core\Views\TplMng $tplMng
* @var array<string, mixed> $tplData
*/
$visibility = DynamicGlobalEntity::getInstance()->getValInt('license_key_visible', License::VISIBILITY_ALL);
?>
<h3 class="title">
<?php esc_html_e('License', 'duplicator-pro') ?>
</h3>
<hr size="1">
<p>
<?php esc_html_e('Your license key provides access to updates and addons.', 'duplicator-pro') ?>
</p>
<label class="lbl-larger">
<?php esc_html_e("License Key", 'duplicator-pro'); ?>
</label>
<div class="margin-bottom-1">
<?php $tplMng->render('licensing/license_key_actions'); ?>
<?php if ($visibility !== License::VISIBILITY_NONE) { ?>
<div id="dup-tr-license-type" >
<?php $tplMng->render('licensing/license_info'); ?>
<?php $tplMng->render('licensing/activation_issue_message'); ?>
</div>
<?php } ?>
</div>

View File

@@ -0,0 +1,59 @@
<?php
/**
* @package Duplicator
*/
use Duplicator\Addons\ProBase\License\License;
use Duplicator\Addons\ProBase\License\LicenseNotices;
use Duplicator\Addons\ProBase\Models\LicenseData;
defined("ABSPATH") or die("");
/**
* Variables
*
* @var Duplicator\Core\Controllers\ControllersManager $ctrlMng
* @var Duplicator\Core\Views\TplMng $tplMng
* @var array<string, mixed> $tplData
*/
switch (LicenseData::getInstance()->getStatus()) {
case LicenseData::STATUS_VALID:
case LicenseData::STATUS_INACTIVE:
case LicenseData::STATUS_SITE_INACTIVE:
case LicenseData::STATUS_EXPIRED:
return;
default:
break;
}
esc_html_e('If license activation fails please wait ~ one hour and retry.', 'duplicator-pro');
?>
<div class="dup-license-status-notes ">
<?php
printf(
esc_html_x(
'- Failure to activate after several attempts please review %1$sfaq activation steps%2$s.',
'1 and 2 represent opening and closing anchor tags (<a> and </a>)',
'duplicator-pro'
),
'<a target="_blank" href="' . esc_url(DUPLICATOR_DUPLICATOR_DOCS_URL . 'how-to-resolve-license-activation-issues/') . '">',
'</a>'
);
?>
<br/>
<?php
printf(
esc_html_x(
'- To upgrade or renew your license visit %1$sduplicator.com%2$s.',
'1 and 2 represent opening and closing anchor tags (<a> and </a>)',
'duplicator-pro'
),
'<a target="_blank" href="' . esc_url(DUPLICATOR_BLOG_URL) . '">',
'</a>'
);
?>
<br/>
<?php esc_html_e('- A valid key is needed for plugin updates but not for functionality.', 'duplicator-pro'); ?>
</div>

View File

@@ -0,0 +1,198 @@
<?php
/**
* @package Duplicator
*/
use Duplicator\Addons\ProBase\License\License;
use Duplicator\Addons\ProBase\LicensingController;
use Duplicator\Addons\ProBase\Models\LicenseData;
use Duplicator\Core\Controllers\PageAction;
defined("ABSPATH") or die("");
/**
* Variables
*
* @var Duplicator\Core\Controllers\ControllersManager $ctrlMng
* @var Duplicator\Core\Views\TplMng $tplMng
* @var array<string, mixed> $tplData
* @var Duplicator\Core\Controllers\PageAction $refreshAction
*/
$refreshAction = $tplData['actions'][LicensingController::ACTION_FORCE_REFRESH];
?>
<p>
<i>
<?php
printf(
esc_html_x(
'If your license has been updated or is incorrect, then please %1$sForce a Refresh%2$s.',
'1: <a> tag, 2: </a> tag',
'duplicator-pro'
),
'<a href="' . esc_url($refreshAction->getUrl()) . '">',
'</a>'
);
?>
</i>
</p>
<div id="dup-license-info">
<?php
switch (LicenseData::getInstance()->getStatus()) {
case LicenseData::STATUS_VALID:
$statusClass = "";
$statusText = '<b>' . License::getLicenseToString() . '</b> ' . __('License expires on', 'duplicator-pro') . ' ';
$statusText .= '<b>' . LicenseData::getInstance()->getExpirationDate(get_option('date_format')) . '</b> ';
$expDays = LicenseData::getInstance()->getExpirationDays();
$statusText .= ' (';
if ($expDays === false) {
$statusText .= __('no data', 'duplicator-pro');
} elseif ($expDays <= 0) {
$statusText .= __('expired', 'duplicator-pro');
} elseif ($expDays == PHP_INT_MAX) {
$statusText .= __('no expiration', 'duplicator-pro');
} else {
$statusText .= sprintf(__('%d days left', 'duplicator-pro'), $expDays);
}
$statusText .= ')';
break;
case LicenseData::STATUS_INACTIVE:
$statusClass = "alert-color";
$statusText = __('License Inactive', 'duplicator-pro');
break;
case LicenseData::STATUS_SITE_INACTIVE:
$statusClass = "alert-color";
if (LicenseData::getInstance()->haveNoActivationsLeft()) {
$statusText = __('License Inactive (out of site licenses).', 'duplicator-pro') . '<br>' . License::getNoActivationLeftMessage();
} else {
$statusText = __('License Inactive', 'duplicator-pro');
}
break;
case LicenseData::STATUS_EXPIRED:
$statusClass = "alert-color";
$statusText = sprintf(
_x(
'Your Duplicator Pro license key has expired so you aren\'t getting important updates! %1$sRenew your license now%2$s',
'1: <a> tag, 2: </a> tag',
'duplicator-pro'
),
'<a target="_blank" href="' . esc_url(License::getLicenseCheckoutURL()) . '">',
'</a>'
);
break;
case LicenseData::STATUS_INVALID:
case LicenseData::STATUS_UNKNOWN:
default:
// https://duplicator.com/knowledge-base/how-to-resolve-license-activation-issues/
$statusClass = "alert-color";
$statusText = sprintf(
_x(
'License %1$s',
'1: License status (Invalid, Unknown)',
'duplicator-pro'
),
'</b>' . LicenseData::getStatusLabel(LicenseData::getInstance()->getStatus()) . '<br/>'
);
break;
}
?>
<div class="<?php echo esc_attr($statusClass); ?>">
<?php
echo wp_kses(
$statusText,
[
'a' => [
'href' => [],
'target' => [],
],
'b' => [],
'br' => [],
]
);
?>
</div>
<ul class="dup-license-type-info no-bullet">
<li>
<?php
$checkedClass = (LicenseData::getInstance()->getStatus() == LicenseData::STATUS_VALID ? 'far fa-check-circle' : 'far fa-circle');
$sitesLimit = (License::isUnlimited() ? __('Unlimited', 'duplicator-pro') : LicenseData::getInstance()->getLicenseLimit());
$sitesCount = (LicenseData::getInstance()->getSiteCount() < 0 ? '?' : LicenseData::getInstance()->getSiteCount());
?>
<i class="<?php echo esc_attr($checkedClass); ?>"></i>
<?php
printf(
esc_html_x(
'Site Licenses: %1$s of %2$s',
'1 = (string) Site Licenses, 2 = (number) Active sites, 3 = (number) License limit',
'duplicator-pro'
),
esc_html($sitesCount),
esc_html($sitesLimit)
);
$tipContent = __(
'Indicates the number of sites the plugin can be active on at any one time.
At any point you may deactivate/uninstall the plugin to free up the license and use the plugin elsewhere if needed.',
'duplicator-pro'
);
?>
<i
class='fa-solid fa-question-circle fa-sm dark-gray-color'
data-tooltip-title='<?php esc_attr_e('Site Licenses', 'duplicator-pro') ?>'
data-tooltip='<?php echo esc_attr($tipContent) ?>'>
</i>
</li>
<li>
<?php
$checkedClass = License::can(License::CAPABILITY_POWER_TOOLS) ? 'far fa-check-circle' : 'far fa-circle';
$tipContent = __(
'Enhanced features that greatly improve the productivity of serious users. Include hourly schedules,
installer branding, salt & key replacement, priority support and more.',
'duplicator-pro'
);
?>
<i class="<?php echo esc_attr($checkedClass); ?>"></i>
<?php esc_html_e('Powertools', 'duplicator-pro') ?>
<i
class='fa-solid fa-question-circle fa-sm dark-gray-color'
data-tooltip-title='<?php echo esc_attr_e('Powertools', 'duplicator-pro') ?>'
data-tooltip='<?php echo esc_attr($tipContent) ?>'>
</i>
</li>
<li>
<?php
$checkedClass = License::can(License::CAPABILITY_MULTISITE_PLUS) ? 'far fa-check-circle' : 'far fa-circle';
$tipContent = __(
'Adds the ability to install a subsite as a standalone site,
insert a standalone site into a multisite, or insert a subsite from the same/different multisite into a multisite.',
'duplicator-pro'
);
?>
<i class="<?php echo esc_attr($checkedClass) ?>"></i>
<?php esc_html_e('Multisite Plus+', 'duplicator-pro') ?>
<i
class='fa-solid fa-question-circle fa-sm dark-gray-color'
data-tooltip-title='<?php echo esc_attr_e('Multisite Plus+', 'duplicator-pro') ?>'
data-tooltip='<?php echo esc_attr($tipContent) ?>'>
</i>
</li>
<?php if (License::canBeUpgraded()) { ?>
<li>
<div class="margin-top-1">
<?php
printf(
esc_html_x(
'🔥 To unlock more features see our %1$sUpgrade Offers%2$s.',
'1: <a> tag, 2: </a> tag',
'duplicator-pro'
),
'<a class="dup-upgrade-license-link primary-color" href="' . esc_url(License::getUpsellURL()) . '" target="_blank">',
'</a>'
);
?>
</div>
</li>
<?php } ?>
</ul>
</div>

View File

@@ -0,0 +1,66 @@
<?php
/**
* @package Duplicator
*/
use Duplicator\Addons\ProBase\License\License;
use Duplicator\Addons\ProBase\Models\LicenseData;
use Duplicator\Models\DynamicGlobalEntity;
defined("ABSPATH") or die("");
/**
* Variables
*
* @var Duplicator\Core\Controllers\ControllersManager $ctrlMng
* @var Duplicator\Core\Views\TplMng $tplMng
* @var array<string, mixed> $tplData
*/
$dGlobal = DynamicGlobalEntity::getInstance();
$licenseVisibility = $dGlobal->getValInt('license_key_visible', License::VISIBILITY_ALL);
if ($licenseVisibility === License::VISIBILITY_ALL) {
?>
<div id="dup-tr-license-key-and-description" class="inline-display">
<input
type="text"
class="dup-license-key-input width-large inline-display margin-0"
name="_license_key"
id="_license_key"
value="<?php echo esc_attr(License::getLicenseKey()); ?>">
<span class="dup-license-check-icon">
<?php if (LicenseData::getInstance()->getStatus() === LicenseData::STATUS_VALID) { ?>
<i class="fa-solid fa-circle-check fa-lg success-color"></i>
<?php } else { ?>
<i class="fa-solid fa-circle-xmark fa-lg alert-color"></i>
<?php } ?>
</span>
&nbsp;
</div>
<?php } ?>
<div class="dup-license-key-btns inline-display">
<?php
if (LicenseData::getInstance()->getStatus() === LicenseData::STATUS_VALID) {
$echostring = 'false';
$buttonText = __('Deactivate', 'duplicator-pro');
} else {
$echostring = 'true';
$buttonText = __('Activate', 'duplicator-pro');
}
?>
<button
id="dup-license-activation-btn"
class="button secondary hollow small margin-0"
onclick="DupliJs.Licensing.ChangeActivationStatus(<?php echo esc_js($echostring); ?>);return false;">
<?php echo esc_html($buttonText); ?>
</button>
&nbsp;
<button
id="dup-license-clear-btn"
class="button secondary hollow small margin-0"
onclick="DupliJs.Licensing.ClearActivationStatus();return false;">
<?php esc_html_e('Clear Key', 'duplicator-pro') ?>
</button>
</div>

View File

@@ -0,0 +1,80 @@
<?php
/**
* @package Duplicator
*/
use Duplicator\Addons\ProBase\License\License;
use Duplicator\Addons\ProBase\LicensingController;
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-settings-wrapper" >
<?php $tplMng->render('licensing/activation'); ?>
</div>
<script>
jQuery(document).ready(function($) {
DupliJs.Licensing = new Object();
DupliJs.Licensing.VISIBILITY_ALL = <?php echo (int) License::VISIBILITY_ALL;?>;
DupliJs.Licensing.VISIBILITY_INFO = <?php echo (int) License::VISIBILITY_INFO;?>;
DupliJs.Licensing.VISIBILITY_NONE = <?php echo (int) License::VISIBILITY_NONE;?>;
$("#_key_password, #_key_password_confirmation").keyup(function(event) {
if (event.keyCode == 13) {
$("#show_hide").click();
}
});
DupliJs.Licensing.ChangeActivationStatus = function(activate) {
if (activate) {
let licenseKey = $('.dup-license-key-input').val();
window.location.href =
<?php echo json_encode($tplData['actions'][LicensingController::ACTION_ACTIVATE_LICENSE]->getUrl()); ?> +
'&_license_key=' + encodeURIComponent(licenseKey);
} else {
window.location.href = <?php echo json_encode($tplData['actions'][LicensingController::ACTION_DEACTIVATE_LICENSE]->getUrl()); ?>;
}
return false;
}
DupliJs.Licensing.ClearActivationStatus = function() {
window.location.href = <?php echo json_encode($tplData['actions'][LicensingController::ACTION_CLEAR_KEY]->getUrl()); ?>;
}
DupliJs.Licensing.ChangeKeyVisibility = function(show) {
$('#dup-license-visibility-form').submit();
}
DupliJs.Licensing.VisibilityTemporary = function(visibility) {
switch (visibility) {
case DupliJs.Licensing.VISIBILITY_ALL:
$("#dup-tr-license-dashboard").show();
$("#dup-tr-license-type").show();
$("#dup-tr-license-key-and-description").show();
break;
case DupliJs.Licensing.VISIBILITY_INFO:
$("#dup-tr-license-dashboard").show();
$("#dup-tr-license-type").show();
$("#dup-tr-license-key-and-description").hide();
break;
case DupliJs.Licensing.VISIBILITY_NONE:
$("#dup-tr-license-dashboard").hide();
$("#dup-tr-license-type").hide();
$("#dup-tr-license-key-and-description").hide();
break;
default:
alert("Unexpected visibility value!");
}
}
});
</script>

View File

@@ -0,0 +1,90 @@
<?php
/**
* @package Duplicator
*/
use Duplicator\Libs\Snap\SnapUtil;
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['license_message'])) {
return;
}
$details = "";
if (isset($tplData['license_request_error'])) {
$details = 'Message: ' . $tplData['license_request_error']['message'] . "\n" .
'Error code: ' . $tplData['license_request_error']['code'];
if (strlen($tplData['license_request_error']['requestDetails'])) {
$details .= "\n\n" . 'Request Details' . "\n" . $tplData['license_request_error']['requestDetails'];
}
if (strlen($tplData['license_request_error']['details'])) {
$details .= "\n" . 'Response Details' . "\n" . $tplData['license_request_error']['details'];
}
}
?>
<p>
<?php if (!$tplData['license_success']) { ?>
<i class="fa fa-exclamation-triangle"></i>&nbsp;
<?php
}
echo wp_kses(
$tplData['license_message'],
[
'a' => [
'href' => [],
'target' => [],
],
'span' => [
'class' => [],
],
'br' => [],
'b' => [
'class' => [],
],
]
);
?>
</p>
<?php if (isset($tplData['license_request_error'])) { ?>
<p>
<?php echo esc_html__('Error:', 'duplicator-pro') ?> <b><?php echo esc_html($tplData['license_request_error']['message']); ?></b>
</p>
<b>Details:</b>
<textarea class="dup-error-message-textarea" disabled ><?php echo esc_textarea($details); ?></textarea>
<button
data-dup-copy-value="<?php echo esc_attr($details); ?>"
data-dup-copy-title="<?php echo esc_attr("Copy Error Message to clipboard"); ?>"
data-dup-copied-title="<?php echo esc_attr("Error Message copied to clipboard"); ?>"
class="button dup-btn-copy-error-message">
<?php esc_html_e('Copy error details', 'duplicator-pro'); ?>
</button>
<?php if (!SnapUtil::isCurlEnabled()) {
$tplMng->render('licensing/notices/curl_message');
} ?>
<p>
<?php
printf(
wp_kses(
__("If the error persists please open a ticket <a href=\"%s\">here</a> and attach the errors details.", 'duplicator-pro'),
[
'a' => [
'href' => [],
],
]
),
esc_url(DUPLICATOR_BLOG_URL . 'my-account/support/')
);
?>
</p>
<?php } ?>

View File

@@ -0,0 +1,47 @@
<?php
/**
* @package Duplicator
*/
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
*/
?>
<p>
<?php
echo wp_kses(
__(
'<b>CURL isn\'t enabled.</b> This module is far more reliable for remote communication.',
'duplicator-pro'
),
ViewHelper::GEN_KSES_TAGS
);
?>
</br>
<?php esc_html_e('A possible solution to the problem could be to activate it.', 'duplicator-pro'); ?>
</br>
<?php
printf(
wp_kses(
_x(
'For detailed steps on how to enable cURL please see <b>Solution 3, Issue A</b> in %1$sthis FAQ Entry%2$s.',
'%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_DUPLICATOR_DOCS_URL . 'how-to-resolve-license-activation-issues/') . '" target="_blank">',
'</a>'
);
?>
<br/>
</p>

View File

@@ -0,0 +1,54 @@
<?php
/**
* @package Duplicator
*/
use Duplicator\Addons\ProBase\License\License;
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
*/
$upgradeUrl = License::getUpsellURL();
?>
<span class='dashicons dashicons-warning'></span>
<div class="dup-sub-content">
<h3>
<?php esc_html_e('Your license does not support multisite functionality', 'duplicator-pro'); ?>
</h3>
<p>
<?php echo esc_html(
sprintf(
_x(
'By upgrading to the %1$s or %2$s plans you will unlock the ability to create
backups and do advanced migrations on multi-site installations!',
'1: name of pro plan, 2: name of elite plan',
'duplicator-pro'
),
License::getLicenseToString(License::TYPE_PRO),
License::getLicenseToString(License::TYPE_ELITE)
)
); ?>
</p>
<br>
<?php if (CapMng::can(CapMng::CAP_LICENSE, false)) { ?>
<a class="button primary small margin-bottom-0" target="_blank" href="<?php echo esc_url($upgradeUrl); ?>">
<?php esc_html_e('Upgrade Now!', 'duplicator-pro'); ?>
</a>
<?php } else { ?>
<?php
echo '<b>' . esc_html__(
'Please contact the Duplicator license manager to update it.',
'duplicator-pro'
) . '</b>';
?>
<?php } ?>
</div>

View File

@@ -0,0 +1,60 @@
<?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
*/
$daysLeft = $tplData['schedule_disalbe_days_left'];
if ($daysLeft === false) {
return;
}
if ($daysLeft >= 0) {
?>
<u>
<?php
if (License::can(License::CAPABILITY_SCHEDULE)) {
$message = sprintf(
_n(
'Scheduled Backups are going to be disabled <b><em>in %d day</em></b>.',
'Scheduled Backups are going to be disabled <b><em>in %d days</em></b>.',
$daysLeft,
'duplicator-pro'
),
$daysLeft
);
$message .= __(' Please renew your license to assure your backups are not interrupted.', 'duplicator-pro');
echo wp_kses(
$message,
[
'b' => [],
'em' => [],
]
);
} else {
esc_html_e(
'All automatic backups have been disabeld. Please renew your license to re-enable them.',
'duplicator-pro'
);
}
?>
</u>
<?php
} else {
esc_html_e(
'Scheduled Backups.',
'duplicator-pro'
);
}

View File

@@ -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
*/
$renewal_url = $tplData['renewal_url'];
?>
<span class='dashicons dashicons-warning'></span>
<div class="dup-sub-content">
<h3>
<?php esc_html_e('Warning! Your Duplicator Pro license has expired...', 'duplicator-pro');?>
</h3>
<?php esc_html_e('You\'re currently missing:', 'duplicator-pro'); ?>
<ul class="dupli-simple-style-disc" >
<li><?php esc_html_e('Access to Advanced Features', 'duplicator-pro'); ?></li>
<li><?php $tplMng->render('licensing/notices/drm_schedules_msg'); ?></li>
<li><?php esc_html_e('Storages Management', 'duplicator-pro'); ?></li>
<li><?php esc_html_e('Templates Management', 'duplicator-pro'); ?></li>
<li><?php esc_html_e('New Features', 'duplicator-pro'); ?></li>
<li><?php esc_html_e('Important Updates for Security Patches', 'duplicator-pro'); ?></li>
<li><?php esc_html_e('Bug Fixes', 'duplicator-pro'); ?></li>
<li><?php esc_html_e('Support Requests', 'duplicator-pro'); ?></li>
</ul>
<?php if (CapMng::can(CapMng::CAP_LICENSE, false)) { ?>
<a class="button primary small" target="_blank" href="<?php echo esc_url($renewal_url); ?>">
<?php esc_html_e('Renew Now!', 'duplicator-pro'); ?>
</a>
<?php } else { ?>
<?php
echo '<b>' . esc_html__(
'Please contact the Duplicator license manager to activate it.',
'duplicator-pro'
) . '</b>';
?>
<?php } ?>
</div>

View File

@@ -0,0 +1,74 @@
<?php
/**
* @package Duplicator
*/
use Duplicator\Controllers\SettingsPageController;
use Duplicator\Core\CapMng;
use Duplicator\Core\Controllers\ControllersManager;
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
*/
$img_url = plugins_url('duplicator-pro/assets/img/warning.png');
$problem_text = $tplData['problem'];
$licensing_tab_url = ControllersManager::getMenuLink(
ControllersManager::SETTINGS_SUBMENU_SLUG,
SettingsPageController::L2_SLUG_GENERAL
);
?>
<span class='dashicons dashicons-warning'></span>
<div class="dup-sub-content">
<h3>
<?php
printf(
esc_html_x('Your Duplicator Pro license key is %1$s ...', '%1$s represent the license status', 'duplicator-pro'),
esc_html($tplData['problem'])
);
?>
</h3>
<?php esc_html_e('You\'re currently missing:', 'duplicator-pro'); ?>
<ul class="dupli-simple-style-disc" >
<li><?php esc_html_e('Access to Advanced Features', 'duplicator-pro'); ?></li>
<li><?php esc_html_e('Scheduled Backups', 'duplicator-pro'); ?></li>
<li><?php esc_html_e('Storages Management', 'duplicator-pro'); ?></li>
<li><?php esc_html_e('Templates Management', 'duplicator-pro'); ?></li>
<li><?php esc_html_e('New Features', 'duplicator-pro'); ?></li>
<li><?php esc_html_e('Important Updates for Security Patches', 'duplicator-pro'); ?></li>
<li><?php esc_html_e('Bug Fixes', 'duplicator-pro'); ?></li>
<li><?php esc_html_e('Support Requests', 'duplicator-pro'); ?></li>
</ul>
<?php
if (CapMng::can(CapMng::CAP_LICENSE, false)) {
printf(
wp_kses(
_x(
'<b>Please %1$sActivate Your License%2$s</b>. If you do not have a license key go to %3$sduplicator.com%4$s to get it.',
'1 and 2 are opening and 3 and 4 are closing anchor tags (<a> and </a>)',
'duplicator-pro'
),
ViewHelper::GEN_KSES_TAGS
),
'<a href="' . esc_url($licensing_tab_url) . '">',
'</a>',
'<a target="_blank" href="' . esc_url(DUPLICATOR_BLOG_URL . 'my-account') . '">',
'</a>'
);
} else {
echo '<b>' . esc_html__(
'Please contact the Duplicator license manager to activate it.',
'duplicator-pro'
) . '</b>';
}
?>
</div>

View File

@@ -0,0 +1,72 @@
<?php
/**
* @package Duplicator
*/
use Duplicator\Addons\ProBase\LicensingController;
use Duplicator\Controllers\SettingsPageController;
use Duplicator\Core\CapMng;
use Duplicator\Core\Controllers\ControllersManager;
defined("ABSPATH") or die("");
/**
* Variables
*
* @var Duplicator\Core\Controllers\ControllersManager $ctrlMng
* @var Duplicator\Core\Views\TplMng $tplMng
* @var array<string, mixed> $tplData
*/
$licensing_tab_url = ControllersManager::getMenuLink(
ControllersManager::SETTINGS_SUBMENU_SLUG,
SettingsPageController::L2_SLUG_GENERAL
);
$dashboard_url = DUPLICATOR_BLOG_URL . 'my-account';
$img_url = plugins_url('duplicator-pro/assets/img/warning.png');
?>
<span class='dashicons dashicons-warning'></span>
<div class="dup-sub-content">
<h3>
<?php esc_html_e('Duplicator Pro\'s license is deactivated because you\'re out of site activations.', 'duplicator-pro'); ?>
</h3>
<?php esc_html_e('You\'re currently missing:', 'duplicator-pro'); ?>
<ul class="dupli-simple-style-disc" >
<li><?php esc_html_e('Access to Advanced Features', 'duplicator-pro'); ?></li>
<li><?php esc_html_e('Scheduled Backups', 'duplicator-pro'); ?></li>
<li><?php esc_html_e('Storages Management', 'duplicator-pro'); ?></li>
<li><?php esc_html_e('Templates Management', 'duplicator-pro'); ?></li>
<li><?php esc_html_e('New Features', 'duplicator-pro'); ?></li>
<li><?php esc_html_e('Important Updates for Security Patches', 'duplicator-pro'); ?></li>
<li><?php esc_html_e('Bug Fixes', 'duplicator-pro'); ?></li>
<li><?php esc_html_e('Support Requests', 'duplicator-pro'); ?></li>
</ul>
<?php
if (CapMng::can(CapMng::CAP_LICENSE, false)) {
printf(
wp_kses(
_x(
'Upgrade your license using the %1$sDuplicator Dashboard%2$s or deactivate plugin on old sites.<br/>
After making necessary changes %3$srefresh the license status%4$s.',
'1 and 2 are opening and 3 and 4 are closing anchor tags (<a> and </a>)',
'duplicator-pro'
),
[
'br' => [],
]
),
'<a href="' . esc_url($dashboard_url) . '" target="_blank">',
'</a>',
'<a href="' . esc_url($licensing_tab_url) . '">',
'</a>'
);
} else {
echo '<b>' . esc_html__(
'Please contact the Duplicator license manager to activate it.',
'duplicator-pro'
) . '</b>';
}
?>
</div>

View File

@@ -0,0 +1,125 @@
<?php
/**
* @package Duplicator
*/
use Duplicator\Addons\ProBase\License\License;
use Duplicator\Addons\ProBase\LicensingController;
use Duplicator\Core\Controllers\ControllersManager;
use Duplicator\Models\DynamicGlobalEntity;
defined("ABSPATH") or die("");
/**
* Variables
*
* @var Duplicator\Core\Controllers\ControllersManager $ctrlMng
* @var Duplicator\Core\Views\TplMng $tplMng
* @var array<string, mixed> $tplData
*/
$dGlobal = DynamicGlobalEntity::getInstance();
$licenseVisibility = $dGlobal->getValInt('license_key_visible', License::VISIBILITY_ALL);
?>
<div class="dup-settings-wrapper" >
<div class="dup-accordion-wrapper display-separators close">
<div class="accordion-header">
<h3 class="title">
<?php esc_html_e("License Key Visibility", 'duplicator-pro') ?>
</h3>
</div>
<div class="accordion-content">
<p>
<?php
esc_html_e(
"This is an optional setting that prevents the 'License Key' from being copied.
Select the desired visibility mode, enter a password and hit the 'Change Visibility' button.",
'duplicator-pro'
);
?>
</p>
<form
id="dup-license-visibility-form"
action="<?php echo esc_url(ControllersManager::getCurrentLink()); ?>"
method="post"
data-parsley-validate>
<?php $tplData['actions'][LicensingController::ACTION_CHANGE_VISIBILITY]->getActionNonceFileds(); ?>
<label class="lbl-larger">
<?php esc_html_e("Visibility", 'duplicator-pro'); ?>
</label>
<div class="margin-bottom-1">
<label class="inline-display margin-right-1">
<input
type="radio"
name="license_key_visible"
value="<?php echo (int) License::VISIBILITY_ALL; ?>"
class="margin-0"
onclick="DupliJs.Licensing.VisibilityTemporary(<?php echo (int) License::VISIBILITY_ALL; ?>);"
<?php checked($licenseVisibility, License::VISIBILITY_ALL); ?>>
<?php esc_html_e("License Visible", 'duplicator-pro'); ?>
</label>
<label class="inline-display margin-right-1">
<input
type="radio"
name="license_key_visible"
value="<?php echo (int) License::VISIBILITY_INFO; ?>"
class="margin-0"
onclick="DupliJs.Licensing.VisibilityTemporary(<?php echo (int) License::VISIBILITY_INFO; ?>);"
<?php checked($licenseVisibility, License::VISIBILITY_INFO); ?>>
<?php esc_html_e("Info Only", 'duplicator-pro'); ?>
</label>
<label class="inline-display">
<input
type="radio"
name="license_key_visible"
value="<?php echo (int) License::VISIBILITY_NONE; ?>"
class="margin-0"
onclick="DupliJs.Licensing.VisibilityTemporary(<?php echo (int) License::VISIBILITY_NONE; ?>);"
<?php checked($licenseVisibility, License::VISIBILITY_NONE); ?>>
<?php esc_html_e("License Invisible", 'duplicator-pro'); ?>
</label>
</div>
<label class="lbl-larger">
<?php esc_html_e("Password", 'duplicator-pro'); ?>
</label>
<div class="margin-bottom-1">
<input
type="password"
class="dup-wide-input"
name="_key_password"
id="_key_password" size="50">
</div>
<?php if ($licenseVisibility == License::VISIBILITY_ALL) { ?>
<label class="lbl-larger">
<?php esc_html_e("Retype Password", 'duplicator-pro'); ?>
</label>
<div class="margin-bottom-1">
<input
type="password"
class="dup-wide-input"
name="_key_password_confirmation"
id="_key_password_confirmation"
data-parsley-equalto="#_key_password"
size="50">
</div>
<?php } ?>
<label class="lbl-larger">
&nbsp;
</label>
<div class="margin-bottom-1">
<button
class="button secondary hollow small margin-0"
id="show_hide"
onclick="DupliJs.Licensing.ChangeKeyVisibility(); return false;">
<?php esc_html_e('Change Visibility', 'duplicator-pro'); ?>
</button>
</div>
</form>
</div>
</div>
</div>