Plugin Directory

Changeset 3260773


Ignore:
Timestamp:
03/24/2025 12:07:35 PM (12 months ago)
Author:
liquid11
Message:

Version 1.0.7

Location:
data-soap-validation/trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • data-soap-validation/trunk/datasoap-validation.php

    r2818859 r3260773  
    55Description: This plugin integrates Data Soap telephone and and email validation in WooCommerce, Gravity Forms, WPForms, Elementor Pro and Contact Form 7
    66Author: DataSoap
    7 Version: 1.0.6
     7Version: 1.0.7
    88WC requires at least: 2.2.3
    9 WC tested up to: 6.0.1
     9WC tested up to: 6.7.2
    1010*/
    1111
    12 /*  Copyright 2022 Liquid11 Data Ltd. All Rights Reserved.
     12/*  Copyright 2025 Liquid11 Data Ltd. All Rights Reserved.
    1313*/
    1414
  • data-soap-validation/trunk/includes/dsvcf7-validation.php

    r2797046 r3260773  
    4141            }
    4242
    43             if ($apiResult['valid'] == false || $apiResult['valid'] == true && isset($apiResult['errors']))
    44                 $result->invalidate( $tag, "Please enter a valid phone number" );
     43      if ($apiResult['valid'] == false || ($apiResult['valid'] == true && isset($apiResult['errors']))) {
     44        $relevantErrors = array_filter($apiResult['errors'], function ($error) {
     45            return $error['code'] != '-98';
     46        });
     47   
     48        if (!empty($relevantErrors)) {
     49            $result->invalidate($tag, "Please enter a valid phone number");
     50        }
     51      }
    4552        }
    4653        else{
  • data-soap-validation/trunk/includes/dsvep-validation.php

    r2797046 r3260773  
    2929        }
    3030
    31         if ($apiResult['valid'] == false || $apiResult['valid'] == true && isset($apiResult['errors']))
    32             $ajax_handler->add_error( $field['id'], 'Please enter a valid phone number' );
     31    if ($apiResult['valid'] == false || ($apiResult['valid'] == true && isset($apiResult['errors']))) {
     32      $relevantErrors = array_filter($apiResult['errors'], function ($error) {
     33          return $error['code'] != '-98';
     34      });
     35 
     36      if (!empty($relevantErrors)) {
     37          $ajax_handler->add_error($field['id'], 'Please enter a valid phone number');
     38      }
     39  }
    3340    }
    3441    else{
  • data-soap-validation/trunk/includes/dsvgf-validation.php

    r2797046 r3260773  
    11<?php
    22
    3 if (get_option('dsv_telephone_validation')) 
    4     add_filter( 'gform_field_validation', 'validate_telephone_datasoap_gf', 10, 4 );
     3if (get_option('dsv_telephone_validation'))
     4  add_filter('gform_field_validation', 'validate_telephone_datasoap_gf', 10, 4);
    55
    6 function validate_telephone_datasoap_gf( $result, $value, $form, $field ) {
    7     $current_page = rgpost( 'gform_source_page_number_' . $form['id'] ) ? rgpost( 'gform_source_page_number_' . $form['id'] ) : 1;
    8     if ( $field->get_input_type() === 'phone' && $result['is_valid'] && $value != '' && $field->pageNumber == $current_page) {
    9        
    10         $params = array(
    11             'lookup' => $value,
    12             'checks' => array (
    13                 'Auto'
    14             )
    15         );
    16        
    17         $dsv_token = get_option('dsv_token');
     6function validate_telephone_datasoap_gf($result, $value, $form, $field)
     7{
     8  $current_page = rgpost('gform_source_page_number_' . $form['id']) ? rgpost('gform_source_page_number_' . $form['id']) : 1;
     9  if ($field->get_input_type() === 'phone' && $result['is_valid'] && $value != '' && $field->pageNumber == $current_page) {
    1810
    19         if($dsv_token != "") {
    20             $apiResult = sendDataSoapValidationRequest($params, $dsv_token);
    21        
    22             if(!isset($apiResult['valid'])){
    23                 $result['is_valid'] = false;
    24                 $result['message'] = "Please enter a valid phone number";
    25                 return $result;
    26             }
     11    $params = array(
     12      'lookup' => $value,
     13      'checks' => array(
     14        'Auto'
     15      )
     16    );
    2717
    28             if ($apiResult['valid'] == false || $apiResult['valid'] == true && isset($apiResult['errors'])) {
    29                 $result['is_valid'] = false;
    30                 $result['message'] = "Please enter a valid phone number";
    31             }
    32         }
    33         else{
    34             $params = array(
    35                 'lookup' => $value,
    36                 'checks' => array (
    37                     'Syntax'
    38                 )
    39             );
    40    
    41             $apiResult = sendDataSoapValidationRequest($params, "");
     18    $dsv_token = get_option('dsv_token');
    4219
    43             if(!isset($apiResult['valid'])){
    44                 $result['is_valid'] = false;
    45                 $result['message'] = "Please enter a valid phone number";
    46                 return $result;
    47             }
     20    if ($dsv_token != "") {
     21      $apiResult = sendDataSoapValidationRequest($params, $dsv_token);
    4822
    49             if ($apiResult['valid'] == false && !isset($apiResult['errors']))
    50                 $result['is_valid'] = false;
    51                 $result['message'] = "Please enter a valid phone number";
    52         }
    53     }
    54     return $result;
     23      if (!isset($apiResult['valid'])) {
     24        $result['is_valid'] = false;
     25        $result['message'] = "Please enter a valid phone number";
     26        return $result;
     27      }
     28
     29      if ($apiResult['valid'] == false || ($apiResult['valid'] == true && isset($apiResult['errors']))) {
     30        // Filter out the "Insufficient credit" error (-98)
     31        $relevantErrors = array_filter($apiResult['errors'], function ($error) {
     32          return $error['code'] != '-98';
     33        });
     34
     35        if (!empty($relevantErrors)) {
     36          $result['is_valid'] = false;
     37          $result['message'] = "Please enter a valid phone number";
     38        }
     39      }
     40    } else {
     41      $params = array(
     42        'lookup' => $value,
     43        'checks' => array(
     44          'Syntax'
     45        )
     46      );
     47
     48      $apiResult = sendDataSoapValidationRequest($params, "");
     49
     50      if (!isset($apiResult['valid'])) {
     51        $result['is_valid'] = false;
     52        $result['message'] = "Please enter a valid phone number";
     53        return $result;
     54      }
     55
     56      if ($apiResult['valid'] == false && !isset($apiResult['errors']))
     57        $result['is_valid'] = false;
     58      $result['message'] = "Please enter a valid phone number";
     59    }
     60  }
     61  return $result;
    5562}
    56    
     63
    5764if (get_option('dsv_email_validation'))
    58     add_filter( 'gform_field_validation', 'validate_email_address_datasoap_gf', 10, 4 );
     65  add_filter('gform_field_validation', 'validate_email_address_datasoap_gf', 10, 4);
    5966
    60 function validate_email_address_datasoap_gf( $result, $value, $form, $field ) {
    61     $current_page = rgpost( 'gform_source_page_number_' . $form['id'] ) ? rgpost( 'gform_source_page_number_' . $form['id'] ) : 1;
    62     if ( $field->get_input_type() === 'email' && $result['is_valid'] && $value != '' && $field->pageNumber == $current_page) {
     67function validate_email_address_datasoap_gf($result, $value, $form, $field)
     68{
     69  $current_page = rgpost('gform_source_page_number_' . $form['id']) ? rgpost('gform_source_page_number_' . $form['id']) : 1;
     70  if ($field->get_input_type() === 'email' && $result['is_valid'] && $value != '' && $field->pageNumber == $current_page) {
    6371
    64         $params = array(
    65             'lookup' => $value,
    66             'checks' => array (
    67                 'Email'
    68             )
    69         );
    70        
    71         $dsv_token = get_option('dsv_token');
     72    $params = array(
     73      'lookup' => $value,
     74      'checks' => array(
     75        'Email'
     76      )
     77    );
    7278
    73         if($dsv_token != "") {
    74             $apiResult = sendDataSoapValidationRequest($params, $dsv_token);
    75        
    76             if(!isset($apiResult['valid'])){
    77                 $result['is_valid'] = false;
    78                 $result['message'] = "Please enter a valid email address";
    79                 return $result;
    80             }
     79    $dsv_token = get_option('dsv_token');
    8180
    82             if ($apiResult['valid'] == false) {
    83                 $result['is_valid'] = false;
    84                 $result['message'] = "Please enter a valid email address";
    85             }
    86         }
    87         else{
    88             $params = array(
    89                 'lookup' => $value,
    90                 'checks' => array (
    91                     'Syntax'
    92                 )
    93             );
    94    
    95             $apiResult = sendDataSoapValidationRequest($params, "");
     81    if ($dsv_token != "") {
     82      $apiResult = sendDataSoapValidationRequest($params, $dsv_token);
    9683
    97             if(!isset($apiResult['valid'])){
    98                 $result['is_valid'] = false;
    99                 $result['message'] = "Please enter a valid email address";
    100                 return $result;
    101             }
     84      if (!isset($apiResult['valid'])) {
     85        $result['is_valid'] = false;
     86        $result['message'] = "Please enter a valid email address";
     87        return $result;
     88      }
    10289
    103             if ($apiResult['valid'] == false) {
    104                 $result['is_valid'] = false;
    105                 $result['message'] = "Please enter a valid email address";
    106         }
    107     }
     90      if ($apiResult['valid'] == false) {
     91        $result['is_valid'] = false;
     92        $result['message'] = "Please enter a valid email address";
     93      }
     94    } else {
     95      $params = array(
     96        'lookup' => $value,
     97        'checks' => array(
     98          'Syntax'
     99        )
     100      );
    108101
    109     return $result;
    110     }
     102      $apiResult = sendDataSoapValidationRequest($params, "");
     103
     104      if (!isset($apiResult['valid'])) {
     105        $result['is_valid'] = false;
     106        $result['message'] = "Please enter a valid email address";
     107        return $result;
     108      }
     109
     110      if ($apiResult['valid'] == false) {
     111        $result['is_valid'] = false;
     112        $result['message'] = "Please enter a valid email address";
     113      }
     114    }
     115
     116    return $result;
     117  }
    111118}
    112 ?>
  • data-soap-validation/trunk/includes/dsvwc-validation.php

    r2797046 r3260773  
    33add_action('woocommerce_checkout_process', 'dsvwc_validate');
    44
    5 function dsvwc_validate(){
     5function dsvwc_validate()
     6{
    67
    7     // telephone validation
    8     if(get_option('dsv_telephone_validation'))
    9         validate_telephone_datasoap_number_wc('billing_phone');
     8  // telephone validation
     9  if (get_option('dsv_telephone_validation'))
     10    validate_telephone_datasoap_number_wc('billing_phone');
    1011
    11     // email validation
    12     if(get_option('dsv_email_validation'))
    13         validate_email_address_datasoap_wc('billing_email');
     12  // email validation
     13  if (get_option('dsv_email_validation'))
     14    validate_email_address_datasoap_wc('billing_email');
    1415}
    1516
    16 function validate_telephone_datasoap_number_wc($name) {
    17     $sanitisedNumber = '';
    18    
    19     if(isset($_POST[$name])){
    20         $sanitisedNumber = sanitize_text_field($_POST[$name]);
    21     }
     17function validate_telephone_datasoap_number_wc($name)
     18{
     19  $sanitisedNumber = '';
    2220
    23     $number = $sanitisedNumber;
     21  if (isset($_POST[$name])) {
     22    $sanitisedNumber = sanitize_text_field($_POST[$name]);
     23  }
    2424
    25     if ('' == $number)
    26         return;
    27     elseif ( '' != $number) {
    28         $dsv_token = get_option('dsv_token');
     25  $number = $sanitisedNumber;
    2926
    30         if($dsv_token != "")
    31         {
    32             $params = array(
    33                 'lookup' => $number,
    34                 'checks' => array (
    35                     'Auto'
    36                 )
    37             );
     27  if ('' == $number)
     28    return;
     29  elseif ('' != $number) {
     30    $dsv_token = get_option('dsv_token');
    3831
    39             $apiResult = sendDataSoapValidationRequest($params, $dsv_token);
     32    if ($dsv_token != "") {
     33      $params = array(
     34        'lookup' => $number,
     35        'checks' => array(
     36          'Auto'
     37        )
     38      );
    4039
    41             if(!isset($apiResult['valid'])){
    42                 wc_add_notice(__('Please enter a valid phone number'), 'error' );
    43                 return;
    44             }
     40      $apiResult = sendDataSoapValidationRequest($params, $dsv_token);
    4541
    46             if ($apiResult['valid'] == false || $apiResult['valid'] == true && isset($apiResult['errors']))
    47                 wc_add_notice(__('Please enter a valid phone number'), 'error' );
    48         }
    49         else{
    50             $params = array(
    51                 'lookup' => $number,
    52                 'checks' => array (
    53                     'Syntax'
    54                 )
    55             );
     42      if (!isset($apiResult['valid'])) {
     43        wc_add_notice(__('Please enter a valid phone number'), 'error');
     44        return;
     45      }
    5646
    57             $apiResult = sendDataSoapValidationRequest($params, "");
     47      if ($apiResult['valid'] == false || ($apiResult['valid'] == true && isset($apiResult['errors']))) {
     48        // Filter out the "Insufficient credit" error (-98)
     49        $relevantErrors = array_filter($apiResult['errors'], function ($error) {
     50          return $error['code'] != '-98';
     51        });
    5852
    59             if(!isset($apiResult['valid'])){
    60                 wc_add_notice(__('Please enter a valid phone number'), 'error' );
    61                 return;
    62             }
     53        if (!empty($relevantErrors)) {
     54          wc_add_notice(__('Please enter a valid phone number'), 'error');
     55        }
     56      }
     57    } else {
     58      $params = array(
     59        'lookup' => $number,
     60        'checks' => array(
     61          'Syntax'
     62        )
     63      );
    6364
    64             if ($apiResult['valid'] == false && !isset($apiResult['errors']))
    65                 wc_add_notice(__('Please enter a valid phone number'), 'error' );
    66         }
    67     }
     65      $apiResult = sendDataSoapValidationRequest($params, "");
     66
     67      if (!isset($apiResult['valid'])) {
     68        wc_add_notice(__('Please enter a valid phone number'), 'error');
     69        return;
     70      }
     71
     72      if ($apiResult['valid'] == false && !isset($apiResult['errors']))
     73        wc_add_notice(__('Please enter a valid phone number'), 'error');
     74    }
     75  }
    6876}
    6977
    70 function validate_email_address_datasoap_wc($name) {
    71     $sanitisedEmail = '';
    72    
    73     if(isset($_POST[$name])){
    74         $sanitisedEmail = sanitize_email($_POST[$name]);
    75     }
     78function validate_email_address_datasoap_wc($name)
     79{
     80  $sanitisedEmail = '';
    7681
    77     $email = $sanitisedEmail;
     82  if (isset($_POST[$name])) {
     83    $sanitisedEmail = sanitize_email($_POST[$name]);
     84  }
    7885
    79     if ('' == $email)
    80         return;
     86  $email = $sanitisedEmail;
    8187
    82     $dsv_token = get_option('dsv_token');
    83        
    84     if($dsv_token != "")
    85     {
    86         $params = array(
    87             'lookup' => $email,
    88             'checks' => array (
    89                 'Email'
    90             )
    91         );
     88  if ('' == $email)
     89    return;
    9290
    93         $apiResult = sendDataSoapValidationRequest($params, $dsv_token);
     91  $dsv_token = get_option('dsv_token');
    9492
    95         if(!isset($apiResult['valid'])){
    96             wc_add_notice(__('Please enter a valid email address'), 'error' );
    97             return;
    98         }
     93  if ($dsv_token != "") {
     94    $params = array(
     95      'lookup' => $email,
     96      'checks' => array(
     97        'Email'
     98      )
     99    );
    99100
    100         if ($apiResult['valid'] == false)
    101             wc_add_notice(__('Please enter a valid email address'), 'error' );
    102     }
    103     else{
    104         $params = array(
    105             'lookup' => $email,
    106             'checks' => array (
    107                 'Syntax'
    108             )
    109         );
     101    $apiResult = sendDataSoapValidationRequest($params, $dsv_token);
    110102
    111         $apiResult = sendDataSoapValidationRequest($params, "");
     103    if (!isset($apiResult['valid'])) {
     104      wc_add_notice(__('Please enter a valid email address'), 'error');
     105      return;
     106    }
    112107
    113         if(!isset($apiResult['valid'])){
    114             wc_add_notice(__('Please enter a valid email address'), 'error' );
    115             return;
    116         }
     108    if ($apiResult['valid'] == false)
     109      wc_add_notice(__('Please enter a valid email address'), 'error');
     110  } else {
     111    $params = array(
     112      'lookup' => $email,
     113      'checks' => array(
     114        'Syntax'
     115      )
     116    );
    117117
    118         if ($apiResult['valid'] == false)
    119             wc_add_notice(__('Please enter a valid email address'), 'error' );
    120     }
     118    $apiResult = sendDataSoapValidationRequest($params, "");
     119
     120    if (!isset($apiResult['valid'])) {
     121      wc_add_notice(__('Please enter a valid email address'), 'error');
     122      return;
     123    }
     124
     125    if ($apiResult['valid'] == false)
     126      wc_add_notice(__('Please enter a valid email address'), 'error');
     127  }
    121128}
    122 
    123 ?>
  • data-soap-validation/trunk/includes/dsvwpf-validation.php

    r2797046 r3260773  
    11<?php
    22
    3 if (get_option('dsv_telephone_validation')){
    4     add_action( 'wpforms_process_validate_phone', 'validate_telephone_datasoap_number_wpf', 10, 3 );
     3if (get_option('dsv_telephone_validation')) {
     4  add_action('wpforms_process_validate_phone', 'validate_telephone_datasoap_number_wpf', 10, 3);
    55}
    66
    7 function validate_telephone_datasoap_number_wpf( $field_id, $field_submit, $form_data ) {
    8     $number = $field_submit;
    9     if($field_submit == null){
    10         return;
    11     }
     7function validate_telephone_datasoap_number_wpf($field_id, $field_submit, $form_data)
     8{
     9  $number = $field_submit;
     10  if ($field_submit == null) {
     11    return;
     12  }
    1213
    13     $number = sanitize_text_field($field_submit);
    14     $dsv_token = get_option('dsv_token');
     14  $number = sanitize_text_field($field_submit);
     15  $dsv_token = get_option('dsv_token');
    1516
    16     if($dsv_token != ""){
    17         $params = array(
    18             'lookup' => $number,
    19             'checks' => array (
    20                 'Auto'
    21             )
    22         );
    23    
    24        
    25         $apiResult = sendDataSoapValidationRequest($params, $dsv_token);
    26    
    27         if(!isset($apiResult['valid'])){
    28             wpforms()->process->errors[ $form_data['id']]['header'] = esc_html__( 'Some details invalid', 'plugin-domain' );
    29             wpforms()->process->errors[ $form_data['id'] ] [$field_id] = esc_html__('Please enter a valid phone number', 'plugin-domain');
    30             return;
    31         }
     17  if ($dsv_token != "") {
     18    $params = array(
     19      'lookup' => $number,
     20      'checks' => array(
     21        'Auto'
     22      )
     23    );
    3224
    33         if ($apiResult['valid'] == false || $apiResult['valid'] == true && isset($apiResult['errors'])) {
    34             wpforms()->process->errors[ $form_data['id']]['header'] = esc_html__( 'Some details invalid', 'plugin-domain' );
    35             wpforms()->process->errors[ $form_data['id'] ] [$field_id] = esc_html__('Please enter a valid phone number', 'plugin-domain');
    36         }
    37     }
    38     else{
    39         $params = array(
    40             'lookup' => $number,
    41             'checks' => array (
    42                 'Syntax'
    43             )
    44         );
    4525
    46         $apiResult = sendDataSoapValidationRequest($params, "");
     26    $apiResult = sendDataSoapValidationRequest($params, $dsv_token);
    4727
    48         if(!isset($apiResult['valid'])){
    49             wpforms()->process->errors[ $form_data['id']]['header'] = esc_html__( 'Some details invalid', 'plugin-domain' );
    50             wpforms()->process->errors[ $form_data['id'] ] [$field_id] = esc_html__('Please enter a valid phone number', 'plugin-domain');
    51             return;
    52         }
     28    if (!isset($apiResult['valid'])) {
     29      wpforms()->process->errors[$form_data['id']]['header'] = esc_html__('Some details invalid', 'plugin-domain');
     30      wpforms()->process->errors[$form_data['id']][$field_id] = esc_html__('Please enter a valid phone number', 'plugin-domain');
     31      return;
     32    }
    5333
    54         if ($apiResult['valid'] == false && !isset($apiResult['errors']))
    55             wpforms()->process->errors[ $form_data['id']]['header'] = esc_html__( 'Some details invalid', 'plugin-domain' );
    56             wpforms()->process->errors[ $form_data['id'] ] [$field_id] = esc_html__('Please enter a valid phone number', 'plugin-domain');
    57     }
     34    if ($apiResult['valid'] == false || ($apiResult['valid'] == true && isset($apiResult['errors']))) {
     35      // Filter out the "Insufficient credit" error (-98)
     36      $relevantErrors = array_filter($apiResult['errors'], function ($error) {
     37        return $error['code'] != '-98';
     38      });
     39
     40      if (!empty($relevantErrors)) {
     41        wpforms()->process->errors[$form_data['id']]['header'] = esc_html__('Some details invalid', 'plugin-domain');
     42        wpforms()->process->errors[$form_data['id']][$field_id] = esc_html__('Please enter a valid phone number', 'plugin-domain');
     43      }
     44    }
     45  } else {
     46    $params = array(
     47      'lookup' => $number,
     48      'checks' => array(
     49        'Syntax'
     50      )
     51    );
     52
     53    $apiResult = sendDataSoapValidationRequest($params, "");
     54
     55    if (!isset($apiResult['valid'])) {
     56      wpforms()->process->errors[$form_data['id']]['header'] = esc_html__('Some details invalid', 'plugin-domain');
     57      wpforms()->process->errors[$form_data['id']][$field_id] = esc_html__('Please enter a valid phone number', 'plugin-domain');
     58      return;
     59    }
     60
     61    if ($apiResult['valid'] == false && !isset($apiResult['errors']))
     62      wpforms()->process->errors[$form_data['id']]['header'] = esc_html__('Some details invalid', 'plugin-domain');
     63    wpforms()->process->errors[$form_data['id']][$field_id] = esc_html__('Please enter a valid phone number', 'plugin-domain');
     64  }
    5865}
    5966
    60 if (get_option('dsv_email_validation')){
    61     add_action( 'wpforms_process', 'validate_email_address_datasoap_wpf', 10, 3 );
     67if (get_option('dsv_email_validation')) {
     68  add_action('wpforms_process', 'validate_email_address_datasoap_wpf', 10, 3);
    6269}
    6370
    64 function validate_email_address_datasoap_wpf( $fields, $entry, $form_data ) {
    65     $email = "";
    66     $dsv_token = get_option('dsv_token');
     71function validate_email_address_datasoap_wpf($fields, $entry, $form_data)
     72{
     73  $email = "";
     74  $dsv_token = get_option('dsv_token');
    6775
    68     //check fields for email
    69     foreach ( $fields as $field_id => $field ) {
    70         //if field type is email run validation logic
    71         if($field['type'] == "email"){
    72             $email = sanitize_email($field['value']);
    73             $emailId = sanitize_text_field($field['id']);
     76  //check fields for email
     77  foreach ($fields as $field_id => $field) {
     78    //if field type is email run validation logic
     79    if ($field['type'] == "email") {
     80      $email = sanitize_email($field['value']);
     81      $emailId = sanitize_text_field($field['id']);
    7482
    75             //return if email blank, setting field to required can be done in WPForms
    76             if($email == ""){
    77                 continue;
    78             }
     83      //return if email blank, setting field to required can be done in WPForms
     84      if ($email == "") {
     85        continue;
     86      }
    7987
    80             if($dsv_token != ""){
    81                 $params = array(
    82                     'lookup' => $email,
    83                     'checks' => array (
    84                         'Email'
    85                     )
    86                 );
    87                
    88                 $apiResult = sendDataSoapValidationRequest($params, $dsv_token);
    89    
    90                 if(!isset($apiResult['valid'])){
    91                     wpforms()->process->errors[ $form_data['id']]['header'] = esc_html__( 'Some details invalid', 'plugin-domain' );
    92                     wpforms()->process->errors[ $form_data['id'] ] [$emailId] = esc_html__('Please enter a valid email address', 'plugin-domain');
    93                     return;
    94                 }
     88      if ($dsv_token != "") {
     89        $params = array(
     90          'lookup' => $email,
     91          'checks' => array(
     92            'Email'
     93          )
     94        );
    9595
    96                 if ($apiResult['valid'] == false){
    97                     wpforms()->process->errors[ $form_data['id']]['header'] = esc_html__( 'Some details invalid', 'plugin-domain' );
    98                     wpforms()->process->errors[ $form_data['id'] ] [$emailId] = esc_html__('Please enter a valid email address', 'plugin-domain');
    99                 }
    100             }
    101             else{
    102                 $params = array(
    103                     'lookup' => $email,
    104                     'checks' => array (
    105                         'Syntax'
    106                     )
    107                 );
    108        
    109                 $apiResult = sendDataSoapValidationRequest($params, "");
    110        
    111                 if(!isset($apiResult['valid'])){
    112                     wpforms()->process->errors[ $form_data['id']]['header'] = esc_html__( 'Some details invalid', 'plugin-domain' );
    113                     wpforms()->process->errors[ $form_data['id'] ] [$emailId] = esc_html__('Please enter a valid email address', 'plugin-domain');
    114                     return;
    115                 }
     96        $apiResult = sendDataSoapValidationRequest($params, $dsv_token);
    11697
    117                 if ($apiResult['valid'] == false)
    118                     wpforms()->process->errors[ $form_data['id']]['header'] = esc_html__( 'Some details invalid', 'plugin-domain' );
    119                     wpforms()->process->errors[ $form_data['id'] ] [$emailId] = esc_html__('Please enter a valid email address', 'plugin-domain');
    120             }
    121         }   
     98        if (!isset($apiResult['valid'])) {
     99          wpforms()->process->errors[$form_data['id']]['header'] = esc_html__('Some details invalid', 'plugin-domain');
     100          wpforms()->process->errors[$form_data['id']][$emailId] = esc_html__('Please enter a valid email address', 'plugin-domain');
     101          return;
     102        }
     103
     104        if ($apiResult['valid'] == false) {
     105          wpforms()->process->errors[$form_data['id']]['header'] = esc_html__('Some details invalid', 'plugin-domain');
     106          wpforms()->process->errors[$form_data['id']][$emailId] = esc_html__('Please enter a valid email address', 'plugin-domain');
     107        }
     108      } else {
     109        $params = array(
     110          'lookup' => $email,
     111          'checks' => array(
     112            'Syntax'
     113          )
     114        );
     115
     116        $apiResult = sendDataSoapValidationRequest($params, "");
     117
     118        if (!isset($apiResult['valid'])) {
     119          wpforms()->process->errors[$form_data['id']]['header'] = esc_html__('Some details invalid', 'plugin-domain');
     120          wpforms()->process->errors[$form_data['id']][$emailId] = esc_html__('Please enter a valid email address', 'plugin-domain');
     121          return;
     122        }
     123
     124        if ($apiResult['valid'] == false)
     125          wpforms()->process->errors[$form_data['id']]['header'] = esc_html__('Some details invalid', 'plugin-domain');
     126        wpforms()->process->errors[$form_data['id']][$emailId] = esc_html__('Please enter a valid email address', 'plugin-domain');
     127      }
    122128    }
     129  }
    123130}
    124 
    125 ?>
  • data-soap-validation/trunk/plugin_interface.php

    r2818859 r3260773  
    4444                'Content-Type' => 'application/json',
    4545                'Authorization' => "Bearer {$bearerToken}",
    46                 'Lib-Version' => 'WordPress-1.0.6'
     46                'Lib-Version' => 'WordPress-1.0.7'
    4747            ),
    4848            'body' => $encodedBody,
  • data-soap-validation/trunk/readme.txt

    r2818859 r3260773  
    33Tags: woocommerce, gravity, gravity forms, gravityforms, elementor, elementor pro, contact form 7, contactform7, cf7, data validation, data, form, international, mobile, phone, validation, verification
    44Requires at least: 4.5
    5 Tested up to: 6.1
    6 Stable tag: 1.0.6
     5Tested up to: 6.7.2
     6Stable tag: 1.0.7
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    5252 * Adjusted API call
    5353
     54 = 1.0.7 =
     55 * Bug fix + tested for 6.7.2
     56
    5457== Frequently Asked Questions ==
    5558
Note: See TracChangeset for help on using the changeset viewer.