Plugin Directory

Changeset 2279560


Ignore:
Timestamp:
04/08/2020 06:19:24 PM (6 years ago)
Author:
mihche
Message:

Version 3.1.40

Location:
goodbye-captcha/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • goodbye-captcha/trunk/assets/public/scripts/gdbc-client-new.js.php

    r2276839 r2279560  
    116116                        }
    117117
    118                         window.jQuery && jQuery.ajaxPrefilter(function( options, originalOptions, jqXHR ) {
    119 
    120                             if( ! ('action' in originalOptions.data)  || originalOptions.data.action !== 'nf_ajax_submit')
     118                         window.jQuery && jQuery.ajaxPrefilter(function( options, originalOptions, jqXHR ) {
     119                           
     120                            if(!formElement.querySelector('.nf-element'))
     121                                return;
     122                            console.log(options);console.log(originalOptions);
     123                           
     124                            if( !isObject(options) || !isObject(originalOptions) || !('data' in originalOptions) || !isObject(originalOptions.data))
     125                                return;
     126                           
     127                            if( !('action' in originalOptions.data) || originalOptions.data.action !== 'nf_ajax_submit')
    121128                                return;
    122129
     
    131138                       
    132139                       
    133                        
    134140                    }
    135141                    catch(e){console.log(e.message);}
     
    140146        init();
    141147
     148        function isObject(a) {return (!!a) && (a.constructor === Object);}
     149       
    142150        function serializeObject(obj) {
    143151            var str = [];
  • goodbye-captcha/trunk/assets/public/scripts/gdbc-client.js.php

    r2276839 r2279560  
    2424);
    2525
    26 //$scriptOutput = <<<Output
    27 //(function() {'use strict';
    28 //    if (!Array.isArray){Array.isArray = function(arg){return Object.prototype.toString.call(arg) === '[object Array]';};}
    29 //    if (!String.prototype.trim){String.prototype.trim = function () {return this.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '');};}
    30 //
    31 //    var WPBruiserClient = function(){
    32 //        var browserInfo = new Array();
    33 //        function init(){
    34 //            var w=window,d=document,e=0,f=0;e|=w.ActiveXObject?1:0;e|=w.opera?2:0;e|=w.chrome?4:0;
    35 //            e|='getBoxObjectFor' in d || 'mozInnerScreenX' in w?8:0;e|=('WebKitCSSMatrix' in w||'WebKitPoint' in w||'webkitStorageInfo' in w||'webkitURL' in w)?16:0;
    36 //            e|=(e&16&&({}.toString).toString().indexOf("\\n")===-1)?32:0;f|='sandbox' in d.createElement('iframe')?1:0;f|='WebSocket' in w?2:0;
    37 //            f|=w.Worker?4:0;f|=w.applicationCache?8:0;f|=w.history && history.pushState?16:0;f|=d.documentElement.webkitRequestFullScreen?32:0;f|='FileReader' in w?64:0;
    38 //
    39 //            var ua = navigator.userAgent.toLowerCase();
    40 //            var regex = /compatible; ([\w.+]+)[ \/]([\w.+]*)|([\w .+]+)[: \/]([\w.+]+)|([\w.+]+)/g;
    41 //            var match = regex.exec(ua);
    42 //            browserInfo = {screenWidth:screen.width,screenHeight:screen.height,engine:e,features:f};
    43 //            while (match !== null) {
    44 //                var prop = {};
    45 //                if (match[1]) {
    46 //                    prop.type = match[1];
    47 //                    prop.version = match[2];
    48 //                } else if (match[3]) {
    49 //                    prop.type = match[3];
    50 //                    prop.version = match[4];
    51 //                } else {
    52 //                    prop.type = match[5];
    53 //                }
    54 //                prop.type = (prop.type).trim().replace('.','').replace(' ','_');
    55 //                var value = prop.version ? prop.version : true;
    56 //                if (browserInfo[prop.type]) {
    57 //                    !Array.isArray(browserInfo[prop.type])?browserInfo[prop.type]=new Array(browserInfo[prop.type]):'';
    58 //                    browserInfo[prop.type].push(value);
    59 //                }
    60 //                else browserInfo[prop.type] = value;
    61 //                match = regex.exec(ua);
    62 //            }
    63 //        };
    64 //
    65 //
    66 //        var requestTokens = function(){for(var i = 0; i < document.forms.length; ++i){retrieveToken(document.forms[i]);}};
    67 //
    68 //        function retrieveToken(formElement){
    69 //
    70 //            var requestObj = (window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject("Microsoft.XMLHTTP"));
    71 //
    72 //            var formFieldElm = formElement.querySelector('input[name="__INPUT_NAME__"]');
    73 //            if(!requestObj || !formFieldElm) return;
    74 //            var ajaxData = [];
    75 //
    76 //            ajaxData['__INPUT_NAME__'] = '__AJAX_NONCE__';
    77 //            ajaxData['action']      = '__AJAX_ACTION__';
    78 //            ajaxData['requestTime'] = (new Date()).getTime();
    79 //            ajaxData['browserInfo'] = JSON.stringify(browserInfo);
    80 //
    81 //            requestObj.open('POST', '__AJAX_URL__', true);
    82 //            requestObj.setRequestHeader("Content-type", "application/x-www-form-urlencoded; charset=UTF-8");
    83 //            requestObj.setRequestHeader("X-Requested-With", "XMLHttpRequest");
    84 //            requestObj.setRequestHeader('Accept',"application/json, text/javascript, */*; q=0.01");
    85 //            requestObj.send(serializeObject(ajaxData));
    86 //
    87 //            requestObj.onreadystatechange = function () {
    88 //                if (4 === requestObj.readyState && 200 === requestObj.status)
    89 //                {
    90 //                    try
    91 //                    {
    92 //                        var rs = JSON.parse(requestObj.responseText);
    93 //                        if(rs.data === 'undefined')
    94 //                            return;
    95 //
    96 //                        var tokens = {};
    97 //
    98 //                        for(var p in rs.data)
    99 //                        {
    100 //                            if(p=='token')
    101 //                            {
    102 //                                formFieldElm.value = rs.data[p];
    103 //                                tokens[formFieldElm.name] = null;
    104 //                            }
    105 //                            else
    106 //                            {
    107 //                                var value = '', arrValues = rs.data[p].split('|');
    108 //                                for (var i = 0; i < arrValues.length; ++i) {
    109 //                                    if (browserInfo.hasOwnProperty(arrValues[i]))
    110 //                                        value += browserInfo[arrValues[i]];
    111 //                                }
    112 //
    113 //                                var elm = document.createElement("input");elm.name = p;elm.value=value;elm.type='hidden';formElement.appendChild(elm);
    114 //                                tokens[elm.name] = null;
    115 //
    116 //                                if((' ' + formElement.className + ' ').indexOf(' mailpoet_form ') > -1){
    117 //                                    elm.name = 'data[' + p + ']';formFieldElm.name = 'data[' + formFieldElm.name + ']';
    118 //                                }
    119 //                            }
    120 //                        }
    121 //
    122 //                        window.jQuery && jQuery.ajaxPrefilter(function( options, originalOptions, jqXHR ) {
    123 //
    124 //                            if( ! ('action' in originalOptions.data)  || originalOptions.data.action !== 'nf_ajax_submit')
    125 //                                return;
    126 //
    127 //                            for(var token in tokens){
    128 //                                tokens[token] = formElement.querySelector('input[name="'+token+'"]');
    129 //                                tokens[token] && (tokens[token] = tokens[token].value );
    130 //                            }
    131 //
    132 //                            options.data = jQuery.param(jQuery.extend(originalOptions.data||{}, tokens));
    133 //
    134 //                        });
    135 //
    136 //
    137 //
    138 //                    }
    139 //                    catch(e){console.log(e.message);}
    140 //                }
    141 //            }
    142 //        }
    143 //
    144 //        init();
    145 //
    146 //        function serializeObject(obj) {
    147 //            var str = [];
    148 //            for(var p in obj)
    149 //                if (obj.hasOwnProperty(p)) {
    150 //                    str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p]));
    151 //                }
    152 //            return str.join("&");
    153 //        }
    154 //        return {requestTokens : requestTokens};
    155 //    }
    156 //
    157 //    window.WPBruiserClient = new WPBruiserClient();window.WPBruiserClient.requestTokens();
    158 //
    159 //})();
    160 //Output;
     26$scriptOutput = <<<Output
     27(function() {'use strict';
     28    if (!Array.isArray){Array.isArray = function(arg){return Object.prototype.toString.call(arg) === '[object Array]';};}
     29    if (!String.prototype.trim){String.prototype.trim = function () {return this.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '');};}
     30
     31    var WPBruiserClient = function(){
     32        var browserInfo = new Array();
     33        function init(){
     34            var w=window,d=document,e=0,f=0;e|=w.ActiveXObject?1:0;e|=w.opera?2:0;e|=w.chrome?4:0;
     35            e|='getBoxObjectFor' in d || 'mozInnerScreenX' in w?8:0;e|=('WebKitCSSMatrix' in w||'WebKitPoint' in w||'webkitStorageInfo' in w||'webkitURL' in w)?16:0;
     36            e|=(e&16&&({}.toString).toString().indexOf("\\n")===-1)?32:0;f|='sandbox' in d.createElement('iframe')?1:0;f|='WebSocket' in w?2:0;
     37            f|=w.Worker?4:0;f|=w.applicationCache?8:0;f|=w.history && history.pushState?16:0;f|=d.documentElement.webkitRequestFullScreen?32:0;f|='FileReader' in w?64:0;
     38
     39            var ua = navigator.userAgent.toLowerCase();
     40            var regex = /compatible; ([\w.+]+)[ \/]([\w.+]*)|([\w .+]+)[: \/]([\w.+]+)|([\w.+]+)/g;
     41            var match = regex.exec(ua);
     42            browserInfo = {screenWidth:screen.width,screenHeight:screen.height,engine:e,features:f};
     43            while (match !== null) {
     44                var prop = {};
     45                if (match[1]) {
     46                    prop.type = match[1];
     47                    prop.version = match[2];
     48                } else if (match[3]) {
     49                    prop.type = match[3];
     50                    prop.version = match[4];
     51                } else {
     52                    prop.type = match[5];
     53                }
     54                prop.type = (prop.type).trim().replace('.','').replace(' ','_');
     55                var value = prop.version ? prop.version : true;
     56                if (browserInfo[prop.type]) {
     57                    !Array.isArray(browserInfo[prop.type])?browserInfo[prop.type]=new Array(browserInfo[prop.type]):'';
     58                    browserInfo[prop.type].push(value);
     59                }
     60                else browserInfo[prop.type] = value;
     61                match = regex.exec(ua);
     62            }
     63        };
     64
     65
     66        var requestTokens = function(){for(var i = 0; i < document.forms.length; ++i){retrieveToken(document.forms[i]);}};
     67
     68        function retrieveToken(formElement){
     69
     70            var requestObj = (window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject("Microsoft.XMLHTTP"));
     71
     72            var formFieldElm = formElement.querySelector('input[name="__INPUT_NAME__"]');
     73            if(!requestObj || !formFieldElm) return;
     74            var ajaxData = [];
     75
     76            ajaxData['__INPUT_NAME__'] = '__AJAX_NONCE__';
     77            ajaxData['action']      = '__AJAX_ACTION__';
     78            ajaxData['requestTime'] = (new Date()).getTime();
     79            ajaxData['browserInfo'] = JSON.stringify(browserInfo);
     80
     81            requestObj.open('POST', '__AJAX_URL__', true);
     82            requestObj.setRequestHeader("Content-type", "application/x-www-form-urlencoded; charset=UTF-8");
     83            requestObj.setRequestHeader("X-Requested-With", "XMLHttpRequest");
     84            requestObj.setRequestHeader('Accept',"application/json, text/javascript, */*; q=0.01");
     85            requestObj.send(serializeObject(ajaxData));
     86
     87            requestObj.onreadystatechange = function () {
     88                if (4 === requestObj.readyState && 200 === requestObj.status)
     89                {
     90                    try
     91                    {
     92                        var rs = JSON.parse(requestObj.responseText);
     93                        if(rs.data === 'undefined')
     94                            return;
     95
     96                        var tokens = {};
     97
     98                        for(var p in rs.data)
     99                        {
     100                            if(p=='token')
     101                            {
     102                                formFieldElm.value = rs.data[p];
     103                                tokens[formFieldElm.name] = null;
     104                            }
     105                            else
     106                            {
     107                                var value = '', arrValues = rs.data[p].split('|');
     108                                for (var i = 0; i < arrValues.length; ++i) {
     109                                    if (browserInfo.hasOwnProperty(arrValues[i]))
     110                                        value += browserInfo[arrValues[i]];
     111                                }
     112
     113                                var elm = document.createElement("input");elm.name = p;elm.value=value;elm.type='hidden';formElement.appendChild(elm);
     114                                tokens[elm.name] = null;
     115
     116                                if((' ' + formElement.className + ' ').indexOf(' mailpoet_form ') > -1){
     117                                    elm.name = 'data[' + p + ']';formFieldElm.name = 'data[' + formFieldElm.name + ']';
     118                                }
     119                            }
     120                        }
     121
     122                        window.jQuery && jQuery.ajaxPrefilter(function( options, originalOptions, jqXHR ) {
     123
     124                            if( ! ('action' in originalOptions.data)  || originalOptions.data.action !== 'nf_ajax_submit')
     125                                return;
     126
     127                            for(var token in tokens){
     128                                tokens[token] = formElement.querySelector('input[name="'+token+'"]');
     129                                tokens[token] && (tokens[token] = tokens[token].value );
     130                            }
     131
     132                            options.data = jQuery.param(jQuery.extend(originalOptions.data||{}, tokens));
     133
     134                        });
     135
     136
     137
     138                    }
     139                    catch(e){console.log(e.message);}
     140                }
     141            }
     142        }
     143
     144        init();
     145
     146        function serializeObject(obj) {
     147            var str = [];
     148            for(var p in obj)
     149                if (obj.hasOwnProperty(p)) {
     150                    str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p]));
     151                }
     152            return str.join("&");
     153        }
     154        return {requestTokens : requestTokens};
     155    }
     156
     157    window.WPBruiserClient = new WPBruiserClient();window.WPBruiserClient.requestTokens();
     158
     159})();
     160Output;
    161161
    162162
     
    164164 * compressed javascript https://jscompress.com/
    165165 */
    166 $scriptOutput = <<<Output
    167 !function(){"use strict";Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")});window.WPBruiserClient=new function(){var p=new Array;function t(s){var c=window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP"),u=s.querySelector('input[name="__INPUT_NAME__"]');if(c&&u){var e=[];e['__INPUT_NAME__']="__AJAX_NONCE__",e.action="__AJAX_ACTION__",e.requestTime=(new Date).getTime(),e.browserInfo=JSON.stringify(p),c.open("POST","__AJAX_URL__",!0),c.setRequestHeader("Content-type","application/x-www-form-urlencoded; charset=UTF-8"),c.setRequestHeader("X-Requested-With","XMLHttpRequest"),c.setRequestHeader("Accept","application/json, text/javascript, */*; q=0.01"),c.send(function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t.join("&")}(e)),c.onreadystatechange=function(){if(4===c.readyState&&200===c.status)try{var e=JSON.parse(c.responseText);if("undefined"===e.data)return;var a={};for(var t in e.data)if("token"==t)u.value=e.data[t],a[u.name]=null;else{for(var n="",r=e.data[t].split("|"),i=0;i<r.length;++i)p.hasOwnProperty(r[i])&&(n+=p[r[i]]);var o=document.createElement("input");o.name=t,o.value=n,o.type="hidden",s.appendChild(o),a[o.name]=null,-1<(" "+s.className+" ").indexOf(" mailpoet_form ")&&(o.name="data["+t+"]",u.name="data["+u.name+"]")}window.jQuery&&jQuery.ajaxPrefilter(function(e,t,n){if("action"in t.data&&"nf_ajax_submit"===t.data.action){for(var r in a)a[r]=s.querySelector('input[name="'+r+'"]'),a[r]&&(a[r]=a[r].value);e.data=jQuery.param(jQuery.extend(t.data||{},a))}})}catch(e){console.log(e.message)}}}}return function(){var e=window,t=document,n=0,r=0;n|=e.ActiveXObject?1:0,n|=e.opera?2:0,n|=e.chrome?4:0,n|="getBoxObjectFor"in t||"mozInnerScreenX"in e?8:0,n|="WebKitCSSMatrix"in e||"WebKitPoint"in e||"webkitStorageInfo"in e||"webkitURL"in e?16:0,n|=16&n&&-1==={}.toString.toString().indexOf("\\n")?32:0,r|="sandbox"in t.createElement("iframe")?1:0,r|="WebSocket"in e?2:0,r|=e.Worker?4:0,r|=e.applicationCache?8:0,r|=e.history&&history.pushState?16:0,r|=t.documentElement.webkitRequestFullScreen?32:0,r|="FileReader"in e?64:0;var a=navigator.userAgent.toLowerCase(),i=/compatible; ([\w.+]+)[ \/]([\w.+]*)|([\w .+]+)[: \/]([\w.+]+)|([\w.+]+)/g,o=i.exec(a);for(p={screenWidth:screen.width,screenHeight:screen.height,engine:n,features:r};null!==o;){var s={};o[1]?(s.type=o[1],s.version=o[2]):o[3]?(s.type=o[3],s.version=o[4]):s.type=o[5],s.type=s.type.trim().replace(".","").replace(" ","_");var c=!s.version||s.version;p[s.type]?(Array.isArray(p[s.type])||(p[s.type]=new Array(p[s.type])),p[s.type].push(c)):p[s.type]=c,o=i.exec(a)}}(),{requestTokens:function(){for(var e=0;e<document.forms.length;++e)t(document.forms[e])}}},window.WPBruiserClient.requestTokens()}();
    168 Output;
     166//$scriptOutput = <<<Output
     167//!function(){"use strict";Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")});window.WPBruiserClient=new function(){var p=new Array;function t(s){var c=window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP"),u=s.querySelector('input[name="__INPUT_NAME__"]');if(c&&u){var e=[];e['__INPUT_NAME__']="__AJAX_NONCE__",e.action="__AJAX_ACTION__",e.requestTime=(new Date).getTime(),e.browserInfo=JSON.stringify(p),c.open("POST","__AJAX_URL__",!0),c.setRequestHeader("Content-type","application/x-www-form-urlencoded; charset=UTF-8"),c.setRequestHeader("X-Requested-With","XMLHttpRequest"),c.setRequestHeader("Accept","application/json, text/javascript, */*; q=0.01"),c.send(function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t.join("&")}(e)),c.onreadystatechange=function(){if(4===c.readyState&&200===c.status)try{var e=JSON.parse(c.responseText);if("undefined"===e.data)return;var a={};for(var t in e.data)if("token"==t)u.value=e.data[t],a[u.name]=null;else{for(var n="",r=e.data[t].split("|"),i=0;i<r.length;++i)p.hasOwnProperty(r[i])&&(n+=p[r[i]]);var o=document.createElement("input");o.name=t,o.value=n,o.type="hidden",s.appendChild(o),a[o.name]=null,-1<(" "+s.className+" ").indexOf(" mailpoet_form ")&&(o.name="data["+t+"]",u.name="data["+u.name+"]")}window.jQuery&&jQuery.ajaxPrefilter(function(e,t,n){if("action"in t.data&&"nf_ajax_submit"===t.data.action){for(var r in a)a[r]=s.querySelector('input[name="'+r+'"]'),a[r]&&(a[r]=a[r].value);e.data=jQuery.param(jQuery.extend(t.data||{},a))}})}catch(e){console.log(e.message)}}}}return function(){var e=window,t=document,n=0,r=0;n|=e.ActiveXObject?1:0,n|=e.opera?2:0,n|=e.chrome?4:0,n|="getBoxObjectFor"in t||"mozInnerScreenX"in e?8:0,n|="WebKitCSSMatrix"in e||"WebKitPoint"in e||"webkitStorageInfo"in e||"webkitURL"in e?16:0,n|=16&n&&-1==={}.toString.toString().indexOf("\\n")?32:0,r|="sandbox"in t.createElement("iframe")?1:0,r|="WebSocket"in e?2:0,r|=e.Worker?4:0,r|=e.applicationCache?8:0,r|=e.history&&history.pushState?16:0,r|=t.documentElement.webkitRequestFullScreen?32:0,r|="FileReader"in e?64:0;var a=navigator.userAgent.toLowerCase(),i=/compatible; ([\w.+]+)[ \/]([\w.+]*)|([\w .+]+)[: \/]([\w.+]+)|([\w.+]+)/g,o=i.exec(a);for(p={screenWidth:screen.width,screenHeight:screen.height,engine:n,features:r};null!==o;){var s={};o[1]?(s.type=o[1],s.version=o[2]):o[3]?(s.type=o[3],s.version=o[4]):s.type=o[5],s.type=s.type.trim().replace(".","").replace(" ","_");var c=!s.version||s.version;p[s.type]?(Array.isArray(p[s.type])||(p[s.type]=new Array(p[s.type])),p[s.type].push(c)):p[s.type]=c,o=i.exec(a)}}(),{requestTokens:function(){for(var e=0;e<document.forms.length;++e)t(document.forms[e])}}},window.WPBruiserClient.requestTokens()}();
     168//Output;
    169169
    170170echo str_replace(array_keys($arrPlaceHolders), $arrPlaceHolders, $scriptOutput);
  • goodbye-captcha/trunk/goodbye-captcha.php

    r2276839 r2279560  
    1111 * Plugin URI: http://www.wpbruiser.com
    1212 * Description: An extremely powerful anti-spam plugin that blocks spambots without annoying captcha images.
    13  * Version: 3.1.39
     13 * Version: 3.1.40
    1414 * Author: Mihai Chelaru
    1515 * Author URI: http://www.wpbruiser.com
     
    2424    {
    2525       
    26         CONST PLUGIN_VERSION    = '3.1.39';
     26        CONST PLUGIN_VERSION    = '3.1.40';
    2727        CONST PLUGIN_SLUG       = 'wp-bruiser';
    2828        CONST PLUGIN_NAME       = 'WPBruiser';
     
    140140        GdbcIPUtils::getClientIpAddress();
    141141
    142         if (!empty($_GET['gdbc-client']) && file_exists($filePath = dirname(__FILE__) . '/assets/public/scripts/gdbc-client.js.php')) {
     142        if (!empty($_GET['gdbc-client']) && file_exists($filePath = dirname(__FILE__) . '/assets/public/scripts/gdbc-client-new.js.php')) {
    143143            require_once(ABSPATH . 'wp-includes/pluggable.php');
    144144            (!defined('LOGGED_IN_COOKIE') && function_exists('wp_cookie_constants')) ? wp_cookie_constants() : null;
  • goodbye-captcha/trunk/readme.txt

    r2276839 r2279560  
    55Requires at least: 4.0
    66Tested up to: 5.4
    7 Stable tag: 3.1.39
     7Stable tag: 3.1.40
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    223223== Changelog ==
    224224
     225= 3.1.40 =
     226**Fixes**
     227- Ajax call javascript error
     228
    225229= 3.1.39 =
    226230- Refreshed Country IPs
Note: See TracChangeset for help on using the changeset viewer.