<?php
defined('ABSPATH') || exit;
?>
<div class="hpixl-securicheck-section" style="padding:20px;margin-bottom:20px;border-radius:0px!important;">
    <strong style="font-size:14px; display:block; margin-bottom:10px;"><?php esc_html_e('Pourquoi changer l\'URL de connexion ?', 'securicheck'); ?></strong>
    <p style="margin:0 0 6px;"><?php esc_html_e('L\'URL par défaut (/wp-admin ou /wp-login.php) est connue de tous les bots et attaquants.', 'securicheck'); ?></p>
    <p style="margin:0 0 6px;"><?php esc_html_e('Une URL personnalisée dissimule la page de connexion et réduit drastiquement les tentatives de force brute.', 'securicheck'); ?></p>
    <p style="margin:0;"><?php esc_html_e('Protection immédiate, sans configuration complexe.', 'securicheck'); ?></p>
</div>

<?php submit_button(); ?>

<table class="form-table">
    <tr>
        <td class="hpixl_securicheck_toggle_title_reglages">
            <?php esc_html_e('URL de Connexion', 'securicheck'); ?>
        </td>
        <td class="hpixl_securicheck_toggle_panneau_option_reglages">
            <div class="hpixl_securicheck_toggle_option_reglages">
                <input type="checkbox" id="hpixl_securicheck_toggle_page_connexion_url" name="hpixl_securicheck_toggle_page_connexion_url" value="1" <?php checked(1, esc_attr(get_option('hpixl_securicheck_toggle_page_connexion_url')), true) ?> />
                <label for="hpixl_securicheck_toggle_page_connexion_url">Toggle</label>
                <p><?php esc_html_e(' Changer l\'url de connexion ?', 'securicheck'); ?></p>
            </div>
            <div class="hpixl_securicheck_panneau_page_connexion_url" id="hpixl_securicheck_panneau_page_connexion_url" style="<?php echo (get_option('hpixl_securicheck_toggle_page_connexion_url') == 1) ? 'display:flex;' : 'display:none;'; ?>">
                <p><?php esc_html_e('Nouvelle url : ', 'securicheck'); ?><?php echo esc_html(trailingslashit(home_url())); ?></p>
                <input type="text" id="hpixl_securicheck_textarea_page_connexion_url" name="hpixl_securicheck_textarea_page_connexion_url" value="<?php echo esc_attr(get_option('hpixl_securicheck_textarea_page_connexion_url')); ?>" style="margin-left:0;" />
            </div>
        </td>
    </tr>
    <tr style="<?php echo (get_option('hpixl_securicheck_toggle_page_connexion_url') == 1) ? 'display:table-row;' : 'display:none;'; ?>" id="hpixl_securicheck_panneau_redirection_url_backoffice">
        <td class="hpixl_securicheck_toggle_title_reglages">
            <?php esc_html_e('Redirection', 'securicheck'); ?>
        </td>
        <td class="hpixl_securicheck_toggle_panneau_option_reglages">
            <div class="hpixl_securicheck_toggle_option_reglages">
                <input type="checkbox" id="hpixl_securicheck_toggle_page_connexion_redirection" name="hpixl_securicheck_toggle_page_connexion_redirection" value="1" <?php checked(1, esc_attr(get_option('hpixl_securicheck_toggle_page_connexion_redirection')), true) ?> />
                <label for="hpixl_securicheck_toggle_page_connexion_redirection">Toggle</label>
                <p><?php esc_html_e(' Activer la redirection ?', 'securicheck'); ?></p>
            </div>
            <div class="hpixl_securicheck_panneau_page_connexion_redirection" id="hpixl_securicheck_panneau_page_connexion_redirection" style="<?php echo (get_option('hpixl_securicheck_toggle_page_connexion_redirection') == 1) ? 'display:flex;' : 'display:none;'; ?>">
                <p><?php esc_html_e('Url de redirection : ', 'securicheck'); ?><?php echo esc_html(trailingslashit(home_url())); ?></p>
                <input type="text" id="hpixl_securicheck_textarea_page_connexion_redirection" name="hpixl_securicheck_textarea_page_connexion_redirection" value="<?php echo esc_attr(get_option('hpixl_securicheck_textarea_page_connexion_redirection')); ?>" />
            </div>
            <p><?php esc_html_e('Redirige les utilisateurs vers une url personnalisée ? Laissez vide pour rediriger vers la page d\'acceuil.', 'securicheck'); ?></p>
        </td>
    </tr>
</table>
<?php
submit_button();
