Random Captcha Settings

Select the captcha method", 'buffercode_random_captcha'); ?> >

>

>

>

>

>

>

>

>

>

>

>

Captcha Background Color", 'buffercode_random_captcha'); ?>    [Only Color code values with out '#' eg. FFFFFF for White and also not as white]
Captcha Font Color", 'buffercode_random_captcha'); ?>    [Only Color code values with out '#' eg. FFFFFF for White and also not as white]
No Captcha for Registered Users", 'buffercode_random_captcha'); ?> >
Minimum Comment Time to Consider as a SPAM", 'buffercode_random_captcha'); ?>    [In Seconds - Default:10secs]

Our Other Works

get_item_quantity(20); $rss_items = $rss->get_items(0, $maxitems); } ?>
=')) { add_action('comment_form_after_fields', 'bc_random_captcha_comment', 1); add_action('comment_form_logged_in_after', 'bc_random_captcha_comment', 1); } add_filter('preprocess_comment', 'bc_random_captcha_comment_form'); //Adding CSS Font function bc_random_captcha_font_css() { wp_enqueue_style('captcha-style', plugins_url('css\captcha-style.css', __FILE__)); } add_action('wp_enqueue_scripts', 'bc_random_captcha_font_css'); function bc_captcha_js() { wp_enqueue_script('captcha-script', plugins_url('js\captcha.js', __FILE__)); } /////////////////////////////////////////////////////////////////////// /////// Cookie set ////////////////////////////////////////////////// add_action('init', 'bc_set_cookie'); function bc_set_cookie() { $bc_set_time_cookie_value = get_option('bc_set_time_cookie'); if (!isset($bc_set_time_cookie_value)) { $bc_set_time_cookie_value = 20; } setcookie("bc_test_cookie", 'buffercode.com', time() + $bc_set_time_cookie_value); } function bc_random_captcha_comment() { $bc_captcha_random_value = get_option('bc_sort_location'); $bc_background_value = get_option('bc_background_color'); $bc_reg_users_value = get_option('bc_reg_users'); $bc_font_value = get_option('bc_font_color'); if (is_user_logged_in() && $bc_reg_users_value == 1) { return true; } else { ///////////////////////////////////////////////////////////////////////// //////Variable - Big or Small number Captcha /////////////////////// /////////////////////////////////////////////////////////////////////// $bc_big_small_number_rand = array_rand(range(00, 99), 3); shuffle($bc_big_small_number_rand); $bc_big_small_sort_var = $bc_big_small_number_rand; $bc_big_small_value_display = implode("  ", $bc_big_small_number_rand); ///////////////////////////////////////////////////////////////////////////////////// //Variable - Sort in Increasing or Decreasing Order Captcha // /////////////////////////////////////////////////////////////////////////////////// $bc_sort_number_rand = array_rand(range(1, 9), 5); shuffle($bc_sort_number_rand); $bc_sort_sort_var = $bc_sort_number_rand; $bc_sort_value_display = implode("", $bc_sort_number_rand); ///////////////////////////////////////////////////////////////////////////////////// //Variable - Addition or Subtraction Number Captcha///////// /////////////////////////////////////////////////////////////////////////////////// $bc_add_sub_number_rand = array_rand(range(00, 99), 2); //$bc_add_sub_random=rand(1,2); ///////////////////////////////////////////////////////////////////////////////////// //Variable - Multiply Number Captcha///////// /////////////////////////////////////////////////////////////////////////////////// $bc_multiply_number_rand = array_rand(range(0, 9), 2); shuffle($bc_multiply_number_rand); ///////////////////////////////////////////////////////////////// ///////////Random Number Generator//////////////////////// //////////////////////////////////////////////////////////////// if ($bc_captcha_random_value == 12) { $bc_captcha_random_value = rand(1, 11); } $bc_captcha_image_value = rand(1, 3); //////////////////////////////////////////////////////////////// //////If 1 - Biggest Value Captcha /////////////////////////// /////////////////////////////////////////////////////////////// if ($bc_captcha_random_value == 1) { $bc_big_small_sort_var_max = max($bc_big_small_sort_var); $bc_captcha_input_passing = $bc_big_small_sort_var_max; echo "
"; ?>
'; } //////////////////////////////////////////////////////////////// //////If 2 - Smallest Value Captcha ////////////////////////// ////////////////////////////////////////////////////////////// elseif ($bc_captcha_random_value == 2) { $bc_big_small_sort_var_min = min($bc_big_small_sort_var); $bc_captcha_input_passing = $bc_big_small_sort_var_min; echo "
"; ?>
'; } //////////////////////////////////////////////////////////////// //////If 3 - Sort in Increasing Order Captcha //////////////// ////////////////////////////////////////////////////////////// elseif ($bc_captcha_random_value == 3) { sort($bc_sort_sort_var); $bc_captcha_input_passing = implode("", $bc_sort_sort_var); echo "" . _e('* Please arrange the below number in increasing order
', 'random_captcha') . "
"; ?>
'; } //////////////////////////////////////////////////////////////// //////If 4 - Sort in Decreasing Order Captcha /////////////// ////////////////////////////////////////////////////////////// elseif ($bc_captcha_random_value == 4) { rsort($bc_sort_sort_var); $bc_captcha_input_passing = implode("", $bc_sort_sort_var); echo "
"; ?>
'; } /////////////////////////////////////////////// //////If 5 - Subtraction Captcha //////////// ///////////////////////////////////////////// elseif ($bc_captcha_random_value == 5) { $bc_add_sub_display = $bc_add_sub_number_rand[1] . '-' . $bc_add_sub_number_rand[0]; $bc_captcha_input_passing = $bc_add_sub_number_rand[1] - $bc_add_sub_number_rand[0]; echo "
"; ?>
'; } /////////////////////////////////////////////// //////If 6 - Addition Captcha /////////////// ///////////////////////////////////////////// elseif ($bc_captcha_random_value == 6) { $bc_add_sub_display = $bc_add_sub_number_rand[1] . '+' . $bc_add_sub_number_rand[0]; $bc_captcha_input_passing = $bc_add_sub_number_rand[1] + $bc_add_sub_number_rand[0]; echo "
"; ?>
'; } /////////////////////////////////////////////// ////// If 7 - Alphabets ////////////////////// ///////////////////////////////////////////// elseif ($bc_captcha_random_value == 7) { $bc_alphabets_number_rand = substr(str_shuffle(str_repeat("ABDEGHNTRQYabcdeghnqrty", 5)), 0, 5); $bc_captcha_input_passing = $bc_alphabets_number_rand; echo "" . _e('* Please enter the Characters - [Case Sensitive]
', 'random_captcha') . "
"; ?>
'; } /////////////////////////////////////////////////////// ////// If 8 - Find Digit Position ////////////////////// ///////////////////////////////////////////////////// elseif ($bc_captcha_random_value == 8) { $bc_digit_number_rand = substr(str_shuffle(str_repeat("ABDEGHNTRQYabdeghnqrty", 5)), 0, 5); $bc_digit_position = rand(1, 5); $bc_captcha_input_passing = $bc_digit_number_rand[$bc_digit_position - 1]; echo "" . _e('* Please enter the ' . $bc_digit_position . ' Characters - [Case Sensitive]
', 'random_captcha') . "
"; ?>
'; } /////////////////////////////////////////////////////// ////// If 9 - Combox ////////////////////// ///////////////////////////////////////////////////// elseif ($bc_captcha_random_value == 9) { ?> '; } /////////////////////////////////////////////////////// ////// If 10 - Multiplication ////////////////////// ///////////////////////////////////////////////////// elseif ($bc_captcha_random_value == 10) { $bc_add_sub_display = $bc_multiply_number_rand[1] . ' x ' . $bc_multiply_number_rand[0]; $bc_captcha_input_passing = $bc_multiply_number_rand[1] * $bc_multiply_number_rand[0]; echo "
"; ?>
'; } /////////////////////////////////////////////////////// ////// If 11 - Characters to Numbers ////////////////////// ///////////////////////////////////////////////////// elseif ($bc_captcha_random_value == 11) { $bc_char_digit_rand = array_rand(range(0, 9), 2); $bc_char_digit = array( 0 => "Zero", 1 => "One", 2 => "Two", 3 => "Three", 4 => "Four", 5 => "Five", 6 => "Six", 7 => "Seven", 8 => "Eight", 9 => "Nine", ); $bc_char_digit_display = $bc_char_digit[$bc_char_digit_rand[0]] . ' ' . $bc_char_digit[$bc_char_digit_rand[1]]; $bc_captcha_input_passing = implode("", $bc_char_digit_rand); echo "
"; ?>
'; } } } function bc_random_captcha_comment_form($comment) { $bc_footer_comment_value = get_option('bc_footer_comment'); global $bc_reg_users_value; if (is_user_logged_in() && $bc_reg_users_value == 1) { return $comment; } // skip captcha for comment replies from the admin menu if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'replyto-comment') { // skip capthca return $comment; } // Skip captcha for trackback or pingback if ($comment['comment_type'] != '' && $comment['comment_type'] != 'comment') { // skip captcha return $comment; } //check for timeout if (!isset($_COOKIE['bc_test_cookie'])) { // Checking for Captcha field empty if ($_REQUEST['bc_captcha_req_text'] == "" && isset($_REQUEST['bc_captcha_req_text'])) wp_die(__('OOPS! You have missed to enter Captcha!', 'random_captcha')); // Checking for Captcha matching if ($_REQUEST['bc_captcha_req_text'] == esc_attr(base64_decode($_REQUEST['bc_captcha_req_value']))) { return $comment; } else { wp_die(__('Error => Incorrect CAPTCHA, Please click back and reenter', 'random_captcha')); } } else { wp_die(__('You are moving fast - Are you Bot ?', 'random_captcha')); } } ///Uninstall Hook function bc_random_delete() { global $wpdb; delete_option('bc_sort_location'); delete_option('bc_reg_users'); } register_uninstall_hook(__FILE__, 'bc_random_delete'); ?>