Plugin Directory

Changeset 3239399

Timestamp:
02/12/2025 12:54:57 PM (17 months ago)
Author:
clearoutio
Message:

Minor Enhancements

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

Legend:

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

    r3236032 r3239399  
    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.1.7
     6 * Version:      3.2.0
    77 * Author:       Clearout.io
    88 * Author URI:   https://clearout.io
     
    1414
    1515// plugin version.
    16 define( 'CLEAROUT_PLUGIN_VERSION', '3.1.7' );
     16define( 'CLEAROUT_PLUGIN_VERSION', '3.2.0' );
    1717define( 'CLEAROUT_RESULT_CACHED_TIMEOUT', 3600 );
    1818define( 'CLEAROUT_BASE_API_URL', 'https://api.clearout.io/v2/' );
  • clearout-email-validator/trunk/readme.txt

    r3236032 r3239399  
    55Requires at least: 4.6
    66Tested up to: 6.5.5
    7 Stable tag: 3.1.7
     7Stable tag: 3.2.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.
     
    4444* Gravity Forms
    4545* Forminator Form
    46 * WooCommerce
     46* WooCommerce Checkout Forms
     47* WooCommerce Registration Form
    4748* Fluent Form
    4849* WP Forms
     
    358359= 3.1.7 =
    359360* Improved WooCommerce hooks
     361= 3.2.0 =
     362* Introduced WooCommerce Signup Form support
  • clearout-email-validator/trunk/src/clearout-plugin-page-settings.php

    r3177739 r3239399  
    283283function _co_option_plugin_page() {
    284284        ?>
    285                 <h2 style="font-size: 1.5em;float:left;">Clearout Email Validator </h2>
    286 
    287                 <div style="float: left;padding: 0px 20px 0px 0px;">
    288                         <div style="background-color: #fff;padding:5px 30px 5px 30px;">
    289                                 <a href="https://clearout.io" target="_blank"><img style="float:right;margin:1em 0;" width="220"
    290                                                 src="<?php echo esc_html( plugin_dir_url( dirname( __FILE__ ) ) ) . 'assets/img/clearout_wp_logo.png'; ?>" /></a>
    291                                 <p style="font-size: 14px;">Clearout Email Validator plugin seamlessly integrated with all major forms to
    292                                         validate the user given email address in real-time. This plugin will perform <a
    293                                                 href="https://clearout.io/email-verifier/#validation_checks" target="_blank">20+ refined validation</a> checks to
    294                                         determine the status of email address, this would help the email address capture process </p>
    295                                 <ul style="list-style-type: disc;padding-left: 10px;font-size: 14px;">
    296                                         <li>To accept only valid email address </li>
    297                                         <li>To accept only business/work email address</li>
    298                                         <li>To prevent all fraudulent signups</li>
    299                                         <!-- <li><a href="https://developer.wordpress.org/plugins/Clearout-email-validator" target="_blank">Know more</a></li> -->
    300                                 </ul>
     285        <h2 style="font-size: 1.5em;float:left;">Clearout Email Validator </h2>
     286
     287        <div style="float: left;padding: 0px 20px 0px 0px;">
     288                <div style="background-color: #fff;padding:5px 30px 5px 30px;">
     289                        <a href="https://clearout.io" target="_blank"><img style="float:right;margin:1em 0;" width="220"
     290                                        src="<?php echo esc_html( plugin_dir_url( dirname( __FILE__ ) ) ) . 'assets/img/clearout_wp_logo.png'; ?>" /></a>
     291                        <p style="font-size: 14px;">Clearout Email Validator plugin seamlessly integrated with all major forms to
     292                                validate the user given email address in real-time. This plugin will perform <a
     293                                        href="https://clearout.io/email-verifier/#validation_checks" target="_blank">20+ refined validation</a>
     294                                checks to
     295                                determine the status of email address, this would help the email address capture process </p>
     296                        <ul style="list-style-type: disc;padding-left: 10px;font-size: 14px;">
     297                                <li>To accept only valid email address </li>
     298                                <li>To accept only business/work email address</li>
     299                                <li>To prevent all fraudulent signups</li>
     300                                <!-- <li><a href="https://developer.wordpress.org/plugins/Clearout-email-validator" target="_blank">Know more</a></li> -->
     301                        </ul>
     302                </div>
     303                <br />
     304                <br />
     305
     306                <div style="background-color: #ffffff61;padding:15px 30px 15px 30px;">
     307                        <form id="clearout_setting_form" action="options.php" method="post">
     308                                <?php settings_fields( 'clearout_email_validator' ); ?>
     309                                <?php do_settings_sections( 'co_plugin' ); ?>
     310                                <hr class="co_sec_diff" />
     311                                <h2 class="co_plugin_subhead">Valid Email Address</h2>
     312                                <?php do_settings_sections( 'co_plugin_vt' ); ?>
     313                                <hr class="co_sec_diff" />
     314                                <h2 class="co_plugin_subhead">Apply Validation</h2>
     315                                <?php do_settings_sections( 'co_plugin_fs' ); ?>
     316                                <hr class="co_sec_diff" />
     317                                <?php do_settings_sections( 'co_plugin_ts' ); ?>
     318                                <input name="clearout_submit" type="submit" value="<?php esc_attr_e( 'Apply' ); ?>"
     319                                        class="button button-primary" />
     320                                <input name="clearout_reset_clicked" type="button" value="<?php esc_attr_e( 'Reset' ); ?>"
     321                                        onclick="_co_reset_plugin()" class="button button-primary" style="margin-left: 10px" />
     322                        </form>
     323                        <form id="clearout_reset_form" name="reset" action="options-general.php?page=clearout-email-validator"
     324                                method="post">
     325                                <?php wp_nonce_field( 'co_reset_options_nonce' ); ?>
     326                                <input id="co_reset_options" name="co_reset_options" type="submit" style="display:none;"
     327                                        value="<?php esc_attr_e( 'Reset' ); ?>" class="button button-primary" />
     328
     329                        </form>
     330                        <script>
     331                                function _co_reset_plugin() {
     332                                        function _check_if_settings_changed(defaultOptions, currentOptions) {
     333                                                // If lenght is different, we dont have to check values, cuz they are not same objects.
     334                                                if (Object.keys(defaultOptions).length !== Object.keys(currentOptions).length) return true;
     335                                                for (let key of Object.keys(defaultOptions)) { // Checking values of each key of both objects. 
     336                                                        if (defaultOptions[key] !== currentOptions[key]) {
     337                                                                return true;
     338                                                        }
     339                                                } return false;
     340                                        }
     341                                        // Make sure user wants to reset @TODO Check if any settings has been changed, if not no need to reset.
     342                                        // Check if the defaults and modified are same, if not show prompt.     
     343                                        if (_check_if_settings_changed(clearout_default_options, clearout_current_options) &&
     344                                                confirm('Are you sure you want to revert to the default settings?')) {
     345                                                document.getElementById('co_reset_options').click();
     346                                        };
     347                                }
     348                        </script>
     349
     350                        <br />
     351                        <h4 style="font-size: 15px;margin: 0;"><b>Note:</b> </h4>
     352                        <ul style="list-style-type: disc;padding-left: 10px;font-size: 14px;">
     353                                <li>Validation check will be performed based on the priority orders until one or more condition satisfies
     354                                </li>
     355                                <li>Option <b>Accept only Business Address</b> will supersede other option during validation </li>
     356                                <li>Option <b>Accept only Safe to Send</b> is higher than Role or Disposable or Gibberish options, when
     357                                        checked Role, Disposable, Gibberish will be disabled </li>
     358                                <li>Option <b>Accept only Business Address</b> is higher than Role or Disposable options. Role,
     359                                        Disposable, Gibberish share the same priority </li>
     360                                <li>Option <b>Safe to Send</b> and <b>Business address</b> share the same priority and can be applied
     361                                        simulateneously </li>
     362                                <li>Page URLs listed under <b>disallow validation will override allowed validation</b> URLs</li>
     363                                <li><a href="mailto:us@clearout.io">Reach out to us</a> if you are looking to have support for additional
     364                                        forms or hooks</li>
     365                                <li>If you are looking for individual <b> form specific custom validation</b>, check out <a
     366                                                href="https://docs.clearout.io/jswidget.html" target="_blank">Clearout JavaScript Widget</a>, the
     367                                        integration can be done without need of developer help. Clearout JS widget provides all bells and
     368                                        whistles to customise the email validation as per your need. </li>
     369                                <li>In case of an incoming email address or domain is already part of <a
     370                                                href="https://app.clearout.io/settings/email_verifier" target="_blank">Allowlist or
     371                                                Blocklist</a> then the verification outcome will be based on that. Above setting options wont have
     372                                        any impact during the verification.</li>
     373                                <li>Know more from <a
     374                                                href="https://wordpress.org/plugins/clearout-email-validator/#how%20to%20opt%20out%20of%20the%20clearout%20email%20validation%20on%20a%20specific%20form%3F"
     375                                                target="_blank">FAQ</a> on how to handle <b>form specific or opting out</b> of email validation</li>
     376                                <li>For testing, you can find <a href="https://docs.clearout.io/api-overview.html#testing"
     377                                                target="_blank">test email addresses</a> to check that your integration works as intended <b>without
     378                                                incurring credits.</b></a>
     379                        </ul>
     380                </div>
     381                <br />
     382                <br />
     383
     384                <div style="background-color: #fff;padding:15px 30px 25px 30px;">
     385                        <h3 style="font-size: 1.5em;">Test Plugin Settings</h3>
     386                        <div style="display: flex;align-items: center">
     387                                <input id="clearout_email_address_input" placeholder="Enter a email address"
     388                                        name="clearout_email_address_input" size="30" type="email" value="" style="height: 28px;" required />
     389                                <div id="clearout_validate_button_div" style="margin-left:5px;">
     390                                        <input id="clearout_email_address_submit" name="submit" type="submit"
     391                                                value="<?php esc_attr_e( 'Test' ); ?>" class="button button-primary" />
     392                                </div>
    301393                        </div>
    302                         <br />
    303                         <br />
    304 
    305                         <div style="background-color: #ffffff61;padding:15px 30px 15px 30px;">
    306                                 <form id="clearout_setting_form" action="options.php" method="post">
    307                                         <?php settings_fields( 'clearout_email_validator' ); ?>
    308                                         <?php do_settings_sections( 'co_plugin' ); ?>
    309                                         <hr class="co_sec_diff" />
    310                                         <h2 class="co_plugin_subhead">Valid Email Address</h2>
    311                                         <?php do_settings_sections( 'co_plugin_vt' ); ?>
    312                                         <hr class="co_sec_diff" />
    313                                         <h2 class="co_plugin_subhead">Apply Validation</h2>
    314                                         <?php do_settings_sections( 'co_plugin_fs' ); ?>
    315                                         <hr class="co_sec_diff" />
    316                                         <?php do_settings_sections( 'co_plugin_ts' ); ?>
    317                                         <input name="clearout_submit" type="submit" value="<?php esc_attr_e( 'Apply' ); ?>"
    318                                                 class="button button-primary" />
    319                                         <input name="clearout_reset_clicked" type="button" value="<?php esc_attr_e( 'Reset' ); ?>"
    320                                                 onclick="_co_reset_plugin()" class="button button-primary" style="margin-left: 10px" />
    321                                 </form>
    322                                 <form id="clearout_reset_form" name="reset" action="options-general.php?page=clearout-email-validator"
    323                                         method="post">
    324                                         <?php wp_nonce_field( 'co_reset_options_nonce' ); ?>
    325                                         <input id="co_reset_options" name="co_reset_options" type="submit" style="display:none;"
    326                                                 value="<?php esc_attr_e( 'Reset' ); ?>" class="button button-primary" />
    327 
    328                                 </form>
    329                                 <script>
    330                                         function _co_reset_plugin() {
    331                                                 function _check_if_settings_changed(defaultOptions, currentOptions) {
    332                                                         // If lenght is different, we dont have to check values, cuz they are not same objects.
    333                                                         if (Object.keys(defaultOptions).length !== Object.keys(currentOptions).length) return true;
    334                                                         for (let key of Object.keys(defaultOptions)) { // Checking values of each key of both objects. 
    335                                                                 if (defaultOptions[key] !== currentOptions[key]) {
    336                                                                         return true;
    337                                                                 }
    338                                                         } return false;
    339                                                 }
    340                                                 // Make sure user wants to reset @TODO Check if any settings has been changed, if not no need to reset.
    341                                                 // Check if the defaults and modified are same, if not show prompt.     
    342                                                 if (_check_if_settings_changed(clearout_default_options, clearout_current_options) &&
    343                                                         confirm('Are you sure you want to revert to the default settings?')) {
    344                                                         document.getElementById('co_reset_options').click();
    345                                                 };
    346                                         }
    347                                 </script>
    348 
    349                                 <br />
    350                                 <h4 style="font-size: 15px;margin: 0;"><b>Note:</b> </h4>
    351                                 <ul style="list-style-type: disc;padding-left: 10px;font-size: 14px;">
    352                                         <li>Validation check will be performed based on the priority orders until one or more condition satisfies
    353                                         </li>
    354                                         <li>Option <b>Accept only Business Address</b> will supersede other option during validation </li>
    355                                         <li>Option <b>Accept only Safe to Send</b> is higher than Role or Disposable or Gibberish options, when
    356                                                 checked Role, Disposable, Gibberish will be disabled </li>
    357                                         <li>Option <b>Accept only Business Address</b> is higher than Role or Disposable options. Role,
    358                                                 Disposable, Gibberish share the same priority </li>
    359                                         <li>Option <b>Safe to Send</b> and <b>Business address</b> share the same priority and can be applied simulateneously </li>
    360                                         <li>Page URLs listed under <b>disallow validation will override allowed validation</b> URLs</li>
    361                                         <li><a href="mailto:us@clearout.io">Reach out to us</a> if you are looking to have support for additional
    362                                                 forms or hooks</li>
    363                                         <li>If you are looking for individual <b> form specific custom validation</b>, check out <a
    364                                                         href="https://docs.clearout.io/jswidget.html" target="_blank">Clearout JavaScript Widget</a>, the
    365                                                 integration can be done without need of developer help. Clearout JS widget provides all bells and
    366                                                 whistles to customise the email validation as per your need. </li>
    367                                         <li>In case of an incoming email address or domain is already part of <a
    368                                                         href="https://app.clearout.io/settings/email_verifier" target="_blank">Allowlist or
    369                                                         Blocklist</a> then the verification outcome will be based on that. Above setting options wont have
    370                                                 any impact during the verification.</li>
    371                                         <li>Know more from <a
    372                                                         href="https://wordpress.org/plugins/clearout-email-validator/#how%20to%20opt%20out%20of%20the%20clearout%20email%20validation%20on%20a%20specific%20form%3F"
    373                                                         target="_blank">FAQ</a> on how to handle <b>form specific or opting out</b> of email validation</li>
    374                                         <li>For testing, you can find <a href="https://docs.clearout.io/api-overview.html#testing"
    375                                                         target="_blank">test email addresses</a> to check that your integration works as intended <b>without
    376                                                         incurring credits.</b></a>
    377                                 </ul>
    378                         </div>
    379                         <br />
    380                         <br />
    381 
    382                         <div style="background-color: #fff;padding:15px 30px 25px 30px;">
    383                                 <h3 style="font-size: 1.5em;">Test Plugin Settings</h3>
    384                                 <div style="display: flex;align-items: center">
    385                                         <input id="clearout_email_address_input" placeholder="Enter a email address"
    386                                                 name="clearout_email_address_input" size="30" type="email" value="" style="height: 28px;" required />
    387                                         <div id="clearout_validate_button_div" style="margin-left:5px;">
    388                                                 <input id="clearout_email_address_submit" name="submit" type="submit"
    389                                                         value="<?php esc_attr_e( 'Test' ); ?>" class="button button-primary" />
    390                                         </div>
    391                                 </div>
    392 
    393                                 <div id="clearout_result_div"></div>
    394                         </div>
     394
     395                        <div id="clearout_result_div"></div>
    395396                </div>
    396 
    397                 <?php
     397        </div>
     398
     399        <?php
    398400}
    399401
     
    542544 */
    543545function _co_filter_url_settings() {
    544         $options     = get_option( 'clearout_email_validator' );
     546        $options               = get_option( 'clearout_email_validator' );
    545547        $inclusion_filter_urls = isset( $options['inclusion_filter_urls'] ) ? sanitize_text_field( $options['inclusion_filter_urls'] ) : '';
    546548        echo '<input id="filter_urls" placeholder="Enter or Paste Form Page URL" name="clearout_email_validator[inclusion_filter_urls]" size="65" type="text" value="' . esc_html( $inclusion_filter_urls ) . '" style="margin-bottom: 5px;"/><span><strong>Note:</strong>&nbsp;Limit email validation to occur on the listed page URLs. Maximum of <strong>50 URLs are permitted</strong>, wildcard URL not supported.</span>';
     
    551553 */
    552554function _co_exclusion_filter_url_settings() {
    553         $options     = get_option( 'clearout_email_validator' );
     555        $options               = get_option( 'clearout_email_validator' );
    554556        $exclusion_filter_urls = isset( $options['exclusion_filter_urls'] ) ? sanitize_text_field( $options['exclusion_filter_urls'] ) : '';
    555557        echo '<input id="exclusion_filter_urls" placeholder="Enter or Paste Form Page URL" name="clearout_email_validator[exclusion_filter_urls]" size="65" type="text" value="' . esc_html( $exclusion_filter_urls ) . '" style="margin-bottom: 5px;"/><span><strong>Note:</strong>&nbsp;Limit email validation NOT to occur on the listed page URLs. Maximum of <strong>50 URLs are permitted</strong>, wildcard URL not supported.</span>';
     
    588590                'ise_on_off'        => 'off',
    589591                'frm_on_off'        => 'on',
     592                'wcr_on_off'        => 'on'
    590593        );
    591594        // Adding a global var with default and current settings to access them from JS during reset settings logic.
     
    608611                $wsf_on_off = isset( $options['wsf_on_off'] ) ? $options['wsf_on_off'] : 'on';
    609612                $frm_on_off = isset( $options['frm_on_off'] ) ? $options['frm_on_off'] : 'on';
     613                $wcr_on_off = isset( $options['wcr_on_off'] ) ? $options['wcr_on_off'] : 'on';
    610614        } else {
    611615                $fmf_on_off = isset( $options['fmf_on_off'] ) ? $options['fmf_on_off'] : 'off';
     
    624628                $wsf_on_off = isset( $options['wsf_on_off'] ) ? $options['wsf_on_off'] : 'off';
    625629                $frm_on_off = isset( $options['frm_on_off'] ) ? $options['frm_on_off'] : 'off';
     630                $wcr_on_off = isset( $options['wcr_on_off'] ) ? $options['wcr_on_off'] : 'off';
    626631        }
    627632
     
    629634        echo '<div><input type="checkbox" name="clearout_email_validator[cfb_on_off]" id="cfb_option" value="on"' . checked( $cfb_on_off, 'on', false ) . ' /><label>Contact Form Bws</label></div>';
    630635        echo '<div><input type="checkbox" name="clearout_email_validator[frm_on_off]" id="frm_option" value="on"' . checked( $frm_on_off, 'on', false ) . ' /><label>Forminator Form </label></div>';
    631         echo '<div><input type="checkbox" name="clearout_email_validator[cf7_on_off]" id="cf7_option" value="on"' . checked( $cf7_on_off, 'on', false ) . ' /><label>Contact Form 7</label></div>';
     636        echo '<div><input type="checkbox" name="clearout_email_validator[chf_on_off]" id="chf_option" value="on"' . checked( $chf_on_off, 'on', false ) . ' /><label>WooCommerce Checkout Form</label></div>';
    632637        echo '<div><input type="checkbox" name="clearout_email_validator[njf_on_off]" id="njf_option" value="on"' . checked( $njf_on_off, 'on', false ) . ' /><label>Ninja Forms </label></div>';
    633638        echo '<div><input type="checkbox" name="clearout_email_validator[gvf_on_off]" id="gvf_option" value="on"' . checked( $gvf_on_off, 'on', false ) . ' /><label>Gravity Form </label></div>';
    634639        echo '<div><input type="checkbox" name="clearout_email_validator[rgf_on_off]" id="rgf_option" value="on"' . checked( $rgf_on_off, 'on', false ) . ' /><label>Registration Form <i class="fa fa-info-circle apitoken-tooltip"><span class="tooltiptext">Default WordPress Registration Form</span></i></label></div>';
    635         echo '<div><input type="checkbox" name="clearout_email_validator[cmf_on_off]" id="cmf_option" value="on"' . checked( $cmf_on_off, 'on', false ) . ' /><label>Comment Form <i class="fa fa-info-circle apitoken-tooltip"><span class="tooltiptext">Default WordPress Comment Form</span></i></label></div>';
     640        echo '<div><input type="checkbox" name="clearout_email_validator[wcr_on_off]" id="wcr_on_off" value="on"' . checked( $wcr_on_off, 'on', false ) . ' /><label>WooCommerce Registration Form </label></div>';
    636641        echo '<div><input type="checkbox" name="clearout_email_validator[wpf_on_off]" id="wpf_option" value="on"' . checked( $wpf_on_off, 'on', false ) . ' /><label>WPForms </label></div>';
    637642        echo '<div><input type="checkbox" name="clearout_email_validator[msf_on_off]" id="msf_option" value="on"' . checked( $msf_on_off, 'on', false ) . ' /><label>Mailster Form </label></div>';
    638         echo '<div><input type="checkbox" name="clearout_email_validator[chf_on_off]" id="chf_option" value="on"' . checked( $chf_on_off, 'on', false ) . ' /><label>Checkout Form <i class="fa fa-info-circle apitoken-tooltip"><span class="tooltiptext">Default WooCommerce Checkout Form</span></i></label></div>';
    639         echo '<div><input type="checkbox" name="clearout_email_validator[pmp_on_off]" id="pmp_option" value="on"' . checked( $pmp_on_off, 'on', false ) . ' /><label>PM Pro Form <i class="fa fa-info-circle apitoken-tooltip"><span class="tooltiptext">Default Paid Memberships Pro Checkout Form</span></i></label></div>';
     643        echo '<div><input type="checkbox" name="clearout_email_validator[cf7_on_off]" id="cf7_option" value="on"' . checked( $cf7_on_off, 'on', false ) . ' /><label>Contact Form 7</label></div>';
     644        echo '<div><input type="checkbox" name="clearout_email_validator[cmf_on_off]" id="cmf_option" value="on"' . checked( $cmf_on_off, 'on', false ) . ' /><label>Comment Form <i class="fa fa-info-circle apitoken-tooltip"><span class="tooltiptext">Default WordPress Comment Form</span></i></label></div>';
    640645        echo '<div><input type="checkbox" name="clearout_email_validator[elm_on_off]" id="elm_option" value="on"' . checked( $elm_on_off, 'on', false ) . ' /><label>Elementor Form </label></div>';
    641646        echo '<div><input type="checkbox" name="clearout_email_validator[flf_on_off]" id="flf_option" value="on"' . checked( $flf_on_off, 'on', false ) . ' /><label>Fluent Form </label></div>';
    642647        echo '<div><input type="checkbox" name="clearout_email_validator[wsf_on_off]" id="wsf_option" value="on"' . checked( $wsf_on_off, 'on', false ) . ' /><label>WS Form </label></div>';
     648        echo '<div><input type="checkbox" name="clearout_email_validator[pmp_on_off]" id="pmp_option" value="on"' . checked( $pmp_on_off, 'on', false ) . ' /><label>PM Pro Form <i class="fa fa-info-circle apitoken-tooltip"><span class="tooltiptext">Default Paid Memberships Pro Checkout Form</span></i></label></div>';
    643649        echo '<div><input type="hidden" name="clearout_email_validator[options_initialized]" id="opi_option" value="yes"/></div></div>';
    644650}
     
    731737                'ise_on_off'        => '',
    732738                'frm_on_off'        => 'on',
     739                'wcr_on_off'        => 'on'
    733740        );
    734741        update_option( 'clearout_email_validator', $defaults );
  • clearout-email-validator/trunk/src/clearout-plugin.php

    r2894908 r3239399  
    6262// is_email hook.
    6363if ( ( isset( $clearout_options['ise_on_off'] ) == 'on' ) ) { // Other plugins that used is_email.
    64         add_filter( 'is_email', 'clearout_email_validator_filter', 1 );
     64        add_filter( 'is_email', 'clearout_email_validator_filter', 10 );
    6565}
    6666
     
    100100}
    101101
     102// WC Signup forms
     103
     104if ( ( isset( $clearout_options['wcr_on_off'] ) == 'on' ) ) {
     105        add_action( 'woocommerce_register_post', 'clearout_woocommerce_registration_email_validator', 1, 3 );
     106}
     107
    102108/**
    103109 * Action Handlers.
  • clearout-email-validator/trunk/src/clearout-validator.php

    r3236032 r3239399  
    10921092        return $submit_errors;
    10931093}
     1094
     1095
     1096/**
     1097 * WooCommerce Signup forms
     1098 *
     1099 * @param mixed $username UserName
     1100 * @param mixed $user_email User EMail
     1101 * @param mixed $errors return Errors
     1102 */
     1103function clearout_woocommerce_registration_email_validator( $username, $user_email, $errors ) {
     1104        $clearout_form_source = 'wooregister';
     1105
     1106        // Get Clearout settings
     1107        $clearout_options = get_option( 'clearout_email_validator' );
     1108        $is_valid_email   = true;
     1109
     1110        // Check if API key is set and email is provided
     1111        if ( ! empty( $clearout_options['api_key'] ) && ! empty( $user_email ) ) {
     1112                // Perform email validation
     1113                $validation_result = _co_email_validation( $user_email, $clearout_options, $clearout_form_source );
     1114
     1115                if ( is_array( $validation_result ) && array_key_exists( 'status', $validation_result ) ) {
     1116                        if ( false === $validation_result['status'] ) {
     1117                                $is_valid_email = false;
     1118
     1119                                // Remove all existing errors related to email validation
     1120                                foreach ( $errors->get_error_codes() as $code ) {
     1121                                        $errors->remove( $code );
     1122                                }
     1123
     1124                                // Use custom error message if configured
     1125                                if ( _check_custom_error_msg_exist( $clearout_options ) ) {
     1126                                        $errors->add( 'validation', $clearout_options['custom_invalid_error'] );
     1127                                        return;
     1128                                }
     1129
     1130                                // Fallback to default error message
     1131                                $error_message = _get_error_message( $validation_result['reason'] );
     1132                                $errors->add( 'validation', $error_message );
     1133                                return;
     1134                        }
     1135                }
     1136        }
     1137}
Note: See TracChangeset for help on using the changeset viewer.