# contact-forms/2.2.32/admin/settings-page.php

Contact Forms by Cimatti, version 2.2.32. 707 lines.

- Page: https://pluginprobe.com/plugins/contact-forms/2.2.32/code/admin/settings-page.php
- Raw: https://pluginprobe.com/plugins/contact-forms/2.2.32/raw/admin/settings-page.php
- Modified: 2026-07-13T10:04:36+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/contact-forms/2.2.32/code/admin/settings-page.php#L10-L20`.

```php
<?php
if ( ! defined( 'ABSPATH' ) ) exit;

function accua_forms_settings_page_head_scripts() {
  wp_enqueue_style('wp-color-picker');
  wp_enqueue_script('wp-color-picker');

  // Enqueue settings page JavaScript
  wp_enqueue_script('contact_forms_tabs', plugins_url('assets/js/admin/tabs.js', ACCUA_FORMS_FILE), array('jquery'), ACCUA_FORMS_JS_VERSION, true);
  wp_enqueue_script('accua-forms-settings-page', plugins_url('assets/js/admin/settings-page.js', ACCUA_FORMS_FILE), array('jquery', 'contact_forms_tabs'), ACCUA_FORMS_JS_VERSION, true);

  // Theme Helper tab scripts
  wp_enqueue_script(
    'accua-forms-theme-helper',
    plugins_url('assets/js/admin/theme-helper.js', ACCUA_FORMS_FILE),
    array('jquery'),
    ACCUA_FORMS_JS_VERSION,
    true
  );
  wp_localize_script('accua-forms-theme-helper', 'accuaThemeHelper', array(
    'ajaxUrl' => admin_url('admin-ajax.php'),
    'nonce' => wp_create_nonce('accua_theme_helper'),
    'pluginCssUrl' => plugins_url('assets/css/frontend.css', ACCUA_FORMS_FILE),
    'i18n' => array(
      'scanning' => __('Scanning...', 'contact-forms'),
      'noConflicts' => __('No CSS conflicts detected!', 'contact-forms'),
      'conflictsFound' => __('CSS conflicts found:', 'contact-forms'),
      'scanComplete' => __('Scan complete', 'contact-forms'),
      'scanError' => __('Error scanning URL', 'contact-forms'),
      'enterUrl' => __('Enter a URL to scan', 'contact-forms'),
      'fetchingCss' => __('Fetching CSS from URL...', 'contact-forms'),
    ),
    'monitoredClasses' => accua_forms_get_monitored_css_classes(),
    'criticalProperties' => array(
      'padding', 'padding-top', 'padding-right', 'padding-bottom', 'padding-left',
      'margin', 'margin-top', 'margin-right', 'margin-bottom', 'margin-left',
      'display', 'position', 'visibility', 'overflow',
      'width', 'height', 'min-width', 'min-height', 'max-width', 'max-height',
      'flex', 'flex-direction', 'flex-wrap', 'align-items', 'justify-content',
      'border', 'border-width', 'border-style',
      'float', 'clear', 'z-index', 'opacity',
    ),
  ));

  // Localize script with AJAX URL, nonce, and translations
  wp_localize_script('accua-forms-settings-page', 'accuaFormsSettings', array(
    'ajaxUrl' => admin_url('admin-ajax.php'),
    'nonce' => wp_create_nonce('accua_forms_restore_default'),
    'dangerNonce' => wp_create_nonce('accua_forms_danger_zone'),
    'siteDomain' => wp_parse_url( home_url(), PHP_URL_HOST ),
    'i18n' => array(
      'confirmRestore' => __('Are you sure you want to restore the default value for this message? This will overwrite your current content.', 'contact-forms'),
      'restoring' => __('Restoring...', 'contact-forms'),
      'restored' => __('Restored!', 'contact-forms'),
      'error' => __('Error restoring default', 'contact-forms'),
      'restoreDefault' => __('Restore default', 'contact-forms'),
      'anonymizing' => __('Anonymizing...', 'contact-forms'),
      'loading' => __('Loading...', 'contact-forms'),
      'deleting' => __('Deleting...', 'contact-forms'),
      'noSubmissionsFound' => __('No submissions found matching the specified period.', 'contact-forms'),
      /* translators: %d: total number of submissions that will be anonymized */
      'previewHeading' => __('The following %d submissions will be anonymized:', 'contact-forms'),
      'formColumn' => __('Form', 'contact-forms'),
      'submissionsColumn' => __('Submissions', 'contact-forms'),
      'totalLabel' => __('Total', 'contact-forms'),
      'confirmAnonymize' => __('Confirm anonymization', 'contact-forms'),
      'cancel' => __('Cancel', 'contact-forms'),
      'confirmDeletePrompt' => sprintf(
        /* translators: %s: site domain */
        __( 'This will permanently delete ALL Contact Forms data (settings, forms, submissions, uploaded files). This cannot be undone. Type "%s" to confirm:', 'contact-forms' ),
        wp_parse_url( home_url(), PHP_URL_HOST )
      ),
    ),
  ));
}

function accua_forms_settings_page() {
?>
<div id="accua_forms_settings_page" class="accua_forms_admin_page wrap">
<h1><?php esc_html_e('Contact Forms - Default Settings', 'contact-forms'); ?></h1>
<?php
  $empty_form_data = array(
    'success_message' => '',
    'error_message' => '',
    'emails_from_name' => '',
    'emails_from' => '',
    'admin_emails_to' => '',
    'emails_bcc' => '',
    'admin_emails_subject' => '',
    'admin_emails_message' => '',
    'confirmation_emails_subject' => '',
    'confirmation_emails_message' => '',
    'layout' => 'sidebyside',
    'style_margin' => '',
    'style_border_color' => '',
    'style_border_width' => '',
    'style_border_radius' => '',
    'style_background_color' => '',
    'style_padding' => '',
    'style_color' => '',
    'style_font_size' => '',
    'style_field_spacing' => '',
    'style_field_border_color' => '',
    'style_field_border_width' => '',
    'style_field_border_radius' => '',
    'style_field_background_color' => '',
    'style_field_padding' => '',
    'style_field_color' => '',
    'style_submit_border_color' => '',
    'style_submit_border_width' => '',
    'style_submit_border_radius' => '',
    'style_submit_background_color' => '',
    'style_submit_padding' => '',
    'style_submit_color' => '',
    'style_submit_font_size' => '',
  );

  $empty_file_data = array(
    'valid_extensions' => '',
    'max_size' => '',
    'dest_path' => '',
  );

  $empty_captcha_data = array(
    'recaptcha_force_v1' => '',
    'recaptcha_public_key' => '',
    'recaptcha_private_key' => '',
  );

  $empty_analytics_data = array(
    'analytics_track_submit' => false,
    'analytics_track_fields' => false,
  );

  $empty_anonymize_ip_data = array(
    'anonymize_ip_bytes' => 0,
  );

  $empty_retention_data = array(
    'retention_value' => 0,
    'retention_unit'  => 'months',
    'retention_mode'  => 'anonymize',
  );

  // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotValidated -- REQUEST_METHOD is always set by server
  if ( isset( $_SERVER['REQUEST_METHOD'] ) && 'POST' === $_SERVER['REQUEST_METHOD'] && ! empty( $_POST['accua_form_save_form_settings'] ) ) {
    check_admin_referer('accua_form_save_settings', '_nonce_accua_form_save_settings');
    $post = stripslashes_deep($_POST);
    $post += $empty_form_data;
    $post += $empty_file_data;
    $post += $empty_captcha_data;
    $post += $empty_analytics_data;
    $post += $empty_anonymize_ip_data;
    $post += $empty_retention_data;
    $form_data = array();
    $file_data = array();
    $captcha_data = array();
    $analytics_data = array();
    $anonymize_ip_data = array();
    $retention_data = array();
    foreach($empty_form_data as $key=>$val){
      $form_data[$key] = $post[$key];
    }
    $form_data = accua_forms_filter_settings($form_data);

    $file_data['valid_extensions'] = accua_forms_filter_extensions($post['valid_extensions']);
    $file_data['max_size'] = $post['max_size'];
    if (current_user_can('edit_files') || current_user_can('install_plugins')) {
      $file_data['dest_path'] = $post['dest_path'];
    } else {
      $old_file_data = get_option('accua_forms_default_file_field_data',array());
      $file_data['dest_path'] = isset($old_file_data['dest_path']) ? $old_file_data['dest_path'] : '';
    }

    $captcha_data['recaptcha_force_v1'] = (bool) $post['recaptcha_force_v1'];
    $captcha_data['recaptcha_public_key'] = sanitize_text_field($post['recaptcha_public_key']);
    $captcha_data['recaptcha_private_key'] = sanitize_text_field($post['recaptcha_private_key']);

    foreach($empty_analytics_data as $key=>$val){
      $analytics_data[$key] = (bool) $post[$key];
    }

    $anonymize_ip_bytes = (int) $post['anonymize_ip_bytes'];
    if ($anonymize_ip_bytes < 0) {
      $anonymize_ip_bytes = 0;
    } elseif ($anonymize_ip_bytes > 4) {
      $anonymize_ip_bytes = 4;
    }
    $anonymize_ip_data['anonymize_ip_bytes'] = $anonymize_ip_bytes;

    update_option('accua_forms_default_form_data', $form_data);
    update_option('accua_forms_default_file_field_data', $file_data);
    update_option('accua_forms_default_captcha_field_data', $captcha_data);
    update_option('accua_forms_default_analytics_data', $analytics_data);
    update_option('accua_forms_anonymize_ip_data', $anonymize_ip_data);

    $retention_data['retention_value'] = max( 0, (int) $post['retention_value'] );
    $retention_data['retention_unit']  = in_array( $post['retention_unit'], array( 'days', 'months', 'years' ), true ) ? $post['retention_unit'] : 'months';
    $retention_data['retention_mode']  = in_array( $post['retention_mode'], array( 'anonymize', 'delete' ), true ) ? $post['retention_mode'] : 'anonymize';
    update_option('accua_forms_retention_data', $retention_data);

    if (!empty($post['delete_previous_ip_values'])) {
      global $wpdb;
      // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching -- Admin-only IP anonymization action, no caching needed
      $wpdb->query("UPDATE `{$wpdb->prefix}accua_forms_submissions` SET afs_ip = ''");
    }
  } else {
    $form_data = get_option('accua_forms_default_form_data',array()) + $empty_form_data;
    $file_data = get_option('accua_forms_default_file_field_data',array()) + $empty_file_data;
    $captcha_data = get_option('accua_forms_default_captcha_field_data',array()) + $empty_captcha_data;
    $analytics_data = get_option('accua_forms_default_analytics_data',array()) + $empty_analytics_data;
    $anonymize_ip_data = get_option('accua_forms_anonymize_ip_data',array()) + $empty_anonymize_ip_data;
    $retention_data = get_option('accua_forms_retention_data',array()) + $empty_retention_data;
  }
  if ($captcha_data['recaptcha_force_v1']) {
    $captcha_data = $empty_captcha_data;
  }
?>
<form method="post">
<?php wp_nonce_field('accua_form_save_settings', '_nonce_accua_form_save_settings'); ?>
<input type="hidden" name="accua_form_save_form_settings" value="1" />
<div id="accua_settings_tabs" class="accua-tabs accua-tabs--primary" data-default-tab="messages">
  <div class="accua-tabs__tablist" role="tablist" aria-label="<?php esc_attr_e( 'Settings', 'contact-forms' ); ?>">
    <button class="accua-tabs__tab" role="tab" data-tab="messages"><?php esc_html_e( 'Default Messages', 'contact-forms' ); ?></button>
    <button class="accua-tabs__tab" role="tab" data-tab="integrations"><?php esc_html_e( 'Integrations', 'contact-forms' ); ?></button>
    <button class="accua-tabs__tab" role="tab" data-tab="privacy"><?php esc_html_e( 'Privacy', 'contact-forms' ); ?></button>
    <button class="accua-tabs__tab" role="tab" data-tab="styling"><?php esc_html_e( 'Layout & Styling', 'contact-forms' ); ?></button>
    <button class="accua-tabs__tab" role="tab" data-tab="theme_helper"><?php esc_html_e( 'Theme Helper', 'contact-forms' ); ?></button>
    <?php if ( current_user_can( 'manage_options' ) ) : ?>
    <button class="accua-tabs__tab" role="tab" data-tab="danger_zone"><?php esc_html_e( 'Danger Zone', 'contact-forms' ); ?></button>
    <?php endif; ?>
    <button class="accua-tabs__tab" role="tab" data-tab="tokens"><?php esc_html_e( 'Tokens', 'contact-forms' ); ?></button>
  </div>

  <div class="accua-tabs__panel" role="tabpanel" data-tab="messages">
 <?php
  $email_font_formats =
    'Arial=arial,helvetica,sans-serif;'
    . 'Arial Black=arial black,avant garde,sans-serif;'
    . 'Comic Sans MS=comic sans ms,sans-serif;'
    . 'Courier New=courier new,courier,monospace;'
    . 'Georgia=georgia,palatino,serif;'
    . 'Lucida Sans=lucida sans unicode,lucida grande,sans-serif;'
    . 'Tahoma=tahoma,arial,helvetica,sans-serif;'
    . 'Times New Roman=times new roman,times,serif;'
    . 'Trebuchet MS=trebuchet ms,geneva,sans-serif;'
    . 'Verdana=verdana,geneva,sans-serif;';

  $settings_editor = array(
    'teeny' => true,
    'editor_class' => 'accua_form_value',
    'tinymce' => array(
        'toolbar1' => 'fontselect,|,bold,italic,underline,|,bullist,numlist,|,link,unlink',
        'font_formats' => $email_font_formats,
        'content_style' => 'body { font-family: arial, helvetica, sans-serif; }',
    ));
  ?>
  <div class="accua-settings-grid">

    <div class="postbox">
      <div class="postbox-header"><h2><?php esc_html_e('1. On-screen success message', 'contact-forms'); ?></h2></div>
      <div class="inside">
        <div id="accua_form_success_message">
          <?php  wp_editor( $form_data['success_message'] , 'success_message' , $settings_editor);   ?>
        </div>
        <p class="accua-restore-default-wrapper">
          <button type="button" class="button-link accua-restore-default-btn" data-message-type="success_message">
            <?php esc_html_e('Restore default', 'contact-forms'); ?>
          </button>
        </p>
    </div></div>

    <div class="postbox">
      <div class="postbox-header"><h2><?php esc_html_e('2. On-screen error message', 'contact-forms'); ?></h2></div>
      <div class="inside">
        <div id="accua_form_error_message">
         <?php  wp_editor( $form_data['error_message'] , 'error_message' , $settings_editor); ?>
        </div>
        <p class="accua-restore-default-wrapper">
          <button type="button" class="button-link accua-restore-default-btn" data-message-type="error_message">
            <?php esc_html_e('Restore default', 'contact-forms'); ?>
          </button>
        </p>
    </div></div>

    <div class="postbox">
      <div class="postbox-header"><h2><?php esc_html_e('3. Email  to notify administrator', 'contact-forms'); ?></h2></div>
      <div class="inside">
        <table class="form-table" role="presentation">
          <tr>
            <th scope="row"><label for="accua_settings_admin_emails_to"><?php esc_html_e( 'To', 'contact-forms'); ?></label></th>
            <td id="accua_form_admin_emails_to"><input id="accua_settings_admin_emails_to" name="admin_emails_to" class="accua_form_value regular-text" type="text" value="<?php echo esc_attr($form_data['admin_emails_to']) ?>" /></td>
          </tr>
          <tr>
            <th scope="row"><label for="accua_settings_emails_bcc"><?php esc_html_e( 'Bcc', 'contact-forms'); ?></label></th>
            <td id="accua_form_emails_bcc"><input id="accua_settings_emails_bcc" name="emails_bcc" class="accua_form_value regular-text" type="text" value="<?php echo esc_attr($form_data['emails_bcc']) ?>" /></td>
          </tr>
          <tr>
            <th scope="row"><label for="accua_settings_admin_emails_subject"><?php esc_html_e( 'Subject', 'contact-forms'); ?></label></th>
            <td id="accua_form_admin_emails_subject"><input id="accua_settings_admin_emails_subject" name="admin_emails_subject" class="accua_form_value regular-text" type="text" value="<?php echo esc_attr($form_data['admin_emails_subject']) ?>" /></td>
          </tr>
        </table>
        <div id="accua_form_admin_emails_message">
          <?php  wp_editor( $form_data['admin_emails_message'] , 'admin_emails_message' , $settings_editor);   ?>
        </div>
        <p class="accua-restore-default-wrapper">
          <button type="button" class="button-link accua-restore-default-btn" data-message-type="admin_emails">
            <?php esc_html_e('Restore default', 'contact-forms'); ?>
          </button>
          <span class="description"><?php esc_html_e('(Restores subject and message only)', 'contact-forms'); ?></span>
        </p>
    </div></div>

    <div class="postbox">
      <div class="postbox-header"><h2><?php esc_html_e('4. Email confirmation to the person who completed the form', 'contact-forms'); ?></h2></div>
      <div class="inside">
        <table class="form-table" role="presentation">
          <tr>
            <th scope="row"><label for="accua_settings_emails_from_name"><?php esc_html_e( 'From name', 'contact-forms'); ?></label></th>
            <td id="accua_form_emails_from_name"><input id="accua_settings_emails_from_name" class="accua_form_value regular-text" name="emails_from_name" type="text" value="<?php echo esc_attr($form_data['emails_from_name']) ?>" /></td>
          </tr>
          <tr>
            <th scope="row"><label for="accua_settings_emails_from"><?php esc_html_e( 'From email', 'contact-forms'); ?></label></th>
            <td id="accua_form_emails_from"><input id="accua_settings_emails_from" class="accua_form_value regular-text" name="emails_from" type="text" value="<?php echo esc_attr($form_data['emails_from']) ?>" /></td>
          </tr>
          <tr>
            <th scope="row"><label for="accua_settings_confirmation_emails_subject"><?php esc_html_e( 'Subject', 'contact-forms'); ?></label></th>
            <td id="accua_form_confirmation_emails_subject"><input id="accua_settings_confirmation_emails_subject" class="accua_form_value regular-text" type="text" name="confirmation_emails_subject" value="<?php echo esc_attr($form_data['confirmation_emails_subject']) ?>" /></td>
          </tr>
        </table>
         <div id="accua_form_confirmation_emails_message">
            <?php  wp_editor( $form_data['confirmation_emails_message'] , 'confirmation_emails_message' , $settings_editor);   ?>
        </div>
        <p class="accua-restore-default-wrapper">
          <button type="button" class="button-link accua-restore-default-btn" data-message-type="confirmation_emails">
            <?php esc_html_e('Restore default', 'contact-forms'); ?>
          </button>
          <span class="description"><?php esc_html_e('(Restores subject and message only)', 'contact-forms'); ?></span>
        </p>
    </div></div>

  </div>
  </div><!-- /panel: messages -->

  <div class="accua-tabs__panel" role="tabpanel" data-tab="integrations">
  <div class="accua-settings-grid">

    <div class="postbox">
      <div class="postbox-header"><h2><?php esc_html_e( 'File upload default settings', 'contact-forms'); ?></h2></div>
      <div class="inside">
         <div id="accua_form_valid_extensions"><?php esc_html_e( 'Valid extensions', 'contact-forms'); ?> <br /><textarea name="valid_extensions" class="accua_form_value" style="width:95%"; cols="80" rows="8"><?php echo esc_textarea($file_data['valid_extensions']) ?></textarea>
           <small><?php esc_html_e( 'List of valid extensions, without dot, one per line.', 'contact-forms'); ?></small>
         </div>
         <div id="accua_form_max_size"><?php esc_html_e( 'Maximum file size:', 'contact-forms'); ?> <input name="max_size" class="accua_form_value" type="text" value="<?php echo esc_attr($file_data['max_size']) ?>" /><br />
           <small><?php esc_html_e( 'You can use suffix K, M or G for kilobyte, megabyte or gigabyte.', 'contact-forms'); ?>
           <?php
             $server_max_size = AccuaForm_Element_File::file_upload_max_size();
             if ($server_max_size > 0) {
               esc_html_e( 'This value is limited by server upload limits of ', 'contact-forms');
               echo esc_html( AccuaForm_Element_File::format_size( $server_max_size ) ) . '. ';
               esc_html_e( 'If you need a greater limit you should ask to the server administrator.', 'contact-forms');
             }
           ?>
           </small>
         </div>
         <?php if (current_user_can('edit_files') || current_user_can('install_plugins')) { ?>
         <div id="accua_form_dest_path"><?php esc_html_e( 'Upload path', 'contact-forms');?> : <input name="dest_path" class="accua_form_value" type="text" value="<?php echo esc_attr($file_data['dest_path']) ?>" />
           <small><?php esc_html_e( 'If it stars with \'/\' an absolute path is used, otherwise a path relative to the WordPress installation directory. Default value is "wp-content/uploads/accua-forms"', 'contact-forms');?>.</small>
         </div>
         <?php } ?>
    </div></div>

    <div class="postbox">
      <div class="postbox-header"><h2><?php esc_html_e( 'reCaptcha settings', 'contact-forms'); ?></h2></div>
      <div class="inside">
         <p><?php esc_html_e( 'As reCAPTCHA v1 is discontinued, only reCAPTCHA v2 is supported', 'contact-forms');?></p>
         <?php // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- HTML with hardcoded link is intentional ?>
         <p><?php echo strtr(__('Please register this site for reCAPTCHA v2 on %REGISTERURL%, then  enter the keys for this site in the following fields', 'contact-forms'), array('%REGISTERURL%' => '<a href="https://www.google.com/recaptcha" target="_blank">google.com/recaptcha</a>'));?></p>
         <div id="accua_form_recaptcha_public_key"><?php esc_html_e('Site key', 'contact-forms');?> : <input name="recaptcha_public_key" class="accua_form_value" type="text" value="<?php echo esc_attr($captcha_data['recaptcha_public_key']) ?>" />
         </div>
         <div id="accua_form_recaptcha_private_key"><?php esc_html_e('Secret key', 'contact-forms');?> : <input name="recaptcha_private_key" class="accua_form_value" type="text" value="<?php echo esc_attr($captcha_data['recaptcha_private_key']) ?>" />
         </div>
    </div></div>

    <div class="postbox">
      <div class="postbox-header"><h2><?php esc_html_e( 'Cloudflare Turnstile settings', 'contact-forms'); ?></h2></div>
      <div class="inside">
         <p><?php esc_html_e( 'Cloudflare Turnstile is a modern CAPTCHA alternative that provides bot protection without frustrating user experiences.', 'contact-forms');?></p>
         <?php
         $turnstile_plugin_installed = function_exists('cfturnstile_field_show');
         if (!$turnstile_plugin_installed) {
           echo '<div class="notice notice-warning inline"><p>';
           // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- HTML with hardcoded link is intentional
           echo strtr(__('<strong>Required Plugin:</strong> The Turnstile field requires the %PLUGINLINK% plugin to be installed and activated.', 'contact-forms'), array(
             '%PLUGINLINK%' => '<a href="https://it.wordpress.org/plugins/simple-cloudflare-turnstile/" target="_blank">Simple Cloudflare Turnstile</a>'
           ));
           echo '</p></div>';
         } else {
           $turnstile_key = get_option('cfturnstile_key', '');
           $turnstile_secretkey = get_option('cfturnstile_secretkey', '');
           if (empty($turnstile_key) || empty($turnstile_secretkey)) {
             echo '<div class="notice notice-info inline"><p>';
             // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- HTML with esc_url() link is intentional
             echo strtr(__('The plugin is installed. Please configure your Cloudflare Turnstile keys in %SETTINGSLINK%.', 'contact-forms'), array(
               '%SETTINGSLINK%' => '<a href="' . esc_url( admin_url('options-general.php?page=cfturnstile') ) . '">Settings &rarr; Cloudflare Turnstile</a>'
             ));
             echo '</p></div>';
           } else {
             echo '<div class="notice notice-success inline"><p>';
             echo '✓ ' . esc_html__( 'Simple Cloudflare Turnstile plugin is installed and configured.', 'contact-forms' );
             echo '</p></div>';
           }
         }
         ?>
         <p><?php esc_html_e( 'Once the Simple Cloudflare Turnstile plugin is installed and configured, you can add the Turnstile field to any form:', 'contact-forms');?></p>
         <ol style="max-width: 600px;">
           <li><?php esc_html_e( 'Go to Forms → Edit Form', 'contact-forms');?></li>
           <li><?php esc_html_e( 'Find "Turnstile" in the Fields sidebar', 'contact-forms');?></li>
           <li><?php esc_html_e( 'Drag it into your form (typically before the Submit button)', 'contact-forms');?></li>
           <li><?php esc_html_e( 'Save your form', 'contact-forms');?></li>
         </ol>
         <p><?php esc_html_e( 'The Turnstile field gives you complete control over which forms use bot protection - simply add it to the forms that need it.', 'contact-forms');?></p>
    </div></div>

    <div class="postbox">
      <div class="postbox-header"><h2><?php esc_html_e( 'Track actions with Google Analytics and/or Matomo', 'contact-forms'); ?></h2></div>
      <div class="inside">
         <p>
           <input type="checkbox" id="accua_form_analytics_track_submit" name="analytics_track_submit" class="accua_form_value" value="1" <?php if($analytics_data['analytics_track_submit']) { echo 'checked="checked"'; } ?> />
           <label for="accua_form_analytics_track_submit"><?php esc_html_e('Track submissions', 'contact-forms');?></label>
         </p>
         <p>
           <input type="checkbox" id="accua_form_analytics_track_fields" name="analytics_track_fields" class="accua_form_value" value="1" <?php if($analytics_data['analytics_track_fields']) { echo 'checked="checked"'; } ?> />
           <label for="accua_form_analytics_track_fields"><?php esc_html_e('Track fields filled in', 'contact-forms');?></label>
         </p>
    </div></div>

  </div>
  </div><!-- /panel: integrations -->

  <div class="accua-tabs__panel" role="tabpanel" data-tab="privacy">

    <div class="postbox">
      <div class="postbox-header"><h2><?php esc_html_e( 'IP address tracking', 'contact-forms'); ?></h2></div>
      <div class="inside">
         <p>
           <?php esc_html_e("Select how many bytes of the visitor's IPs should be masked.", 'contact-forms');?>
         </p>
         <p>
           <input type="radio" name="anonymize_ip_bytes" id="anonymize_ip_bytes_0" value="0" <?php if($anonymize_ip_data['anonymize_ip_bytes'] == 0) { echo 'checked="checked"'; } ?> />
             <label for="anonymize_ip_bytes_0"><?php esc_html_e('No mask - e.g. 192.168.1.1', 'contact-forms');?></label><br />
         </p>
         <p>
           <input type="radio" name="anonymize_ip_bytes" id="anonymize_ip_bytes_1" value="1" <?php if($anonymize_ip_data['anonymize_ip_bytes'] == 1) { echo 'checked="checked"'; } ?> />
             <label for="anonymize_ip_bytes_1"><?php esc_html_e('1 byte - e.g. 192.168.1.xxx', 'contact-forms');?></label><br />
         </p>
         <p>
           <input type="radio" name="anonymize_ip_bytes" id="anonymize_ip_bytes_2" value="2" <?php if($anonymize_ip_data['anonymize_ip_bytes'] == 2) { echo 'checked="checked"'; } ?> />
             <label for="anonymize_ip_bytes_2"><?php esc_html_e('2 byte - e.g. 192.168.xxx.xxx', 'contact-forms');?></label><br />
         </p>
         <p>
           <input type="radio" name="anonymize_ip_bytes" id="anonymize_ip_bytes_3" value="3" <?php if($anonymize_ip_data['anonymize_ip_bytes'] == 3) { echo 'checked="checked"'; } ?> />
             <label for="anonymize_ip_bytes_3"><?php esc_html_e('3 byte - e.g. 192.xxx.xxx.xxx', 'contact-forms');?></label><br />
         </p>
         <p>
           <input type="radio" name="anonymize_ip_bytes" id="anonymize_ip_bytes_4" value="4" <?php if($anonymize_ip_data['anonymize_ip_bytes'] == 4) { echo 'checked="checked"'; } ?> />
             <label for="anonymize_ip_bytes_4"><?php esc_html_e('Fully mask IP address', 'contact-forms');?></label><br />
         </p>
         <h4><?php esc_html_e( 'Delete IP addresses', 'contact-forms'); ?></h4>
         <p>
           <input type="checkbox" id="delete_previous_ip_values" name="delete_previous_ip_values" class="accua_form_value" value="1" />
           <label for="delete_previous_ip_values"><?php esc_html_e('Delete all previous IP values', 'contact-forms');?></label><br />
         </p>
    </div></div>

    <div class="postbox">
      <div class="postbox-header"><h2><?php esc_html_e( 'Data retention', 'contact-forms'); ?></h2></div>
      <div class="inside">
         <p><?php esc_html_e( 'Automatically anonymize or delete form submissions after a specified period. Set to 0 to keep submissions indefinitely.', 'contact-forms'); ?></p>
         <p>
           <label for="retention_value"><?php esc_html_e( 'Retention period', 'contact-forms'); ?></label>
           <input type="number" id="retention_value" name="retention_value" min="0" step="1" value="<?php echo esc_attr( $retention_data['retention_value'] ); ?>" style="width: 80px;" />
           <select name="retention_unit" id="retention_unit">
             <option value="days" <?php selected( $retention_data['retention_unit'], 'days' ); ?>><?php esc_html_e( 'days', 'contact-forms'); ?></option>
             <option value="months" <?php selected( $retention_data['retention_unit'], 'months' ); ?>><?php esc_html_e( 'months', 'contact-forms'); ?></option>
             <option value="years" <?php selected( $retention_data['retention_unit'], 'years' ); ?>><?php esc_html_e( 'years', 'contact-forms'); ?></option>
           </select>
         </p>
         <p>
           <strong><?php esc_html_e( 'When submissions expire:', 'contact-forms'); ?></strong><br />
           <input type="radio" name="retention_mode" id="retention_mode_anonymize" value="anonymize" <?php checked( $retention_data['retention_mode'], 'anonymize' ); ?> />
             <label for="retention_mode_anonymize"><?php esc_html_e( 'Anonymize — replace personal data with placeholders, keep submission record for statistics', 'contact-forms'); ?></label><br />
           <input type="radio" name="retention_mode" id="retention_mode_delete" value="delete" <?php checked( $retention_data['retention_mode'], 'delete' ); ?> />
             <label for="retention_mode_delete"><?php esc_html_e( 'Delete — permanently remove submission records from the database', 'contact-forms'); ?></label>
         </p>
         <p class="description"><?php esc_html_e( 'Individual forms can override this setting in the form editor.', 'contact-forms'); ?></p>
         <p class="description"><?php
           /* translators: %s: URL to the WordPress Erase Personal Data tool */
           printf( esc_html__( 'To manually erase data for a specific person, use the WordPress %s tool.', 'contact-forms'),
             '<a href="' . esc_url( admin_url( 'erase-personal-data.php' ) ) . '">' . esc_html__( 'Erase Personal Data', 'contact-forms') . '</a>'
           );
         ?></p>
    </div></div>

  </div><!-- /panel: privacy -->

  <div class="accua-tabs__panel" role="tabpanel" data-tab="styling">
  <div class="accua-settings-grid">

    <div class="postbox">
      <div class="postbox-header"><h2><?php esc_html_e( 'Form Container', 'contact-forms'); ?></h2></div>
      <div class="inside">
          <table class="form-table" role="presentation">
            <tr>
              <th scope="row"><label for="accua_form_layout_select"><?php esc_html_e( 'Layout', 'contact-forms'); ?></label></th>
              <td>
                <select id="accua_form_layout_select" name="layout" class="accua_form_value">
                  <option value="sidebyside" <?php selected( 'sidebyside', $form_data['layout'] ); ?>><?php echo esc_html( accua_forms_get_layout_label( 'sidebyside' ) ); ?></option>
                  <option value="toplabel" <?php selected( 'toplabel', $form_data['layout'] ); ?>><?php echo esc_html( accua_forms_get_layout_label( 'toplabel' ) ); ?></option>
                  <option value="inlinelabel" <?php selected( 'inlinelabel', $form_data['layout'] ); ?>><?php echo esc_html( accua_forms_get_layout_label( 'inlinelabel' ) ); ?></option>
                </select>
                <p class="description"><?php esc_html_e( 'With "Labels on the left", labels move above the fields automatically when the form container is narrower than 500px.', 'contact-forms' ); ?></p>
              </td>
            </tr>
            <tr>
              <th scope="row"><label for="accua_style_margin"><?php esc_html_e( 'Margin', 'contact-forms'); ?></label></th>
              <td><input id="accua_style_margin" name="style_margin" class="accua_form_value regular-text" type="text" value="<?php echo esc_attr($form_data['style_margin']) ?>" /></td>
            </tr>
            <tr>
              <th scope="row"><label for="accua_style_border_color"><?php esc_html_e( 'Border color', 'contact-forms'); ?></label></th>
              <td><input id="accua_style_border_color" name="style_border_color" class="accua_form_value accua-color-picker" type="text" value="<?php echo esc_attr($form_data['style_border_color']) ?>" /></td>
            </tr>
            <tr>
              <th scope="row"><label for="accua_style_border_width"><?php esc_html_e( 'Border width', 'contact-forms'); ?></label></th>
              <td><input id="accua_style_border_width" name="style_border_width" class="accua_form_value small-text" type="text" value="<?php echo esc_attr($form_data['style_border_width']) ?>" /></td>
            </tr>
            <tr>
              <th scope="row"><label for="accua_style_border_radius"><?php esc_html_e( 'Rounded corner radius', 'contact-forms'); ?></label></th>
              <td><input id="accua_style_border_radius" name="style_border_radius" class="accua_form_value small-text" type="text" value="<?php echo esc_attr($form_data['style_border_radius']) ?>" /></td>
            </tr>
            <tr>
              <th scope="row"><label for="accua_style_background_color"><?php esc_html_e( 'Background color', 'contact-forms'); ?></label></th>
              <td><input id="accua_style_background_color" name="style_background_color" class="accua_form_value accua-color-picker" type="text" value="<?php echo esc_attr($form_data['style_background_color']) ?>" /></td>
            </tr>
            <tr>
              <th scope="row"><label for="accua_style_padding"><?php esc_html_e( 'Padding', 'contact-forms'); ?></label></th>
              <td><input id="accua_style_padding" name="style_padding" class="accua_form_value regular-text" type="text" value="<?php echo esc_attr($form_data['style_padding']) ?>" /></td>
            </tr>
            <tr>
              <th scope="row"><label for="accua_style_color"><?php esc_html_e( 'Text color', 'contact-forms'); ?></label></th>
              <td><input id="accua_style_color" name="style_color" class="accua_form_value accua-color-picker" type="text" value="<?php echo esc_attr($form_data['style_color']) ?>" /></td>
            </tr>
            <tr>
              <th scope="row"><label for="accua_style_font_size"><?php esc_html_e( 'Font size', 'contact-forms'); ?></label></th>
              <td><input id="accua_style_font_size" name="style_font_size" class="accua_form_value small-text" type="text" value="<?php echo esc_attr($form_data['style_font_size']) ?>" /></td>
            </tr>
          </table>
    </div></div>

    <div class="postbox">
      <div class="postbox-header"><h2><?php esc_html_e( 'Fields', 'contact-forms'); ?></h2></div>
      <div class="inside">
          <table class="form-table" role="presentation">
            <tr>
              <th scope="row"><label for="accua_style_field_spacing"><?php esc_html_e( 'Spacing', 'contact-forms'); ?></label></th>
              <td><input id="accua_style_field_spacing" name="style_field_spacing" class="accua_form_value small-text" type="text" value="<?php echo esc_attr($form_data['style_field_spacing']) ?>" /></td>
            </tr>
            <tr>
              <th scope="row"><label for="accua_style_field_border_color"><?php esc_html_e( 'Border color', 'contact-forms'); ?></label></th>
              <td><input id="accua_style_field_border_color" name="style_field_border_color" class="accua_form_value accua-color-picker" type="text" value="<?php echo esc_attr($form_data['style_field_border_color']) ?>" /></td>
            </tr>
            <tr>
              <th scope="row"><label for="accua_style_field_border_width"><?php esc_html_e( 'Border width', 'contact-forms'); ?></label></th>
              <td><input id="accua_style_field_border_width" name="style_field_border_width" class="accua_form_value small-text" type="text" value="<?php echo esc_attr($form_data['style_field_border_width']) ?>" /></td>
            </tr>
            <tr>
              <th scope="row"><label for="accua_style_field_border_radius"><?php esc_html_e( 'Rounded corner radius', 'contact-forms'); ?></label></th>
              <td><input id="accua_style_field_border_radius" name="style_field_border_radius" class="accua_form_value small-text" type="text" value="<?php echo esc_attr($form_data['style_field_border_radius']) ?>" /></td>
            </tr>
            <tr>
              <th scope="row"><label for="accua_style_field_background_color"><?php esc_html_e( 'Background color', 'contact-forms'); ?></label></th>
              <td><input id="accua_style_field_background_color" name="style_field_background_color" class="accua_form_value accua-color-picker" type="text" value="<?php echo esc_attr($form_data['style_field_background_color']) ?>" /></td>
            </tr>
            <tr>
              <th scope="row"><label for="accua_style_field_padding"><?php esc_html_e( 'Padding', 'contact-forms'); ?></label></th>
              <td><input id="accua_style_field_padding" name="style_field_padding" class="accua_form_value regular-text" type="text" value="<?php echo esc_attr($form_data['style_field_padding']) ?>" /></td>
            </tr>
            <tr>
              <th scope="row"><label for="accua_style_field_color"><?php esc_html_e( 'Text color', 'contact-forms'); ?></label></th>
              <td><input id="accua_style_field_color" name="style_field_color" class="accua_form_value accua-color-picker" type="text" value="<?php echo esc_attr($form_data['style_field_color']) ?>" /></td>
            </tr>
          </table>
    </div></div>

    <div class="postbox">
      <div class="postbox-header"><h2><?php esc_html_e( 'Submit Button', 'contact-forms'); ?></h2></div>
      <div class="inside">
          <table class="form-table" role="presentation">
            <tr>
              <th scope="row"><label for="accua_style_submit_border_color"><?php esc_html_e( 'Border color', 'contact-forms'); ?></label></th>
              <td><input id="accua_style_submit_border_color" name="style_submit_border_color" class="accua_form_value accua-color-picker" type="text" value="<?php echo esc_attr($form_data['style_submit_border_color']) ?>" /></td>
            </tr>
            <tr>
              <th scope="row"><label for="accua_style_submit_border_width"><?php esc_html_e( 'Border width', 'contact-forms'); ?></label></th>
              <td><input id="accua_style_submit_border_width" name="style_submit_border_width" class="accua_form_value small-text" type="text" value="<?php echo esc_attr($form_data['style_submit_border_width']) ?>" /></td>
            </tr>
            <tr>
              <th scope="row"><label for="accua_style_submit_border_radius"><?php esc_html_e( 'Rounded corner radius', 'contact-forms'); ?></label></th>
              <td><input id="accua_style_submit_border_radius" name="style_submit_border_radius" class="accua_form_value small-text" type="text" value="<?php echo esc_attr($form_data['style_submit_border_radius']) ?>" /></td>
            </tr>
            <tr>
              <th scope="row"><label for="accua_style_submit_background_color"><?php esc_html_e( 'Background color', 'contact-forms'); ?></label></th>
              <td><input id="accua_style_submit_background_color" name="style_submit_background_color" class="accua_form_value accua-color-picker" type="text" value="<?php echo esc_attr($form_data['style_submit_background_color']) ?>" /></td>
            </tr>
            <tr>
              <th scope="row"><label for="accua_style_submit_padding"><?php esc_html_e( 'Padding', 'contact-forms'); ?></label></th>
              <td><input id="accua_style_submit_padding" name="style_submit_padding" class="accua_form_value regular-text" type="text" value="<?php echo esc_attr($form_data['style_submit_padding']) ?>" /></td>
            </tr>
            <tr>
              <th scope="row"><label for="accua_style_submit_color"><?php esc_html_e( 'Text color', 'contact-forms'); ?></label></th>
              <td><input id="accua_style_submit_color" name="style_submit_color" class="accua_form_value accua-color-picker" type="text" value="<?php echo esc_attr($form_data['style_submit_color']) ?>" /></td>
            </tr>
            <tr>
              <th scope="row"><label for="accua_style_submit_font_size"><?php esc_html_e( 'Font size', 'contact-forms'); ?></label></th>
              <td><input id="accua_style_submit_font_size" name="style_submit_font_size" class="accua_form_value small-text" type="text" value="<?php echo esc_attr($form_data['style_submit_font_size']) ?>" /></td>
            </tr>
          </table>
    </div></div>

  </div>
  </div><!-- /panel: styling -->

   <?php if ( current_user_can( 'manage_options' ) ) : ?>
  <div class="accua-tabs__panel" role="tabpanel" data-tab="danger_zone">

    <div class="postbox accua-danger-zone">
      <div class="postbox-header"><h2><?php esc_html_e( 'Anonymize old submissions', 'contact-forms' ); ?></h2></div>
      <div class="inside">
         <p class="description"><?php esc_html_e( 'Anonymize all submissions older than the specified period, across all forms. This replaces personal data with placeholders and sets IP to 0.0.0.0. This cannot be undone.', 'contact-forms' ); ?></p>
         <p>
           <input type="number" id="accua_danger_anon_value" min="1" step="1" value="12" style="width: 80px;" />
           <select id="accua_danger_anon_unit" style="vertical-align: baseline;">
             <option value="days"><?php esc_html_e( 'days', 'contact-forms' ); ?></option>
             <option value="months" selected><?php esc_html_e( 'months', 'contact-forms' ); ?></option>
             <option value="years"><?php esc_html_e( 'years', 'contact-forms' ); ?></option>
           </select>
           <button type="button" id="accua_danger_anon_btn" class="button" style="color: #d63638; border-color: #d63638;"><?php esc_html_e( 'Anonymize submissions', 'contact-forms' ); ?></button>
         </p>
         <div id="accua_danger_anon_result" style="display:none;"></div>
    </div></div>

    <div class="postbox accua-danger-zone">
      <div class="postbox-header"><h2><?php esc_html_e( 'Delete all Contact Forms data', 'contact-forms' ); ?></h2></div>
      <div class="inside">
         <p class="description"><?php esc_html_e( 'Permanently delete ALL Contact Forms settings, forms, submissions, and uploaded files. The plugin will remain installed but completely reset. Make a full backup before proceeding.', 'contact-forms' ); ?></p>
         <p>
           <button type="button" id="accua_danger_delete_btn" class="button" style="color: #d63638; border-color: #d63638;"><?php esc_html_e( 'Delete all data', 'contact-forms' ); ?></button>
         </p>
         <div id="accua_danger_delete_result" style="display:none;"></div>
    </div></div>

  </div><!-- /panel: danger_zone -->
   <?php endif; ?>

  <div class="accua-tabs__panel" role="tabpanel" data-tab="tokens">
  <?php accua_forms_print_tokens(); ?>
  </div><!-- /panel: tokens -->

  <div class="accua-tabs__panel" role="tabpanel" data-tab="theme_helper">
  <?php accua_forms_theme_helper_content(); ?>
  </div><!-- /panel: theme_helper -->

</div><!-- /accua_settings_tabs -->

<?php /*
<h3><?php _e( 'File upload default settings', 'contact-forms'); ?></h3>
<p id="accua_form_valid_extensions"><?php _e( 'Valid extensions', 'contact-forms'); ?> <br /><textarea name="valid_extensions" class="accua_form_value" style="width:95%"; cols="80" rows="8"><?php echo htmlspecialchars($file_data['valid_extensions'], ENT_QUOTES) ?></textarea>
  <small><?php _e( 'List of valid extensions, without dot, one per line.', 'contact-forms'); ?></small>
</p>
<p id="accua_form_max_size"><?php _e( 'Maximum file size:', 'contact-forms'); ?> <input name="max_size" class="accua_form_value" type="text" value="<?php echo htmlspecialchars($file_data['max_size'], ENT_QUOTES) ?>" /><br />
  <small><?php _e( 'You can use suffix K, M or G for kilobyte, megabyte or gigabyte.', 'contact-forms'); ?>
<?php
    $server_max_size = AccuaForm_Element_File::file_upload_max_size();
    if ($server_max_size > 0) {
      _e( 'This value is limited by server upload limits of ', 'contact-forms');
      echo  AccuaForm_Element_File::format_size($server_max_size).". ";
      _e( 'If you need a greater limit you should ask to the server administrator.', 'contact-forms');
    }
?>
  </small></p>
<p id="accua_form_dest_path"><?php _e( 'Upload path', 'contact-forms');?> : <input name="dest_path" class="accua_form_value" type="text" value="<?php echo htmlspecialchars($file_data['dest_path'], ENT_QUOTES) ?>" />
  <small><?php _e( 'If it stars with \'/\' an absolute path is used, otherwise a path relative to the WordPress installation directory. Default value is "wp-content/uploads/accua-forms"', 'contact-forms');?>.</small>
</p> */ ?>
<p><input class="button button-primary button-large" id="accua_form_save_settings" type="submit" value="Save settings" /></p>

</form>

<span id="accua-forms-version"><?php
  $plugin_data = get_plugin_data( ACCUA_FORMS_FILE );
  echo esc_html( $plugin_data['Name'] ); ?> &mdash; <a href="https://www.cimatti.it/en/wordpress-plugins/contact-forms/"><?php
  esc_html_e('Version', 'contact-forms'); echo ' ' . esc_html( $plugin_data['Version'] ); ?></a></span>

</div>

<?php
}

```
