Plugin Directory

Changeset 2959830


Ignore:
Timestamp:
08/29/2023 11:17:11 AM (3 years ago)
Author:
teamzt
Message:

Release 1.0.1 version

Location:
zt-captcha
Files:
27 added
4 edited

Legend:

Unmodified
Added
Removed
  • zt-captcha/trunk/captcha_settings.php

    r2856982 r2959830  
    334334<?php
    335335}
    336 ?>
  • zt-captcha/trunk/inc/Zt_Captcha.php

    r2856982 r2959830  
    246246
    247247endif;
    248 ?>
  • zt-captcha/trunk/readme.txt

    r2860673 r2959830  
    11=== ZT Captcha ===
    2 Tags: Captcha, recaptcha, contactform7, antispam, spamprotection, loginsecurity
     2Tags: captcha, simple captcha, login, register, comment, captcha for login, captcha for register, captcha for comment
    33Requires at least: 4.4
    44Contributors: teamzt
    5 Tested up to: 6.1.1
    6 Stable tag: 1.0
     5Tested up to: 6.3
     6Stable tag: 1.0.1
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
    99Requires PHP: 7.1
    10 Last Update: 2023-01-30
     10Last Update: 2023-08-29
    1111
    1212The simple captcha plugin was developed to keep the WordPress website safe. Captcha helps protect you from spam and password decryption by asking you to complete a simple test that proves you are human and not a computer trying to break into a password-protected account.
     
    1414== Description ==
    1515
    16 The Simple Captcha plugin designed with the aim of enhancing the security of WordPress websites. It functions by implementing a human verification test to safeguard against potential spam and unauthorized access attempts. The test, in the form of a simple challenge, ensures that only humans can access password-protected accounts and prevents automated scripts from compromising the security of the website.
    17 
    18 = Below features are available to WordPress administrators: =
    19 
    20 * Admin Have an option to enable/disable the captcha on the default WordPress login/registration form.
    21 * Admin Have an option to enable/disable the captcha on the default WordPress reset password form.
    22 * Admin Have an option to enable/disable the captcha on the default WordPress comment form.
    23 
    24 = Admin Have an option to select different captcha options: =
    25 
    26 * Numeric
    27 * Alphabetic
    28 * Mathematical captcha with random option
    29 * Mathematical captcha with algebraic option
    30 * Include special characters in the captcha string
    31 * Include uppercase letters in the captcha string
    32 * Set a limit of captcha digits
     161.As an administrator, Admin Have an option to enable/disable the captcha on the default WordPress login form.
     172.As an administrator, Admin Have an option to enable/disable the captcha on the default WordPress registration form.
     183.As an administrator, Admin Have an option to enable/disable the captcha on the default WordPress reset password form.
     194.As an administrator, Admin Have an option to enable/disable the captcha on the default WordPress comment form.
     205.As an administrator, Admin Have an option to select numeric captcha.
     216.As an administrator, Admin Have an option to select alphabetic captcha.
     227.As an administrator, Admin Have an option to select mathematical captcha with random option.
     238.As an administrator, Admin Have an option to select mathematical captcha with algebraic operations.
     249.As an administrator, Admin Have an option to include special characters in the captcha string.
     2510.As an administrator, Admin Have an option to include uppercase letters in the captcha string.
     2611.As an administrator, Admin Have an option to set a limit of captcha digits.
    3327
    3428== Installation ==
    3529
    36 * Install ZT Captcha either via the WordPress.org plugin directory, or by uploading the files to your server.
    37 * Activate the plugin through the 'Plugins' menu in WordPress.
    38 * Go to the ZT Captcha menu and set your captcha display settings.
     301. Install ZT Captcha either via the WordPress.org plugin directory, or by uploading the files to your server
     312. Activate the plugin through the 'Plugins' menu in WordPress
     323. Go to the ZT Captcha menu and set your captcha display settings.
    3933
    4034**Installing via FTP**
    4135
    42  - Login to your hosting space via an FTP software, e.g. FileZilla.   
    43  - Unzip the downloaded ZT Captcha by WordPress plugin folder without making any changes to the folder.   
    44  - Upload the ZT Captcha by WordPress plugin into the following location wp-content > wp-plugins.   
    45  - Login to the WordPress Administrator Panel.   
    46  - Activate ZT Captcha plugin by going to Plugins and pressing Activate button. 
     36Login to your hosting space via an FTP software, e.g. FileZilla.   
     37Unzip the downloaded ZT Captcha by WordPress plugin folder without making any changes to the folder.   
     38Upload the ZT Captcha by WordPress plugin into the following location wp-content>wp-plugins.   
     39Login to the WordPress Administrator Panel.   
     40Activate ZT Captcha plugin by going to Plugins and pressing Activate button. 
    4741
    4842
    4943== Frequently Asked Questions ==
    5044
    51 = Is it work for cutom login, comment, register forms generated from plugins? =
     45= Is it work for cutom login,comment,register forms generated from plugins? =
    5246
    53 Yes, it work's if Wordpress standard hooks are used in the forms.
     47Yes ,it work's if Wordpress standard hooks are used in the forms.
    5448
    5549= Is it requires PHP GD extention? =
    5650
    57 Yes, it requires PHP GD extention for more help please go through the page [here](https://bobcares.com/blog/php-install-gd-extension/).
     51Yes ,it requires PHP GD extention for more help please go through the page https://bobcares.com/blog/php-install-gd-extension/.
    5852
    5953
     
    7468 First Release
    7569
     70 = 1.0.1 =
     71
     72*  New: Added Captcha for woocommerce lost password form.
     73*  Update: All functionality was updated for WordPress 6.3.
  • zt-captcha/trunk/zt-captcha.php

    r2860673 r2959830  
    33Plugin Name: ZT Captcha
    44Description: The simple captcha plugin was developed to keep the WordPress website safe. Captcha helps protect you from spam and password decryption by asking you to complete a simple test that proves you are human and not a computer trying to break into a password-protected account.
    5 Version: 1.0
     5Version: 1.0.1
    66Author: Webcresty
    77Author URI: https://www.webcresty.com/
     
    1212define('ZTCPT_CAPTCHA_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
    1313define('ZTCPT_CAPTCHA_URL_DIR',plugin_dir_url( __FILE__ ) );
    14 define('ZTCPT_CAPTCHA_VERSION','1.0');
     14define('ZTCPT_CAPTCHA_VERSION','1.0.1');
    1515define('ZTCPT_VALIDATE_REQ','a_c_validate');
    1616define('ZTCPT_SESSION_STORAGE','a_security_code');
     
    8989            add_action( 'woocommerce_register_form', function(){ztcpt_captcha('wc_register'); });
    9090            add_action( 'woocommerce_register_post', 'ztcpt_a_cptch_wooc_validate_fields', 10, 3 );
     91           
    9192        }
    9293
     
    99100            //woocomerce
    100101            add_action( 'woocommerce_lostpassword_form',function(){ztcpt_captcha('wp_forget');});
     102            add_action( 'lostpassword_post', 'ztcpt_a_cptch_wooc_forget_validate'); // for lost password woocommerce
    101103        }
    102104        /*
     
    643645}
    644646/* end script Woocommerce Register validate form case */
     647
     648/*lost password for woocommerce account*/
     649
     650if(!function_exists('ztcpt_a_cptch_wooc_forget_validate')){
     651    function ztcpt_a_cptch_wooc_forget_validate($errors) {
     652        ztcptCaptchaSessionStart();
     653        if(get_option('zt_captcha_selected_captcha')=='mathematical_captcha'){
     654            return ztcpt_is_numeric_wooc_forget_case($errors);
     655        }
     656        if(get_option('zt_captcha_selected_captcha')=='number_captcha'){
     657            if(get_option('zt_captcha_numeric_symbol')!='on'){
     658                return ztcpt_is_numeric_wooc_forget_case($errors);
     659            }
     660            else{
     661                return ztcpt_is_alphanumeric_wooc_forget_case($errors);
     662            }
     663        }
     664        if(get_option('zt_captcha_selected_captcha')=='alphzt_captcha'){
     665            if((get_option('zt_captcha_alpha_capital')=='on') && (get_option('zt_captcha_alpha_symbol')=='on')){
     666                return ztcpt_is_alphanumeric_wooc_forget_case($errors);
     667            }
     668            elseif((get_option('zt_captcha_alpha_capital')=='on') || (get_option('zt_captcha_alpha_symbol')=='on')){
     669                return ztcpt_is_alphanumeric_wooc_forget_case($errors);
     670            }
     671            else{
     672                return ztcpt_is_alphanumeric_wooc_forget_case($errors);
     673            }
     674        }
     675    }
     676}
     677
     678
     679if(!function_exists('ztcpt_is_numeric_wooc_forget_case')){
     680    function ztcpt_is_numeric_wooc_forget_case($errors){
     681        $zt_captcha_error_message = get_option('zt_captcha_error_message');
     682        if(strlen($_REQUEST[ZTCPT_VALIDATE_REQ])==strlen($_SESSION[ZTCPT_SESSION_STORAGE]['wp_forget'])){
     683            if(is_numeric($_REQUEST[ZTCPT_VALIDATE_REQ])==is_numeric($_SESSION[ZTCPT_SESSION_STORAGE]['wp_forget'])){
     684                if(isset($_REQUEST[ZTCPT_VALIDATE_REQ])){
     685                    $ZTCPT_VALIDATE_REQ = sanitize_text_field($_REQUEST[ZTCPT_VALIDATE_REQ]);
     686                    if(!isset($_SESSION[ZTCPT_SESSION_STORAGE]) || !isset($_SESSION[ZTCPT_SESSION_STORAGE]['wp_forget']) || $_SESSION[ZTCPT_SESSION_STORAGE]['wp_forget']!=$ZTCPT_VALIDATE_REQ){
     687                        $message = esc_html__( $zt_captcha_error_message, ZTCPT_TEXT_DOMAIN);
     688                        $errors->add( 'captcha_not_verified', $message);
     689                    }
     690                }
     691            }
     692            else{
     693                $message = esc_html__( $zt_captcha_error_message, ZTCPT_TEXT_DOMAIN);
     694                $errors->add( 'captcha_not_verified', $message);
     695            }
     696        }
     697        else{
     698            $message = esc_html__( $zt_captcha_error_message, ZTCPT_TEXT_DOMAIN);
     699            $errors->add( 'captcha_not_verified', $message);
     700        }
     701        return $errors;
     702    }
     703}
     704
     705if(!function_exists('ztcpt_is_alphanumeric_wooc_forget_case')){
     706    function ztcpt_is_alphanumeric_wooc_forget_case($errors){
     707        $zt_captcha_error_message = get_option('zt_captcha_error_message');
     708        if(strlen($_REQUEST[ZTCPT_VALIDATE_REQ])==strlen($_SESSION[ZTCPT_SESSION_STORAGE]['wp_forget'])){
     709            if(is_string($_REQUEST[ZTCPT_VALIDATE_REQ])==is_string($_SESSION[ZTCPT_SESSION_STORAGE]['wp_forget'])){
     710                if(isset($_REQUEST[ZTCPT_VALIDATE_REQ])){
     711                    $ZTCPT_VALIDATE_REQ = sanitize_text_field($_REQUEST[ZTCPT_VALIDATE_REQ]);
     712                    if(!isset($_SESSION[ZTCPT_SESSION_STORAGE]) || !isset($_SESSION[ZTCPT_SESSION_STORAGE]['wp_forget']) || $_SESSION[ZTCPT_SESSION_STORAGE]['wp_forget']!=$ZTCPT_VALIDATE_REQ){
     713                        $message = esc_html__( $zt_captcha_error_message, ZTCPT_TEXT_DOMAIN);
     714                        $errors->add( 'captcha_not_verified', $message);
     715                    }
     716                }
     717            }
     718            else{
     719                $message = esc_html__( $zt_captcha_error_message, ZTCPT_TEXT_DOMAIN);
     720                $errors->add( 'captcha_not_verified', $message);
     721            }
     722        }
     723        else{
     724            $message = esc_html__( $zt_captcha_error_message, ZTCPT_TEXT_DOMAIN);
     725            $errors->add( 'captcha_not_verified', $message, ZTCPT_TEXT_DOMAIN);
     726        }   
     727        return $errors;
     728    }
     729}
Note: See TracChangeset for help on using the changeset viewer.