Plugin Directory

Changeset 3460861


Ignore:
Timestamp:
02/13/2026 02:59:20 PM (7 weeks ago)
Author:
clearoutio
Message:

added support for blocking unknown emails

Location:
clearout-email-validator
Files:
19 added
5 edited

Legend:

Unmodified
Added
Removed
  • clearout-email-validator/trunk/plugin.php

    r3445705 r3460861  
    44 * Plugin URL:   https://developer.wordpress.org/plugins/clearout-email-validator
    55 * 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.2.5
     6 * Version:      3.3.0
    77 * Author:       Clearout.io
    88 * Author URI:   https://clearout.io
     
    1414
    1515// plugin version.
    16 define( 'CLEAROUT_PLUGIN_VERSION', '3.2.5' );
     16define( 'CLEAROUT_PLUGIN_VERSION', '3.3.0' );
    1717define( 'CLEAROUT_RESULT_CACHED_TIMEOUT', 3600 );
    1818define( 'CLEAROUT_BASE_API_URL', 'https://api.clearout.io/v2/' );
  • clearout-email-validator/trunk/readme.txt

    r3445705 r3460861  
    55Requires at least: 4.6
    66Tested up to: 6.8.1
    7 Stable tag: 3.2.5
     7Stable tag: 3.3.0
    88License: GPLv2 or later
    99Block invalid emails like temporary, disposable, etc. with our real-time email verification. Verify email address during form-fill and stop form spam.
     
    371371= 3.2.5 =
    372372* Minor Improvements
     373= 3.3.0 =
     374* Introduced blocking unknown email support
  • clearout-email-validator/trunk/src/clearout-plugin-page-settings.php

    r3379447 r3460861  
    197197    add_settings_field( 'clearout_free_option', _co_freebased_label_setting(), '_co_free_setting_option', 'co_plugin_vt', 'clearout_plugin_main', array( 'class' => 'clearout_lables' ) );
    198198    add_settings_field( 'clearout_sts_option', _co_stsbased_label_setting(), '_co_sts_setting_option', 'co_plugin_vt', 'clearout_plugin_main' );
     199    add_settings_field('clearout_unknown_option', _co_unknownbased_label_setting(), '_co_unknown_setting_option', 'co_plugin_vt', 'clearout_plugin_main');
    199200    add_settings_field( 'clearout_role_email_option', _co_rolebased_label_setting(), '_co_role_email_setting_option', 'co_plugin_vt', 'clearout_plugin_main' );
    200201    add_settings_field( 'clearout_disposable_option', _co_dispbased_label_setting(), '_co_disposable_setting_option', 'co_plugin_vt', 'clearout_plugin_main' );
     
    470471}
    471472
     473/**
     474 * Settings unknown label.
     475 */
     476function _co_unknownbased_label_setting()
     477{
     478    return '<div>Block unknown status email&nbsp;<i class="fa fa-info-circle apitoken-tooltip"><span class="tooltiptext">Block submission if the email status could not be determined by the verification.</span></i></div>';
     479}
    472480
    473481/**
     
    709717
    710718/**
     719 * Settings free email.
     720 */
     721function _co_unknown_setting_option() {
     722    $options     = get_option( 'clearout_email_validator' );
     723    $unknown_on_off = isset( $options['unknown_on_off'] ) ? $options['unknown_on_off'] : 'off';
     724    echo '<label><input type="checkbox" name="clearout_email_validator[unknown_on_off]" id="unknown_option" value="on"' . ( ( 'on' == $unknown_on_off ) ? ' checked' : 'unchecked' ) . ' /></label>';
     725}
     726
     727/**
    711728 * Private method to set defaults
    712729 */
     
    717734        'disposable_on_off' => '',
    718735        'free_on_off'       => '',
     736        'unknown_on_off'    => '',
    719737        'gibberish_on_off'  => '',
    720738        'sts_on_off'        => '',
  • clearout-email-validator/trunk/src/clearout-validator.php

    r3445705 r3460861  
    218218
    219219/**
     220 * Is Unknown email
     221 *
     222 * @param mixed $email_result Ev Result object.
     223 */
     224function _co_is_unknown($email_result)
     225{
     226    $is_unknown = false;
     227    if ('unknown' == $email_result['data']['status']) {
     228        $is_unknown = true;
     229    }
     230    return $is_unknown;
     231}
     232
     233/**
    220234 * Is Free email.
    221235 *
     
    362376            $clearout_validation_result['status'] = false;
    363377            $clearout_validation_result['reason'] = 'sts_email';
     378            return $clearout_validation_result;
     379        }
     380    }
     381
     382    // does the user checked allow unknown emails
     383    if ( ( isset($clearout_options['unknown_on_off']) && 'on' == $clearout_options['unknown_on_off'])) {
     384        $is_unknown = _co_is_unknown($email_result);
     385        if ($is_unknown) {
     386            $clearout_validation_result['status'] = false;
     387            $clearout_validation_result['reason'] = 'unknown_email';
    364388            return $clearout_validation_result;
    365389        }
     
    440464            $error_message = 'Not a safe to send email address, please try with different email address';
    441465            break;
     466        case 'unknown_email':
     467            $error_message = 'Unable to verify the email address, try again after sometime.';
     468            break;
    442469        default:
    443470            $error_message = 'This email address is not allowed due to ' . $error_status;
Note: See TracChangeset for help on using the changeset viewer.