Plugin Directory

Changeset 1704793


Ignore:
Timestamp:
07/29/2017 02:07:57 AM (9 years ago)
Author:
allprowebtools
Message:

Enhanced support for Google reCaptcha to allow multiple reCaptchas per page

Location:
allprowebtools-leadboxes/tags/1.1.1
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • allprowebtools-leadboxes/tags/1.1.1/allprowebtools.php

    r1598164 r1704793  
    66Author: AllProWebTools
    77Author URI: http://www.AllProWebTools.com
    8 Version: 1.1.0
     8Version: 1.1.1
    99License: GPLv2
    1010*/
  • allprowebtools-leadboxes/tags/1.1.1/includes/apwt.php

    r1556509 r1704793  
    2323    $thereturn = wp_remote_get($thisurl);
    2424
     25
    2526    if ($thereturn['body'] == 'API credentials not found') {
    2627        print $thereturn['body'];
     
    5354    $debug = 0;
    5455    $args = APWTCookieSessionHandler();
    55     $args['timeout'] = 30;
     56    $args['timeout'] = 120;
    5657
    5758    $url .= '&siteurl='.$_SERVER['HTTP_HOST'].'&ip='.$_SERVER["REMOTE_ADDR"];
    5859    $url = "https:".$_SESSION['serverurl'].$url;
     60
     61//in an attempt to debug leadbox slowness, we tried using direct curl instead of wp_remote_get() to improve response times
     62//we later found another issue related to L30 that improved the leadbox slowness - JAB 2017.05.11
     63//$ch = curl_init($url);
     64//$response = curl_exec($ch);
    5965
    6066    $response = wp_remote_get($url, $args);
     
    199205            echo $thereturn;
    200206        }
     207
    201208        die(0);
    202209    }
  • allprowebtools-leadboxes/tags/1.1.1/js/apwt-leadbox.js

    r1645139 r1704793  
    11jQuery('body').on('click','.leadbox-submit', function(e) {
    22    e.preventDefault();
    3     var leadboxForm = jQuery(this).closest('form');
     3    var saveBtn = jQuery(this);
     4    var leadboxForm = saveBtn.closest('form');
    45    var recaptchaBox = leadboxForm.find('.g-recaptcha-response');
     6    var oldBtnTxt = saveBtn.html();
     7   
     8    saveBtn.prop('disabled', true);
     9    saveBtn.html('<div class="leadbox-loader"></div>');
    510
    611    var postedValues = {};
     
    2328        success: function(response) {
    2429          if(response.status == "error") {
    25             leadboxForm.find('.leadbox-error').html(response.message);
    26             grecaptcha.reset() //reset recaptcha
     30            jQuery(leadboxForm.children('.leadbox-error')).html(response.message);
     31            if (typeof(grecaptcha) != 'undefined') {
     32                var widgetId = parseInt(leadboxForm.find('.recaptcha-widget').val());
     33                try {
     34                    grecaptcha.reset(widgetId); //reset recaptcha
     35                } catch (e) {
     36                    console.log(e);
     37                }
     38            }
    2739          } else {
    2840                if (response.status != 'paige') {
     
    3446                }
    3547          }
     48          saveBtn.prop('disabled', false);
     49          saveBtn.html(oldBtnTxt);
    3650        }
    3751  });
  • allprowebtools-leadboxes/tags/1.1.1/readme.txt

    r1645139 r1704793  
    33Tags: allprowebtools, crm, lead box, signup box, optin box, autoresponder, email marketing
    44Requires at least: 3.4
    5 Tested up to: 4.7.4
    6 Stable tag: 1.1.0
     5Tested up to: 4.8
     6Stable tag: 1.1.1
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    97971. Patched for better compatability with WP 4.7 and certain PHP versions
    9898
    99 = 1.1.0 - 04/25/17 =
     99= 1.1.0 - 02/17/17 =
    1001001. Added support for Google reCaptcha
    101101
     102= 1.1.1 - 07/28/17 =
     1031. Enhanced support for Google reCaptcha to allow multiple reCaptchas per page
Note: See TracChangeset for help on using the changeset viewer.