Changeset 3236032
- Timestamp:
- 02/06/2025 01:07:13 PM (14 months ago)
- Location:
- clearout-email-validator
- Files:
-
- 19 added
- 3 edited
-
tags/3.1.7 (added)
-
tags/3.1.7/assets (added)
-
tags/3.1.7/assets/css (added)
-
tags/3.1.7/assets/css/amsify.suggestags.css (added)
-
tags/3.1.7/assets/css/clearout_plugin.css (added)
-
tags/3.1.7/assets/img (added)
-
tags/3.1.7/assets/img/clearout_wp_logo.png (added)
-
tags/3.1.7/assets/js (added)
-
tags/3.1.7/assets/js/clearout_plugin.js (added)
-
tags/3.1.7/assets/js/jquery.amsify.suggestags.js (added)
-
tags/3.1.7/license.txt (added)
-
tags/3.1.7/plugin.php (added)
-
tags/3.1.7/readme.txt (added)
-
tags/3.1.7/src (added)
-
tags/3.1.7/src/clearout-plugin-page-settings.php (added)
-
tags/3.1.7/src/clearout-plugin.php (added)
-
tags/3.1.7/src/clearout-validator.php (added)
-
tags/3.1.7/src/helper.php (added)
-
tags/3.1.7/uninstall.php (added)
-
trunk/plugin.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/src/clearout-validator.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
clearout-email-validator/trunk/plugin.php
r3184424 r3236032 4 4 * Plugin URL: https://developer.wordpress.org/plugins/clearout-email-validator 5 5 * Description: This plugin seamlessly integrated with all major forms to validate the user's given email address in real-time. Under the hood, this plugin use Clearout API to perform 20+ refined validation checks to determine the status of the email address, and thus helps capturing only the valid leads to maintain high quality mailing list. 6 * Version: 3.1. 66 * Version: 3.1.7 7 7 * Author: Clearout.io 8 8 * Author URI: https://clearout.io … … 14 14 15 15 // plugin version. 16 define( 'CLEAROUT_PLUGIN_VERSION', '3.1. 6' );16 define( 'CLEAROUT_PLUGIN_VERSION', '3.1.7' ); 17 17 define( 'CLEAROUT_RESULT_CACHED_TIMEOUT', 3600 ); 18 18 define( 'CLEAROUT_BASE_API_URL', 'https://api.clearout.io/v2/' ); -
clearout-email-validator/trunk/readme.txt
r3184424 r3236032 5 5 Requires at least: 4.6 6 6 Tested up to: 6.5.5 7 Stable tag: 3.1. 67 Stable tag: 3.1.7 8 8 License: GPLv2 or later 9 9 Block invalid emails like temporary, disposable, etc. with our real-time email verification. Verify email address during form-fill and stop form spam. … … 356 356 = 3.1.6 = 357 357 * Minor Fixes 358 = 3.1.7 = 359 * Improved WooCommerce hooks -
clearout-email-validator/trunk/src/clearout-validator.php
r3184424 r3236032 159 159 try { 160 160 global $wp; 161 161 162 162 // Get Clients IP 163 163 $client_ip = _get_user_ip(); … … 286 286 // the Strpos check is introduced to make sure even if Rest API is called from admin page it shud not trigger EV 287 287 // Use the custom is_admin_request() function to check if in the admin context 288 if ( is_admin_request() && CLEAROUT_TEST_PLUGIN_SOURCE != $clearout_form_source ) {288 if ( is_admin_request() && CLEAROUT_TEST_PLUGIN_SOURCE != $clearout_form_source ) { 289 289 return $clearout_validation_result; 290 290 } … … 358 358 if ( ( isset( $clearout_options['sts_on_off'] ) && 'on' == $clearout_options['sts_on_off'] ) ) { 359 359 $is_sts = _co_is_sts( $email_result ); 360 if ( ! $is_sts ) {360 if ( ! $is_sts ) { 361 361 $clearout_validation_result['status'] = false; 362 362 $clearout_validation_result['reason'] = 'sts_email'; … … 882 882 } 883 883 884 // checkoutFields reference: https://woocommerce.github.io/code-reference/classes/WC-Checkout.html#method_get_checkout_fields 884 885 /** 885 886 * Woocommerce Checkout Forms. … … 890 891 function clearout_woocom_checkout_validate_email( $fields, $errors ) { 891 892 $clearout_form_source = 'woochkfrm'; 892 893 if ( isset( $fields['billing_email'] ) ) { 894 $email = $fields['billing_email']; 895 896 // Get option settings to know which validator is been called. 897 $clearout_options = get_option( 'clearout_email_validator' ); 898 $is_valid_email = true; 899 if ( ( ! ( '' == $clearout_options['api_key'] ) ) && ( '' != $email ) ) { 900 // do the email validation. 901 $validation_result = _co_email_validation( $email, $clearout_options, $clearout_form_source ); 902 if ( ( is_array( $validation_result ) ) && array_key_exists( 'status', $validation_result ) ) { 903 if ( false == $validation_result['status'] ) { 904 $is_valid_email = false; 905 // if any validation errors. 906 // remove all of them. 907 foreach ( $errors->get_error_codes() as $code ) { 908 $errors->remove( $code ); 909 } 910 911 if ( _check_custom_error_msg_exist( $clearout_options ) ) { 912 $errors->add( 'validation', $clearout_options['custom_invalid_error'] ); 893 $checkout_fields = WC()->checkout()->get_checkout_fields(); 894 895 896 foreach ( $fields as $key => $value ) { 897 if ( strpos( $key, '_email' ) !== false ) { 898 $email = $value; 899 900 // if the field's class has clearout skip validation identifier, dont validate 901 $class_array = []; 902 foreach ( $checkout_fields as $section => $section_fields ) { 903 if ( isset( $section_fields[ $key ]['class'] ) ) { 904 $class_array = $section_fields[ $key ]['class']; 905 break; 906 } 907 } 908 909 // if the clearout skip validation class is set for this field, skip it. 910 if ( ! empty( preg_grep( CLEAROUT_IGNORE_VALIDATION_IDENTIFIER_REGEX, $class_array ) ) ) { 911 continue; 912 } 913 914 // Get option settings to know which validator is been called. 915 $clearout_options = get_option( 'clearout_email_validator' ); 916 $is_valid_email = true; 917 if ( ( ! ( '' == $clearout_options['api_key'] ) ) && ( '' != $email ) ) { 918 // do the email validation. 919 $validation_result = _co_email_validation( $email, $clearout_options, $clearout_form_source ); 920 if ( ( is_array( $validation_result ) ) && array_key_exists( 'status', $validation_result ) ) { 921 if ( false == $validation_result['status'] ) { 922 $is_valid_email = false; 923 // if any validation errors. 924 // remove all of them. 925 foreach ( $errors->get_error_codes() as $code ) { 926 $errors->remove( $code ); 927 } 928 929 if ( _check_custom_error_msg_exist( $clearout_options ) ) { 930 $errors->add( 'validation', $clearout_options['custom_invalid_error'] ); 931 return; 932 } 933 $error_message = _get_error_message( $validation_result['reason'] ); 934 $errors->add( 'validation', $error_message ); 913 935 return; 914 936 } 915 $error_message = _get_error_message( $validation_result['reason'] ); 916 $errors->add( 'validation', $error_message ); 917 } 918 } 937 } 938 } 939 919 940 } 920 941 }
Note: See TracChangeset
for help on using the changeset viewer.