<?php

defined("ABSPATH") or die("");

/**
 * Variables
 *
 * @var Duplicator\Core\Controllers\ControllersManager $ctrlMng
 * @var Duplicator\Core\Views\TplMng $tplMng
 */

$lockSettingLabel = $tplMng->getDataValueStringRequired('lockSettingLabel');
$kickSettingLabel = $tplMng->getDataValueStringRequired('kickSettingLabel');
$ajaxSettingLabel = $tplMng->getDataValueStringRequired('ajaxSettingLabel');
$ajaxUrl          = $tplMng->getDataValueStringRequired('ajaxUrl');
$lockModeResult   = $tplMng->getDataValueStringRequired('lockModeResult');
$kickoffResult    = $tplMng->getDataValueStringRequired('kickoffResult');
$kickoffMismatch  = $tplMng->getDataValueBool('kickoffMismatch');
$lockMismatch     = $tplMng->getDataValueBool('lockMismatch');
?>
<b><?php esc_html_e('Settings Saved', 'duplicator-pro'); ?></b>
<br><br>
<b><?php esc_html_e('Process Settings', 'duplicator-pro'); ?></b><br>
<?php esc_html_e('Thread Lock', 'duplicator-pro'); ?>: <b><?php echo esc_html($lockSettingLabel); ?></b><br>
<?php esc_html_e('Client-side Kickoff', 'duplicator-pro'); ?>: <b><?php echo esc_html($kickSettingLabel); ?></b><br>
<?php esc_html_e('Server-to-Server Ajax', 'duplicator-pro'); ?>: <b><?php echo esc_html($ajaxSettingLabel); ?></b>
(<?php echo esc_html($ajaxUrl); ?>)
<br><br>
<b><?php esc_html_e('Mode Usage', 'duplicator-pro'); ?></b><br>
<?php esc_html_e('Lock mode', 'duplicator-pro'); ?>: <b><?php echo esc_html($lockModeResult); ?></b><br>
<?php esc_html_e('Client-side Kickoff', 'duplicator-pro'); ?>: <b><?php echo esc_html($kickoffResult); ?></b>
<?php if ($lockMismatch) : ?>
    <br><br>
    <span class="alert-color">
        <b>⚠ <?php esc_html_e('Warning', 'duplicator-pro'); ?>:</b>
        <?php esc_html_e(
            'The lock mode reliability test did not pass for the selected mode.
            Concurrent backup workers may not be prevented, which can cause overlapping writes and server overload.
            Keep this setting only if you are sure or if instructed by support.',
            'duplicator-pro'
        ); ?>
    </span>
<?php endif; ?>
<?php if ($kickoffMismatch) : ?>
    <br><br>
    <span class="alert-color">
        <b>⚠ <?php esc_html_e('Warning', 'duplicator-pro'); ?>:</b>
        <?php esc_html_e(
            'The loopback self-request test failed, but kickoff is forced to Server.
            Backup creation may not work. Keep this setting only if you are sure the server can reach itself
            or if instructed by support.',
            'duplicator-pro'
        ); ?>
    </span>
<?php endif; ?>
