Plugin Directory

Changeset 2794226


Ignore:
Timestamp:
10/04/2022 07:14:07 PM (3 years ago)
Author:
textp2p
Message:

Google reCaptcha Added

Location:
textp2p-texting-widget/trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • textp2p-texting-widget/trunk/assets/css/im-textp2p.css

    r2404868 r2794226  
    689689.im__chat__form__block__ThankyouText , .Im__TextInput__TextInputError{ display: none;}
    690690.im-Error{ font-size:10px; color: red; }
     691
     692#im-gcaptcha-wrapper .Im__TextInput__TextInputError{
     693    top:initial;
     694}
     695#im-gcaptcha-v2, #im-gcaptcha-v2 div{
     696    width:100%!important;
     697    position:relative!important;
     698}
     699#im-gcaptcha-v2 div iframe{
     700    width:100%!important;
     701    position:absolute!important;
     702}
     703#im-gcaptcha-v2, #im-gcaptcha-v2 iframe div{
     704    position:relative!important;
     705}
  • textp2p-texting-widget/trunk/assets/js/im-textp2p.js

    r2175790 r2794226  
    1 /* Copyright 2019 Harshal Dhingra*/
     1/* Copyright 2019-2022 Harshal Dhingra*/
     2
     3function imCaptchaV2(){
     4    console.log('imCaptchaV2 loaded!');
     5    grecaptcha.render('im-gcaptcha-v2', {
     6        'sitekey': ImAjax.imGcaptchaSiteKey,
     7        'theme' : ImAjax.imGcaptchaTheme
     8
     9    });
     10}
     11
     12function imCaptchaV3(){
     13    console.log('imCaptchaV3 loaded!');
     14    grecaptcha.execute(ImAjax.imGcaptchaSiteKey, {action: 'submit'}).then(function(token) { 
     15         let response =  document.getElementById('im-token-generate');
     16             response.value = token;
     17    });
     18    setTimeout(imCaptchaV3, 1000 * 60);
     19}
    220jQuery(function(){ 
    3    
     21
    422    jQuery("#im-fname, #im-lname, #im-phone, #im-email, #im-msg").on('input',function(){
    523    var imErrorMsg = jQuery(".im-Error");
     
    106124    });
    107125   
    108    
    109     function imSubmitContact(){
    110        
     126
     127
     128function imSubmitContact(){
     129       console.log('textp2p-submit');
    111130       var imFrontFirst = jQuery("#im-fname");
    112131       var imFrontLast = jQuery("#im-lname");
     
    114133       var imFrontEmail = jQuery("#im-email");
    115134       var imFrontMsg = jQuery("#im-msg");
     135       
    116136       var imThanksText = jQuery(".im__chat__form__block__ThankyouText");
    117137       var imChatFormBlock = jQuery(".im__chat__form__block__FormContent");
     
    127147       var imFrontMsgError   = jQuery("#im-msg-wrapper .Im__TextInput__TextInputError");
    128148       var imFrontPhoneCheckbox = jQuery("#im-phone-wrapper .Im__TextInput__Checkmark");
     149       var imFrontGCaptchError   = jQuery("#im-gcaptcha-wrapper .Im__TextInput__TextInputError");
    129150       var imFirstName =  imFrontFirst.val();
    130151       var imLastName =  imFrontLast.val();
     
    132153       var imEmail =  imFrontEmail.val();
    133154       var imMessage =  imFrontMsg.val();
     155       
    134156       var imFirstError = false;
    135157       var imEmailError = false;
     
    137159       var imLastError = false;
    138160       var imMsgError = false;
     161       var imGCaptchaError = false;
    139162       var regex = /^([a-zA-Z0-9_\.\-\+])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
    140        if(imFirstName === ""){ imFrontFirstError.show(); imFirstError = false; }else{ imFrontFirstError.hide(); imFirstError = true;}
    141        if(imLastName === "" && imFrontEmail.hasClass("im-lname-required")){ imLastError = false; imFrontLastError.show();}else{ imFrontLastError.hide(); imLastError = true; }
    142        if(imEmail === "" && imFrontEmail.hasClass("im-email-required")){ imEmailError = false; imFrontEmailError.show();}else if(!regex.test(imEmail) && imFrontEmail.hasClass("im-email-required")){ imEmailError = false; imFrontEmailError.text('Invalid Format'); imFrontEmailError.show(); }else{ imFrontEmailError.hide(); imEmailError = true;}
    143        if(imPhone === ""){ imFrontPhoneError.show(); imPhoneError = false;}else if(imPhone.length < '10'){imPhoneError = false; imFrontPhoneError.text('Too Short'); imFrontPhoneError.show(); imFrontPhoneCheckbox.hide(); }else if(imPhone.length >=13){imPhoneError = false; imFrontPhoneError.text('Too long'); imFrontPhoneError.show(); imFrontPhoneCheckbox.hide(); }else{ imFrontPhoneError.hide(); imPhoneError = true;}   
    144        if(imMessage === ""){ imFrontMsgError.show(); imMsgError = false;}else{ imFrontMsgError.hide(); imMsgError = true;}
    145  
    146        if(imFirstError === true && imLastError === true && imEmailError === true && imPhoneError === true && imMsgError === true){
    147      
    148        jQuery.ajax({
    149             type: "post",
    150             url:  ImAjax.ajaxurl,
    151             data: {action: "im_textp2p_send_form_data", im_first_name: imFirstName,  im_last_name: imLastName, im_phone: imPhone, im_email: imEmail, im_message: imMessage  },
    152             beforeSend: function() {
    153            
    154               },
    155             success: function(data){
    156 
    157             var obj = jQuery.parseJSON(data);
    158             var imVerifyCode = obj.code;
    159             var imContent = obj.content;
    160            
    161             if(imVerifyCode == "200"){
    162              
    163                 imChatFormContainer.hide();
    164                 imThanksText.show();
    165                 imErrorMsg.hide();
    166                 imErrorMsg.html('');
    167                
     163        if(imFirstName === ""){ imFrontFirstError.show(); imFirstError = false; }else{ imFrontFirstError.hide(); imFirstError = true;}
     164        if(imLastName === "" && imFrontEmail.hasClass("im-lname-required")){ imLastError = false; imFrontLastError.show();}else{ imFrontLastError.hide(); imLastError = true; }
     165        if(imEmail === "" && imFrontEmail.hasClass("im-email-required")){ imEmailError = false; imFrontEmailError.show();}else if(!regex.test(imEmail) && imFrontEmail.hasClass("im-email-required")){ imEmailError = false; imFrontEmailError.text('Invalid Format'); imFrontEmailError.show(); }else{ imFrontEmailError.hide(); imEmailError = true;}
     166        if(imPhone === ""){ imFrontPhoneError.show(); imPhoneError = false;}else if(imPhone.length < '10'){imPhoneError = false; imFrontPhoneError.text('Too Short'); imFrontPhoneError.show(); imFrontPhoneCheckbox.hide(); }else if(imPhone.length >=13){imPhoneError = false; imFrontPhoneError.text('Too long'); imFrontPhoneError.show(); imFrontPhoneCheckbox.hide(); }else{ imFrontPhoneError.hide(); imPhoneError = true;}   
     167        if(imMessage === ""){ imFrontMsgError.show(); imMsgError = false;}else{ imFrontMsgError.hide(); imMsgError = true;}
     168       
     169       
     170        if(ImAjax.imGcaptcha == "on" && ImAjax.imGcaptchaVersion == "v3"){
     171                console.log('textp2p-v3');
     172            var imFrontCaptchaV3 = jQuery("#im-token-generate");
     173            var imCaptchaTokenValue =  imFrontCaptchaV3.val();
     174                console.log('textp2p v3 response:- '+imCaptchaTokenValue);
     175        }else if(ImAjax.imGcaptcha == "on" && ImAjax.imGcaptchaVersion == "v2"){
     176                console.log('textp2p-v2');
     177            var imCaptchaTokenValue = grecaptcha.getResponse()
     178                console.log('textp2p v2 response:- '+imCaptchaTokenValue);
     179        }else{
     180            imCaptchaTokenValue  = "NO-CAPTCHA";
     181            imGCaptchaError = true;
     182        }
     183       
     184        if(imCaptchaTokenValue === ""){
     185            imFrontGCaptchError.show();
     186            imGCaptchaError = false;
     187        }else{
     188            imFrontGCaptchError.hide();
     189            imGCaptchaError = true;
     190        }
     191        console.log('textp2p-err'+imGCaptchaError);
     192     
     193       if(imFirstError === true && imLastError === true && imEmailError === true && imPhoneError === true && imMsgError === true && imGCaptchaError === true && "1"==="1"){
     194            jQuery('.SendButton').prop('disabled', true);               
     195            jQuery.ajax({
     196                 type: "post",
     197                 url:  ImAjax.ajaxurl,
     198                 data: {action: "im_textp2p_send_form_data", im_first_name: imFirstName,  im_last_name: imLastName, im_phone: imPhone, im_email: imEmail, im_message: imMessage, im_captcha_token: imCaptchaTokenValue  },
     199                 beforeSend: function() {
     200
     201                   },
     202                 success: function(data){
     203
     204                 var obj = jQuery.parseJSON(data);
     205                 var imVerifyCode = obj.code;
     206                 var imContent = obj.content;
     207
     208                 if(imVerifyCode == "200"){
     209
     210                     imChatFormContainer.hide();
     211                     imThanksText.show();
     212                     imErrorMsg.hide();
     213                     imErrorMsg.html('');
     214
     215                 }else{
     216                     imErrorMsg.show();
     217                     imErrorMsg.html(imContent);
     218
     219                 }
     220                 jQuery('.SendButton').prop('disabled', false); 
     221                 },                     
     222                 complete: function(){
     223                 //    imLoading.hide();
     224                    jQuery('.SendButton').prop('disabled', false); 
     225                 },
     226                 error: function(data){     
     227                      alert("Error while request..");
     228                 }
     229             });
     230
    168231            }else{
    169                 imErrorMsg.show();
    170                 imErrorMsg.html(imContent);
    171                        
     232             //   alert("Some thing not correct..");
    172233            }
    173             },                         
    174             complete: function(){
    175             //    imLoading.hide();
    176             },
    177             error: function(data){     
    178                  alert("Error while request..");
    179             }
    180         });   
    181        }else{
    182         //   alert("Some thing not correct..");
    183        }
     234
    184235   
    185236    }
  • textp2p-texting-widget/trunk/inc/admin/assets/js/im-textp2p-admin-settings.js

    r2175790 r2794226  
    5050    jQuery( '#im_chat_welcome_message_background_color' ).wpColorPicker();
    5151    jQuery( '#im_chat_welcome_message_text_color' ).wpColorPicker();
     52
     53
     54
     55
     56    jQuery('input[name="im_gcaptcha_version"]').on('click', function() {
     57        jQuery('#im_gcaptcha_site_key').val('');
     58        jQuery('#im_gcaptcha_secret_key').val('');
     59    });
    5260 
    5361});
  • textp2p-texting-widget/trunk/inc/admin/im-textp2p-options.php

    r2404868 r2794226  
    243243        }else{
    244244             $options['im_api_list_id'] = '';
     245        }
     246
     247        //Google Captcha Settings
     248
     249        if (array_key_exists('im_gcaptcha', $_POST) && filter_var($_POST['im_gcaptcha'], FILTER_SANITIZE_STRING)) {
     250             $options['im_gcaptcha'] = sanitize_text_field( $_POST['im_gcaptcha']);
     251        }else{
     252             $options['im_gcaptcha'] = '';
     253        }
     254
     255        if (array_key_exists('im_gcaptcha_site_key', $_POST) && filter_var($_POST['im_gcaptcha_site_key'], FILTER_SANITIZE_STRING)) {
     256             $options['im_gcaptcha_site_key'] = sanitize_text_field( $_POST['im_gcaptcha_site_key']);
     257        }else{
     258             $options['im_gcaptcha_site_key'] = '';
     259        }
     260
     261        if (array_key_exists('im_gcaptcha_secret_key', $_POST) && filter_var($_POST['im_gcaptcha_secret_key'], FILTER_SANITIZE_STRING)) {
     262             $options['im_gcaptcha_secret_key'] = sanitize_text_field( $_POST['im_gcaptcha_secret_key']);
     263        }else{
     264             $options['im_gcaptcha_secret_key'] = '';
     265        }
     266
     267        if (array_key_exists('im_gcaptcha_version', $_POST) && filter_var($_POST['im_gcaptcha_version'], FILTER_SANITIZE_STRING)) {
     268             $options['im_gcaptcha_version'] = sanitize_text_field( $_POST['im_gcaptcha_version']);
     269        }else{
     270             $options['im_gcaptcha_version'] = '';
     271        }
     272       
     273        if (array_key_exists('im_gcaptcha_theme', $_POST) && filter_var($_POST['im_gcaptcha_theme'], FILTER_SANITIZE_STRING)) {
     274             $options['im_gcaptcha_theme'] = sanitize_text_field( $_POST['im_gcaptcha_theme']);
     275        }else{
     276             $options['im_gcaptcha_theme'] = 'light';
    245277        }
    246278       
     
    265297                                                <a class="nav-tab" id="general-tab" href="#top#general"><?php _e( 'General Settings', 'im-textp2p' );?></a>
    266298                                                <a class="nav-tab" id="chat-tab" href="#top#chat"><?php _e( 'Chat Settings', 'im-textp2p' );?></a>
     299                                                <a class="nav-tab" id="gcaptcha-tab" href="#top#gcaptcha"><?php _e( 'Captcha Settings', 'im-textp2p' );?></a>
    267300                                            </h2>
    268301                                            <div class="tabwrapper">
     
    272305                                                <div id="chat" class="im-tab">
    273306                                                    <?php include(IM_TEXTP2P_BASE_PATH.'/inc/admin/tabs/im-textp2p-chat-settings.php'); ?>
    274                                                 </div>                 
     307                                                </div>
     308                                                <div id="gcaptcha" class="im-tab">
     309                                                    <?php include(IM_TEXTP2P_BASE_PATH.'/inc/admin/tabs/im-textp2p-gcaptcha-settings.php'); ?>
     310                                                </div>                     
    275311                                            </div>
    276312                    </form>
  • textp2p-texting-widget/trunk/inc/im-textp2p-functions.php

    r2404868 r2794226  
    246246   
    247247    $options = get_option('imtextp2p_options');
     248    $imGCaptchaVersion = $options['im_gcaptcha_version'];
    248249    $imUsername  = $options['im_username'];
    249250    $imSecretkey = $options['im_secretkey'];
    250251    $imApiListID = $options['im_api_list_id'];
    251     $_POST = array_map( 'stripslashes_deep', $_POST );
    252     $idata = array( 'AUTH_USERNAME' => $imUsername, 'AUTH_SECRET' => $imSecretkey , 'listid' => $imApiListID, 'PHONE' => $_POST['im_phone'], 'FNAME' => $_POST['im_first_name'], 'LNAME' => $_POST['im_last_name'], 'EMAIL' => $_POST['im_email'], 'MSG' => $_POST['im_message'] );
    253     $response = wp_remote_post( IM_TEXTP2P_CONTACT_API, array( 'body' => $idata ) );
    254    
    255     if (!is_wp_error($response)) {
    256         $responseArray = $response['response'];
    257         $responseCode = $responseArray['code'];
    258      
    259         $apiListReturn['code'] = $responseCode ;
    260         $apiListReturn['content'] = $response['body'];
    261        
     252    $imGCaptchaEnableDisable = $options['im_gcaptcha'];
     253    $imGCaptchaSecretkey = $options['im_gcaptcha_secret_key'];
     254   
     255    // $_POST = array_map( 'stripslashes_deep', $_POST );
     256   
     257    $imGCaptchaToken = $_POST['im_captcha_token'];
     258   
     259    if($imGCaptchaEnableDisable == "on" && $imGCaptchaToken != "NO-CAPTCHA"){
     260       
     261        $ip = $_SERVER['REMOTE_ADDR'];
     262       
     263        $postArray = array(
     264            'secret' => $imGCaptchaSecretkey,
     265            'response' => $imGCaptchaToken
     266        ); 
     267
     268        $postJSON = http_build_query($postArray);
     269       
     270        $curl = curl_init();
     271        curl_setopt($curl, CURLOPT_URL, "https://www.google.com/recaptcha/api/siteverify");
     272        curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
     273        curl_setopt($curl, CURLOPT_POST, 1);
     274        curl_setopt($curl, CURLOPT_POSTFIELDS, $postJSON);
     275        $response = curl_exec($curl);
     276        curl_close($curl);
     277       
     278        $curlResponseArray = json_decode($response, true);
     279     
     280       
     281       $imCaptchaSuccess = $curlResponseArray["success"];
     282       $imCaptchaScore  = $curlResponseArray["score"];
     283       $imCaptchaErrorCode = $curlResponseArray['error-codes'][0] ?? null;
     284       
    262285    }else{
    263        
    264          $apiListReturn['code'] = "501" ;
    265          $apiListReturn['content'] = "Something wrong with server"; 
    266     }
    267 
     286       $imCaptchaSuccess = true;
     287       $imCaptchaScore = '0.8';
     288       $imCaptchaErrorCode = null;
     289    }
     290 
     291   
     292    if( ($imCaptchaSuccess && floatval($imCaptchaScore ?? 0) > 0.5 && $imGCaptchaVersion == 'v3') || ($imCaptchaSuccess &&  $imGCaptchaVersion == 'v2') ) {
     293        $idata = array( 'AUTH_USERNAME' => $imUsername, 'AUTH_SECRET' => $imSecretkey , 'listid' => $imApiListID, 'PHONE' => $_POST['im_phone'], 'FNAME' => $_POST['im_first_name'], 'LNAME' => $_POST['im_last_name'], 'EMAIL' => $_POST['im_email'], 'MSG' => $_POST['im_message'] );
     294        $response = wp_remote_post( IM_TEXTP2P_CONTACT_API, array( 'body' => $idata ) );
     295        if (!is_wp_error($response)) {
     296            $responseArray = $response['response'];
     297            $responseCode = $responseArray['code'];
     298            $apiListReturn['code'] = $responseCode ;
     299            $apiListReturn['content'] = $response['body'];
     300
     301        }else{
     302            $apiListReturn['code'] = "501" ;
     303            $apiListReturn['content'] = __('Something wrong with server!', 'im-textp2p'); 
     304        }
     305       
     306    } else {
     307        $apiListReturn['code'] = "501" ;
     308        $apiListReturn['content'] = __('You are probably not a human!', 'im-textp2p');
     309    }
     310       
    268311    echo json_encode($apiListReturn);
    269312    die();
     
    289332        //echo '<p>' . __('<span style="font-weight: bold;">Need Help ? OR Want new site built ?</span> You can hire professional assistance with us: <a target="_blank" href="https://www.ignitemediasolution.com">Harshal Dhingra</a> | You can email us as well <a href="mailto:[email protected]">[email protected]</a>', 'im-gf-ip-block');
    290333        echo '</p><p>';
    291         echo '<a type="button" class="im-textp2p-settings-button button button-primary" href="/wp-admin/options-general.php?page=im-textp2p">'. __('Settings', 'im-textp2p').'</a> ';
    292         echo '<a type="button" class="im-textp2p-addons-button button button-primary" target="_blank" href="https://www.ignitemediasolution.com/wordpress-plugins-ignite-media">'. __('Check out our Premium Services', 'im-textp2p').'</a>';
     334        echo '<a type="button" class="im-textp2p-settings-button button button-primary" href="'.esc_url( get_admin_url(null, 'options-general.php?page='.IM_TEXTP2P_ADMIN_SLUG) ).'">'. __('Settings', 'im-textp2p').'</a> ';
     335//        echo '<a type="button" class="im-textp2p-addons-button button button-primary" target="_blank" href="https://www.ignitemediasolution.com/wordpress-plugins-ignite-media">'. __('Check out our Premium Services', 'im-textp2p').'</a>';
    293336        echo '</p>';
    294337        echo '<button type="button" class="im-textp2p-dismiss-notice notice-dismiss"><span class="screen-reader-text">'. __('Dismiss this notice.', 'im-textp2p').'</span></button>';
     
    398441   return '<input '.$filter.' type="checkbox" id="'.$id.'" name="'.$id.'"'. checked($checked,true,false).'/>';
    399442}
     443
     444/**
     445* Create a radio button input field
     446*/
     447function imRadioButton($id, $options, $multiple = false, $state = "", $msg = "",$optionname) {
     448    $opt = get_option( $optionname );
     449   
     450    $output = '';
     451    foreach ($options as $val => $name) {
     452
     453     if ($opt[$id] == $val){
     454          $sel = ' checked="checked"';
     455     }else{
     456         $sel = '';
     457     }
     458     if ($name == ''){
     459         $name = $val;
     460     }
     461
     462     $output .=   '<input  type="radio" id="'.$id.'" name="'.$id.'" value="'.$val.'"'.$sel.'>'.$name.'&nbsp';
     463     
     464    }
     465   
     466   return $output;
     467}
    400468 
    401469/**
    402470* Create a Text input field
    403471*/
    404 function imTextInput($id,$optionname,$imtype="text", $inputText = "") {
     472function imTextInput($id,$optionname,$imtype="text", $inputText = "" , $attr = array()) {
    405473   $options = get_option( $optionname );
     474   
     475   if(!empty($attr)){
     476        $attr =  implode(' ', array_map(
     477            function ($v, $k) { return sprintf('%s="%s"', $k, $v); },
     478            $attr,
     479            array_keys($attr)
     480        ));
     481    }else{
     482        $attr = "";
     483    }
     484           
    406485  $val = '';
    407486   if ( isset( $options[$id] ) )
     
    468547            $class .= ' even';
    469548        }
     549        if(!isset($row['flag'])){
    470550        $content .= '<tr id="'.$row['id'].'_row" class="'.$class.'"><th valign="top" scrope="row">';
    471551        if (isset($row['id']) && $row['id'] != '')
     
    484564        }       
    485565            $content .= '</tr>';
     566        }   
    486567        if ( isset($row['desc']) && !empty($row['desc']) ) {
    487568            $content .= '<tr class="'.$class.'"><td colspan="2" class="yst_desc"><small>'.$row['desc'].'</small></td></tr>';
     
    515596        return "";
    516597    }
    517 }       
     598
     599
     600/**
     601* @param string|null $error_code
     602* @return string
     603*/
     604function imErrorMessage(?string $error_code): string
     605{
     606    switch ($error_code) {
     607        case 'missing-input-secret':
     608            return __('The secret parameter is missing.', 'im-textp2p');
     609        case 'missing-input-response':
     610            return __('The response parameter is missing.', 'im-textp2p');
     611        case 'invalid-input-secret':
     612            return __('The secret parameter is invalid or malformed.', 'im-textp2p');
     613        case 'invalid-input-response':
     614            return __('The response parameter is invalid or malformed.', 'im-textp2p');
     615        case 'bad-request':
     616            return __('The request is invalid or malformed.', 'im-textp2p');
     617        case 'timeout-or-duplicate':
     618            return __('The response is no longer valid: either is too old or has been used previously.', 'im-textp2p');
     619        default:
     620            return __('Unknown error.', 'im-textp2p');
     621    }
     622
  • textp2p-texting-widget/trunk/readme.txt

    r2673993 r2794226  
    33Tags: textp2p, texting-widget, bulksms, text-messages, ubscribes-sms, voice-mail, ringless, sms, subscribe, wordpress, send, message, register, notification
    44Requires at least: 4.0
    5 Tested up to: 5.9
    6 Stable tag: 1.3
     5Tested up to: 6.0.2
     6Stable tag: 1.4
    77Author URI: https://textp2p.com
    88Author:   Textp2p LLC
    9 Version: 1.3
     9Version: 1.4
    1010
    1111== Description ==
    1212
    13 Allow site visitors to contact your business the way most prefer, by Texting. Installing the TextP2P Texting Widget plugin into your Wordpress site provides an icon people can click on to immediately text you. All contact information including name, email, and mobile number will be captured and stored in TextP2P’s cloud based web application. All incoming texts can be automatically forwarded to your cell phone or you can easily set up automated text responses, drip campaigns or respond manually to each text message within TextP2P knowing that text messages have a 98% open rate!
     13Allow site visitors to contact your business the way most prefer, by Texting. Installing the TextP2P Texting Widget plugin into your WordPress site provides an icon people can click on to immediately text you. All contact information including name, email, and mobile number will be captured and stored in TextP2P’s cloud based web application. The plugin also supports google captcha v2 and v3.
    1414
    15 = What is TextP2P and why do you need it? =
     15All incoming texts can be accessed from our website, mobile app, or automatically forwarded to your cell phone. You will receive an email or mobile app notification for any new messages. You can also easily set up automated text responses, drip campaigns or respond manually to each text message using TextP2P knowing that text messages have a 98% open rate!
    1616
    17 TextP2P combines Text messaging, Email, and Ringless Voicemail drops into one affordable and easy to use online application. Thousands of small to mid-sized businesses in the US & Canada have used our services to communicate with their customers, getting a 98% open rate in under 3 minutes! Save time with our automation features including drip campaigns, keyword signups, automated responses, in-text surveys, and more.
     17= WHAT IS TEXTP2P AND WHY DO YOU NEED IT? =
     18
     19TextP2P combines Text messaging, Email, and Ringless Voicemail drops into one affordable and easy to use online application. Thousands of small to mid-sized businesses in the US & Canada have used our services to communicate with their customers, getting a 98% open rate in under 3 minutes! Save time with our automation features including drip campaigns, keyword signups, automated responses, in-text surveys, and more.
    1820
    1921= Differentiators of TextP2P include: =
     
    2931* TextP2P offers in-text rich multiple choice surveys.
    3032
    31 = TextP2P Sign up and Free Trial =
     33= TEXTP2P SIGN UP AND FREE TRIAL =
    3234
    3335Along with our free texting plugin you will need an account with TextP2P. You can sign up completely for free for 14 days and receive 100 free text credits good for 100 SMS text messages. All incoming texts are free so you only pay for outgoing text messages. A valid credit card is required to start your free trial, and you can always cancel at any time Once your trial is over, you will start your subscription to our Starter Package which costs just $21/month and gives you 500 text credits. If you don’t need 500 texts a month, we have a pay as you go plan for $5/month and text credits are extra.
     
    9597
    9698= Do you have a mobile app? =
    97 No. There is no mobile app at this time, but our site is completely mobile friendly with responsive design. It’s fully functional on a mobile device by opening up a browser and going to app.textp2p.com
     99Yes. We recently launched the mobile app for our Apple users and Android users. You can easily download the app from App/Play store. And our site is also completely mobile friendly with responsive design. It’s fully functional on a mobile device by opening up a browser and going to app.textp2p.com
    98100
    99101= Do you support short codes? =
     
    122124= 1.2 =
    123125* New setting added for chat widow always visible OR Visible on hover
     126
     127= 1.3 =
     128* Fix some issue as per Wordpress 6.0
     129
     130= 1.4 =
     131* Added new google reCaptcha v2 & v3 Methods into plugin.
  • textp2p-texting-widget/trunk/textp2p-texting-widget.php

    r2673993 r2794226  
    33Plugin Name: TextP2P Texting Widget
    44Description: The easiest and best way to allow your site visitors to text your business.
     5Version: 1.4
    56Author: TextP2P LLC
    6 Version: 1.3
    77Author URI: https://textp2p.com
     8Developer: Harshal Dhingra
     9Developer URI: https://www.ignitemediasolution.com
    810Text Domain: textp2p
    9 Copyright 2019-2022  Harshal Dhingra  (email : [email protected])
     11Copyright 2019-2022  Harshal Dhingra  (email : [email protected] || [email protected])
    1012*/
    1113
     
    1416}
    1517
    16 define('IM_TEXTP2P_VERSION', '1.3');
     18define('IM_TEXTP2P_VERSION', '1.4');
    1719define('IM_TEXTP2P_PLUGIN_DIR', untrailingslashit( dirname(__FILE__)));
    1820define('IM_TEXTP2P_ADMIN_SLUG', 'im-textp2p');
     
    2224define('IM_TEXTP2P_LIST_API', 'https://app.textp2p.com/zapier/get-lists.php');
    2325define('IM_TEXTP2P_CONTACT_API', 'https://app.textp2p.com/api-textme.php');
    24 define('IM_TEXTP2P_POWEREDBY', '1.1');
     26define('IM_TEXTP2P_CAPTCHA_VERIFY', 'https://www.google.com/recaptcha/api/siteverify');
     27define('IM_TEXTP2P_POWEREDBY', '1.4');
    2528define('IM_TEXTP2P_POWEREDBY_LINK', 'https://textp2p.com');
     29define('IM_TEXTP2P_RECAPTCHA_V2', 'https://www.google.com/recaptcha/admin/create');
     30define('IM_TEXTP2P_RECAPTCHA_V3', 'https://www.google.com/recaptcha/admin/create');
    2631define('IM_TEXTP2P_AGREE_MSG', 'By submitting you agree to receive text messages at the number provided. Message/data rates apply.');
    2732
     
    6772function imTextP2PActionlinks( $links ) {
    6873   $links[] = '<a href="'. esc_url( get_admin_url(null, 'options-general.php?page='.IM_TEXTP2P_ADMIN_SLUG) ) .'">Settings</a>';
    69    $links[] = '<a href="https://www.ignitemediasolution.com/wordpress-plugins-ignite-media" target="_blank">More plugins by Harshal Dhingra</a>';
     74//   $links[] = '<a href="https://www.ignitemediasolution.com/wordpress-plugins-ignite-media" target="_blank">More plugins by Harshal Dhingra</a>';
    7075   return $links;
    7176}
     
    168173                                                                        <div class="Im__TextInput__TextInputError">'. __('Required').'</div>
    169174                                    <div class="Im__TextInput__Bar"></div>
    170                                 </div>
    171                             </div>             
     175                                </div>';
     176                               
     177                                if($options['im_gcaptcha'] == "on" && $options['im_gcaptcha_version'] == 'v2') {
     178                                   
     179    $imChatWindow .=                                            '<div class="TextInput" id="im-gcaptcha-wrapper">
     180                                                                    <div id="im-gcaptcha-v2"></div>
     181                                                                    <div class="Im__TextInput__TextInputError">'. __('Please Fill the Captcha').'</div>
     182                                                                 
     183                                </div>';
     184   
     185                                }elseif ($options['im_gcaptcha'] == "on" && $options['im_gcaptcha_version'] == 'v3') {
     186    $imChatWindow .=                                            '<div class="TextInput" id="im-gcaptcha-wrapper">
     187                                                                    <input class="Im__TextInput__Input"  name="g-recaptcha-response" id="im-token-generate" type="hidden" value="">
     188                                                                    <div class="Im__TextInput__TextInputError">'. __('There are some error, Please contact with site owner.').'</div>
     189                                                                   
     190                                                                </div>';
     191                                }
     192
     193                                   
     194   
     195                               
     196
     197    $imChatWindow .=        '</div>             
    172198                            <div class="im__chat__Legal__notice">
    173199                                <p>'. __(IM_TEXTP2P_AGREE_MSG).'</p>
     
    235261        wp_enqueue_script( 'jquery-ui-core' );
    236262    }
    237 
     263    $options = get_option('imtextp2p_options');
     264       
    238265    wp_enqueue_script('textp2p-js', IM_TEXTP2P_BASE_URL . '/assets/js/im-textp2p.js',array('jquery'),IM_TEXTP2P_VERSION);
     266   
     267    $apiUrlBase = sprintf('https://www.recaptcha.net/recaptcha/api.js?hl=%s', get_locale());
     268    $jsUrl = sprintf('%s&onload=imCaptchaV2&render=explicit', $apiUrlBase);
     269   
     270    if($options['im_gcaptcha'] == "on" && $options['im_gcaptcha_version'] == 'v3'){
     271        $jsUrl = sprintf('%s&render=%s&onload=imCaptchaV3', $apiUrlBase, $options['im_gcaptcha_site_key']);
     272    }
     273 
     274    if($options['im_gcaptcha'] == "on"){
     275        wp_enqueue_script('recaptcha-js', $jsUrl, [], IM_TEXTP2P_VERSION);
     276    }
     277
    239278    wp_localize_script( 'textp2p-js', 'ImAjax', array(
    240279        'ajaxurl' => admin_url( 'admin-ajax.php' ),
    241280        'security' =>  wp_create_nonce( "sa_security_ajax" ),
    242281        'baseUrl' =>IM_TEXTP2P_BASE_URL,
     282        'imGcaptchaSiteKey' => $options['im_gcaptcha_site_key'],
     283        'imGcaptcha' => $options['im_gcaptcha'],
     284        'imGcaptchaVersion' => $options['im_gcaptcha_version'],
     285        'imGcaptchaTheme' => $options['im_gcaptcha_theme']
    243286   ) );
    244287
     
    352395        $options['im_username'] = '';
    353396 
    354      if (!isset($options['im_secretkey']))
     397    if (!isset($options['im_secretkey']))
    355398        $options['im_secretkey'] = '';
    356399     
    357       if (!isset($options['im_api_list_id']))
     400    if (!isset($options['im_api_list_id']))
    358401        $options['im_api_list_id'] = '';
    359      
     402   
     403    if (!isset($options['im_gcaptcha_version']))
     404        $options['im_gcaptcha_version'] = 'v2';
     405     
     406    if (!isset($options['im_gcaptcha_theme']))
     407        $options['im_gcaptcha_theme'] = 'light';
    360408    return $options;
    361409}
Note: See TracChangeset for help on using the changeset viewer.