'; echo __( 'Internal Error: Invalid form number.', 'si-contact-form' ); echo "\n"; self::$current_form = $form_num_default; } self::$form_option_name = "fs_contact_form" . self::$current_form; // Check for the current tab number if ( isset( $_REQUEST['fscf_tab'] ) && is_numeric( $_REQUEST['fscf_tab'] ) ) self::$current_tab = absint($_REQUEST['fscf_tab']); else self::$current_tab = 1; } static function register_options_page() { // Adds link on admin 'Settings' menu add_options_page( __('Fast Secure Contact Form Options', 'si-contact-form'), // The text to the display in the browser when this menu item is active __('FS Contact Form', 'si-contact-form'), // The text for this menu item 'manage_options', // Which type of users can see this menu // The slug should point to the main plugin file, not this one! 'si-contact-form/si-contact-form.php', // __FILE__, // The unique ID - the slug - for this menu item 'FSCF_Options::display_options' // The function used to render the menu for this page to the screen ); } static function get_options() { if ( ! isset( self::$form_defaults ) ) self::$form_defaults = FSCF_Util::set_defaults ( ); if ( ! self::$global_options ) { self::$global_options = FSCF_Util::get_global_options(); } if ( ! self::$form_options ) { self::$form_options = FSCF_Util::get_form_options(self::$current_form, true); } // See if the form name has changed--if so, update it in the list if ( ( self::$global_options['form_list'][self::$current_form] <> self::$form_options['form_name'] ) && self::$form_options['form_name'] <> "" ) { self::$global_options['form_list'][self::$current_form] = self::$form_options['form_name']; update_option( 'fs_contact_global', self::$global_options ); } if ( count( self::$form_options ) < count( self::$form_defaults ) ) { // add missing elements from the default form options array self::$form_options = array_merge( self::$form_defaults, self::$form_options ); } } static function unload_options() { // Forces the reload of global and form options // Called by FSCF_Action::restore_settings() self::$global_options = false; self::$form_options = false; } static function initialize_options() { // Carry out form backup if requested if ( isset($_POST['ctf_action']) && esc_attr__('Backup Settings', 'si-contact-form') == $_POST['ctf_action'] ) FSCF_Action::backup_download(); // Get the current form self::get_form_num(); // Register settings sections add_settings_section( 'fscf_basic_settings', // ID used to identify this section and with which to register options __('Basic Settings', 'si-contact-form'), // Title to be displayed on the administration page 'FSCF_Options::basic_settings_callback', // Callback used to render the description of the section 'tab_page1' // Page on which to add this section of options ); add_settings_section( 'fscf_email_settings', __('Email Settings', 'si-contact-form'), 'FSCF_Options::email_settings_callback', 'tab_page1' ); add_settings_section( 'fscf_field_settings', __('Field Settings', 'si-contact-form'), 'FSCF_Options::field_settings_callback', 'tab_page2' ); add_settings_section( 'fscf_style_settings', __('Style Settings', 'si-contact-form'), 'FSCF_Options::style_settings_callback', 'tab_page3' ); add_settings_section( 'fscf_label_settings', __('Field Label Settings', 'si-contact-form'), 'FSCF_Options::label_settings_callback', 'tab_page4' ); add_settings_section( 'fscf_tooltip_settings', __('Tooltip Label Settings', 'si-contact-form'), 'FSCF_Options::tooltip_settings_callback', 'tab_page4' ); add_settings_section( 'fscf_error_settings', __('Error Message Settings', 'si-contact-form'), 'FSCF_Options::error_settings_callback', 'tab_page4' ); add_settings_section( 'fscf_captcha_settings', __('CAPTCHA Settings', 'si-contact-form'), 'FSCF_Options::captcha_settings_callback', 'tab_page5' ); add_settings_section( 'fscf_akismet_settings', __('Akismet Settings', 'si-contact-form'), 'FSCF_Options::akismet_settings_callback', 'tab_page5' ); add_settings_section( 'fscf_domain_settings', __('Domain Protect Settings', 'si-contact-form'), 'FSCF_Options::domain_settings_callback', 'tab_page5' ); add_settings_section( 'fscf_confirmation_email', __('Confirmation Email Settings', 'si-contact-form'), 'FSCF_Options::confirmation_email_callback', 'tab_page6' ); add_settings_section( 'fscf_redirect', __('Redirect Settings', 'si-contact-form'), 'FSCF_Options::redirect_callback', 'tab_page6' ); add_settings_section( 'fscf_advanced_form', __('Advanced Form Settings', 'si-contact-form'), 'FSCF_Options::advanced_form_callback', 'tab_page6' ); add_settings_section( 'fscf_advanced_email', __('Advanced Email Settings', 'si-contact-form'), 'FSCF_Options::advanced_email_callback', 'tab_page6' ); add_settings_section( 'fscf_silent_sending', __('Silent Remote Sending Settings', 'si-contact-form'), 'FSCF_Options::silent_sending_callback', 'tab_page6' ); add_settings_section( 'fscf_data_export', __('Data Export Settings', 'si-contact-form'), 'FSCF_Options::data_export_callback', 'tab_page6' ); add_settings_section( 'fscf_meeting_settings', __('vCita Online Scheduling Settings', 'si-contact-form'), 'FSCF_Options::meeting_settings_callback', 'tab_page7' ); add_settings_section( 'fscf_tools_settings', __('Tools and Backup', 'si-contact-form'), 'FSCF_Options::tools_callback', 'tab_page8' ); //
'si-contact-form' ) ); if ( !is_wp_error( $api ) ) { // cache isn't up to date, write this fresh information to it now to avoid the query for xx time. $myexpire = 60 * 15; // Cache data for 15 minutes set_transient( 'si_contact_form_info', $api, $myexpire ); } } if ( !is_wp_error( $api ) ) { $plugins_allowedtags = array( 'a' => array( 'href' => array( ), 'title' => array( ), 'target' => array( ) ), 'abbr' => array( 'title' => array( ) ), 'acronym' => array( 'title' => array( ) ), 'code' => array( ), 'pre' => array( ), 'em' => array( ), 'strong' => array( ), 'div' => array( ), 'p' => array( ), 'ul' => array( ), 'ol' => array( ), 'li' => array( ), 'h1' => array( ), 'h2' => array( ), 'h3' => array( ), 'h4' => array( ), 'h5' => array( ), 'h6' => array( ), 'img' => array( 'src' => array( ), 'class' => array( ), 'alt' => array( ) ) ); //Sanitize HTML foreach ( (array) $api->sections as $section_name => $content ) $api->sections[$section_name] = wp_kses( $content, $plugins_allowedtags ); foreach ( array( 'version', 'author', 'requires', 'tested', 'homepage', 'downloaded', 'slug' ) as $key ) $api->$key = wp_kses( $api->$key, $plugins_allowedtags ); if ( !empty( $api->downloaded ) ) { echo sprintf( __( 'Downloaded %s times.', 'si-contact-form' ), number_format_i18n( $api->downloaded ) ); } ?> rating ) ) { ?>
<?php esc_attr_e( '5 stars', 'si-contact-form' ) ?>
<?php esc_attr_e( '4 stars', 'si-contact-form' ) ?>
<?php esc_attr_e( '3 stars', 'si-contact-form' ) ?>
<?php esc_attr_e( '2 stars', 'si-contact-form' ) ?>
<?php esc_attr_e( '1 star', 'si-contact-form' ) ?>
num_ratings ) ); ?>
version ) ) { if ( version_compare( $api->version, FSCF_VERSION, '>' ) ) { echo '\n"; } else { echo sprintf( __( 'Version %s (up to date)', 'si-contact-form' ), FSCF_VERSION ); } } // end div fscf_statbox ?>

| | | |

'. __('vCita Meeting Scheduler has been disabled.', 'si-contact-form'); echo '
'; self::$global_options = FSCF_Util::get_global_options(); self::$global_options['vcita_show_disable_msg'] = 'false'; update_option( 'fs_contact_global', self::$global_options ); } else { FSCF_Process::vcita_print_admin_page_notification(self::$form_options, self::$global_options); } /* --- vCita Header Error Messages - End --- */ // action hook for database extension menu do_action( 'fsctf_menu_links' ); ?>

:  
'; ?>
self::$current_form ) ); } else { ?>
'; settings_fields( 'fs_contact_options' ); do_settings_sections( 'tab_page' . $i ); if ( $i < $num_tabs ) { // submit_button(); // XXX if moving tabs around, you have may have to change 8 to a diff number, also make a change in fscf-scripts-admin.js if (tabId < 8) { if ($i != 8) { // skip tab 8 for the tools tab ?>

'; } ?>

' . __( 'Settings have been imported from a previous version. Please check over the settings to be sure that everything is all right. Also, please go to the Tools tab and click "Reset default style settings on all forms" so that all the new style changes are set for your imported forms.', 'si-contact-form' ); $msg_class = 'fsc-notice'; } else { echo '

' . __( 'A previous version was detected, but settings could not be imported because it is too old. Installed as new.', 'si-contact-form' ); $msg_class = 'fsc-error'; } echo '
('. __('You can dismiss this message on the Basic Settings tab', 'si-contact-form').')

'; echo '

'; ?>

'; } ?>
'; echo '

' . __('Donate', 'si-contact-form') . '

' . __('Please donate to keep this plugin FREE', 'si-contact-form') . '
' . __('If you find this plugin useful to you, please consider making a small donation to help contribute to my time invested and to further development. Thanks for your kind support!', 'si-contact-form') . ' ' . '-
' . __('You have 1 message from Mike Challis', 'si-contact-form') .'




'; } ?>

'; } ?> value="true" />
Mike Challis

.


.

[si-contact-form form='". self::$current_form ."']"; ?>






__( 'Webmaster', 'si-contact-form' ), 'EMAIL' => $ctf_contacts_test ); } } else { $ctf_ct_arr = explode( "\n", $ctf_contacts_test ); if ( is_array( $ctf_ct_arr ) ) { foreach ( $ctf_ct_arr as $line ) { // echo '|'.$line.'|' ; list($key, $value) = preg_split( '#(? $key, 'EMAIL' => $value ); } else { $ctf_contacts_error = 1; } } else { // multiple emails here (additional ones will be Cc:) // Webmaster,user1@example.com;user2@example.com;user3@example.com;[cc]user4@example.com;[bcc]user5@example.com $multi_cc_arr = explode( ";", $value ); $multi_cc_string = ''; foreach ( $multi_cc_arr as $multi_cc ) { $multi_cc_t = str_replace( '[cc]', '', $multi_cc ); $multi_cc_t = str_replace( '[bcc]', '', $multi_cc_t ); if ( FSCF_Util::validate_email( $multi_cc_t ) ) { $multi_cc_string .= "$multi_cc,"; } else { $ctf_contacts_error = 1; } } if ( $multi_cc_string != '' ) { // multi cc emails $ctf_contacts[] = array( 'CONTACT' => $key, 'EMAIL' => rtrim( $multi_cc_string, ',' ) ); } } } } // end foreach } // end if (is_array($ctf_ct_arr) ) { } // end else //print_r($ctf_contacts); ?> '; echo __( 'ERROR: Misconfigured "Email To" address.', 'si-contact-form' ); echo "\n"; echo '
' . __( 'ERROR: Misconfigured "Email To" address.', 'si-contact-form' ) . '
' . "\n"; } if ( !function_exists( 'mail' ) ) { echo '
' . __( 'Warning: Your web host has the mail() function disabled. PHP cannot send email.', 'si-contact-form' ); echo ' ' . __( 'Have them fix it. Or you can install the "WP Mail SMTP" plugin and configure it to use SMTP.', 'si-contact-form' ) . '
' . "\n"; } ?>





Webmaster,user1@example.com
Sales,user2@example.com


Sales,user3@example.com;user4@example.com;user5@example.com


Sales,user3@example.com;[cc]user1@example.com;[cc]user2@example.com;[bcc]user3@example.com;[bcc]user4@example.com

'; echo __( 'ERROR: Misconfigured "Bcc Email" address.', 'si-contact-form' ); echo "\n"; echo '
' . __( 'ERROR: Misconfigured "Bcc Email" address.', 'si-contact-form' ) . '
' . "\n"; } } ?>


user1@example.com
user1@example.com,user2@example.com




[from_name]

"; ?>

'; echo __( 'ERROR: Misconfigured "Return-path address".', 'si-contact-form' ); echo "\n"; echo '
' . __( 'ERROR: Misconfigured "Return-path address".', 'si-contact-form' ) . '
' . "\n"; } } ?>







'; echo __( 'Warning: Enabling this setting requires the "Return-path address" setting above to also be set.', 'si-contact-form' ); echo "\n"; } ?> value="true" />









__( 'text', 'si-contact-form' ), 'textarea' => __( 'textarea', 'si-contact-form' ), 'checkbox' => __( 'checkbox', 'si-contact-form' ), 'checkbox-multiple' => __( 'checkbox-multiple', 'si-contact-form' ), 'radio' => __( 'radio', 'si-contact-form' ), 'select' => __( 'select', 'si-contact-form' ), 'select-multiple' => __( 'select-multiple', 'si-contact-form' ), 'attachment' => __( 'attachment', 'si-contact-form' ), 'date' => __( 'date', 'si-contact-form' ), 'time' => __( 'time', 'si-contact-form' ), 'email' => __( 'email', 'si-contact-form' ), 'url' => __( 'url', 'si-contact-form' ), 'hidden' => __( 'hidden', 'si-contact-form' ), 'password' => __( 'password', 'si-contact-form' ), 'fieldset' => __( 'fieldset(box-open)', 'si-contact-form' ), 'fieldset-close' => __( 'fieldset(box-close)', 'si-contact-form' ) ); $select_type_fields = array( 'checkbox-multiple', 'select', 'select-multiple', 'radio' ); // Display the field options ?>


















'; echo __('When using "Default as placeholder" setting with "Enable double email entry" setting enabled. The "Default" setting should be in this example format: "Email==Re-enter Email". Separate words with == separators.', 'si-contact-form'); ?>
'; echo __('When using "Default as placeholder" setting with "First Name, Last Name" setting enabled. The "Default" setting should be in this example format: "First Name==Last Name". Separate words with == separators.', 'si-contact-form'); ?>
'; echo __('When using "Default as placeholder" setting with "First Name, Middle Name, Last Name" setting enabled. The "Default" setting should be in this example format: "First Name==Middle Name==Last Name". Separate words with == separators.', 'si-contact-form'); ?>













$field ) { $slug_list[] = $field['slug']; } $bad_slug_list = array(); foreach (self::$post_types_slugs as $key => $slug) { if ( in_array( strtolower( $slug ), $slug_list ) ) { echo '
'; echo sprintf( __( 'Warning: one of your field tags conflicts with the post type redirect tag "%s". To automatically correct this, click the Save Changes button.', 'si-contact-form' ), $slug ); echo "
\n"; $bad_slug_list[] = $slug; } } // fill in any missing defaults $field_opt_defaults = array( 'hide_label' => 'false', 'placeholder' => 'false', ); $placeholder_error = 0; $name_format_error = 0; $email_format_error = 0; $dup_field_error = 0; $field_names = array(); $fields_count = count(self::$form_options['fields']); foreach ( self::$form_options['fields'] as $key => $field ) { $field_opt_name = self::$form_option_name . '[fields][' . $key . ']'; $nextkey = $key+1; // fill in any missing field options defaults foreach ( $field_opt_defaults as $dfkey => $dfval ) { if ( !isset($field[$dfkey]) || empty($field[$dfkey]) ) $field[$dfkey] = $dfval; } ?>
' . self::$new_field_added . '' . "\n"; self::$new_field_key = $nextkey; } if ( in_array( strtolower( $field['slug'] ), $bad_slug_list ) ) { echo '
' . sprintf( __( 'Warning: one of your field tags conflicts with the post type redirect tag "%s". To automatically correct this, click the Save Changes button.', 'si-contact-form' ), $field['slug'] ) . '
' . "\n"; } // warn if placeholder is missing the Default text if ( $field['placeholder'] == 'true' && $field['default'] == '' ) { if (!$placeholder_error) { echo '
'; echo __( 'Caution: "Default as placeholder" setting requires "Default" setting to be filled in. Correct this on the Fields tab and click Save Changes', 'si-contact-form' ); echo "
\n"; } echo '
' . __( 'Caution: "Default as placeholder" setting requires "Default" setting to be filled in. Correct this in the field details and click Save Changes', 'si-contact-form' ) . '
' . "\n"; $placeholder_error = 1; } // warn if name default not in proper format if ( FSCF_NAME_FIELD == $field['standard'] ) { $name_format_array = array( 'name' => __( 'Name', 'si-contact-form' ), 'first_last' => __( 'First Name, Last Name', 'si-contact-form' ), 'first_middle_i_last' => __( 'First Name, Middle Initial, Last Name', 'si-contact-form' ), 'first_middle_last' => __( 'First Name, Middle Name, Last Name', 'si-contact-form' ), ); if ( $field['default'] != '' && self::$form_options['name_format'] == 'first_last' ) { if ( !preg_match('/^(.*)(==)(.*)$/', $field['default'], $matches) ) $name_format_error = 'First Name==Last Name'; } else if ( $field['default'] != '' && self::$form_options['name_format'] == 'first_middle_last' ) { if ( !preg_match('/^(.*)(==)(.*)(==)(.*)$/', $field['default'], $matches) ) $name_format_error = 'First Name==Middle Name==Last Name'; } else if ( $field['default'] != '' && self::$form_options['name_format'] == 'first_middle_i_last' ) { if ( !preg_match('/^(.*)(==)(.*)(==)(.*)$/', $field['default'], $matches) ) $name_format_error = 'First Name==Middle Initial==Last Name'; } if ($name_format_error) { $this_name_format = $name_format_array[self::$form_options['name_format']]; echo '
'; echo sprintf( __( 'Caution: Name field format "%s" requires the "Default" setting to be in this example format: %s. Separate words with == separators, or empty the "Default" setting. Correct this on the Fields tab and click Save Changes', 'si-contact-form'), $this_name_format, $name_format_error ); echo "
\n"; echo '
' . sprintf( __( 'Caution: Name field format "%s" requires the "Default" setting to be in this example format: %s. Separate words with == separators, or empty the "Default" setting. Correct this in the field details and click Save Changes', 'si-contact-form'), $this_name_format, $name_format_error ) . '
' . "\n"; } } // warn if double email default not in proper format if ( FSCF_EMAIL_FIELD == $field['standard'] && 'true' == self::$form_options['double_email'] && $field['default'] != '' ) { if ( !preg_match('/^(.*)(==)(.*)$/', $field['default'], $matches) ) { echo '
'; echo __( 'Caution: When "Enable double email entry" setting is enabled, the "Default" setting should be in this example format: Email==Re-enter Email. Separate words with == separators, or empty the "Default" setting. Correct this on the Fields tab and click Save Changes', 'si-contact-form'); echo "
\n"; echo '
' . __( 'Caution: "When Enable double email entry" setting is enabled, the "Default" setting should be in this example format: Email==Re-enter Email. Separate words with == separators, or empty the "Default" setting. Correct this in the field details and click Save Changes', 'si-contact-form') . '
' . "\n"; } } // Make sure field names are unique if ( in_array( $field['label'], $field_names ) ) { // We have a duplicate field label, display an error message if (!$dup_field_error) { echo '
'; echo __( 'Caution: Duplicate field label. Now you must change the field label on the Fields tab and click Save Changes', 'si-contact-form' ); echo "
\n"; } echo '
' . __( 'Caution: Duplicate field label. Change the field label and click Save Changes', 'si-contact-form' ) . '
' . "\n"; $dup_field_error = 1; } $field_names[] = $field['label']; $k = $key + 1; ?> 0 ) echo ' readonly="readonly"'; ?>/> " />    '. __('DISABLED', 'si-contact-form') .''; ?>
'; } if ( FSCF_NAME_FIELD == $field['standard'] ) { // Add special fields for the Name field ?>
     value="true" />

size="45" />     value="true" />        value="true" />     value="true" />
:       value="true" />     value="true" />

    value="true" />    








'; if ( FSCF_EMAIL_FIELD == $field['standard'] ) { // Add extra field to the email field ?>
value="true" />





doc,docx,pdf,txt,gif,jpg,jpeg,png



500kb, 800kb, 1mb, 1.5mb, 2mb mb

value="true" />

value="true" />





text-align:left; color:#000000; background-color:#CCCCCC;
style="text-align:left; color:#000000; background-color:#CCCCCC;"
class="input"


value="true" />



'; _e('View custom CSS', 'si-contact-form'); echo '

'; } else { _e('help', 'si-contact-form'); } ?>


'; ?>






/*------------------------------------------------*/
/*-----------[Fast Secure Contact Form]-----------*/
/*------------------------------------------------*/

/* Alignment DIVs */
.fscf-div-form              {  }
.fscf-div-left-box          {  }
.fscf-div-right-box         {  }
.fscf-div-clear             {  }
.fscf-div-field-left        {  }
.fscf-div-field-prefollow   {  }
.fscf-div-field-follow      {  }
.fscf-div-label             {  }
.fscf-div-field             {  }
.fscf-div-captcha-sm        {  }
.fscf-div-captcha-m         {  }
.fscf-image-captcha         {  }
.fscf-image-captcha-refresh {  }
.fscf-div-submit            {  }
.fscf-fieldset              {  }

/* Styles of labels, fields and text */
.fscf-required-indicator {  }
.fscf-required-text      {  }
.fscf-hint-text          {  }
.fscf-div-error          {  }
.fscf-div-redirecting    {  }
.fscf-fieldset-field     {  }
.fscf-label              {  }
.fscf-option-label       {  }
.fscf-input-text         {  }
.fscf-input-captcha      {  }
.fscf-input-textarea     {  }
.fscf-input-select       {  }
.fscf-input-checkbox     {  }
.fscf-input-radio        {  }
.fscf-button-submit      {  }
.fscf-button-reset       {  }
.fscf-button-vcita       {  }
.fscf-button-div-vcita   {  }
.fscf-powered-by         {  }

/* Placeholder Style - WebKit browsers - Safari, Chrome */
::-webkit-input-placeholder {  }

/* Placeholder Style - Mozilla Firefox 4 - 18 */
:-moz-placeholder {  }

/* Placeholder Style - Mozilla Firefox 19+ */
::-moz-placeholder {  }

/* Placeholder Style - Internet Explorer 10+ */
:-ms-input-placeholder {  }
'; echo __('Caution: "External Style Sheet CSS" is enabled in the Styles tab. This setting requires your theme\'s style.css to include the custom CSS. You can get the custom CSS on the Styles tab. Be sure your theme includes the custom CSS from this plugin, if it does not, then add the custom CSS to your theme or change the setting back to "Internal Style Sheet CSS".', 'si-contact-form'); echo "
\n"; echo '
'; echo __('Note: "Internal Style Sheet CSS" fields below are not editable while "External Style Sheet CSS" is enabled.', 'si-contact-form'); echo "
\n"; } ?>





text-align:left; color:#000000; background-color:#CCCCCC;
style="text-align:left; color:#000000; background-color:#CCCCCC;"
class="input"




name="[form_style]" id="si_contact_form_style" type="text" value="" />

name="[left_box_style]" id="si_contact_left_box_style" type="text" value="" />

name="[right_box_style]" id="si_contact_right_box_style" type="text" value="" />

name="[clear_style]" id="si_contact_clear_style" type="text" value="" />

name="[field_left_style]" id="si_contact_field_left_style" type="text" value="" />

name="[field_follow_style]" id="si_contact_field_follow_style" type="text" value="" />

name="[field_prefollow_style]" id="si_contact_field_prefollow_style" type="text" value="" />

name="[title_style]" id="si_contact_title_style" type="text" value="" />

name="[field_div_style]" id="si_contact_field_div_style" type="text" value="" />

name="[captcha_div_style_sm]" id="si_contact_captcha_div_style_sm" type="text" value="" />

name="[captcha_div_style_m]" id="si_contact_captcha_div_style_m" type="text" value="" />

name="[captcha_image_style]" id="si_contact_captcha_image_style" type="text" value="" />

name="[captcha_reload_image_style]" id="si_contact_captcha_reload_image_style" type="text" value="" />

name="[submit_div_style]" id="si_contact_submit_div_style" type="text" value="" />

name="[border_style]" id="si_contact_border_style" type="text" value="" />





text-align:left; color:#000000; background-color:#CCCCCC;
style="text-align:left; color:#000000; background-color:#CCCCCC;"
class="input"



name="[required_style]" id="si_contact_required_style" type="text" value="" />

name="[required_text_style]" id="si_contact_required_text_style" type="text" value="" />

name="[hint_style]" id="si_contact_hint_style" type="text" value="" />

name="[error_style]" id="si_contact_error_style" type="text" value="" />

name="[redirect_style]" id="si_contact_redirect_style" type="text" value="" />

name="[fieldset_style]" id="si_contact_fieldset_style" type="text" value="" />

name="[label_style]" id="si_contact_label_style" type="text" value="" />

name="[option_label_style]" id="si_contact_option_label_style" type="text" value="" />

name="[field_style]" id="si_contact_field_style" type="text" value="" />

name="[captcha_input_style]" id="si_contact_captcha_input_style" type="text" value="" />

name="[textarea_style]" id="si_contact_textarea_style" type="text" value="" />

name="[select_style]" id="si_contact_select_style" type="text" value="" />

name="[checkbox_style]" id="si_contact_checkbox_style" type="text" value="" />

name="[radio_style]" id="si_contact_radio_style" type="text" value="" />

name="[placeholder_style]" id="si_contact_placeholder_style" type="text" value="" />

name="[button_style]" id="si_contact_button_style" type="text" value="" />

name="[reset_style]" id="si_contact_reset_style" type="text" value="" />

name="[vcita_button_style]" id="si_contact_vcita_button_style" type="text" value="" />

name="[vcita_div_button_style]" id="si_contact_vcita_div_button_style" type="text" value="" />

name="[powered_by_style]" id="si_contact_powered_by_style" type="text" value="" />

value="true" />


value="true" />

value="true" />









































value="true" />

'; echo __( 'Warning: Enabling this setting requires all the confirmation email fields below to also be set.', 'si-contact-form' ); echo "\n"; } if ( ! self::$autoresp_ok && self::$form_options['auto_respond_enable'] == 'true' && self::$form_options['auto_respond_from_name'] != '' && self::$form_options['auto_respond_from_email'] != '' && self::$form_options['auto_respond_reply_to'] != '' && self::$form_options['auto_respond_subject'] != '' && self::$form_options['auto_respond_message'] != '' ) { echo '
'; echo __( 'Warning: You have disabled the email address field on the Fields tab, you will not be able to reply to emails and the confirmation email (if enabled) will not work.', 'si-contact-form' ); echo "
\n"; } if ( ! self::$autoresp_ok ) { echo '
'; echo __( 'Warning: You have disabled the email address field on the Fields tab, you will not be able to reply to emails and the confirmation email (if enabled) will not work.', 'si-contact-form' ); echo "
\n"; } ?>




[from_name]

"; ?>


[from_name]

"; } ?>


value="true" />

<html><body>
<h1></h1>
</body></html>

value="true" />



'; echo __( 'Warning: Enabling this setting requires the "Enable redirect" to also be set.', 'si-contact-form' ); echo "\n"; } ?> value="true" />







"; ?>






from_name=name
from_email=email



"; ?>







account=3629675
newsletter=join
action=signup


'; echo __( 'Warning: Enabling this setting requires the "Enable redirect" and "Enable posted data to be sent as a query string" to also be set.', 'si-contact-form' ); echo "\n"; } ?>
'; echo __( 'Just a reminder: You have turned off email sending in the setting below. If that is what you intended, then ignore this message.', 'si-contact-form' ); echo "\n"; } ?> value="true" />



value="true" />

value="true" />

value="true" />

OK - Writable ' . substr(sprintf('%o', fileperms($check_this_dir)), -4); } else if ( !file_exists( $check_this_dir ) ) { echo ''; echo __( 'There is a problem with the directory', 'si-contact-form' ); echo ' /captcha/cache/. '; echo __( 'The directory is not found, a permissions problem may have prevented this directory from being created.', 'si-contact-form' ); echo ' '; echo __( 'Fixing the actual problem is recommended, but you can check this setting on the contact form options page: "Use PHP Sessions" and the captcha will work this way just fine (as long as PHP Sessions are supported by your web host).', 'si-contact-form'); echo '
'; } else { echo ''; echo __( 'There is a problem with the directory', 'si-contact-form' ) . ' /captcha/cache/. '; echo __( 'The directory Unwritable (fix permissions)', 'si-contact-form' ) . '. '; echo __( 'Permissions are: ', 'si-contact-form' ); echo ' '; echo substr( sprintf( '%o', fileperms( $check_this_dir ) ), -4 ); echo ' '; echo __( 'Fixing this may require assigning 0755 permissions or higher (e.g. 0777 on some hosts. Try 0755 first, because 0777 is sometimes too much and will not work.)', 'si-contact-form' ); echo ' '; echo __( 'Fixing the actual problem is recommended, but you can check this setting on the contact form options page: "Use PHP Sessions" and the captcha will work this way just fine (as long as PHP Sessions are supported by your web host).', 'si-contact-form'); echo '
'; } } ?> value="true" />

value="true" />

value="true" />

value="true" /> ' . __( 'Fast Secure Contact Form', 'si-contact-form' ); ?>





value="true" />

value="true" />

value="true" />

value="true" />

value="true" />

value="true" />
Visitor Maps plugin to enable geolocation and then city, state, country will automatically be included.', 'si-contact-form' ); ?>

value="true" />

value="true" />





'; echo __( 'Warning: Enabling this setting requires the "Silent Remote URL" to also be set.', 'si-contact-form' ); echo "\n"; } ?>






"; ?>






from_name=name
from_email=email



"; ?>







account=3629675
newsletter=join
action=signup







"; ?>






'; echo __( 'Warning: Enabling this setting requires the "Silent Remote Send" and "Silent Remote URL" to also be set.', 'si-contact-form' ); echo "\n"; } ?>
'; echo __( 'Just a reminder: You have turned off email sending in the setting below. This is just a reminder in case that was a mistake. If that is what you intended, then ignore this message.', 'si-contact-form' ); echo "\n"; } ?> value="true" />

Contact Form DB plugin.', 'si-contact-form' ), 'http://www.fastsecurecontactform.com/save-to-database' ); ?>






"; ?>






from_name=name
from_email=email



"; ?>







account=3629675
newsletter=join
action=signup


'; echo __( 'Just a reminder: You have turned off email sending in the setting below. This is just a reminder in case that was a mistake. If that is what you intended, then ignore this message.', 'si-contact-form' ); echo "\n"; } ?> value="true" />



value="true" />




value="true" />

'; echo __( 'Warning: reCAPTCHA V2 API key(s) missing. Enabling reCAPTCHA V2 on the Security tab requires the keys to also be set.', 'si-contact-form' ); echo "\n"; } ?>


Get reCAPTCHA V2 keys for your site here', 'si-contact-form' ); ?>





value="true" />
value="true" />

value="true" />

permission_level $choices = array ( __('All registered users', 'si-contact-form') => 'read', __('Edit posts', 'si-contact-form') => 'edit_posts', __('Publish Posts', 'si-contact-form') => 'publish_posts', __('Moderate Comments', 'si-contact-form') => 'moderate_comments', __('Administer site', 'si-contact-form') => 'level_10' ); // print the ' . "\n"; foreach ($choices as $text => $capability) : if ($capability == $checked_value) $checked = ' selected="selected" '; echo "\t". '\n"; $checked = ''; endforeach; echo "\t\n"; } // end function si_contact_captcha_perm_dropdown static function akismet_settings_callback() { ?>


' . __( 'Akismet is installed.', 'si-contact-form' ) . ''; $akismet_installed = 1; } // Has an Akismet check been requested? if ( strpos($_SERVER['REQUEST_URI'],'akismet_check') !== false ) { $key_status = 'failed'; $key = get_option( 'wordpress_api_key' ); if ( empty( $key ) ) { $key_status = 'empty'; } else { if ( is_callable( array( 'Akismet', 'verify_key' ) ) ) $key_status = Akismet::verify_key( $key ); // akismet 3.xx else $key_status = akismet_verify_key( $key ); // akismet 2.xx } if ( $key_status == 'valid' ) { $akismet_installed = 1; ?>
' . __( 'Akismet is installed and the key is valid. This form will be checked with Akismet to help prevent spam.', 'si-contact-form' ) . ''; } else if ( $key_status == 'invalid' ) { ?>
' . __( 'Akismet plugin is installed but key needs to be activated.', 'si-contact-form' ) . ''; } else if ( !empty( $key ) && $key_status == 'failed' ) { ?>
' . __( 'Akismet plugin is installed but key failed to verify.', 'si-contact-form' ) . ''; } else { ?>
' . __( 'Akismet plugin is installed but key has not been entered.', 'si-contact-form' ) . ''; } } ?>

' . __( 'Configure Akismet', 'si-contact-form' ) . ''; ?> ' . __( 'Akismet plugin is not installed or is deactivated.', 'si-contact-form' ) . ''; } } else { echo '
' . __( 'Akismet is turned off for this form.', 'si-contact-form' ) . '
'; } if ( self::$form_options['akismet_disable'] == 'false' ) { ?>
'; } ?>
value="true" />
value="true" />






" />



' . __( 'Warning: Your web host has the mail() function disabled. PHP cannot send email.', 'si-contact-form' ); echo ' ' . __( 'Have them fix it. Or you can install a WordPress SMTP plugin and configure it to use SMTP.', 'si-contact-form' ) . '' . "\n"; } ?>

















1 ) { ?>



self::$global_options['donated'] ) { self::$global_options['donated'] = $donated; } if ( isset($_POST['fs_dismiss_import_msg']) ) { self::$global_options['import_msg'] = false; } // Update global options array based on value of enable_php_sessions // if the POST variable enable_php_session, then the checkbox was checked $php_sessions = ( isset($_POST['enable_php_sessions']) ) ? 'true' : 'false'; if ( $php_sessions <> self::$global_options['enable_php_sessions'] ) { self::$global_options['enable_php_sessions'] = $php_sessions; } // vcita_auto_install if ( ! empty($_POST['vcita_auto_install']) && ($_POST['vcita_auto_install'] == 'true' || $_POST['vcita_auto_install'] == 'false')) self::$global_options['vcita_auto_install'] = $_POST['vcita_auto_install']; // vcita_dismiss if ( ! empty($_POST['vcita_dismiss']) && ($_POST['vcita_dismiss'] == 'true' || $_POST['vcita_dismiss'] == 'false')) self::$global_options['vcita_dismiss'] = $_POST['vcita_dismiss']; // recaptcha keys are a global setting so all forms will have it filled in if ( ! empty($_POST['recaptcha_public_key'])) self::$global_options['recaptcha_public_key'] = sanitize_text_field( $_POST['recaptcha_public_key'] ); if ( ! empty($_POST['recaptcha_secret_key'])) self::$global_options['recaptcha_secret_key'] = sanitize_text_field( $_POST['recaptcha_secret_key'] ); update_option( 'fs_contact_global', self::$global_options ); // Trim trailing spaces FSCF_Util::trim_array($text); // Special processing for certain form fields if ( '' == $text['email_to'] ) $text['email_to'] = self::$form_defaults['email_to']; // use default if empty $text['redirect_seconds'] = ( is_numeric( $text['redirect_seconds'] ) && $text['redirect_seconds'] < 61 ) ? absint( $text['redirect_seconds'] ) : self::$form_defaults['redirect_seconds']; if ( '' == $text['redirect_url'] ) $text['redirect_url'] = self::$form_defaults['redirect_url']; // use default if empty if ( ! preg_match( '/^[0-6]?$/', $text['cal_start_day'] ) ) $text['cal_start_day'] = self::$form_defaults['cal_start_day']; $text['attach_types'] = str_replace( '.', '', $text['attach_types'] ); if ( '' == $text['attach_size'] || ! preg_match( '/^([[0-9.]+)([kKmM]?[bB])?$/', $text['attach_size'] ) ) $text['attach_size'] = self::$form_defaults['attach_size']; if ( '' == $text['auto_respond_from_name'] ) $text['auto_respond_from_name'] = self::$form_defaults['auto_respond_from_name']; // use default if empty if ( '' == $text['auto_respond_from_email'] || !FSCF_Util::validate_email( $text['auto_respond_from_email'] ) ) $text['auto_respond_from_email'] = self::$form_defaults['auto_respond_from_email']; // use default if empty if ( $text['auto_respond_reply_to'] == '' || !FSCF_Util::validate_email( $text['auto_respond_reply_to'] ) ) $text['auto_respond_reply_to'] = self::$form_defaults['auto_respond_reply_to']; // use default if empty // $text['field_size'] = ( is_numeric( $text['field_size'] ) && $text['field_size'] > 14 ) ? absint( $text['field_size'] ) : self::$form_defaults['field_size']; // use default if empty //$text['captcha_field_size'] = ( is_numeric( $text['captcha_field_size'] ) && $text['captcha_field_size'] > 4 ) ? absint( $text['captcha_field_size'] ) : self::$form_defaults['captcha_field_size']; //$text['text_cols'] = absint( $text['text_cols'] ); //$text['text_rows'] = absint( $text['text_rows'] ); if( !empty($text['domain_protect_names']) ) $text['domain_protect_names'] = self::clean_textarea($text['domain_protect_names']); if( !empty($text['email_to']) ) $text['email_to'] = self::clean_textarea($text['email_to']); // Use default style settings if styles are empty if ( ! isset(self::$style_defaults) ) self::$style_defaults = FSCF_Util::set_style_defaults(); foreach ( self::$style_defaults as $key => $val ) { //if ( '' == $text[$key] ) // caused error on import settings from some older versions if ( !isset($text[$key]) || empty($text[$key]) ) $text[$key] = $val; } // Do we need to reset all styles top this form? if ( isset( $_POST['fscf_reset_styles'] ) ) { // reset styles feature $text = FSCF_Action::copy_styles( self::$form_defaults, $text ); } if ( isset( $_POST['fscf_reset_styles_top'] ) ) { $style_resets_arr = array( // 'border_enable' => 'false', // reset labels on top // Alignment DIVs 'form_style' => 'width:99%; max-width:555px;', // Form DIV, how wide is the form DIV 'left_box_style' => 'float:left; width:55%; max-width:270px;', // left box DIV, container for vcita 'right_box_style' => 'float:left; width:235px;', // right box DIV, container for vcita 'clear_style' => 'clear:both;', // clear both 'field_left_style' => 'clear:left; float:left; width:99%; max-width:550px; margin-right:10px;', // field left 'field_prefollow_style' => 'clear:left; float:left; width:99%; max-width:250px; margin-right:10px;', // field pre follow 'field_follow_style' => 'float:left; padding-left:10px; width:99%; max-width:250px;', // field follow 'title_style' => 'text-align:left; padding-top:5px;', // Input labels alignment DIV 'field_div_style' => 'text-align:left;', // Input fields alignment DIV 'captcha_div_style_sm' => 'width:175px; height:50px; padding-top:2px;', // Small CAPTCHA DIV 'captcha_div_style_m' => 'width:250px; height:65px; padding-top:2px;', // Large CAPTCHA DIV 'captcha_image_style' => 'border-style:none; margin:0; padding:0px; padding-right:5px; float:left;', // CAPTCHA image alignment 'captcha_reload_image_style' => 'border-style:none; margin:0; padding:0px; vertical-align:bottom;', // CAPTCHA reload image alignment 'submit_div_style' => 'text-align:left; clear:both; padding-top:15px;', // Submit DIV 'border_style' => 'border:1px solid black; width:99%; max-width:550px; padding:10px;', // style of the fieldset box (if enabled) ); // reset left styles feature foreach ( $style_resets_arr as $key => $val ) { $text[$key] = $val; } } // end reset styles top if ( isset( $_POST['fscf_reset_styles_left'] ) ) { $style_resets_arr = array( //'border_enable' => 'false', // reset labels on left // Alignment DIVs 'form_style' => 'width:655px;', // how wide is the form DIV 'left_box_style' => 'float:left; width:450px;', // left box DIV, container for vcita 'right_box_style' => 'float:left; width:235px;', // right box DIV, container for vcita 'clear_style' => 'clear:both;', // clear both 'field_left_style' => 'clear:left; float:left; margin-right:10px;', // field left 'field_prefollow_style' => 'clear:left; float:left; margin-right:10px;', // field pre follow 'field_follow_style' => 'float:left; padding-left:10px;', // field follow 'title_style' => 'width:138px; float:left; clear:left; text-align:right; padding-top:8px; padding-right:10px;', // Input labels alignment DIV 'field_div_style' => 'text-align:left; float:left; padding-top:10px;', // Input fields alignment DIV 'captcha_div_style_sm' => 'float:left; width:162px; height:50px; padding-top:5px;', // Small CAPTCHA DIV 'captcha_div_style_m' => 'float:left; width:362px; height:65px; padding-top:5px;', // Large CAPTCHA DIV 'captcha_image_style' => 'border-style:none; margin:0; padding:0px; padding-right:5px; float:left;', // CAPTCHA image alignment 'captcha_reload_image_style' => 'border-style:none; margin:0; padding:0px; vertical-align:bottom;', // CAPTCHA reload image alignment 'submit_div_style' => 'padding-left:146px; float:left; clear:left; text-align:left; padding-top:15px;', // Submit DIV 'border_style' => 'border:1px solid black; width:99%; max-width:450px; padding:10px;', // style of the fieldset box (if enabled) ); // reset left styles feature foreach ( $style_resets_arr as $key => $val ) { $text[$key] = $val; } } // end reset styles left if ( isset( $_POST['fscf_reset_styles_labels'] ) ) { $style_resets_arr = array( 'border_enable' => 'false', // reset labels only // Style of labels, fields and text 'required_style' => 'text-align:left;', // required field indicator 'required_text_style' => 'text-align:left;', // required field text 'hint_style' => 'font-size:x-small; font-weight:normal;', // small text hints like please enter your email again 'error_style' => 'text-align:left; color:red;', // Input validation messages 'redirect_style' => 'text-align:left;', // Redirecting message 'fieldset_style' => 'border:1px solid black; width:97%; max-width:500px; padding:10px;', // style of the fieldset box (for fields) 'label_style' => 'display:inline;', // Field labels 'option_label_style' => 'display:inline;', // Options labels 'field_style' => 'text-align:left; margin:0; width:99%; max-width:250px;', // Input text fields (out of place here?) 'captcha_input_style' => 'text-align:left; margin:0; width:50px;', // CAPTCHA input field 'textarea_style' => 'text-align:left; margin:0; width:99%; max-width:250px; height:120px;', // Input Textarea 'select_style' => 'text-align:left;', // Input Select 'checkbox_style' => 'width:22px; height:32px;', // Input checkbox 'radio_style' => 'width:22px; height:32px;', // Input radio 'placeholder_style' => 'opacity:0.6; color:#333333;', // placeholder style 'button_style' => 'cursor:pointer; margin:0;', // Submit button 'reset_style' => 'cursor:pointer; margin:0;', // Reset button 'vcita_button_style' => 'text-decoration:none; display:block; text-align:center; background:linear-gradient(to bottom, #ed6a31 0%, #e55627 100%); color:#fff !important; padding:10px;', // vCita button 'vcita_div_button_style' => 'border-left:1px dashed #ccc; margin-top:25px; height:50px; padding:8px 20px;', // vCita button div box 'powered_by_style' => 'font-size:x-small; font-weight:normal; padding-top:5px; text-align:center;', // the "powered by" link ); // reset label styles feature foreach ( $style_resets_arr as $key => $val ) { $text[$key] = $val; } } // end reset styles left // List of all checkbox settings names (except for checkboxes in fields) $checkboxes = array ( 'email_from_enforced', 'preserve_space_enable', 'double_email', 'name_case_enable' , 'sender_info_enable', 'domain_protect', 'email_check_dns', 'email_check_easy', 'email_html', 'akismet_disable', 'captcha_enable', 'recaptcha_enable', 'recaptcha_dark', 'akismet_send_anyway', 'captcha_small','email_hide_empty', 'email_keep_attachments','print_form_enable', 'captcha_perm', 'honeypot_enable', 'redirect_enable', 'redirect_query', 'redirect_email_off', 'silent_email_off', 'export_email_off', 'ex_fields_after_msg', 'email_inline_label', 'textarea_html_allow', 'enable_areyousure', 'enable_submit_oneclick', 'auto_respond_enable', 'auto_respond_html', 'req_field_indicator_enable', 'req_field_label_enable', 'border_enable', 'anchor_enable', 'aria_required', 'auto_fill_enable', 'enable_reset', 'enable_credit_link' ); // Set missing checkbox values to 'false' because these boxes were unchecked // html form checkboxes do not return anything in POST if unchecked // $text = array_merge($unchecked, $text); foreach ( $checkboxes as $checkbox ) { if ( ! isset($text[$checkbox]) ) $text[$checkbox] = 'false'; } // Sanitize settings fields $html_fields = array( 'welcome', 'after_form_note', 'req_field_indicator', 'text_message_sent', 'success_page_html' ); if ( 'true' == $text['auto_respond_html'] ) $html_fields[] = 'auto_respond_message'; if ( defined( 'DISALLOW_UNFILTERED_HTML' ) && DISALLOW_UNFILTERED_HTML ) // do not allow unfiltered HTML $html_fields = array( ); foreach ( $text as $key => $value ) { if ( is_string($value) ) { if ( in_array( $key, $html_fields ) ) { $text[$key] = $value; } else $text[$key] = strip_tags( $value ); } } // Process contact form fields $slug_list = $fscf_special_slugs; // The $special_slugs list is also used in FSCF_Display::get_query_parms() // $special_slugs = array( 'f_name', 'm_name', 'mi_name', 'l_name', 'email2', 'mailto_id', 'subject_id' ); $select_type_fields = array( 'checkbox-multiple', 'select', 'select-multiple', 'radio' ); // none of the field slugs can be the same as a post type rewrite_slug // or you will get "page not found" when posting the form with that field filled in self::get_post_types_slugs(); $slug_list = array(); if( isset(self::$form_options) && (!empty(self::$form_options['fields'])) ) { foreach ( self::$form_options['fields'] as $key => $field ) { $slug_list[] = $field['slug']; } } $bad_slugs = array(); foreach (self::$post_types_slugs as $key => $slug) { if ( in_array( strtolower( $slug ), $slug_list ) ) $bad_slugs[] = $slug; } foreach ( $text['fields'] as $key => $field ) { if ( isset( $field['delete'] ) && "true" == $field['delete'] ) { // Delete the field unset( $text['fields'][$key] ); } else { unset( $text['fields']['$key']['delete'] ); // Don't need to keep this // Add 'false' to any missing checkboxes for fields if ( ! isset($field['req'])) $text['fields'][$key]['req'] = 'false'; if ( ! isset($field['disable'])) $text['fields'][$key]['disable'] = 'false'; if ( ! isset($field['follow'])) $text['fields'][$key]['follow'] = 'false'; if ( ! isset($field['inline'])) $text['fields'][$key]['inline'] = 'false'; if ( ! isset($field['hide_label'])) $text['fields'][$key]['hide_label'] = 'false'; if ( ! isset($field['placeholder'])) $text['fields'][$key]['placeholder'] = 'false'; // Sanitize html in form field settings foreach ( $field as $k => $v ) { if ( is_string($v) ) { //if ( 'notes' == $k || 'notes_after' == $k ) $text['fields'][$key][$k] = wp_filter_kses( $v ); //strips too much if ( 'notes' == $k || 'notes_after' == $k ) $text['fields'][$key][$k] = $v; // allow html else $text['fields'][$key][$k] = strip_tags( $v ); // strip html tags } } // Make sure the field name is not blank if ( empty($field['label'])) { $text['fields'][$key]['label'] = sprintf( __( 'Field %s', 'si-contact-form' ), $key ); $temp = sprintf( __( 'Field label cannot be blank. Label set to "Field %s". To delete a field, use the delete option.', 'si-contact-form' ), $key ); add_settings_error('fscf_field_settings', 'missing-label', $temp); } // Sanitize the slug $slug_changed = false; if ( !empty($field['slug']) && in_array( strtolower( $field['slug'] ), $bad_slugs ) ) $slug_changed = true; if ( empty($field['slug']) ) { // no slug, so make one from the label // the sanitize title function encodes UTF-8 characters, so we need to undo that // this line croaked on some chinese characters //$field['slug'] = substr( urldecode(self::sanitize_slug_with_dashes(remove_accents($field['label']))), 0, FSCF_MAX_SLUG_LEN ); $field['slug'] = remove_accents($field['label']); $field['slug'] = preg_replace('~([^a-zA-Z\d_ .-])~', '', $field['slug']); $field['slug'] = substr( urldecode(self::sanitize_slug_with_dashes($field['slug'])), 0, FSCF_MAX_SLUG_LEN ); if ($field['slug'] == '') $field['slug'] = 'na'; if ( '-' == substr( $field['slug'], strlen($field['slug'])-1, 1) ) $field['slug'] = substr( $field['slug'], 0, strlen($field['slug'])-1); $slug_changed = true; } else if ( empty(self::$form_options['fields'][$key]['slug']) || ( $field['slug'] != self::$form_options['fields'][$key]['slug'] ) ) { // The slug has changed, so sanitize it // this line croaked on some chinese characters //$field['slug'] = substr( urldecode(self::sanitize_slug_with_dashes(remove_accents($field['slug']))), 0, FSCF_MAX_SLUG_LEN ); $field['slug'] = remove_accents($field['slug']); $field['slug'] = preg_replace('~([^a-zA-Z\d_ .-])~', '', $field['slug']); $field['slug'] = substr( urldecode(self::sanitize_slug_with_dashes($field['slug'])), 0, FSCF_MAX_SLUG_LEN ); if ($field['slug'] == '') $field['slug'] = 'na'; $slug_changed = true; } // Make sure the slug is unique if ( $slug_changed ) { $text['fields'][$key]['slug'] = self::check_slug( $field['slug'], $slug_list ); } } if( isset( $text['fields'][$key]['slug'] ) ) $slug_list[] = $text['fields'][$key]['slug']; // If a select type field, make sure the select options list is not empty if ( in_array( $field['type'], $select_type_fields ) ) { // remove blank lines and trim options if( !empty($text['fields'][$key]['options']) ) $text['fields'][$key]['options'] = self::clean_textarea($text['fields'][$key]['options']); if (empty($field['options'])) { $temp = sprintf( __( 'Select options are required for the %s field.', 'si-contact-form' ), $field['label'] ); add_settings_error('fscf_field_settings', 'missing-options', $temp); } } // If date type field, check format of default (if any) if ( 'date' == $field['type'] && '' != $field['default'] ) { if ($field['default'] != '[today]' && !FSCF_Process::validate_date( $field['default'], self::$current_form ) ) { $cal_date_array = array( 'mm/dd/yyyy' => esc_html( __( 'mm/dd/yyyy', 'si-contact-form' ) ), 'dd/mm/yyyy' => esc_html( __( 'dd/mm/yyyy', 'si-contact-form' ) ), 'mm-dd-yyyy' => esc_html( __( 'mm-dd-yyyy', 'si-contact-form' ) ), 'dd-mm-yyyy' => esc_html( __( 'dd-mm-yyyy', 'si-contact-form' ) ), 'mm.dd.yyyy' => esc_html( __( 'mm.dd.yyyy', 'si-contact-form' ) ), 'dd.mm.yyyy' => esc_html( __( 'dd.mm.yyyy', 'si-contact-form' ) ), 'yyyy/mm/dd' => esc_html( __( 'yyyy/mm/dd', 'si-contact-form' ) ), 'yyyy-mm-dd' => esc_html( __( 'yyyy-mm-dd', 'si-contact-form' ) ), 'yyyy.mm.dd' => esc_html( __( 'yyyy.mm.dd', 'si-contact-form' ) ), ); $temp = sprintf( __( 'Default date for %s is not correctly formatted. Format should be %s.', 'si-contact-form' ), $field['label'], $cal_date_array[$text['date_format']] ); add_settings_error( 'fscf_field_settings', 'invalid-date', $temp ); } } } // end foreach (Process fields) $text = self::vcita_update_details($text); FSCF_Util::unencode_html($text); // Update the query args if necessary if ( ! isset($_POST['ctf_action'])&& isset( $_REQUEST['_wp_http_referer'] ) ) { // Set the current tab in _wp_http_referer so that we go there after the save $wp_referer = esc_url_raw(remove_query_arg( 'fscf_tab', $_REQUEST['_wp_http_referer'] )); $wp_referer = esc_url_raw(add_query_arg( 'fscf_tab', $_POST['current_tab'], $wp_referer )); if ( isset( $text['akismet_check'] ) ) { // Request Akismet check on page reload $wp_referer = esc_url_raw(add_query_arg( 'akismet_check', 'true', $wp_referer )); unset ( $text['akismet_check'] ); // Don't save this in database } else { $wp_referer = esc_url_raw(remove_query_arg( 'akismet_check', $wp_referer )); } $_REQUEST['_wp_http_referer'] = $wp_referer; } return( $text ); } // end function validate($text); static function sanitize_slug_with_dashes( $title, $raw_title = '' ) { $title = strip_tags($title); // Preserve escaped octets. $title = preg_replace('|%([a-fA-F0-9][a-fA-F0-9])|', '---$1---', $title); // Remove percent signs that are not part of an octet. $title = str_replace('%', '', $title); // Restore octets. $title = preg_replace('|---([a-fA-F0-9][a-fA-F0-9])---|', '%$1', $title); if (seems_utf8($title)) { $title = utf8_uri_encode($title, 200); } $title = preg_replace('/&.+?;/', '', $title); // kill entities $title = str_replace('.', '-', $title); $title = preg_replace('/[^%a-zA-Z0-9 _-]/', '', $title); $title = preg_replace('/\s+/', '-', $title); $title = preg_replace('|-+|', '-', $title); $title = trim($title, '-'); return $title; } // function sanitize_title_with_dashes static function get_post_types_slugs() { // check for custom post types, returns the global static self::$post_types_slugs // none of the field slugs can be the same as a post type rewrite_slug // or you will get "page not found" when posting the form with that field filled in $pt_args = array('public' => true,'_builtin' => false); $post_types = get_post_types( $pt_args, 'objects' ); if ( $post_types ) { foreach ( $post_types as $post_type ) { self::$post_types_slugs[] = ( isset( $post_type->rewrite_slug ) ) ? $post_type->rewrite_slug : $post_type->name; } } } static function check_slug($slug, $slug_list) { // Checks the slug, and adds a number if necessary to make it unique // $slug -- the slug to be checked // $slug_list -- a list of existing slugs // Returns the new slug $slug_list = array_merge( self::$post_types_slugs, $slug_list ); // Duplicates have a two digit number appended to the end to make them unique // XXX do I neeed any messages about changing the slug? $numb = preg_match( '/\d{2}$/', $slug, $match); while ( in_array( $slug, $slug_list ) ) { if ( $numb ) { $new_numb = sprintf("%02d", substr($slug,strlen($slug)-2,2) + 1); $slug = substr($slug, 0, strlen($slug)-2) . $new_numb; } else { $slug .= '01'; $numb = 1; } } // end while return($slug); } static function clean_textarea($data) { // cleans blank lines and trims gaps from textarea list inputs // Returns the new data $new_data = preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $data); $data_array = explode("\n",$new_data); $new_data = ''; foreach($data_array as $line) { $line = trim($line); if ($line != '') // do not use !empty, or an option '0' is deleted $new_data .= "$line\n"; } return trim($new_data); } // end function clean_textarea static function set_fld_array() { // Set up the list of available tags for email self::get_options(); self::$av_fld_arr = array(); // used to show available field tags this form self::$av_fld_subj_arr = array(); // used to show available field tags for this form subject // Fields foreach ( self::$form_options['fields'] as $key => $field ) { switch ($field['standard']) { case FSCF_NAME_FIELD : if ($field['disable'] == 'false') { switch (self::$form_options['name_format']) { case 'name': self::$av_fld_arr[] = 'from_name'; break; case 'first_last': self::$av_fld_arr[] = 'first_name'; self::$av_fld_arr[] = 'last_name'; break; case 'first_middle_i_last': self::$av_fld_arr[] = 'first_name'; self::$av_fld_arr[] = 'middle_initial'; self::$av_fld_arr[] = 'last_name'; break; case 'first_middle_last': self::$av_fld_arr[] = 'first_name'; self::$av_fld_arr[] = 'middle_name'; self::$av_fld_arr[] = 'last_name'; break; } } break; case FSCF_EMAIL_FIELD : // email self::$autoresp_ok = 1; // used in autoresp settings below if ($field['disable'] == 'false') { self::$av_fld_arr[] = 'from_email'; }else{ self::$autoresp_ok = 0; } break; case FSCF_SUBJECT_FIELD : break; case FSCF_MESSAGE_FIELD : $msg_key = $key; // this is used below break; default : // This is an added field if ( $field['type'] != 'fieldset-close' && $field['standard'] < 1) { if ( $field['type'] == 'fieldset' ) { } else if ( $field['type'] == 'attachment' && self::$form_options['php_mailer_enable'] == 'wordpress') { self::$av_fld_arr[] = $field['slug']; } else { // text, textarea, date, password, email, url, hidden, time, select, select-multiple, radio, checkbox, checkbox-multiple self::$av_fld_arr[] = $field['slug']; if ( $field['type'] == 'email' ) $autoresp_ok = 1; } } } // end switch } // end foreach self::$av_fld_subj_arr = self::$av_fld_arr; self::$av_fld_arr[] = 'subject'; if (self::$form_options['fields'][$msg_key]['disable'] == 'false') self::$av_fld_arr[] = 'message'; self::$av_fld_arr[] = 'full_message'; if ( function_exists('akismet_verify_key') && self::$form_options['akismet_disable'] == 'false' ) self::$av_fld_arr[] = 'akismet'; self::$av_fld_arr[] = 'date_time'; self::$av_fld_arr[] = 'ip_address'; self::$av_fld_subj_arr[] = 'form_label'; } // function set_fld_array() static function add_field() { check_admin_referer( 'fs_contact_options-options', 'fs_options' ); self::get_options(); self::$form_options['fields'][] = FSCF_Util::$field_defaults; self::$new_field_added = __( 'A new field has been added. Now you must edit the field name and details, then click Save Changes.', 'si-contact-form' ); echo '

