Beispiel #1
0
 function cptch_settings()
 {
     global $cptch_options, $cptch_plugin_info, $cptch_option_defaults, $wpdb;
     $db_version = '1.2';
     $cptch_option_defaults = array('plugin_option_version' => $cptch_plugin_info["Version"], 'plugin_db_version' => $db_version, 'cptch_str_key' => array('time' => '', 'key' => ''), 'cptch_login_form' => '1', 'cptch_register_form' => '1', 'cptch_lost_password_form' => '1', 'cptch_comments_form' => '1', 'cptch_hide_register' => '1', 'cptch_contact_form' => '0', 'cptch_math_action_plus' => '1', 'cptch_math_action_minus' => '1', 'cptch_math_action_increase' => '1', 'cptch_label_form' => '', 'cptch_required_symbol' => '*', 'cptch_error_empty_value' => __('Please enter a CAPTCHA value.', 'captcha'), 'cptch_error_incorrect_value' => __('Please enter a valid CAPTCHA value.', 'captcha'), 'cptch_error_time_limit' => __('Time limit is exhausted. Please enter CAPTCHA value again.', 'captcha'), 'whitelist_message' => __('You are in the white list', 'captcha'), 'cptch_difficulty_number' => '1', 'cptch_difficulty_word' => '1', 'cptch_difficulty_image' => '0', 'first_install' => strtotime("now"), 'display_settings_notice' => 1, 'display_notice_about_images' => 1, 'use_limit_attempts_whitelist' => 0, 'display_reload_button' => 1, 'used_packages' => array(), 'enlarge_images' => 0, 'whitelist_is_empty' => true, 'use_time_limit' => 1, 'time_limit' => 120);
     /* Install the option defaults */
     if (!get_option('cptch_options')) {
         add_option('cptch_options', $cptch_option_defaults);
     }
     /* Get options from the database */
     $cptch_options = get_option('cptch_options');
     /* Array merge incase this version has added new options */
     if (!isset($cptch_options['plugin_option_version']) || $cptch_options['plugin_option_version'] != $cptch_plugin_info["Version"]) {
         $cptch_option_defaults['display_settings_notice'] = 0;
         $cptch_option_defaults['display_notice_about_images'] = 0;
         if (!isset($cptch_option_defaults['cptch_difficulty_image'])) {
             $cptch_option_defaults['cptch_difficulty_image'] = 0;
         }
         $cptch_options = array_merge($cptch_option_defaults, $cptch_options);
         $cptch_options['hide_premium_options'] = 0;
         $cptch_options['plugin_option_version'] = $cptch_plugin_info["Version"];
         $update_option = true;
     }
     /* Update tables when update plugin and tables changes*/
     if (!isset($cptch_options['plugin_db_version']) || $cptch_options['plugin_db_version'] != $db_version) {
         cptch_create_table();
         if (!class_exists('Cptch_package_loader')) {
             require_once dirname(__FILE__) . '/includes/package_loader.php';
         }
         $package_loader = new Cptch_package_loader();
         $package_loader->parse_packages(dirname(__FILE__) . '/images/package');
         if (!is_null($wpdb->get_var("SELECT `id` FROM `{$wpdb->prefix}cptch_whitelist` LIMIT 1"))) {
             $cptch_options['whitelist_is_empty'] = false;
         }
         /* update DB version */
         $cptch_options['plugin_db_version'] = $db_version;
         $update_option = true;
     }
     if (isset($update_option)) {
         update_option('cptch_options', $cptch_options);
     }
 }
    function cptch_settings_page()
    {
        global $cptch_options, $wp_version, $cptch_plugin_info, $cptch_option_defaults, $wpdb;
        $error = $message = "";
        $plugin_basename = plugin_basename(__FILE__);
        /* These fields for the 'Enable CAPTCHA on the' block which is located at the admin setting captcha page */
        $cptch_admin_fields_enable = array(array('cptch_login_form', __('Login form', 'captcha'), 'login_form.jpg'), array('cptch_register_form', __('Registration form', 'captcha'), 'register_form.jpg'), array('cptch_lost_password_form', __('Reset Password form', 'captcha'), 'lost_password_form.jpg'), array('cptch_comments_form', __('Comments form', 'captcha'), 'comment_form.jpg'));
        $cptch_admin_fields_hide = array(array('cptch_hide_register', __('in Comments form for registered users', 'captcha')));
        /* These fields for the 'Arithmetic actions for CAPTCHA' block which is located at the admin setting captcha page */
        $cptch_admin_fields_actions = array(array('cptch_math_action_plus', __('Plus (+)', 'captcha'), __('Plus', 'captcha')), array('cptch_math_action_minus', __('Minus (−)', 'captcha'), __('Minus', 'captcha')), array('cptch_math_action_increase', __('Multiplication (×)', 'captcha'), __('Multiply', 'captcha')));
        /* This fields for the 'Difficulty for CAPTCHA' block which is located at the admin setting captcha page */
        $cptch_admin_fields_difficulty = array(array('cptch_difficulty_number', __('Numbers', 'captcha'), __('Numbers', 'captcha')), array('cptch_difficulty_word', __('Words', 'captcha'), __('Words', 'captcha')), array('cptch_difficulty_image', __('Images', 'captcha')));
        if (!function_exists('get_plugins')) {
            require_once ABSPATH . 'wp-admin/includes/plugin.php';
        }
        $all_plugins = get_plugins();
        $is_network = is_multisite() && is_network_admin();
        $admin_url = $is_network ? network_admin_url('/') : admin_url('/');
        $bws_contact_form = cptch_plugin_status(array('contact-form-plugin/contact_form.php', 'contact-form-pro/contact_form_pro.php'), $all_plugins, $is_network);
        if (isset($_GET['action']) && 'advanced' == $_GET['action']) {
            $package_list = $wpdb->get_results("SELECT `id`, `name` FROM `{$wpdb->base_prefix}cptch_packages` ORDER BY `name` ASC;");
        }
        /* Save data for settings page */
        if (isset($_REQUEST['cptch_form_submit']) && check_admin_referer($plugin_basename, 'cptch_nonce_name')) {
            /* hide pro blocks */
            if (isset($_POST['bws_hide_premium_options']) && check_admin_referer($plugin_basename, 'cptch_nonce_name')) {
                $hide_result = bws_hide_premium_options($cptch_options);
                $cptch_options = $hide_result['options'];
            }
            if (!isset($_GET['action'])) {
                $cptch_options['cptch_login_form'] = isset($_REQUEST['cptch_login_form']) ? 1 : 0;
                $cptch_options['cptch_register_form'] = isset($_REQUEST['cptch_register_form']) ? 1 : 0;
                $cptch_options['cptch_lost_password_form'] = isset($_REQUEST['cptch_lost_password_form']) ? 1 : 0;
                $cptch_options['cptch_comments_form'] = isset($_REQUEST['cptch_comments_form']) ? 1 : 0;
                $cptch_options['cptch_contact_form'] = isset($_REQUEST['cptch_contact_form']) ? 1 : 0;
                $cptch_options['cptch_hide_register'] = isset($_REQUEST['cptch_hide_register']) ? 1 : 0;
                $cptch_options['cptch_label_form'] = isset($_REQUEST['cptch_label_form']) ? stripslashes(esc_html($_REQUEST['cptch_label_form'])) : '';
                $cptch_options['cptch_required_symbol'] = isset($_REQUEST['cptch_required_symbol']) ? stripslashes(esc_html($_REQUEST['cptch_required_symbol'])) : '';
                $cptch_options['display_reload_button'] = isset($_REQUEST['cptch_display_reload_button']) ? 1 : 0;
                $cptch_options['cptch_math_action_plus'] = isset($_REQUEST['cptch_math_action_plus']) ? 1 : 0;
                $cptch_options['cptch_math_action_minus'] = isset($_REQUEST['cptch_math_action_minus']) ? 1 : 0;
                $cptch_options['cptch_math_action_increase'] = isset($_REQUEST['cptch_math_action_increase']) ? 1 : 0;
                $cptch_options['cptch_difficulty_number'] = isset($_REQUEST['cptch_difficulty_number']) ? 1 : 0;
                $cptch_options['cptch_difficulty_word'] = isset($_REQUEST['cptch_difficulty_word']) ? 1 : 0;
                $cptch_options['cptch_difficulty_image'] = isset($_REQUEST['cptch_difficulty_image']) ? 1 : 0;
                if (1 == $cptch_options['cptch_difficulty_image']) {
                    $package_list = $wpdb->get_results("SELECT `id`, `name` FROM `{$wpdb->base_prefix}cptch_packages` ORDER BY `name` ASC LIMIT 1;");
                    if (empty($package_list)) {
                        if (!class_exists('Cptch_package_loader')) {
                            require_once dirname(__FILE__) . '/includes/package_loader.php';
                        }
                        $package_loader = new Cptch_package_loader();
                        $package_loader->parse_packages(dirname(__FILE__) . '/images/package');
                    }
                }
                /* Check select one point in the blocks Arithmetic actions and Difficulty on settings page */
                $arithmetic_actions = isset($_REQUEST['cptch_math_action_plus']) || isset($_REQUEST['cptch_math_action_minus']) || isset($_REQUEST['cptch_math_action_increase']) ? true : false;
                $complexity_level = isset($_REQUEST['cptch_difficulty_number']) || isset($_REQUEST['cptch_difficulty_word']) || isset($_REQUEST['cptch_difficulty_image']) ? true : false;
                /* if 'Arithmetic actions'- or 'Complexity level'- options are disabled */
                if (!$arithmetic_actions || !$complexity_level) {
                    $error = __("Please select one item in the block Arithmetic and Complexity for CAPTCHA", 'captcha');
                }
            } else {
                $cptch_options['used_packages'] = isset($_REQUEST['cptch_used_packages']) ? $_REQUEST['cptch_used_packages'] : array();
                if (!empty($package_list) && empty($cptch_options['used_packages']) && 1 == $cptch_options['cptch_difficulty_image']) {
                    $error = __("Please select one item in the block Enable image packages", 'captcha');
                }
                $cptch_options['enlarge_images'] = isset($_REQUEST['cptch_enlarge_images']) ? 1 : 0;
                $cptch_options['use_time_limit'] = isset($_REQUEST['cptch_use_time_limit']) ? 1 : 0;
                $cptch_options['time_limit'] = !isset($_REQUEST['cptch_time_limit']) || !is_numeric($_REQUEST['cptch_time_limit']) || 10 > $_REQUEST['cptch_time_limit'] ? 120 : $_REQUEST['cptch_time_limit'];
                $cptch_options['cptch_error_empty_value'] = isset($_REQUEST['cptch_error_empty_value']) ? stripslashes(esc_html($_REQUEST['cptch_error_empty_value'])) : '';
                $cptch_options['cptch_error_incorrect_value'] = isset($_REQUEST['cptch_error_incorrect_value']) ? stripslashes(esc_html($_REQUEST['cptch_error_incorrect_value'])) : '';
                $cptch_options['cptch_error_time_limit'] = isset($_REQUEST['cptch_error_time_limit']) ? stripslashes(esc_html($_REQUEST['cptch_error_time_limit'])) : '';
                $cptch_options['whitelist_message'] = isset($_REQUEST['cptch_whitelist_message']) ? stripslashes(esc_html($_REQUEST['cptch_whitelist_message'])) : '';
                if ($cptch_options['cptch_error_empty_value'] == '') {
                    $cptch_options['cptch_error_empty_value'] = $cptch_option_defaults['cptch_error_empty_value'];
                }
                if ($cptch_options['cptch_error_incorrect_value'] == '') {
                    $cptch_options['cptch_error_incorrect_value'] = $cptch_option_defaults['cptch_error_incorrect_value'];
                }
                if ($cptch_options['cptch_error_time_limit'] == '') {
                    $cptch_options['cptch_error_time_limit'] = $cptch_option_defaults['cptch_error_time_limit'];
                }
            }
            if (empty($error)) {
                /* Update options in the database */
                update_option('cptch_options', $cptch_options);
                $message = __("Settings saved.", 'captcha');
            }
        }
        if (!class_exists('Cptch_package_loader')) {
            require_once dirname(__FILE__) . '/includes/package_loader.php';
        }
        $package_loader = new Cptch_package_loader();
        $error .= $package_loader->error;
        if (isset($_REQUEST['bws_restore_confirm']) && check_admin_referer($plugin_basename, 'bws_settings_nonce_name')) {
            $cptch_options = $cptch_option_defaults;
            update_option('cptch_options', $cptch_options);
            $message = __('All plugin settings were restored.', 'captcha');
        }
        require_once dirname(__FILE__) . '/includes/pro_banners.php';
        /* GO PRO */
        if (isset($_GET['action']) && 'go_pro' == $_GET['action']) {
            $go_pro_result = bws_go_pro_tab_check($plugin_basename, 'cptch_options');
            if (!empty($go_pro_result['error'])) {
                $error = $go_pro_result['error'];
            } elseif (!empty($go_pro_result['message'])) {
                $message = $go_pro_result['message'];
            }
        }
        /* Display form on the setting page */
        ?>
		<div class="wrap">
			<h1><?php 
        _e('Captcha Settings', 'captcha');
        ?>
</h1>
			<ul class="subsubsub cptch_how_to_use">
				<li><a href="https://docs.google.com/document/d/11_TUSAjMjG7hLa53lmyTZ1xox03hNlEA4tRmllFep3I/edit" target="_blank"><?php 
        _e('How to Use Step-by-step Instruction', 'captcha');
        ?>
</a></li>
			</ul>
			<h2 class="nav-tab-wrapper">
				<a class="nav-tab<?php 
        if (!isset($_GET['action'])) {
            echo ' nav-tab-active';
        }
        ?>
" href="admin.php?page=captcha.php"><?php 
        _e('Basic', 'captcha');
        ?>
</a>
				<a class="nav-tab<?php 
        if (isset($_GET['action']) && 'advanced' == $_GET['action']) {
            echo ' nav-tab-active';
        }
        ?>
" href="admin.php?page=captcha.php&amp;action=advanced"><?php 
        _e('Advanced', 'captcha');
        ?>
</a>
				<a class="nav-tab <?php 
        if (isset($_GET['action']) && 'whitelist' == $_GET['action']) {
            echo ' nav-tab-active';
        }
        ?>
" href="admin.php?page=captcha.php&amp;action=whitelist"><?php 
        _e('Whitelist', 'captcha');
        ?>
</a>
				<a class="nav-tab <?php 
        if (isset($_GET['action']) && 'custom_code' == $_GET['action']) {
            echo ' nav-tab-active';
        }
        ?>
" href="admin.php?page=captcha.php&amp;action=custom_code"><?php 
        _e('Custom code', 'captcha');
        ?>
</a> 
				<a class="nav-tab bws_go_pro_tab<?php 
        if (isset($_GET['action']) && 'go_pro' == $_GET['action']) {
            echo ' nav-tab-active';
        }
        ?>
" href="admin.php?page=captcha.php&amp;action=go_pro"><?php 
        _e('Go PRO', 'captcha');
        ?>
</a>
			</h2>
			<div class="updated fade below-h2" <?php 
        if ('' == $message || "" != $error) {
            echo "style=\"display:none\"";
        }
        ?>
><p><strong><?php 
        echo $message;
        ?>
</strong></p></div>
			<div class="error below-h2" <?php 
        if ("" == $error) {
            echo "style=\"display:none\"";
        }
        ?>
><p><strong><?php 
        echo $error;
        ?>
</strong></p></div>
			<?php 
        if (!isset($_GET['action']) || !in_array($_GET['action'], array('whitelist', 'custom_code', 'go_pro'))) {
            if (isset($_REQUEST['bws_restore_default']) && check_admin_referer($plugin_basename, 'bws_settings_nonce_name')) {
                bws_form_restore_default_confirm($plugin_basename);
            } else {
                bws_show_settings_notice();
                if (!empty($hide_result['message'])) {
                    ?>
						<div class="updated fade below-h2"><p><strong><?php 
                    echo $hide_result['message'];
                    ?>
</strong></p></div>
					<?php 
                }
                ?>
					<form class="bws_form" method="post" action="">
						<?php 
                if (!isset($_GET['action'])) {
                    ?>
							<table class="form-table">
								<tr valign="top">
									<th scope="row"><?php 
                    _e('Enable CAPTCHA for', 'captcha');
                    ?>
:</th>
									<td>
										<fieldset>
											<legend class="screen-reader-text"><span><?php 
                    _e('Enable CAPTCHA for', 'captcha');
                    ?>
</span></legend>
											<p><i><?php 
                    _e('WordPress default', 'captcha');
                    ?>
</i></p>
											<?php 
                    foreach ($cptch_admin_fields_enable as $fields) {
                        if (in_array($fields[0], array('cptch_register_form', 'cptch_lost_password_form')) && !in_array(get_current_blog_id(), array(0, 1))) {
                            $notice = '<br /><span class="bws_info">' . __('This option is available only for main blog', 'captcha') . '</span>';
                            $disable_reg_form = ' disabled="disabled"';
                            $checked = '';
                        } else {
                            $notice = $disable_reg_form = '';
                            $checked = 1 == $cptch_options[$fields[0]] ? ' checked="checked"' : '';
                        }
                        ?>
												<label><input<?php 
                        echo $disable_reg_form . $checked;
                        ?>
 type="checkbox" name="<?php 
                        echo $fields[0];
                        ?>
" value="<?php 
                        echo $fields[0];
                        ?>
"/> <?php 
                        echo $fields[1];
                        ?>
</label>
												<div class="bws_help_box dashicons dashicons-editor-help cptch_thumb_block">
													<div class="bws_hidden_help_text"><img src="<?php 
                        echo plugins_url('captcha/images') . '/' . $fields[2];
                        ?>
" title="<?php 
                        echo $fields[1];
                        ?>
" alt="<?php 
                        echo $fields[1];
                        ?>
"/></div>
												</div>
												<?php 
                        echo $notice;
                        ?>
												<br />
											<?php 
                    }
                    ?>
											<br />
											<p><i><?php 
                    _e('Plugins', 'captcha');
                    ?>
</i></p>
											<?php 
                    if ('actived' == $bws_contact_form['status']) {
                        $disabled_attr = $info = '';
                    } elseif ('deactivated' == $bws_contact_form['status']) {
                        $disabled_attr = "disabled='disabled'";
                        $info = '<span class="bws_info">' . __('You should', 'captcha') . '&nbsp;<a href="' . $admin_url . 'plugins.php">' . __('activate', 'captcha') . '&nbsp;Contact Form&nbsp;' . (is_network_admin() ? __('for network', 'captcha') : '') . '</a>' . '&nbsp;' . __('to use this functionality', 'captcha') . '</span>';
                    } elseif ('not_installed' == $bws_contact_form['status']) {
                        $disabled_attr = "disabled='disabled'";
                        $info = '<span class="bws_info">' . __('You should', 'captcha') . '&nbsp;<a href="http://bestwebsoft.com/products/contact-form/?k=9ab9d358ad3a23b8a99a8328595ede2e&pn=72&v=' . $cptch_plugin_info["Version"] . '&wp_v=' . $wp_version . '">' . __('download', 'captcha') . '&nbsp;Contact Form&nbsp;</a>' . '&nbsp;' . __('to use this functionality', 'captcha') . '</span>';
                    }
                    ?>
											<label><input <?php 
                    echo $disabled_attr;
                    ?>
 type="checkbox" name="cptch_contact_form" value="1" <?php 
                    if (1 == $cptch_options['cptch_contact_form']) {
                        echo 'checked="checked"';
                    }
                    ?>
 /> Contact Form by BestWebSoft</label> 
											<div class="bws_help_box dashicons dashicons-editor-help cptch_thumb_block">
												<div class="bws_hidden_help_text">
													<img src="<?php 
                    echo plugins_url('captcha/images/contact_form.jpg');
                    ?>
" title="Contact Form" alt="Contact Form"/>
												</div>
											</div>
											<?php 
                    echo $info;
                    ?>
											<br />
											<?php 
                    echo apply_filters('cptch_forms_list', '');
                    ?>
											<span class="bws_info"><?php 
                    _e('If you would like to add Captcha to a custom form, please see', 'captcha');
                    ?>
 <a href="http://bestwebsoft.com/products/captcha/faq" target="_blank">FAQ</a></span>
										</fieldset>
									</td>
								</tr>
							</table>
							<?php 
                    cptch_pro_block('cptch_basic_banner');
                    ?>
							<table class="form-table">
								<tr valign="top">
									<th scope="row"><?php 
                    _e('Hide CAPTCHA', 'captcha');
                    ?>
</th>
									<td><?php 
                    foreach ($cptch_admin_fields_hide as $fields) {
                        ?>
											<label><input type="checkbox" name="<?php 
                        echo $fields[0];
                        ?>
" value="<?php 
                        echo $fields[0];
                        ?>
" <?php 
                        if (1 == $cptch_options[$fields[0]]) {
                            echo "checked=\"checked\"";
                        }
                        ?>
 /> <?php 
                        echo $fields[1];
                        ?>
</label><br />
										<?php 
                    }
                    ?>
									</td>
								</tr>
								<tr valign="top">
									<th scope="row"><?php 
                    _e('Title', 'captcha');
                    ?>
</th>
									<td><input class="cptch_settings_input" type="text" name="cptch_label_form" value="<?php 
                    echo $cptch_options['cptch_label_form'];
                    ?>
" maxlength="100" /></td>
								</tr>
								<tr valign="top">
									<th scope="row"><?php 
                    _e("Required symbol", 'captcha');
                    ?>
</th>
									<td colspan="2">
										<input class="cptch_settings_input" type="text" name="cptch_required_symbol" value="<?php 
                    echo $cptch_options['cptch_required_symbol'];
                    ?>
" maxlength="100" />
									</td>
								</tr>
								<tr valign="top">
									<th scope="row"><?php 
                    _e('Show "Reload" button', 'captcha');
                    ?>
</th>
									<td>
										<input type="checkbox" name="cptch_display_reload_button" value="1" <?php 
                    if (1 == $cptch_options['display_reload_button']) {
                        echo 'checked="checked"';
                    }
                    ?>
 />
									</td>
								</tr>
								<tr valign="top">
									<th scope="row"><?php 
                    _e('Arithmetic actions', 'captcha');
                    ?>
</th>
									<td colspan="2">
										<fieldset>
											<legend class="screen-reader-text"><span><?php 
                    _e('Arithmetic actions for CAPTCHA', 'captcha');
                    ?>
</span></legend>
											<?php 
                    foreach ($cptch_admin_fields_actions as $actions) {
                        ?>
												<label><input type="checkbox" name="<?php 
                        echo $actions[0];
                        ?>
" value="1" <?php 
                        if (1 == $cptch_options[$actions[0]]) {
                            echo "checked=\"checked\"";
                        }
                        ?>
 /> <?php 
                        echo $actions[1];
                        ?>
</label>
												<div class="bws_help_box dashicons dashicons-editor-help">
													<div class="bws_hidden_help_text"><?php 
                        cptch_display_example($actions[0]);
                        ?>
</div>
												</div>				
												<br />
											<?php 
                    }
                    ?>
										</fieldset>
									</td>
								</tr>
								<tr valign="top">
									<th scope="row"><?php 
                    _e('Complexity', 'captcha');
                    ?>
</th>
									<td colspan="2"><fieldset>
										<legend class="screen-reader-text"><span><?php 
                    _e('Complexity', 'captcha');
                    ?>
</span></legend>
										<?php 
                    foreach ($cptch_admin_fields_difficulty as $diff) {
                        ?>
											<label><input type="checkbox" name="<?php 
                        echo $diff[0];
                        ?>
" value="<?php 
                        echo $cptch_options[$diff[0]];
                        ?>
" <?php 
                        if (1 == $cptch_options[$diff[0]]) {
                            echo "checked=\"checked\"";
                        }
                        ?>
 /> <?php 
                        echo $diff[1];
                        ?>
</label>
											<div class="bws_help_box dashicons dashicons-editor-help">
												<div class="bws_hidden_help_text"><?php 
                        cptch_display_example($diff[0]);
                        ?>
</div>
											</div>
											<br />
										<?php 
                    }
                    ?>
									</fieldset></td>
								</tr>
							</table>
						<?php 
                } else {
                    if (!empty($package_list)) {
                        ?>
								<table class="form-table">
									<tr class="cptch_packages">
										<th scope="row"><?php 
                        _e('Enable image packages', 'captcha');
                        ?>
</th>
										<td>
											<select name="cptch_used_packages[]" multiple="multiple">
												<?php 
                        foreach ($package_list as $pack) {
                            ?>
													<option value="<?php 
                            echo $pack->id;
                            ?>
"<?php 
                            if (in_array($pack->id, $cptch_options['used_packages'])) {
                                echo ' selected="selected"';
                            }
                            ?>
><?php 
                            echo $pack->name;
                            ?>
</option>
												<?php 
                        }
                        ?>
											</select>
										</td>
									</tr>
									<tr class="cptch_packages">
										<th scope="row"><?php 
                        _e('Enlarge images on mouseover', 'captcha');
                        ?>
</th>
										<td>
											<input type="checkbox" name="cptch_enlarge_images" value="1"<?php 
                        if (1 == $cptch_options['enlarge_images']) {
                            echo ' checked="checked"';
                        }
                        ?>
 /><br/>
										</td>
									</tr>
								</table>
							<?php 
                    }
                    cptch_pro_block('cptch_advanced_banner');
                    ?>
							<table class="form-table">
								<tr valign="top">
									<th scope="row"><?php 
                    _e('Enable time limit', 'captcha');
                    ?>
</th>
									<td>
										<input type="checkbox" name="cptch_use_time_limit" value="1"<?php 
                    if (1 == $cptch_options['use_time_limit']) {
                        echo ' checked="checked"';
                    }
                    ?>
 />
									</td>
								</tr>
								<tr valign="top" class="cptch_limt_options"<?php 
                    if (0 == $cptch_options['use_time_limit']) {
                        echo ' style="display: none;"';
                    }
                    ?>
>
									<th scope="row"><?php 
                    _e('Set time limit', 'captcha');
                    ?>
</th>
									<td>
										<label for="cptch_time_limit">
											<input type="number" name="cptch_time_limit" id ="cptch_time_limit" min="10" max="9999" step="1" value="<?php 
                    echo $cptch_options['time_limit'];
                    ?>
" style="width: 70px;"/>&nbsp;<?php 
                    _e('seconds', 'captcha');
                    ?>

										</label>
									</td>
								</tr>
								<tr valign="top">
									<th scope="row"><?php 
                    _e("Notification messages", 'captcha');
                    ?>
</th>
									<td colspan="2">
										<p><i><?php 
                    _e("Error", 'captcha');
                    ?>
</i></p>
										<p><input class="cptch_settings_input" type="text" name="cptch_error_empty_value" value="<?php 
                    echo $cptch_options['cptch_error_empty_value'];
                    ?>
" maxlength="100" />&nbsp;<?php 
                    _e('If CAPTCHA field is empty', 'captcha');
                    ?>
</p>
										<p><input class="cptch_settings_input" type="text" name="cptch_error_incorrect_value" value="<?php 
                    echo $cptch_options['cptch_error_incorrect_value'];
                    ?>
" maxlength="100" />&nbsp;<?php 
                    _e('If CAPTCHA is incorrect', 'captcha');
                    ?>
</p>
										<p><input class="cptch_settings_input" type="text" name="cptch_error_time_limit" value="<?php 
                    echo $cptch_options['cptch_error_time_limit'];
                    ?>
" maxlength="100" />&nbsp;<?php 
                    _e('If time limit is exhausted', 'captcha');
                    ?>
</p>
										<p><i><?php 
                    _e("Info", 'captcha');
                    ?>
</i></p>
										<p><input class="cptch_settings_input" type="text" name="cptch_whitelist_message" value="<?php 
                    echo $cptch_options['whitelist_message'];
                    ?>
" maxlength="100"  />&nbsp;<?php 
                    _e('If the user IP is added to the whitelist (this message will be displayed instead of CAPTCHA).', 'captcha');
                    ?>
</p>
									</td>
								</tr>
							</table>
						<?php 
                }
                ?>
						<input type="hidden" name="cptch_form_submit" value="submit" />
						<p class="submit">
							<input id="bws-submit-button" type="submit" class="button-primary" value="<?php 
                _e('Save Changes', 'captcha');
                ?>
" />
						</p>
						<?php 
                wp_nonce_field($plugin_basename, 'cptch_nonce_name');
                ?>
					</form>
					<?php 
                bws_form_restore_default_settings($plugin_basename);
            }
        } elseif ('go_pro' == $_GET['action']) {
            $show = bws_hide_premium_options_check($cptch_options) ? true : false;
            bws_go_pro_tab_show($show, $cptch_plugin_info, $plugin_basename, 'captcha.php', 'captcha_pro.php', 'captcha-pro/captcha_pro.php', 'captcha', '9701bbd97e61e52baa79c58c3caacf6d', '75', isset($go_pro_result['pro_plugin_is_activated']));
        } elseif ('custom_code' == $_GET['action']) {
            bws_custom_code_tab();
        } elseif ('whitelist' == $_GET['action']) {
            $limit_attempts_info = cptch_plugin_status(array('limit-attempts/limit-attempts.php', 'limit-attempts-pro/limit-attempts-pro.php'), $all_plugins, $is_network);
            require_once dirname(__FILE__) . '/includes/whitelist.php';
            $cptch_whitelist = new Cptch_Whitelist($plugin_basename, $limit_attempts_info);
            $cptch_whitelist->display_content();
        }
        bws_plugin_reviews_block($cptch_plugin_info['Name'], 'captcha');
        ?>
		</div>
	<?php 
    }