' . self::$new_field_added . '

'; } // end function add_field() static function add_form() { // Add a new form check_admin_referer( 'fs_contact_options-options', 'fs_options' ); self::$global_options = FSCF_Util::get_global_options(); // Find the next form number // When forms are deleted, their form number is NOT reused self::$global_options['form_list'][self::$current_form] = __('New Form', 'si-contact-form'); // Highest form ID (used to assign ID to new form) // When forms are deleted, the remaining forms are NOT renumberd, so max_form_num might be greater than // the number of existing forms // recalibrate max_form_num to the highest form number (not count) ksort(self::$global_options['form_list']); self::$global_options['max_form_num'] = max(array_keys(self::$global_options['form_list'])); update_option( 'fs_contact_global', self::$global_options ); echo '

' . sprintf( __( 'Form %d has been added.', 'si-contact-form' ), self::$current_form ) . '

'; return; } static function reset_form() { // Reset the current form to the defaults, but preserve the name check_admin_referer( 'fs_contact_options-options', 'fs_options' ); self::get_options(); $form_name = self::$form_options['form_name']; self::$form_options = self::$form_defaults; self::$form_options['form_name'] = $form_name; update_option(self::$form_option_name, self::$form_options); echo '

' . sprintf( __( 'Form %d has been reset to the default settings.', 'si-contact-form' ), self::$current_form ) . '

'; } static function delete_form() { // Delete the current form check_admin_referer( 'fs_contact_options-options', 'fs_options' ); self::get_options(); if ( isset($_POST['form_num']) && is_numeric( $_POST['form_num'] ) ) { $form_num = absint($_POST['form_num']); $op_name = 'fs_contact_form' . $form_num ; $result = delete_option( $op_name ); if ( ! $result ) { // Error deleting option echo '

' . sprintf( __( 'An error has occured. Form %d could not be deleted.', 'si-contact-form' ), $form_num ) . '

'; } else { unset( self::$global_options['form_list'][$form_num] ); // Highest form ID (used to assign ID to new form) // When forms are deleted, the remaining forms are NOT renumberd, so max_form_num might be greater than // the number of existing forms ksort(self::$global_options['form_list']); self::$global_options['max_form_num'] = max(array_keys(self::$global_options['form_list'])); update_option( 'fs_contact_global', self::$global_options ); echo '

' . sprintf( __( 'Form %d has been deleted.', 'si-contact-form' ), $form_num ) . '

'; } } } /** * Remotely fetch, cache, and display HTML ad for the Fast Secure Contact Form Newsletter plugin addon. * for Constant Contact on Newsletter tab */ static function kws_get_remote_ad() { // The ad is stored locally for 30 days as a transient. See if it exists. $cache = function_exists('get_site_transient') ? get_site_transient('fscf_kws_ad4') : get_transient('fscf_kws_ad4'); // If it exists, use that (so we save some request time), unless ?cache is set. if(!empty($cache) && !isset($_REQUEST['cache'])) { return $cache; } // Get the advertisement remotely. An encrypted site identifier, the language of the site, and the version of the FSCF plugin will be sent to katz.co $response = wp_remote_post('http://katz.co/ads/', array('timeout' => 45,'body' => array('siteid' => sha1(site_url()), 'language' => get_bloginfo('language'), 'version' => FSCF_VERSION))); // If it was a successful request, process it. if(!is_wp_error($response)) { // Basically, remove