Changeset 3129246
- Timestamp:
- 08/01/2024 08:03:43 AM (20 months ago)
- Location:
- hcaptcha-for-forms-and-more
- Files:
-
- 6 added
- 2 deleted
- 101 edited
- 1 copied
-
assets/screenshot-10.png (modified) (previous)
-
assets/screenshot-11.png (added)
-
assets/screenshot-12.png (added)
-
assets/screenshot-6.png (modified) (previous)
-
assets/screenshot-7.png (modified) (previous)
-
assets/screenshot-8.png (modified) (previous)
-
assets/screenshot-9.png (modified) (previous)
-
tags/4.4.0 (copied) (copied from hcaptcha-for-forms-and-more/trunk)
-
tags/4.4.0/assets/css/notifications.css (modified) (1 diff)
-
tags/4.4.0/assets/css/notifications.min.css (modified) (1 diff)
-
tags/4.4.0/assets/images/elementor-edit-form.png (added)
-
tags/4.4.0/assets/js/admin-elementor-pro.js (modified) (1 diff)
-
tags/4.4.0/assets/js/apps/hcaptcha.js (modified) (1 diff)
-
tags/4.4.0/assets/js/hcaptcha-elementor-pro.js (modified) (1 diff)
-
tags/4.4.0/assets/js/hcaptcha-elementor-pro.min.js (modified) (1 diff)
-
tags/4.4.0/assets/js/hcaptcha-nf.js (modified) (4 diffs)
-
tags/4.4.0/assets/js/hcaptcha-nf.min.js (modified) (1 diff)
-
tags/4.4.0/assets/js/hcaptcha-wpdiscuz-comment.js (modified) (1 diff)
-
tags/4.4.0/assets/js/hcaptcha-wpdiscuz-comment.min.js (modified) (1 diff)
-
tags/4.4.0/assets/js/notifications.js (modified) (3 diffs)
-
tags/4.4.0/assets/js/notifications.min.js (modified) (1 diff)
-
tags/4.4.0/changelog.txt (modified) (1 diff)
-
tags/4.4.0/hcaptcha.php (modified) (2 diffs)
-
tags/4.4.0/readme.txt (modified) (4 diffs)
-
tags/4.4.0/src/php/Admin/Notifications.php (modified) (4 diffs)
-
tags/4.4.0/src/php/AutoVerify/AutoVerify.php (modified) (1 diff)
-
tags/4.4.0/src/php/CF7/Admin.php (modified) (5 diffs)
-
tags/4.4.0/src/php/CF7/Base.php (modified) (1 diff)
-
tags/4.4.0/src/php/CF7/CF7.php (modified) (3 diffs)
-
tags/4.4.0/src/php/ElementorPro/Login.php (modified) (1 diff)
-
tags/4.4.0/src/php/EssentialAddons/Login.php (modified) (1 diff)
-
tags/4.4.0/src/php/EssentialAddons/Register.php (modified) (3 diffs)
-
tags/4.4.0/src/php/GiveWP/Base.php (modified) (2 diffs)
-
tags/4.4.0/src/php/Helpers/HCaptcha.php (modified) (2 diffs)
-
tags/4.4.0/src/php/Helpers/Request.php (modified) (3 diffs)
-
tags/4.4.0/src/php/MailPoet/Form.php (modified) (1 diff)
-
tags/4.4.0/src/php/Main.php (modified) (4 diffs)
-
tags/4.4.0/src/php/Settings/Integrations.php (modified) (4 diffs)
-
tags/4.4.0/src/php/WP/Base.php (added)
-
tags/4.4.0/src/php/WP/LostPassword.php (modified) (3 diffs)
-
tags/4.4.0/src/php/WP/Register.php (modified) (4 diffs)
-
tags/4.4.0/src/php/WPDiscuz/Comment.php (modified) (2 diffs)
-
tags/4.4.0/src/php/Wordfence/General.php (modified) (3 diffs)
-
tags/4.4.0/vendor/composer/autoload_classmap.php (modified) (3 diffs)
-
tags/4.4.0/vendor/composer/autoload_psr4.php (modified) (1 diff)
-
tags/4.4.0/vendor/composer/autoload_real.php (modified) (1 diff)
-
tags/4.4.0/vendor/composer/autoload_static.php (modified) (5 diffs)
-
tags/4.4.0/vendor/composer/installed.php (modified) (2 diffs)
-
tags/4.4.0/vendor/composer/platform_check.php (deleted)
-
tags/4.4.0/vendors/matthiasmullie/minify/src/CSS.php (modified) (1 diff)
-
tags/4.4.0/vendors/matthiasmullie/minify/src/Exception.php (modified) (1 diff)
-
tags/4.4.0/vendors/matthiasmullie/minify/src/Exceptions/BasicException.php (modified) (1 diff)
-
tags/4.4.0/vendors/matthiasmullie/minify/src/Exceptions/FileImportException.php (modified) (1 diff)
-
tags/4.4.0/vendors/matthiasmullie/minify/src/Exceptions/IOException.php (modified) (1 diff)
-
tags/4.4.0/vendors/matthiasmullie/minify/src/JS.php (modified) (2 diffs)
-
tags/4.4.0/vendors/matthiasmullie/minify/src/Minify.php (modified) (1 diff)
-
tags/4.4.0/vendors/matthiasmullie/path-converter/src/Converter.php (modified) (1 diff)
-
tags/4.4.0/vendors/matthiasmullie/path-converter/src/ConverterInterface.php (modified) (1 diff)
-
tags/4.4.0/vendors/matthiasmullie/path-converter/src/NoConverter.php (modified) (1 diff)
-
trunk/assets/css/notifications.css (modified) (1 diff)
-
trunk/assets/css/notifications.min.css (modified) (1 diff)
-
trunk/assets/images/elementor-edit-form.png (added)
-
trunk/assets/js/admin-elementor-pro.js (modified) (1 diff)
-
trunk/assets/js/apps/hcaptcha.js (modified) (1 diff)
-
trunk/assets/js/hcaptcha-elementor-pro.js (modified) (1 diff)
-
trunk/assets/js/hcaptcha-elementor-pro.min.js (modified) (1 diff)
-
trunk/assets/js/hcaptcha-nf.js (modified) (4 diffs)
-
trunk/assets/js/hcaptcha-nf.min.js (modified) (1 diff)
-
trunk/assets/js/hcaptcha-wpdiscuz-comment.js (modified) (1 diff)
-
trunk/assets/js/hcaptcha-wpdiscuz-comment.min.js (modified) (1 diff)
-
trunk/assets/js/notifications.js (modified) (3 diffs)
-
trunk/assets/js/notifications.min.js (modified) (1 diff)
-
trunk/changelog.txt (modified) (1 diff)
-
trunk/hcaptcha.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (4 diffs)
-
trunk/src/php/Admin/Notifications.php (modified) (4 diffs)
-
trunk/src/php/AutoVerify/AutoVerify.php (modified) (1 diff)
-
trunk/src/php/CF7/Admin.php (modified) (5 diffs)
-
trunk/src/php/CF7/Base.php (modified) (1 diff)
-
trunk/src/php/CF7/CF7.php (modified) (3 diffs)
-
trunk/src/php/ElementorPro/Login.php (modified) (1 diff)
-
trunk/src/php/EssentialAddons/Login.php (modified) (1 diff)
-
trunk/src/php/EssentialAddons/Register.php (modified) (3 diffs)
-
trunk/src/php/GiveWP/Base.php (modified) (2 diffs)
-
trunk/src/php/Helpers/HCaptcha.php (modified) (2 diffs)
-
trunk/src/php/Helpers/Request.php (modified) (3 diffs)
-
trunk/src/php/MailPoet/Form.php (modified) (1 diff)
-
trunk/src/php/Main.php (modified) (4 diffs)
-
trunk/src/php/Settings/Integrations.php (modified) (4 diffs)
-
trunk/src/php/WP/Base.php (added)
-
trunk/src/php/WP/LostPassword.php (modified) (3 diffs)
-
trunk/src/php/WP/Register.php (modified) (4 diffs)
-
trunk/src/php/WPDiscuz/Comment.php (modified) (2 diffs)
-
trunk/src/php/Wordfence/General.php (modified) (3 diffs)
-
trunk/vendor/composer/autoload_classmap.php (modified) (3 diffs)
-
trunk/vendor/composer/autoload_psr4.php (modified) (1 diff)
-
trunk/vendor/composer/autoload_real.php (modified) (1 diff)
-
trunk/vendor/composer/autoload_static.php (modified) (5 diffs)
-
trunk/vendor/composer/installed.php (modified) (2 diffs)
-
trunk/vendor/composer/platform_check.php (deleted)
-
trunk/vendors/matthiasmullie/minify/src/CSS.php (modified) (1 diff)
-
trunk/vendors/matthiasmullie/minify/src/Exception.php (modified) (1 diff)
-
trunk/vendors/matthiasmullie/minify/src/Exceptions/BasicException.php (modified) (1 diff)
-
trunk/vendors/matthiasmullie/minify/src/Exceptions/FileImportException.php (modified) (1 diff)
-
trunk/vendors/matthiasmullie/minify/src/Exceptions/IOException.php (modified) (1 diff)
-
trunk/vendors/matthiasmullie/minify/src/JS.php (modified) (2 diffs)
-
trunk/vendors/matthiasmullie/minify/src/Minify.php (modified) (1 diff)
-
trunk/vendors/matthiasmullie/path-converter/src/Converter.php (modified) (1 diff)
-
trunk/vendors/matthiasmullie/path-converter/src/ConverterInterface.php (modified) (1 diff)
-
trunk/vendors/matthiasmullie/path-converter/src/NoConverter.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
hcaptcha-for-forms-and-more/tags/4.4.0/assets/css/notifications.css
r2949443 r3129246 62 62 } 63 63 64 #hcaptcha-navigation > span { 65 margin-right: 10px; 66 align-self: center; 67 } 68 64 69 #hcaptcha-navigation a { 65 70 width: 30px; -
hcaptcha-for-forms-and-more/tags/4.4.0/assets/css/notifications.min.css
r2949443 r3129246 1 #hcaptcha-notifications{background:#fff;box-sizing:border-box;margin:5px 0 15px;max-width:760px;padding:15px 20px}#hcaptcha-notifications-header{align-items:center;border-bottom:1px solid #c3c4c7;column-gap:3px;display:flex;font-size:14px;font-weight:600;justify-content:flex-start;line-height:1.3;margin-bottom:10px;padding-bottom:10px}#hcaptcha-notifications-header:before{background-image:url(../images/notification-bell.svg);background-size:cover;content:"";height:30px;position:relative;width:30px}#hcaptcha-notifications-footer{border-top:1px solid #c3c4c7;display:flex;justify-content:space-between;margin-top:10px;padding-top:10px}#hcaptcha-notifications .hcaptcha-notification{margin:0}.hcaptcha-notification .hcaptcha-notification-title{font-weight:600;line-height:1.3;margin:7px 0;padding:2px}.hcaptcha-notification{display:none}#hcaptcha-notifications-header+.hcaptcha-notification{display:block}#hcaptcha-navigation{column-gap:3px;display:flex;justify-content:flex-end}#hcaptcha-navigation a{background:#f6f7f7;border:1px solid #2271b1;border-radius:3px;box-sizing:border-box;cursor:pointer;font-size:16px;height:30px;line-height:25px;text-align:center;width:30px}#hcaptcha-navigation a.disabled{background:#f6f7f7;border-color:#dcdcde;color:#a7aaad;cursor:default}#hcaptcha-navigation a.next:after,#hcaptcha-navigation a.prev:after{font-size:12px}#hcaptcha-navigation a.prev:after{content:"<"}#hcaptcha-navigation a.next:after{content:">"}1 #hcaptcha-notifications{background:#fff;box-sizing:border-box;margin:5px 0 15px;max-width:760px;padding:15px 20px}#hcaptcha-notifications-header{align-items:center;border-bottom:1px solid #c3c4c7;column-gap:3px;display:flex;font-size:14px;font-weight:600;justify-content:flex-start;line-height:1.3;margin-bottom:10px;padding-bottom:10px}#hcaptcha-notifications-header:before{background-image:url(../images/notification-bell.svg);background-size:cover;content:"";height:30px;position:relative;width:30px}#hcaptcha-notifications-footer{border-top:1px solid #c3c4c7;display:flex;justify-content:space-between;margin-top:10px;padding-top:10px}#hcaptcha-notifications .hcaptcha-notification{margin:0}.hcaptcha-notification .hcaptcha-notification-title{font-weight:600;line-height:1.3;margin:7px 0;padding:2px}.hcaptcha-notification{display:none}#hcaptcha-notifications-header+.hcaptcha-notification{display:block}#hcaptcha-navigation{column-gap:3px;display:flex;justify-content:flex-end}#hcaptcha-navigation>span{align-self:center;margin-right:10px}#hcaptcha-navigation a{background:#f6f7f7;border:1px solid #2271b1;border-radius:3px;box-sizing:border-box;cursor:pointer;font-size:16px;height:30px;line-height:25px;text-align:center;width:30px}#hcaptcha-navigation a.disabled{background:#f6f7f7;border-color:#dcdcde;color:#a7aaad;cursor:default}#hcaptcha-navigation a.next:after,#hcaptcha-navigation a.prev:after{font-size:12px}#hcaptcha-navigation a.prev:after{content:"<"}#hcaptcha-navigation a.next:after{content:">"} -
hcaptcha-for-forms-and-more/tags/4.4.0/assets/js/admin-elementor-pro.js
r2956786 r3129246 66 66 this.filterItem 67 67 ); 68 68 69 elementor.hooks.addFilter( 69 70 'elementor_pro/forms/content_template/field/hcaptcha', -
hcaptcha-for-forms-and-more/tags/4.4.0/assets/js/apps/hcaptcha.js
r3114572 r3129246 1 (()=>{"use strict";function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(t){return function(t){if(Array.isArray(t))return n(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||r(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(t,e){if(t){if("string"==typeof t)return n(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}}function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function a(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,i(n.key),n)}}function i(e){var r=function(e,r){if("object"!=t(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var a=n.call(e,r||"default");if("object"!=t(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}(e,"string");return"symbol"==t(r)?r:r+""}var o=new(function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.foundForms=[],this.params=null,this.observing=!1,this.darkElement=null,this.darkClass=null,this.callback=this.callback.bind(this),this.validate=this.validate.bind(this)},n=[{key:"generateID",value:function(){var t=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return t()+"-"+t()+"-"+t()+"-"+t()}},{key:"getFoundFormById",value:function(t){return this.foundForms.filter((function(e){return t===e.hCaptchaId}))[0]}},{key:"getWidgetId",value:function(t){var e;if(void 0===t)return"";var r=t.getElementsByClassName("h-captcha")[0];if(void 0===r)return"";var n=r.getElementsByTagName("iframe")[0];return void 0===n?"":null!==(e=n.dataset.hcaptchaWidgetId)&&void 0!==e?e:""}},{key:"reset",value:function(t){var e=this.getWidgetId(t);e&&hcaptcha.reset(e)}},{key:"isSameOrDescendant",value:function(t,e){for(var r=e;r;){if(r===t)return!0;r=r.parentElement}return!1}},{key:"validate",value:function(t){var e=t.currentTarget.closest(this.formSelector),r=this.getFoundFormById(e.dataset.hCaptchaId).submitButtonElement;if(this.isSameOrDescendant(r,t.target)){t.preventDefault(),t.stopPropagation(),this.currentForm={formElement:e,submitButtonElement:r};var n=this.getWidgetId(e);if(n){var a=e.querySelector(".h-captcha iframe").dataset.hcaptchaResponse;""===a?hcaptcha.execute(n):this.callback(a)}}}},{key:"isValidated",value:function(){return void 0!==this.currentForm}},{key:"getForms",value:function(){return e(document.querySelectorAll(this.formSelector))}},{key:"getParams",value:function(){if(null!==this.params)return this.params;var t;try{ t=JSON.parse(HCaptchaMainObject.params)}catch(e){t={}}return t.callback=this.callback,t}},{key:"setParams",value:function(t){this.params=t}},{key:"setDarkData",value:function(){var t={"twenty-twenty-one":{darkStyleId:"twenty-twenty-one-style-css",darkElement:document.body,darkClass:"is-dark-theme"},"wp-dark-mode":{darkStyleId:"wp-dark-mode-frontend-css",darkElement:document.documentElement,darkClass:"wp-dark-mode-active"},"droit-dark-mode":{darkStyleId:"dtdr-public-inline-css",darkElement:document.documentElement,darkClass:"drdt-dark-mode"}};t=wp.hooks.applyFilters("hcaptcha.darkData",t);for(var e=0,r=Object.values(t);e<r.length;e++){var n=r[e];if(document.getElementById(n.darkStyleId))return this.darkElement=n.darkElement,void(this.darkClass=n.darkClass)}}},{key:"observeDarkMode",value:function(){var t=this;this.observing||(this.observing=!0,"auto"!==this.getParams().theme)||(this.setDarkData(),this.darkElement&&this.darkClass&&new MutationObserver((function(e){var n,a=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=r(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var a=0,i=function(){};return{s:i,n:function(){return a>=t.length?{done:!0}:{done:!1,value:t[a++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,u=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return u=t.done,t},e:function(t){s=!0,o=t},f:function(){try{u||null==n.return||n.return()}finally{if(s)throw o}}}}(e);try{var i=function(){var e=n.value.oldValue,r=t.darkElement.getAttribute("class");e=e?e.split(" "):[],(r=r?r.split(" "):[]).filter((function(t){return!e.includes(t)})).concat(e.filter((function(t){return!r.includes(t)}))).includes(t.darkClass)&&t.bindEvents()};for(a.s();!(n=a.n()).done;)i()}catch(t){a.e(t)}finally{a.f()}})).observe(this.darkElement,{attributes:!0,attributeOldValue:!0}))}},{key:"callback",value:function(t){document.dispatchEvent(new CustomEvent("hCaptchaSubmitted",{detail:{token:t}}));var e=this.getParams(),r=document.querySelector('iframe[data-hcaptcha-response="'+t+'"]'),n=r?r.closest(".h-captcha"):null,a=n?n.dataset.force:null;("invisible"===e.size||"true"===a&&this.isValidated())&&this.submit()}},{key:"applyAutoTheme",value:function(t){if("auto"!==t.theme)return t;if(t.theme="light",!this.darkElement)return t;var e=this.darkElement.getAttribute("class");return(e=e||"").includes(this.darkClass)&&(t.theme="dark"),t}},{key:"render",value:function(t){this.observeDarkMode();var e=this.applyAutoTheme(this.getParams());hcaptcha.render(t,e)}},{key:"bindEvents",value:function(){var t=this;"undefined"!=typeof hcaptcha&&(this.formSelector=wp.hooks.applyFilters("hcaptcha.formSelector","form, section.cwginstock-subscribe-form, div.sdm_download_item, .gform_editor, #nf-builder, .wpforms-captcha-preview"),this.submitButtonSelector=wp.hooks.applyFilters("hcaptcha.submitButtonSelector",'*[type="submit"]:not(.quform-default-submit), #check_config, button[type="button"].ff-btn, a.et_pb_newsletter_button.et_pb_button, .forminator-button-submit, .frm_button_submit, a.sdm_download, .uagb-forms-main-submit-button'),this.getForms().map((function(e){var r=e.querySelector(".h-captcha");if(null===r)return e;if(r.classList.contains("hcaptcha-widget-id"))return e;var n=r.querySelector("iframe");if(null!==n&&n.remove(),t.render(r),"invisible"!==r.dataset.size&&"true"!==r.dataset.force)return e;var a=e.querySelectorAll(t.submitButtonSelector)[0];if(!a)return e;var i=t.generateID();return t.foundForms.push({hCaptchaId:i,submitButtonElement:a}),e.dataset.hCaptchaId=i,a.addEventListener("click",t.validate,!0),e}),this))}},{key:"isAjaxSubmitButton",value:function(t){var e=t.getAttribute("type"),r="submit"!==(e=e?e.toLowerCase():"");return wp.hooks.applyFilters("hcaptcha.ajaxSubmitButton",r,t)}},{key:"submit",value:function(){var t=this.currentForm.formElement,e=this.currentForm.submitButtonElement;if("form"!==t.tagName.toLowerCase()||this.isAjaxSubmitButton(e))return e.removeEventListener("click",this.validate,!0),void e.click();t.requestSubmit?t.requestSubmit(e):t.submit()}}],n&&a(t.prototype,n),i&&a(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,i}());window.hCaptcha=o,window.hCaptchaGetWidgetId=function(t){o.getWidgetId(t)},window.hCaptchaReset=function(t){o.reset(t)},window.hCaptchaBindEvents=function(){o.bindEvents()},window.hCaptchaSubmit=function(){o.submit()},window.hCaptchaOnLoad=function(){function t(){window.hCaptchaBindEvents(),document.dispatchEvent(new CustomEvent("hCaptchaLoaded"))}"loading"===document.readyState?window.addEventListener("DOMContentLoaded",t):t()}})();1 (()=>{"use strict";function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(t){return function(t){if(Array.isArray(t))return n(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||r(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(t,e){if(t){if("string"==typeof t)return n(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}}function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function a(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,i(n.key),n)}}function i(e){var r=function(e,r){if("object"!=t(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var a=n.call(e,r||"default");if("object"!=t(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}(e,"string");return"symbol"==t(r)?r:r+""}var o=new(function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.foundForms=[],this.params=null,this.observing=!1,this.darkElement=null,this.darkClass=null,this.callback=this.callback.bind(this),this.validate=this.validate.bind(this)},n=[{key:"generateID",value:function(){var t=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return t()+"-"+t()+"-"+t()+"-"+t()}},{key:"getFoundFormById",value:function(t){return this.foundForms.filter((function(e){return t===e.hCaptchaId}))[0]}},{key:"getWidgetId",value:function(t){var e;if(void 0===t)return"";var r=t.getElementsByClassName("h-captcha")[0];if(void 0===r)return"";var n=r.getElementsByTagName("iframe")[0];return void 0===n?"":null!==(e=n.dataset.hcaptchaWidgetId)&&void 0!==e?e:""}},{key:"reset",value:function(t){var e=this.getWidgetId(t);e&&hcaptcha.reset(e)}},{key:"isSameOrDescendant",value:function(t,e){for(var r=e;r;){if(r===t)return!0;r=r.parentElement}return!1}},{key:"validate",value:function(t){var e=t.currentTarget.closest(this.formSelector),r=this.getFoundFormById(e.dataset.hCaptchaId).submitButtonElement;if(this.isSameOrDescendant(r,t.target)){t.preventDefault(),t.stopPropagation(),this.currentForm={formElement:e,submitButtonElement:r};var n=this.getWidgetId(e);if(n){var a=e.querySelector(".h-captcha iframe").dataset.hcaptchaResponse;""===a?hcaptcha.execute(n):this.callback(a)}}}},{key:"isValidated",value:function(){return void 0!==this.currentForm}},{key:"getForms",value:function(){return e(document.querySelectorAll(this.formSelector))}},{key:"getParams",value:function(){if(null!==this.params)return this.params;var t;try{var e,r;t=JSON.parse(wp.hooks.applyFilters("hcaptcha.params",null!==(e=null===(r=window)||void 0===r||null===(r=r.HCaptchaMainObject)||void 0===r?void 0:r.params)&&void 0!==e?e:""))}catch(e){t={}}return t.callback=this.callback,t}},{key:"setParams",value:function(t){this.params=t}},{key:"setDarkData",value:function(){var t={"twenty-twenty-one":{darkStyleId:"twenty-twenty-one-style-css",darkElement:document.body,darkClass:"is-dark-theme"},"wp-dark-mode":{darkStyleId:"wp-dark-mode-frontend-css",darkElement:document.documentElement,darkClass:"wp-dark-mode-active"},"droit-dark-mode":{darkStyleId:"dtdr-public-inline-css",darkElement:document.documentElement,darkClass:"drdt-dark-mode"}};t=wp.hooks.applyFilters("hcaptcha.darkData",t);for(var e=0,r=Object.values(t);e<r.length;e++){var n=r[e];if(document.getElementById(n.darkStyleId))return this.darkElement=n.darkElement,void(this.darkClass=n.darkClass)}}},{key:"observeDarkMode",value:function(){var t=this;this.observing||(this.observing=!0,"auto"!==this.getParams().theme)||(this.setDarkData(),this.darkElement&&this.darkClass&&new MutationObserver((function(e){var n,a=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=r(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var a=0,i=function(){};return{s:i,n:function(){return a>=t.length?{done:!0}:{done:!1,value:t[a++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,u=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return u=t.done,t},e:function(t){s=!0,o=t},f:function(){try{u||null==n.return||n.return()}finally{if(s)throw o}}}}(e);try{var i=function(){var e=n.value.oldValue,r=t.darkElement.getAttribute("class");e=e?e.split(" "):[],(r=r?r.split(" "):[]).filter((function(t){return!e.includes(t)})).concat(e.filter((function(t){return!r.includes(t)}))).includes(t.darkClass)&&t.bindEvents()};for(a.s();!(n=a.n()).done;)i()}catch(t){a.e(t)}finally{a.f()}})).observe(this.darkElement,{attributes:!0,attributeOldValue:!0}))}},{key:"callback",value:function(t){document.dispatchEvent(new CustomEvent("hCaptchaSubmitted",{detail:{token:t}}));var e=this.getParams(),r=document.querySelector('iframe[data-hcaptcha-response="'+t+'"]'),n=r?r.closest(".h-captcha"):null,a=n?n.dataset.force:null;("invisible"===e.size||"true"===a&&this.isValidated())&&this.submit()}},{key:"applyAutoTheme",value:function(t){if("auto"!==t.theme)return t;if(t.theme="light",!this.darkElement)return t;var e=this.darkElement.getAttribute("class");return(e=e||"").includes(this.darkClass)&&(t.theme="dark"),t}},{key:"render",value:function(t){this.observeDarkMode();var e=this.applyAutoTheme(this.getParams());hcaptcha.render(t,e)}},{key:"bindEvents",value:function(){var t=this;"undefined"!=typeof hcaptcha&&(this.formSelector=wp.hooks.applyFilters("hcaptcha.formSelector","form, section.cwginstock-subscribe-form, div.sdm_download_item, .gform_editor, #nf-builder, .wpforms-captcha-preview"),this.submitButtonSelector=wp.hooks.applyFilters("hcaptcha.submitButtonSelector",'*[type="submit"]:not(.quform-default-submit), #check_config, button[type="button"].ff-btn, a.et_pb_newsletter_button.et_pb_button, .forminator-button-submit, .frm_button_submit, a.sdm_download, .uagb-forms-main-submit-button'),this.getForms().map((function(e){var r=e.querySelector(".h-captcha");if(null===r)return e;if(r.classList.contains("hcaptcha-widget-id"))return e;var n=r.querySelector("iframe");if(null!==n&&n.remove(),t.render(r),"invisible"!==r.dataset.size&&"true"!==r.dataset.force)return e;var a=e.querySelectorAll(t.submitButtonSelector)[0];if(!a)return e;var i=t.generateID();return t.foundForms.push({hCaptchaId:i,submitButtonElement:a}),e.dataset.hCaptchaId=i,a.addEventListener("click",t.validate,!0),e}),this))}},{key:"isAjaxSubmitButton",value:function(t){var e=t.getAttribute("type"),r="submit"!==(e=e?e.toLowerCase():"");return wp.hooks.applyFilters("hcaptcha.ajaxSubmitButton",r,t)}},{key:"submit",value:function(){var t=this.currentForm.formElement,e=this.currentForm.submitButtonElement;if("form"!==t.tagName.toLowerCase()||this.isAjaxSubmitButton(e))return e.removeEventListener("click",this.validate,!0),void e.click();t.requestSubmit?t.requestSubmit(e):t.submit()}}],n&&a(t.prototype,n),i&&a(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,i}());window.hCaptcha=o,window.hCaptchaGetWidgetId=function(t){o.getWidgetId(t)},window.hCaptchaReset=function(t){o.reset(t)},window.hCaptchaBindEvents=function(){o.bindEvents()},window.hCaptchaSubmit=function(){o.submit()},window.hCaptchaOnLoad=function(){function t(){window.hCaptchaBindEvents(),document.dispatchEvent(new CustomEvent("hCaptchaLoaded"))}"loading"===document.readyState?window.addEventListener("DOMContentLoaded",t):t()}})(); -
hcaptcha-for-forms-and-more/tags/4.4.0/assets/js/hcaptcha-elementor-pro.js
r2956786 r3129246 19 19 } 20 20 21 wp.hooks.addFilter( 22 'hcaptcha.params', 23 'hcaptcha', 24 () => { 25 // noinspection JSUnresolvedReference 26 return window?.parent?.HCaptchaMainObject?.params ?? ''; 27 } 28 ); 29 21 30 elementorFrontend.hooks.addAction( 22 31 'frontend/element_ready/widget', -
hcaptcha-for-forms-and-more/tags/4.4.0/assets/js/hcaptcha-elementor-pro.min.js
r2956786 r3129246 1 (()=>{jQuery(document).on("ajaxSuccess",(function(e,n,o){var t=new URLSearchParams(o.data);if("elementor_pro_forms_send_form"===t.get("action")){var r=t.get("form_id"),a=jQuery('input[name="form_id"][value="'+r+'"]').closest("form");window.hCaptchaReset(a[0])}}));var e=function(){"undefined"!=typeof elementorFrontend&&elementorFrontend.hooks.addAction("frontend/element_ready/widget",(function(e){e[0].classList.contains("elementor-widget-form")&&hCaptchaBindEvents()}))};window.hCaptchaElementorPro=e,jQuery(document).ready(e)})();1 (()=>{jQuery(document).on("ajaxSuccess",(function(e,n,o){var t=new URLSearchParams(o.data);if("elementor_pro_forms_send_form"===t.get("action")){var a=t.get("form_id"),r=jQuery('input[name="form_id"][value="'+a+'"]').closest("form");window.hCaptchaReset(r[0])}}));var e=function(){"undefined"!=typeof elementorFrontend&&(wp.hooks.addFilter("hcaptcha.params","hcaptcha",(function(){var e,n;return null!==(e=null===(n=window)||void 0===n||null===(n=n.parent)||void 0===n||null===(n=n.HCaptchaMainObject)||void 0===n?void 0:n.params)&&void 0!==e?e:""})),elementorFrontend.hooks.addAction("frontend/element_ready/widget",(function(e){e[0].classList.contains("elementor-widget-form")&&hCaptchaBindEvents()})))};window.hCaptchaElementorPro=e,jQuery(document).ready(e)})(); -
hcaptcha-for-forms-and-more/tags/4.4.0/assets/js/hcaptcha-nf.js
r3064004 r3129246 3 3 */ 4 4 5 /* global hcaptcha, Marionette, Backbone*/5 /* global hcaptcha, Marionette, nfRadio */ 6 6 7 7 wp.hooks.addFilter( … … 21 21 initialize() { 22 22 // On the Form Submission's field validation. 23 const submitChannel = Backbone.Radio.channel( 'submit' );23 const submitChannel = nfRadio.channel( 'submit' ); 24 24 this.listenTo( submitChannel, 'validate:field', this.updateHcaptcha ); 25 25 this.listenTo( submitChannel, 'validate:field', this.updateHcaptcha ); 26 26 27 27 // On the Field's model value change. 28 const fieldsChannel = Backbone.Radio.channel( 'fields' );28 const fieldsChannel = nfRadio.channel( 'fields' ); 29 29 this.listenTo( fieldsChannel, 'change:modelValue', this.updateHcaptcha ); 30 30 }, … … 39 39 if ( model.get( 'value' ) ) { 40 40 // Remove Error from Model. 41 Backbone.Radio.channel( 'fields' ).request(41 nfRadio.channel( 'fields' ).request( 42 42 'remove:error', 43 43 model.get( 'id' ), … … 70 70 const data = options.data ?? ''; 71 71 72 if ( ! ( typeof data === 'string' || data instanceof String ) ) { 73 return; 74 } 75 72 76 if ( ! data.startsWith( 'action=nf_ajax_submit' ) ) { 73 77 return; -
hcaptcha-for-forms-and-more/tags/4.4.0/assets/js/hcaptcha-nf.min.js
r3064004 r3129246 1 (()=>{var a;wp.hooks.addFilter("hcaptcha.ajaxSubmitButton","hcaptcha",(function(a, e){return!!e.classList.contains("nf-element")||a})),document.addEventListener("DOMContentLoaded",(function(){var a=Marionette.Object.extend({initialize:function(){var a=Backbone.Radio.channel("submit");this.listenTo(a,"validate:field",this.updateHcaptcha),this.listenTo(a,"validate:field",this.updateHcaptcha);var e=Backbone.Radio.channel("fields");this.listenTo(e,"change:modelValue",this.updateHcaptcha)},updateHcaptcha:function(a){if("hcaptcha-for-ninja-forms"===a.get("type"))if(a.get("value"))Backbone.Radio.channel("fields").request("remove:error",a.get("id"),"required-error");else{var e=a.get("id"),t=document.querySelector('.h-captcha[data-fieldId="'+e+'"] iframe');if(!t)return;var i=t.dataset.hcaptchaWidgetId,n=hcaptcha.getResponse(i);a.set("value",n)}}});window.hCaptchaFieldController=new a})),(a=jQuery).ajaxPrefilter((function(e){var t,i=null!==(t=e.data)&&void 0!==t?t:"";if(i.startsWith("action=nf_ajax_submit")){var n=new URLSearchParams(i),c=JSON.parse(n.get("formData")).id,d=a("#nf-form-"+c+"-cont").find('[name="hcaptcha-widget-id"]').val();d=d||"",e.data+="&hcaptcha-widget-id="+d}}))})();1 (()=>{var a;wp.hooks.addFilter("hcaptcha.ajaxSubmitButton","hcaptcha",(function(a,t){return!!t.classList.contains("nf-element")||a})),document.addEventListener("DOMContentLoaded",(function(){var a=Marionette.Object.extend({initialize:function(){var a=nfRadio.channel("submit");this.listenTo(a,"validate:field",this.updateHcaptcha),this.listenTo(a,"validate:field",this.updateHcaptcha);var t=nfRadio.channel("fields");this.listenTo(t,"change:modelValue",this.updateHcaptcha)},updateHcaptcha:function(a){if("hcaptcha-for-ninja-forms"===a.get("type"))if(a.get("value"))nfRadio.channel("fields").request("remove:error",a.get("id"),"required-error");else{var t=a.get("id"),e=document.querySelector('.h-captcha[data-fieldId="'+t+'"] iframe');if(!e)return;var i=e.dataset.hcaptchaWidgetId,n=hcaptcha.getResponse(i);a.set("value",n)}}});window.hCaptchaFieldController=new a})),(a=jQuery).ajaxPrefilter((function(t){var e,i=null!==(e=t.data)&&void 0!==e?e:"";if(("string"==typeof i||i instanceof String)&&i.startsWith("action=nf_ajax_submit")){var n=new URLSearchParams(i),c=JSON.parse(n.get("formData")).id,d=a("#nf-form-"+c+"-cont").find('[name="hcaptcha-widget-id"]').val();d=d||"",t.data+="&hcaptcha-widget-id="+d}}))})(); -
hcaptcha-for-forms-and-more/tags/4.4.0/assets/js/hcaptcha-wpdiscuz-comment.js
r3064004 r3129246 3 3 */ 4 4 5 wp.hooks.addFilter( 6 'hcaptcha.ajaxSubmitButton', 7 'hcaptcha', 8 ( isAjaxSubmitButton, submitButtonElement ) => { 9 if ( submitButtonElement.classList.contains( 'wc_comm_submit' ) ) { 10 return true; 5 /* global jQuery */ 6 7 document.addEventListener( 'DOMContentLoaded', function() { 8 wp.hooks.addFilter( 9 'hcaptcha.ajaxSubmitButton', 10 'hcaptcha', 11 ( isAjaxSubmitButton, submitButtonElement ) => { 12 if ( submitButtonElement.classList.contains( 'wc_comm_submit' ) ) { 13 return true; 14 } 15 16 return isAjaxSubmitButton; 11 17 } 18 ); 12 19 13 return isAjaxSubmitButton; 20 const threadsElement = document.getElementById( 'wpd-threads' ); 21 22 if ( ! threadsElement ) { 23 return; 14 24 } 15 ); 25 26 // Define the callback function for the MutationObserver. 27 const observerCallback = function( mutationsList ) { 28 for ( const mutation of mutationsList ) { 29 [ ...mutation.addedNodes ].map( ( node ) => { 30 if ( 31 node.nodeType === Node.ELEMENT_NODE && 32 node.classList.contains( 'wpd-form' ) && 33 node.querySelector( '.h-captcha' ) 34 ) { 35 window.hCaptchaBindEvents(); 36 } 37 38 return node; 39 } ); 40 } 41 }; 42 43 // Create a MutationObserver instance. 44 const observer = new MutationObserver( observerCallback ); 45 46 const config = { 47 childList: true, 48 subtree: true, 49 }; 50 51 // Start observing the #wpd-threads element for child node additions. 52 observer.observe( threadsElement, config ); 53 } ); 54 55 jQuery( document ).on( 'ajaxSuccess', function( event, xhr, settings ) { 56 const params = new URLSearchParams( settings.data ); 57 58 if ( params.get( 'action' ) !== 'wpdAddComment' ) { 59 return; 60 } 61 62 window.hCaptchaBindEvents(); 63 } ); -
hcaptcha-for-forms-and-more/tags/4.4.0/assets/js/hcaptcha-wpdiscuz-comment.min.js
r3064004 r3129246 1 wp.hooks.addFilter("hcaptcha.ajaxSubmitButton","hcaptcha",(function(t,a){return!!a.classList.contains("wc_comm_submit")||t}));1 (()=>{function t(t){return function(t){if(Array.isArray(t))return e(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||n(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(t,n){if(t){if("string"==typeof t)return e(t,n);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?e(t,n):void 0}}function e(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,r=Array(n);e<n;e++)r[e]=t[e];return r}document.addEventListener("DOMContentLoaded",(function(){wp.hooks.addFilter("hcaptcha.ajaxSubmitButton","hcaptcha",(function(t,n){return!!n.classList.contains("wc_comm_submit")||t}));var e=document.getElementById("wpd-threads");if(e){new MutationObserver((function(e){var r,o=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=n(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var o=0,a=function(){};return{s:a,n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,u=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return u=t.done,t},e:function(t){c=!0,i=t},f:function(){try{u||null==r.return||r.return()}finally{if(c)throw i}}}}(e);try{for(o.s();!(r=o.n()).done;){t(r.value.addedNodes).map((function(t){return t.nodeType===Node.ELEMENT_NODE&&t.classList.contains("wpd-form")&&t.querySelector(".h-captcha")&&window.hCaptchaBindEvents(),t}))}}catch(t){o.e(t)}finally{o.f()}})).observe(e,{childList:!0,subtree:!0})}})),jQuery(document).on("ajaxSuccess",(function(t,n,e){"wpdAddComment"===new URLSearchParams(e.data).get("action")&&window.hCaptchaBindEvents()}))})(); -
hcaptcha-for-forms-and-more/tags/4.4.0/assets/js/notifications.js
r2991126 r3129246 10 10 11 11 /** 12 * Notification slogic.12 * Notification logic. 13 13 * 14 14 * @param {Object} $ jQuery instance. … … 20 20 const notificationSelector = 'div.hcaptcha-notification'; 21 21 const dismissSelector = notificationsSelector + ' button.notice-dismiss'; 22 const navSpanSelector = '#hcaptcha-navigation span'; 23 const navPageSelector = '#hcaptcha-navigation-page'; 24 const navPagesSelector = '#hcaptcha-navigation-pages'; 22 25 const navPrevSelector = '#hcaptcha-navigation .prev'; 23 26 const navNextSelector = '#hcaptcha-navigation .next'; … … 51 54 52 55 if ( index >= 0 ) { 56 $( navPageSelector ).text( index + 1 ); 57 $( navPagesSelector ).text( $notifications.length ); 58 $( navSpanSelector ).show(); 53 59 $( navSelectors ).removeClass( 'disabled' ); 54 60 } else { 61 $( navSpanSelector ).hide(); 55 62 $( navSelectors ).addClass( 'disabled' ); 56 63 return; -
hcaptcha-for-forms-and-more/tags/4.4.0/assets/js/notifications.min.js
r2991126 r3129246 1 jQuery(document).ready((function(t){var i,a="form#hcaptcha-options",n="div#hcaptcha-notifications",o="div.hcaptcha-notification",c=n+" button.notice-dismiss",e="#hcaptcha-navigation .prev",s="#hcaptcha-navigation .next",r=e+", "+s,d=".hcaptcha-notification-buttons",h="#hcaptcha-notifications-footer",f=function(){if(!(i=t(o)).length)return!1;var a=0;return i.each((function(i){if(t(this).is(":visible"))return a=i,!1})),a},l=function(){var a=f();a>=0?(t(r).removeClass("disabled"),0===a&&t(e).addClass("disabled"),a===i.length-1&&t(s).addClass("disabled")):t(r).addClass("disabled")},u=function(){var a=f();t(h).find(d).remove(),a<0||t(i[a]).find(d).clone().removeClass("hidden").prependTo(h)};t(a).on("click",c,(function(i){var a=t(i.target).closest(o),c={action:HCaptchaNotificationsObject.dismissNotificationAction,nonce:HCaptchaNotificationsObject.dismissNotificationNonce,id:a.data("id")},e=t(o).index(a)+1;e=e<t(o).length?e:0;var s=t(o).eq(e);return a.remove(),s.show(),l(),u(),0===t(o).length&&t(n).remove(),t.post({url:HCaptchaNotificationsObject.ajaxUrl,data:c}),!1})),t(a).on("click",r,(function(a){var n=1;t(a.target).hasClass("prev")&&(n=-1);var o=f(),c=o+n;o>=0&&c!==o&&c>=0&&c<i.length&&(t(i[o]).hide(),t(i[c]).show(),l(),u())})),t("button#reset_notifications").on("click",(function(){var i={action:HCaptchaNotificationsObject.resetNotificationAction,nonce:HCaptchaNotificationsObject.resetNotificationNonce};t.post({url:HCaptchaNotificationsObject.ajaxUrl,data:i}).success((function(i){i.success&&(t(n).remove(),t(i.data).insertBefore("h3.hcaptcha-section-keys"),u(),t(document).trigger("wp-updates-notice-added"))}))})),u()}));1 jQuery(document).ready((function(t){var a,i="form#hcaptcha-options",n="div#hcaptcha-notifications",c="div.hcaptcha-notification",o=n+" button.notice-dismiss",e="#hcaptcha-navigation span",s="#hcaptcha-navigation .prev",r="#hcaptcha-navigation .next",h=s+", "+r,d=".hcaptcha-notification-buttons",f="#hcaptcha-notifications-footer",p=function(){if(!(a=t(c)).length)return!1;var i=0;return a.each((function(a){if(t(this).is(":visible"))return i=a,!1})),i},l=function(){var i=p();if(!(i>=0))return t(e).hide(),void t(h).addClass("disabled");t("#hcaptcha-navigation-page").text(i+1),t("#hcaptcha-navigation-pages").text(a.length),t(e).show(),t(h).removeClass("disabled"),0===i&&t(s).addClass("disabled"),i===a.length-1&&t(r).addClass("disabled")},v=function(){var i=p();t(f).find(d).remove(),i<0||t(a[i]).find(d).clone().removeClass("hidden").prependTo(f)};t(i).on("click",o,(function(a){var i=t(a.target).closest(c),o={action:HCaptchaNotificationsObject.dismissNotificationAction,nonce:HCaptchaNotificationsObject.dismissNotificationNonce,id:i.data("id")},e=t(c).index(i)+1;e=e<t(c).length?e:0;var s=t(c).eq(e);return i.remove(),s.show(),l(),v(),0===t(c).length&&t(n).remove(),t.post({url:HCaptchaNotificationsObject.ajaxUrl,data:o}),!1})),t(i).on("click",h,(function(i){var n=1;t(i.target).hasClass("prev")&&(n=-1);var c=p(),o=c+n;c>=0&&o!==c&&o>=0&&o<a.length&&(t(a[c]).hide(),t(a[o]).show(),l(),v())})),t("button#reset_notifications").on("click",(function(){var a={action:HCaptchaNotificationsObject.resetNotificationAction,nonce:HCaptchaNotificationsObject.resetNotificationNonce};t.post({url:HCaptchaNotificationsObject.ajaxUrl,data:a}).success((function(a){a.success&&(t(n).remove(),t(a.data).insertBefore("h3.hcaptcha-section-keys"),v(),t(document).trigger("wp-updates-notice-added"))}))})),v()})); -
hcaptcha-for-forms-and-more/tags/4.4.0/changelog.txt
r3115148 r3129246 1 = 4.4.0 = 2 * Added compatibility with Contact Form 7 Stripe integration. 3 * Added compatibility with WPS Hide Login plugin. 4 * Added compatibility with LoginPress plugin. 5 * Improved compatibility with Wordfence Login Security plugin. 6 * Updated MailPoet integration. 7 * Fixed conflict with Ninja Forms Upload field. 8 * Fixed Ninja Forms Ajax processing. 9 * Fixed error in cron with Matomo Analytics. 10 * Fixed error with the Elementor Checkout Element. 11 * Fixed ignorance of Pro params in the Elementor admin editor. 12 * Fixed inability to activate the Elementor Pro plugin when Elementor plugin is activated. 13 * Fixed sending replies to wpDiscuz comments. 14 * Fixed replies in the WP Dashboard with wpDiscuz active. 15 * Fixed sending several wpDiscuz comments without a page reload. 16 1 17 = 4.3.1 = 2 18 * Added a live form in the Contact Form 7 admin form view. -
hcaptcha-for-forms-and-more/tags/4.4.0/hcaptcha.php
r3115148 r3129246 11 11 * Plugin URI: https://www.hcaptcha.com/ 12 12 * Description: hCaptcha keeps out bots and spam while putting privacy first. It is a drop-in replacement for reCAPTCHA. 13 * Version: 4. 3.113 * Version: 4.4.0 14 14 * Requires at least: 5.3 15 15 * Requires PHP: 7.2 … … 40 40 * Plugin version. 41 41 */ 42 const HCAPTCHA_VERSION = '4. 3.1';42 const HCAPTCHA_VERSION = '4.4.0'; 43 43 44 44 /** -
hcaptcha-for-forms-and-more/tags/4.4.0/readme.txt
r3115148 r3129246 5 5 Tested up to: 6.6 6 6 Requires PHP: 7.2 7 Stable tag: 4. 3.17 Stable tag: 4.4.0 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 17 17 Need to keep out bots? hCaptcha protects privacy while offering better protection against spam and abuse. Help build a better web. 18 18 19 [The hCaptcha for WP many advantages over similar captcha plugins](https://kagg.eu/why-choose-hcaptcha-for-wp/). 20 19 21 == How hCaptcha Works == 20 22 … … 29 31 == Screenshots == 30 32 31 1. Login page with hCaptcha widget 32 2. Login page with hCaptcha challenge 33 3. WooCommerce Login/Register page 34 4. Contact Form 7 with hCaptcha 35 5. Contact Form 7 live form in the admin editor. 36 6. General settings page 37 7. Integrations settings page 38 8. Activating plugin from the Integration settings page 39 9. (Optional) Local Forms statistics 40 10. (Optional) Local Events statistics 33 1. Login page with hCaptcha widget. 34 2. Login page with hCaptcha challenge. 35 3. WooCommerce Login/Register page. 36 4. Contact Form 7 with hCaptcha. 37 5. Contact Form 7 live form in the admin editor. 38 6. Elementor Pro Form. 39 7. Elementor Pro From in admin editor. 40 8. General settings page. 41 9. Integrations settings page. 42 10. Activating plugin from the Integration settings page. 43 11. (Optional) Local Forms statistics. 44 12. (Optional) Local Events statistics. 41 45 42 46 == Installation == … … 562 566 == Changelog == 563 567 568 = 4.4.0 = 569 * Added compatibility with Contact Form 7 Stripe integration. 570 * Added compatibility with WPS Hide Login plugin. 571 * Added compatibility with LoginPress plugin. 572 * Improved compatibility with Wordfence Login Security plugin. 573 * Updated MailPoet integration. 574 * Fixed conflict with Ninja Forms Upload field. 575 * Fixed Ninja Forms Ajax processing. 576 * Fixed error in cron with Matomo Analytics. 577 * Fixed error with the Elementor Checkout Element. 578 * Fixed ignorance of Pro params in the Elementor admin editor. 579 * Fixed inability to activate the Elementor Pro plugin when Elementor plugin is activated. 580 * Fixed sending replies to wpDiscuz comments. 581 * Fixed replies in the WP Dashboard with wpDiscuz active. 582 * Fixed sending several wpDiscuz comments without a page reload. 583 564 584 = 4.3.1 = 565 585 * Added a live form in the Contact Form 7 admin form view. -
hcaptcha-for-forms-and-more/tags/4.4.0/src/php/Admin/Notifications.php
r3114572 r3129246 113 113 $statistics_url = $general_url . '#statistics_1'; 114 114 $force_url = $general_url . '#force_1'; 115 $elementor_edit_form_url = HCAPTCHA_URL . '/assets/images/elementor-edit-form.png'; 115 116 116 117 $notifications = [ … … 270 271 ], 271 272 ], 273 // Added in 4.4.0. 274 'admin-elementor' => [ 275 'title' => __( 'Add hCaptcha to Elementor Pro Form', 'hcaptcha-for-forms-and-more' ), 276 'message' => __( 'Add hCaptcha to Elementor Pro Form in the Elementor admin editor.', 'hcaptcha-for-forms-and-more' ), 277 'button' => [ 278 'url' => $elementor_edit_form_url, 279 'text' => __( 'See an example', 'hcaptcha-for-forms-and-more' ), 280 ], 281 ], 272 282 ]; 273 283 … … 282 292 } 283 293 294 if ( $settings->is_on( 'statistics' ) ) { 295 unset( $notifications['statistics'] ); 296 } 297 298 if ( $settings->is_on( 'statistics' ) && $settings->is_pro() ) { 299 unset( $notifications['events_page'] ); 300 } 301 284 302 if ( $settings->is_on( 'force' ) ) { 285 303 unset( $notifications['force'] ); 286 304 } 287 305 288 return $notifications; 306 if ( ! class_exists( '\ElementorPro\Plugin', false ) ) { 307 unset( $notifications['admin-elementor'] ); 308 } 309 310 // Added in 4.4.0. 311 return array_merge( $notifications, $this->cf7_admin_notification() ); 312 } 313 314 /** 315 * Contact Form 7 admin notification. 316 * 317 * @return array 318 */ 319 private function cf7_admin_notification(): array { 320 if ( ! class_exists( 'WPCF7_ContactForm' ) ) { 321 return []; 322 } 323 324 // Get the latest CF7 form. 325 $args = [ 326 'post_type' => 'wpcf7_contact_form', 327 'posts_per_page' => 1, 328 'orderby' => 'date', 329 'order' => 'DESC', 330 ]; 331 $cf7_forms = get_posts( $args ); 332 333 if ( empty( $cf7_forms ) ) { 334 return []; 335 } 336 337 $form_id = $cf7_forms[0]->ID; 338 $edit_url = admin_url( "?page=wpcf7&post=$form_id&action=edit#postbox-container-live" ); 339 340 return [ 341 'admin-cf7' => [ 342 'title' => __( 'Live form in Contact Form 7 admin', 'hcaptcha-for-forms-and-more' ), 343 'message' => __( 'With the hCaptcha plugin, you can see a live form on the form edit admin page.', 'hcaptcha-for-forms-and-more' ), 344 'button' => [ 345 'url' => $edit_url, 346 'text' => __( 'Use live form', 'hcaptcha-for-forms-and-more' ), 347 ], 348 ], 349 ]; 289 350 } 290 351 … … 358 419 <div id="hcaptcha-notifications-footer"> 359 420 <div id="hcaptcha-navigation"> 421 <span> 422 <span id="hcaptcha-navigation-page">1</span> 423 <?php esc_html_e( 'of', 'hcaptcha-for-forms-and-more' ); ?> 424 <span id="hcaptcha-navigation-pages"><?php echo count( $notifications ); ?></span> 425 </span> 360 426 <a class="prev disabled"></a> 361 427 <a class="next <?php echo esc_attr( $next_disabled ); ?>"></a> -
hcaptcha-for-forms-and-more/tags/4.4.0/src/php/AutoVerify/AutoVerify.php
r3114572 r3129246 74 74 */ 75 75 public function verify_form(): void { 76 if ( ! Request::is_frontend() ) { 77 return; 78 } 79 80 $request_method = isset( $_SERVER['REQUEST_METHOD'] ) ? filter_var( wp_unslash( $_SERVER['REQUEST_METHOD'] ), FILTER_SANITIZE_FULL_SPECIAL_CHARS ) : ''; 81 82 if ( 'POST' !== $request_method ) { 76 if ( ! Request::is_post() || ! Request::is_frontend() ) { 83 77 return; 84 78 } -
hcaptcha-for-forms-and-more/tags/4.4.0/src/php/CF7/Admin.php
r3115148 r3129246 47 47 * Current screen. 48 48 * 49 * @param mixed $current_screen Current screen.49 * @param WP_Screen|mixed $current_screen Current screen. 50 50 * 51 51 * @return void … … 54 54 $current_screen_id = $current_screen->id ?? ''; 55 55 56 if ( ! $current_screen ) {56 if ( ! $current_screen_id ) { 57 57 return; 58 58 } … … 109 109 110 110 $form_shortcode = htmlspecialchars_decode( $m[1] ); 111 $live_form = do_shortcode( $form_shortcode ); 112 $stripe_message = ''; 113 114 if ( $this->has_stripe_element( $live_form ) ) { 115 $stripe_message = 116 '<h4><em>' . 117 __( 'The Stripe payment element already contains an invisible hCaptcha. No need to add it to the form.', 'hcaptcha-for-forms-and-more' ) . 118 '</em></h4>'; 119 } 111 120 112 121 $live_container = … … 114 123 '<div id="postbox-container-live" class="postbox-container">' . 115 124 '<div id="form-live">' . 116 '<h3>Live Form</h3>' . 117 do_shortcode( $form_shortcode ) . 125 '<h3>' . __( 'Live Form', 'hcaptcha-for-forms-and-more' ) . '</h3>' . 126 $stripe_message . 127 $live_form . 118 128 '</div>' . 119 129 '</div>' . … … 290 300 * @return bool 291 301 */ 292 pr ivatefunction is_cf7_form_admin_page(): bool {302 protected function is_cf7_form_admin_page(): bool { 293 303 294 304 // phpcs:ignore WordPress.Security.NonceVerification.Recommended -
hcaptcha-for-forms-and-more/tags/4.4.0/src/php/CF7/Base.php
r3114572 r3129246 43 43 $this->mode_embed = hcaptcha()->settings()->is( 'cf7_status', 'embed' ); 44 44 } 45 46 /** 47 * Whether the form contains a Stripe element. 48 * 49 * @param string $output Output. 50 * 51 * @return bool 52 */ 53 protected function has_stripe_element( string $output ): bool { 54 return false !== strpos( $output, '<div class="wpcf7-stripe">' ); 55 } 45 56 } -
hcaptcha-for-forms-and-more/tags/4.4.0/src/php/CF7/CF7.php
r3114572 r3129246 59 59 * @param array $m Regular expression match array. 60 60 * 61 * @return string |mixed61 * @return string 62 62 * @noinspection PhpUnusedParameterInspection 63 63 */ 64 public function wpcf7_shortcode( $output, string $tag, $attr, array $m ) { 64 public function wpcf7_shortcode( $output, string $tag, $attr, array $m ): string { 65 $output = (string) $output; 66 65 67 if ( 'contact-form-7' !== $tag ) { 66 68 return $output; 67 69 } 68 70 69 $output = (string) $output; 71 if ( $this->has_stripe_element( $output ) ) { 72 /** 73 * Do not show hCaptcha in the CF7 form having Stripe field. 74 * Stripe payment form has its own hidden hCaptcha field. 75 */ 76 return preg_replace( '/\[cf7-hcaptcha.*?]/', '', $output ); 77 } 78 70 79 $form_id = isset( $attr['id'] ) ? (int) $attr['id'] : 0; 71 80 $cf7_hcap_shortcode = $this->get_cf7_hcap_shortcode( $output ); … … 184 193 } 185 194 195 if ( $this->has_field( $submission, 'stripe' ) ) { 196 /** 197 * Do not verify CF7 form having Stripe field. 198 * Stripe payment form has its own hidden hCaptcha field. 199 */ 200 return $result; 201 } 202 186 203 if ( 187 204 ! $this->mode_auto && 188 ! ( $this->mode_embed && $this->has_ hcaptcha_field( $submission) )205 ! ( $this->mode_embed && $this->has_field( $submission, 'hcaptcha' ) ) 189 206 ) { 190 207 return $result; … … 203 220 204 221 /** 205 * Whether the field is hCaptcha field. 206 * 207 * @param WPCF7_FormTag $field Field. 222 * Whether form has a field of given type. 223 * 224 * @param WPCF7_Submission $submission Submission. 225 * @param string $type Field type. 208 226 * 209 227 * @return bool 210 228 */ 211 private function is_hcaptcha_field( WPCF7_FormTag $field ): bool { 212 return ( 'hcaptcha' === $field->type ); 213 } 214 215 /** 216 * Whether form has its own hCaptcha field. 217 * 218 * @param WPCF7_Submission $submission Submission. 219 * 220 * @return bool 221 */ 222 protected function has_hcaptcha_field( WPCF7_Submission $submission ): bool { 229 protected function has_field( WPCF7_Submission $submission, string $type ): bool { 223 230 $form_fields = $submission->get_contact_form()->scan_form_tags(); 224 231 225 232 foreach ( $form_fields as $form_field ) { 226 if ( $t his->is_hcaptcha_field( $form_field )) {233 if ( $type === $form_field->type ) { 227 234 return true; 228 235 } -
hcaptcha-for-forms-and-more/tags/4.4.0/src/php/ElementorPro/Login.php
r3114572 r3129246 92 92 $signatures = (string) ob_get_clean(); 93 93 94 $pattern = '/(<div class="elementor-field-group.+ <button type="submit")/s';94 $pattern = '/(<div class="elementor-field-group.+?<button type="submit")/s'; 95 95 $replacement = $hcaptcha . $signatures . "\n$1"; 96 96 $form = preg_replace( $pattern, $replacement, $form ); -
hcaptcha-for-forms-and-more/tags/4.4.0/src/php/EssentialAddons/Login.php
r3114572 r3129246 82 82 wp_safe_redirect( wp_unslash( $_SERVER['HTTP_REFERER'] ) ); 83 83 84 exit();84 $this->exit(); 85 85 } 86 86 } 87 88 /** 89 * Wrapper for exit(). Used for tests. 90 * 91 * @return void 92 */ 93 protected function exit(): void { 94 // @codeCoverageIgnoreStart 95 exit(); 96 // @codeCoverageIgnoreEnd 97 } 87 98 } -
hcaptcha-for-forms-and-more/tags/4.4.0/src/php/EssentialAddons/Register.php
r3114572 r3129246 24 24 * Nonce action. 25 25 */ 26 const ACTION = 'hcaptcha_essential_addons_register';26 private const ACTION = 'hcaptcha_essential_addons_register'; 27 27 28 28 /** 29 29 * Nonce name. 30 30 */ 31 const NONCE = 'hcaptcha_essential_addons_register_nonce';31 private const NONCE = 'hcaptcha_essential_addons_register_nonce'; 32 32 33 33 /** … … 98 98 wp_safe_redirect( wp_unslash( $_SERVER['HTTP_REFERER'] ) ); 99 99 100 exit();100 $this->exit(); 101 101 } 102 102 } … … 118 118 HCaptcha::css_display( $css ); 119 119 } 120 121 /** 122 * Wrapper for exit(). Used for tests. 123 * 124 * @return void 125 */ 126 protected function exit(): void { 127 // @codeCoverageIgnoreStart 128 exit(); 129 // @codeCoverageIgnoreEnd 130 } 120 131 } -
hcaptcha-for-forms-and-more/tags/4.4.0/src/php/GiveWP/Base.php
r3114572 r3129246 15 15 use Give\DonationForms\ValueObjects\DonationFormErrorTypes; 16 16 use HCaptcha\Helpers\HCaptcha; 17 use HCaptcha\Helpers\Request; 17 18 use WP_Error; 18 19 … … 129 130 */ 130 131 public function verify_block(): void { 131 // phpcs:disable WordPress.Security.NonceVerification.Missing, WordPress.Security.NonceVerification.Recommended 132 $request_method = isset( $_SERVER['REQUEST_METHOD'] ) 133 ? sanitize_text_field( wp_unslash( $_SERVER['REQUEST_METHOD'] ) ) 134 : ''; 135 // phpcs:enable WordPress.Security.NonceVerification.Missing, WordPress.Security.NonceVerification.Recommended 136 137 if ( 'POST' !== $request_method ) { 132 if ( ! Request::is_post() ) { 138 133 return; 139 134 } -
hcaptcha-for-forms-and-more/tags/4.4.0/src/php/Helpers/HCaptcha.php
r3114572 r3129246 13 13 namespace HCaptcha\Helpers; 14 14 15 use HCaptcha\Vendor \MatthiasMullie\Minify\CSS;16 use HCaptcha\Vendor \MatthiasMullie\Minify\JS;15 use HCaptcha\Vendors\MatthiasMullie\Minify\CSS; 16 use HCaptcha\Vendors\MatthiasMullie\Minify\JS; 17 17 use WP_Error; 18 18 … … 167 167 value="<?php echo esc_attr( $widget_id ); ?>"> 168 168 <?php 169 } 170 171 /** 172 * Get signature. 173 * 174 * @param string $class_name Class name. 175 * @param int|string $form_id Form id. 176 * @param bool $hcaptcha_shown The hCaptcha was shown. 177 * 178 * @return string 179 */ 180 public static function get_signature( string $class_name, $form_id, bool $hcaptcha_shown ): string { 181 ob_start(); 182 self::display_signature( $class_name, $form_id, $hcaptcha_shown ); 183 184 return (string) ob_get_clean(); 169 185 } 170 186 -
hcaptcha-for-forms-and-more/tags/4.4.0/src/php/Helpers/Request.php
r2965110 r3129246 21 21 */ 22 22 public static function is_frontend(): bool { 23 return ! ( self::is_cli() || is_admin() || wp_doing_ajax() || self::is_rest() ); 23 return ! ( 24 self::is_xml_rpc() || self::is_cli() || self::is_wc_ajax() || 25 is_admin() || wp_doing_ajax() || wp_doing_cron() || 26 self::is_rest() 27 ); 28 } 29 30 /** 31 * Check if it is the xml-rpc request. 32 * 33 * @return bool 34 */ 35 public static function is_xml_rpc(): bool { 36 return defined( 'XMLRPC_REQUEST' ) && constant( 'XMLRPC_REQUEST' ); 24 37 } 25 38 … … 31 44 public static function is_cli(): bool { 32 45 return defined( 'WP_CLI' ) && constant( 'WP_CLI' ); 46 } 47 48 /** 49 * Check if it is a WooCommerce AJAX request. 50 * 51 * @return bool 52 */ 53 public static function is_wc_ajax(): bool { 54 // phpcs:ignore WordPress.Security.NonceVerification.Recommended 55 return isset( $_GET['wc-ajax'] ); 33 56 } 34 57 … … 79 102 return 0 === strpos( $current_url, $rest_url ); 80 103 } 104 105 /** 106 * Check if it is a POST request. 107 * 108 * @return bool 109 */ 110 public static function is_post(): bool { 111 $request_method = isset( $_SERVER['REQUEST_METHOD'] ) 112 ? strtoupper( filter_var( wp_unslash( $_SERVER['REQUEST_METHOD'] ), FILTER_SANITIZE_FULL_SPECIAL_CHARS ) ) 113 : ''; 114 115 return 'POST' === $request_method; 116 } 81 117 } -
hcaptcha-for-forms-and-more/tags/4.4.0/src/php/MailPoet/Form.php
r3114572 r3129246 95 95 */ 96 96 public function verify( API $api ): void { 97 if ( is_admin() ) {97 if ( ! wp_doing_ajax() ) { 98 98 return; 99 99 } -
hcaptcha-for-forms-and-more/tags/4.4.0/src/php/Main.php
r3114572 r3129246 24 24 use HCaptcha\ElementorPro\HCaptchaHandler; 25 25 use HCaptcha\Helpers\HCaptcha; 26 use HCaptcha\Helpers\Request; 26 27 use HCaptcha\Jetpack\JetpackForm; 27 28 use HCaptcha\Migrations\Migrations; … … 123 124 */ 124 125 public function init(): void { 125 if ( $this->is_xml_rpc() ) {126 if ( Request::is_xml_rpc() ) { 126 127 return; 127 128 } 128 129 130 new Migrations(); 131 132 if ( wp_doing_cron() ) { 133 return; 134 } 135 129 136 ( new Fix() )->init(); 130 131 new Migrations();132 137 133 138 add_action( 'plugins_loaded', [ $this, 'init_hooks' ], -PHP_INT_MAX ); … … 519 524 justify-content: center; 520 525 } 526 .h-captcha[data-size="normal"] { 527 scale: calc(270 / 303); 528 transform: translate(-20px, 0); 529 } 521 530 } 522 531 523 532 @media (min-width: 350px) { 524 #login {533 body #login { 525 534 width: 350px; 535 box-sizing: content-box; 526 536 } 527 537 } … … 1360 1370 ); 1361 1371 } 1362 1363 /**1364 * Check if it is the xml-rpc request.1365 *1366 * @return bool1367 */1368 protected function is_xml_rpc(): bool {1369 return defined( 'XMLRPC_REQUEST' ) && constant( 'XMLRPC_REQUEST' );1370 }1371 1372 } -
hcaptcha-for-forms-and-more/tags/4.4.0/src/php/Settings/Integrations.php
r3114572 r3129246 1038 1038 $result = $this->activate_plugin_tree( $this->plugins_tree ); 1039 1039 1040 if ( null === $result) {1040 if ( ! is_wp_error( $result ) ) { 1041 1041 // Activate the first available plugin only. 1042 1042 return true; … … 1056 1056 protected function activate_plugin_tree( array &$node ) { 1057 1057 if ( $node['children'] ) { 1058 foreach ( $node['children'] as $child ) {1059 $ result= $this->activate_plugin_tree( $child );1060 1061 if ( null !== $result) {1062 return $ result;1058 foreach ( $node['children'] as & $child ) { 1059 $child['result'] = $this->activate_plugin_tree( $child ); 1060 1061 if ( is_wp_error( $child['result'] ) ) { 1062 return $child['result']; 1063 1063 } 1064 1064 } 1065 1066 unset( $child ); 1065 1067 } 1066 1068 … … 1075 1077 * @param string $plugin Path to the plugin file relative to the plugins' directory. 1076 1078 * 1077 * @return null|true|WP_Error 1079 * @return null|true|WP_Error Null on success, WP_Error on failure. True if the plugin is already active. 1078 1080 */ 1079 1081 protected function activate_plugin( string $plugin ) { … … 1087 1089 1088 1090 ob_start(); 1091 // Null on success, WP_Error on failure. 1089 1092 $result = activate_plugin( $plugin ); 1090 1093 ob_end_clean(); -
hcaptcha-for-forms-and-more/tags/4.4.0/src/php/WP/LostPassword.php
r3114572 r3129246 14 14 */ 15 15 class LostPassword extends LostPasswordBase { 16 use Base; 16 17 17 18 /** … … 41 42 42 43 /** 43 * WP login URL.44 */45 private const WP_LOGIN_URL = '/wp-login.php';46 47 /**48 44 * WP login action. 49 45 */ … … 56 52 */ 57 53 public function add_captcha(): void { 58 $request_uri = isset( $_SERVER['REQUEST_URI'] ) ? 59 filter_var( wp_unslash( $_SERVER['REQUEST_URI'] ), FILTER_SANITIZE_FULL_SPECIAL_CHARS ) : 60 ''; 61 62 $request_uri = wp_parse_url( $request_uri, PHP_URL_PATH ); 63 64 if ( false === strpos( $request_uri, self::WP_LOGIN_URL ) ) { 65 return; 66 } 67 68 // phpcs:ignore WordPress.Security.NonceVerification.Recommended 69 $action = isset( $_GET['action'] ) ? sanitize_text_field( wp_unslash( $_GET['action'] ) ) : ''; 70 71 if ( self::WP_LOGIN_ACTION !== $action ) { 54 if ( ! $this->is_login_url() || ! $this->is_login_action() ) { 72 55 return; 73 56 } -
hcaptcha-for-forms-and-more/tags/4.4.0/src/php/WP/Register.php
r3114572 r3129246 15 15 */ 16 16 class Register { 17 18 /** 19 * WP login URL. 20 */ 21 private const WP_LOGIN_URL = '/wp-login.php'; 17 use Base; 22 18 23 19 /** … … 30 26 */ 31 27 private const NONCE = 'hcaptcha_registration_nonce'; 28 29 /** 30 * WP login action. 31 */ 32 private const WP_LOGIN_ACTION = 'register'; 32 33 33 34 /** … … 54 55 */ 55 56 public function add_captcha(): void { 56 $request_uri = isset( $_SERVER['REQUEST_URI'] ) ? 57 filter_var( wp_unslash( $_SERVER['REQUEST_URI'] ), FILTER_SANITIZE_FULL_SPECIAL_CHARS ) : 58 ''; 59 60 $request_uri = wp_parse_url( $request_uri, PHP_URL_PATH ); 61 62 if ( false === strpos( $request_uri, self::WP_LOGIN_URL ) ) { 63 return; 64 } 65 66 // phpcs:ignore WordPress.Security.NonceVerification.Recommended 67 $action = isset( $_GET['action'] ) ? sanitize_text_field( wp_unslash( $_GET['action'] ) ) : ''; 68 69 if ( 'register' !== $action ) { 57 if ( ! $this->is_login_url() || ! $this->is_login_action() ) { 70 58 return; 71 59 } … … 95 83 */ 96 84 public function verify( $errors, string $sanitized_user_login, string $user_email ) { 97 // phpcs:ignore WordPress.Security.NonceVerification.Recommended 98 $action = isset( $_GET['action'] ) ? sanitize_text_field( wp_unslash( $_GET['action'] ) ) : ''; 99 100 if ( 'register' !== $action ) { 85 if ( ! $this->is_login_action() ) { 101 86 return $errors; 102 87 } -
hcaptcha-for-forms-and-more/tags/4.4.0/src/php/WPDiscuz/Comment.php
r3114572 r3129246 57 57 ?> 58 58 <div class="wpd-field-hcaptcha wpdiscuz-item"> 59 <div class="wpdiscuz-hcaptcha" id="wpdiscuz-hcaptcha"></div>59 <div class="wpdiscuz-hcaptcha"></div> 60 60 <?php HCaptcha::form_display( $args ); ?> 61 61 <div class="clearfix"></div> … … 79 79 */ 80 80 public function verify( $comment_data ) { 81 // Nonce is checked by wpDiscuz. 82 83 // phpcs:disable WordPress.Security.NonceVerification.Missing 84 $action = isset( $_POST['action'] ) 85 ? sanitize_text_field( wp_unslash( $_POST['action'] ) ) 86 : ''; 87 // phpcs:enable WordPress.Security.NonceVerification.Missing 88 89 if ( ! ( 'wpdAddComment' === $action && wp_doing_ajax() ) ) { 90 return $comment_data; 91 } 92 81 93 $wp_discuz = wpDiscuz(); 82 94 83 95 remove_filter( 'preprocess_comment', [ $wp_discuz, 'validateRecaptcha' ] ); 84 85 // Nonce is checked by wpDiscuz.86 96 87 97 // phpcs:disable WordPress.Security.NonceVerification.Missing -
hcaptcha-for-forms-and-more/tags/4.4.0/src/php/Wordfence/General.php
r3114572 r3129246 8 8 namespace HCaptcha\Wordfence; 9 9 10 use HCaptcha\Helpers\HCaptcha; 10 11 use HCaptcha\WP\Login; 11 12 … … 37 38 add_action( 'plugins_loaded', [ $this, 'remove_wp_login_hcaptcha_hooks' ] ); 38 39 } 40 41 add_action( 'login_head', [ $this, 'print_inline_styles' ], 20 ); 39 42 } 40 43 … … 74 77 remove_filter( 'wp_authenticate_user', [ $wp_login, 'check_signature' ], PHP_INT_MAX ); 75 78 } 79 80 /** 81 * Print inline styles. 82 * 83 * @return void 84 * @noinspection CssUnusedSymbol 85 */ 86 public function print_inline_styles(): void { 87 $css = <<<CSS 88 #loginform[style="position: relative;"] > .h-captcha { 89 visibility: hidden !important; 76 90 } 91 CSS; 92 93 HCaptcha::css_display( $css ); 94 } 95 } -
hcaptcha-for-forms-and-more/tags/4.4.0/vendor/composer/autoload_classmap.php
r3115148 r3129246 125 125 'HCaptcha\\UsersWP\\Login' => $baseDir . '/src/php/UsersWP/Login.php', 126 126 'HCaptcha\\UsersWP\\Register' => $baseDir . '/src/php/UsersWP/Register.php', 127 'HCaptcha\\Vendor \\MatthiasMullie\\Minify\\CSS' => $baseDir . '/vendors/matthiasmullie/minify/src/CSS.php',128 'HCaptcha\\Vendor \\MatthiasMullie\\Minify\\Exception' => $baseDir . '/vendors/matthiasmullie/minify/src/Exception.php',129 'HCaptcha\\Vendor \\MatthiasMullie\\Minify\\Exceptions\\BasicException' => $baseDir . '/vendors/matthiasmullie/minify/src/Exceptions/BasicException.php',130 'HCaptcha\\Vendor \\MatthiasMullie\\Minify\\Exceptions\\FileImportException' => $baseDir . '/vendors/matthiasmullie/minify/src/Exceptions/FileImportException.php',131 'HCaptcha\\Vendor \\MatthiasMullie\\Minify\\Exceptions\\IOException' => $baseDir . '/vendors/matthiasmullie/minify/src/Exceptions/IOException.php',132 'HCaptcha\\Vendor \\MatthiasMullie\\Minify\\JS' => $baseDir . '/vendors/matthiasmullie/minify/src/JS.php',133 'HCaptcha\\Vendor \\MatthiasMullie\\Minify\\Minify' => $baseDir . '/vendors/matthiasmullie/minify/src/Minify.php',134 'HCaptcha\\Vendor \\MatthiasMullie\\PathConverter\\Converter' => $baseDir . '/vendors/matthiasmullie/path-converter/src/Converter.php',135 'HCaptcha\\Vendor \\MatthiasMullie\\PathConverter\\ConverterInterface' => $baseDir . '/vendors/matthiasmullie/path-converter/src/ConverterInterface.php',136 'HCaptcha\\Vendor \\MatthiasMullie\\PathConverter\\NoConverter' => $baseDir . '/vendors/matthiasmullie/path-converter/src/NoConverter.php',127 'HCaptcha\\Vendors\\MatthiasMullie\\Minify\\CSS' => $baseDir . '/vendors/matthiasmullie/minify/src/CSS.php', 128 'HCaptcha\\Vendors\\MatthiasMullie\\Minify\\Exception' => $baseDir . '/vendors/matthiasmullie/minify/src/Exception.php', 129 'HCaptcha\\Vendors\\MatthiasMullie\\Minify\\Exceptions\\BasicException' => $baseDir . '/vendors/matthiasmullie/minify/src/Exceptions/BasicException.php', 130 'HCaptcha\\Vendors\\MatthiasMullie\\Minify\\Exceptions\\FileImportException' => $baseDir . '/vendors/matthiasmullie/minify/src/Exceptions/FileImportException.php', 131 'HCaptcha\\Vendors\\MatthiasMullie\\Minify\\Exceptions\\IOException' => $baseDir . '/vendors/matthiasmullie/minify/src/Exceptions/IOException.php', 132 'HCaptcha\\Vendors\\MatthiasMullie\\Minify\\JS' => $baseDir . '/vendors/matthiasmullie/minify/src/JS.php', 133 'HCaptcha\\Vendors\\MatthiasMullie\\Minify\\Minify' => $baseDir . '/vendors/matthiasmullie/minify/src/Minify.php', 134 'HCaptcha\\Vendors\\MatthiasMullie\\PathConverter\\Converter' => $baseDir . '/vendors/matthiasmullie/path-converter/src/Converter.php', 135 'HCaptcha\\Vendors\\MatthiasMullie\\PathConverter\\ConverterInterface' => $baseDir . '/vendors/matthiasmullie/path-converter/src/ConverterInterface.php', 136 'HCaptcha\\Vendors\\MatthiasMullie\\PathConverter\\NoConverter' => $baseDir . '/vendors/matthiasmullie/path-converter/src/NoConverter.php', 137 137 'HCaptcha\\WCWishlists\\CreateList' => $baseDir . '/src/php/WCWishlists/CreateList.php', 138 138 'HCaptcha\\WC\\Checkout' => $baseDir . '/src/php/WC/Checkout.php', … … 149 149 'HCaptcha\\WPForo\\Reply' => $baseDir . '/src/php/WPForo/Reply.php', 150 150 'HCaptcha\\WPJobOpenings\\Form' => $baseDir . '/src/php/WPJobOpenings/Form.php', 151 'HCaptcha\\WP\\Base' => $baseDir . '/src/php/WP/Base.php', 151 152 'HCaptcha\\WP\\Comment' => $baseDir . '/src/php/WP/Comment.php', 152 153 'HCaptcha\\WP\\Login' => $baseDir . '/src/php/WP/Login.php', … … 157 158 'KAGG\\Settings\\Abstracts\\SettingsBase' => $baseDir . '/src/php/Settings/Abstracts/SettingsBase.php', 158 159 'KAGG\\Settings\\Abstracts\\SettingsInterface' => $baseDir . '/src/php/Settings/Abstracts/SettingsInterface.php', 159 'MatthiasMullie\\Minify\\CSS' => $vendorDir . '/matthiasmullie/minify/src/CSS.php',160 'MatthiasMullie\\Minify\\Exception' => $vendorDir . '/matthiasmullie/minify/src/Exception.php',161 'MatthiasMullie\\Minify\\Exceptions\\BasicException' => $vendorDir . '/matthiasmullie/minify/src/Exceptions/BasicException.php',162 'MatthiasMullie\\Minify\\Exceptions\\FileImportException' => $vendorDir . '/matthiasmullie/minify/src/Exceptions/FileImportException.php',163 'MatthiasMullie\\Minify\\Exceptions\\IOException' => $vendorDir . '/matthiasmullie/minify/src/Exceptions/IOException.php',164 'MatthiasMullie\\Minify\\JS' => $vendorDir . '/matthiasmullie/minify/src/JS.php',165 'MatthiasMullie\\Minify\\Minify' => $vendorDir . '/matthiasmullie/minify/src/Minify.php',166 'MatthiasMullie\\PathConverter\\Converter' => $vendorDir . '/matthiasmullie/path-converter/src/Converter.php',167 'MatthiasMullie\\PathConverter\\ConverterInterface' => $vendorDir . '/matthiasmullie/path-converter/src/ConverterInterface.php',168 'MatthiasMullie\\PathConverter\\NoConverter' => $vendorDir . '/matthiasmullie/path-converter/src/NoConverter.php',169 160 ); -
hcaptcha-for-forms-and-more/tags/4.4.0/vendor/composer/autoload_psr4.php
r3115148 r3129246 7 7 8 8 return array( 9 'MatthiasMullie\\PathConverter\\' => array($vendorDir . '/matthiasmullie/path-converter/src'),10 'MatthiasMullie\\Minify\\' => array($vendorDir . '/matthiasmullie/minify/src'),11 9 'KAGG\\Settings\\Abstracts\\' => array($baseDir . '/src/php/Settings/Abstracts'), 12 10 'HCaptcha\\Scoper\\' => array($baseDir . '/.php-scoper/src'), -
hcaptcha-for-forms-and-more/tags/4.4.0/vendor/composer/autoload_real.php
r3115148 r3129246 23 23 } 24 24 25 require __DIR__ . '/platform_check.php';26 27 25 spl_autoload_register(array('ComposerAutoloaderInita6c3d020c47c988d11030e9a25036470', 'loadClassLoader'), true, true); 28 26 self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); -
hcaptcha-for-forms-and-more/tags/4.4.0/vendor/composer/autoload_static.php
r3115148 r3129246 8 8 { 9 9 public static $prefixLengthsPsr4 = array ( 10 'M' =>11 array (12 'MatthiasMullie\\PathConverter\\' => 29,13 'MatthiasMullie\\Minify\\' => 22,14 ),15 10 'K' => 16 11 array ( … … 25 20 26 21 public static $prefixDirsPsr4 = array ( 27 'MatthiasMullie\\PathConverter\\' =>28 array (29 0 => __DIR__ . '/..' . '/matthiasmullie/path-converter/src',30 ),31 'MatthiasMullie\\Minify\\' =>32 array (33 0 => __DIR__ . '/..' . '/matthiasmullie/minify/src',34 ),35 22 'KAGG\\Settings\\Abstracts\\' => 36 23 array ( … … 166 153 'HCaptcha\\UsersWP\\Login' => __DIR__ . '/../..' . '/src/php/UsersWP/Login.php', 167 154 'HCaptcha\\UsersWP\\Register' => __DIR__ . '/../..' . '/src/php/UsersWP/Register.php', 168 'HCaptcha\\Vendor \\MatthiasMullie\\Minify\\CSS' => __DIR__ . '/../..' . '/vendors/matthiasmullie/minify/src/CSS.php',169 'HCaptcha\\Vendor \\MatthiasMullie\\Minify\\Exception' => __DIR__ . '/../..' . '/vendors/matthiasmullie/minify/src/Exception.php',170 'HCaptcha\\Vendor \\MatthiasMullie\\Minify\\Exceptions\\BasicException' => __DIR__ . '/../..' . '/vendors/matthiasmullie/minify/src/Exceptions/BasicException.php',171 'HCaptcha\\Vendor \\MatthiasMullie\\Minify\\Exceptions\\FileImportException' => __DIR__ . '/../..' . '/vendors/matthiasmullie/minify/src/Exceptions/FileImportException.php',172 'HCaptcha\\Vendor \\MatthiasMullie\\Minify\\Exceptions\\IOException' => __DIR__ . '/../..' . '/vendors/matthiasmullie/minify/src/Exceptions/IOException.php',173 'HCaptcha\\Vendor \\MatthiasMullie\\Minify\\JS' => __DIR__ . '/../..' . '/vendors/matthiasmullie/minify/src/JS.php',174 'HCaptcha\\Vendor \\MatthiasMullie\\Minify\\Minify' => __DIR__ . '/../..' . '/vendors/matthiasmullie/minify/src/Minify.php',175 'HCaptcha\\Vendor \\MatthiasMullie\\PathConverter\\Converter' => __DIR__ . '/../..' . '/vendors/matthiasmullie/path-converter/src/Converter.php',176 'HCaptcha\\Vendor \\MatthiasMullie\\PathConverter\\ConverterInterface' => __DIR__ . '/../..' . '/vendors/matthiasmullie/path-converter/src/ConverterInterface.php',177 'HCaptcha\\Vendor \\MatthiasMullie\\PathConverter\\NoConverter' => __DIR__ . '/../..' . '/vendors/matthiasmullie/path-converter/src/NoConverter.php',155 'HCaptcha\\Vendors\\MatthiasMullie\\Minify\\CSS' => __DIR__ . '/../..' . '/vendors/matthiasmullie/minify/src/CSS.php', 156 'HCaptcha\\Vendors\\MatthiasMullie\\Minify\\Exception' => __DIR__ . '/../..' . '/vendors/matthiasmullie/minify/src/Exception.php', 157 'HCaptcha\\Vendors\\MatthiasMullie\\Minify\\Exceptions\\BasicException' => __DIR__ . '/../..' . '/vendors/matthiasmullie/minify/src/Exceptions/BasicException.php', 158 'HCaptcha\\Vendors\\MatthiasMullie\\Minify\\Exceptions\\FileImportException' => __DIR__ . '/../..' . '/vendors/matthiasmullie/minify/src/Exceptions/FileImportException.php', 159 'HCaptcha\\Vendors\\MatthiasMullie\\Minify\\Exceptions\\IOException' => __DIR__ . '/../..' . '/vendors/matthiasmullie/minify/src/Exceptions/IOException.php', 160 'HCaptcha\\Vendors\\MatthiasMullie\\Minify\\JS' => __DIR__ . '/../..' . '/vendors/matthiasmullie/minify/src/JS.php', 161 'HCaptcha\\Vendors\\MatthiasMullie\\Minify\\Minify' => __DIR__ . '/../..' . '/vendors/matthiasmullie/minify/src/Minify.php', 162 'HCaptcha\\Vendors\\MatthiasMullie\\PathConverter\\Converter' => __DIR__ . '/../..' . '/vendors/matthiasmullie/path-converter/src/Converter.php', 163 'HCaptcha\\Vendors\\MatthiasMullie\\PathConverter\\ConverterInterface' => __DIR__ . '/../..' . '/vendors/matthiasmullie/path-converter/src/ConverterInterface.php', 164 'HCaptcha\\Vendors\\MatthiasMullie\\PathConverter\\NoConverter' => __DIR__ . '/../..' . '/vendors/matthiasmullie/path-converter/src/NoConverter.php', 178 165 'HCaptcha\\WCWishlists\\CreateList' => __DIR__ . '/../..' . '/src/php/WCWishlists/CreateList.php', 179 166 'HCaptcha\\WC\\Checkout' => __DIR__ . '/../..' . '/src/php/WC/Checkout.php', … … 190 177 'HCaptcha\\WPForo\\Reply' => __DIR__ . '/../..' . '/src/php/WPForo/Reply.php', 191 178 'HCaptcha\\WPJobOpenings\\Form' => __DIR__ . '/../..' . '/src/php/WPJobOpenings/Form.php', 179 'HCaptcha\\WP\\Base' => __DIR__ . '/../..' . '/src/php/WP/Base.php', 192 180 'HCaptcha\\WP\\Comment' => __DIR__ . '/../..' . '/src/php/WP/Comment.php', 193 181 'HCaptcha\\WP\\Login' => __DIR__ . '/../..' . '/src/php/WP/Login.php', … … 198 186 'KAGG\\Settings\\Abstracts\\SettingsBase' => __DIR__ . '/../..' . '/src/php/Settings/Abstracts/SettingsBase.php', 199 187 'KAGG\\Settings\\Abstracts\\SettingsInterface' => __DIR__ . '/../..' . '/src/php/Settings/Abstracts/SettingsInterface.php', 200 'MatthiasMullie\\Minify\\CSS' => __DIR__ . '/..' . '/matthiasmullie/minify/src/CSS.php',201 'MatthiasMullie\\Minify\\Exception' => __DIR__ . '/..' . '/matthiasmullie/minify/src/Exception.php',202 'MatthiasMullie\\Minify\\Exceptions\\BasicException' => __DIR__ . '/..' . '/matthiasmullie/minify/src/Exceptions/BasicException.php',203 'MatthiasMullie\\Minify\\Exceptions\\FileImportException' => __DIR__ . '/..' . '/matthiasmullie/minify/src/Exceptions/FileImportException.php',204 'MatthiasMullie\\Minify\\Exceptions\\IOException' => __DIR__ . '/..' . '/matthiasmullie/minify/src/Exceptions/IOException.php',205 'MatthiasMullie\\Minify\\JS' => __DIR__ . '/..' . '/matthiasmullie/minify/src/JS.php',206 'MatthiasMullie\\Minify\\Minify' => __DIR__ . '/..' . '/matthiasmullie/minify/src/Minify.php',207 'MatthiasMullie\\PathConverter\\Converter' => __DIR__ . '/..' . '/matthiasmullie/path-converter/src/Converter.php',208 'MatthiasMullie\\PathConverter\\ConverterInterface' => __DIR__ . '/..' . '/matthiasmullie/path-converter/src/ConverterInterface.php',209 'MatthiasMullie\\PathConverter\\NoConverter' => __DIR__ . '/..' . '/matthiasmullie/path-converter/src/NoConverter.php',210 188 ); 211 189 -
hcaptcha-for-forms-and-more/tags/4.4.0/vendor/composer/installed.php
r3115148 r3129246 2 2 'root' => array( 3 3 'name' => 'hcaptcha/hcaptcha-wordpress-plugin', 4 'pretty_version' => '4. 3.1',5 'version' => '4. 3.1.0',6 'reference' => ' ac465ffed1388385455f805823726eaf3543586f',4 'pretty_version' => '4.4.0', 5 'version' => '4.4.0.0', 6 'reference' => '25bdd39c5629233960c20655da571516f475acb3', 7 7 'type' => 'wordpress-plugin', 8 8 'install_path' => __DIR__ . '/../../', … … 12 12 'versions' => array( 13 13 'hcaptcha/hcaptcha-wordpress-plugin' => array( 14 'pretty_version' => '4. 3.1',15 'version' => '4. 3.1.0',16 'reference' => ' ac465ffed1388385455f805823726eaf3543586f',14 'pretty_version' => '4.4.0', 15 'version' => '4.4.0.0', 16 'reference' => '25bdd39c5629233960c20655da571516f475acb3', 17 17 'type' => 'wordpress-plugin', 18 18 'install_path' => __DIR__ . '/../../', -
hcaptcha-for-forms-and-more/tags/4.4.0/vendors/matthiasmullie/minify/src/CSS.php
r3115148 r3129246 10 10 * @license MIT License 11 11 */ 12 namespace HCaptcha\Vendor \MatthiasMullie\Minify;13 14 use HCaptcha\Vendor \MatthiasMullie\Minify\Exceptions\FileImportException;15 use HCaptcha\Vendor \MatthiasMullie\PathConverter\Converter;16 use HCaptcha\Vendor \MatthiasMullie\PathConverter\ConverterInterface;12 namespace HCaptcha\Vendors\MatthiasMullie\Minify; 13 14 use HCaptcha\Vendors\MatthiasMullie\Minify\Exceptions\FileImportException; 15 use HCaptcha\Vendors\MatthiasMullie\PathConverter\Converter; 16 use HCaptcha\Vendors\MatthiasMullie\PathConverter\ConverterInterface; 17 17 /** 18 18 * CSS minifier. -
hcaptcha-for-forms-and-more/tags/4.4.0/vendors/matthiasmullie/minify/src/Exception.php
r3115148 r3129246 8 8 * @author Matthias Mullie <minify@mullie.eu> 9 9 */ 10 namespace HCaptcha\Vendor \MatthiasMullie\Minify;10 namespace HCaptcha\Vendors\MatthiasMullie\Minify; 11 11 12 12 /** -
hcaptcha-for-forms-and-more/tags/4.4.0/vendors/matthiasmullie/minify/src/Exceptions/BasicException.php
r3115148 r3129246 10 10 * @license MIT License 11 11 */ 12 namespace HCaptcha\Vendor \MatthiasMullie\Minify\Exceptions;12 namespace HCaptcha\Vendors\MatthiasMullie\Minify\Exceptions; 13 13 14 use HCaptcha\Vendor \MatthiasMullie\Minify\Exception;14 use HCaptcha\Vendors\MatthiasMullie\Minify\Exception; 15 15 /** 16 16 * Basic Exception Class. -
hcaptcha-for-forms-and-more/tags/4.4.0/vendors/matthiasmullie/minify/src/Exceptions/FileImportException.php
r3115148 r3129246 10 10 * @license MIT License 11 11 */ 12 namespace HCaptcha\Vendor \MatthiasMullie\Minify\Exceptions;12 namespace HCaptcha\Vendors\MatthiasMullie\Minify\Exceptions; 13 13 14 14 /** -
hcaptcha-for-forms-and-more/tags/4.4.0/vendors/matthiasmullie/minify/src/Exceptions/IOException.php
r3115148 r3129246 10 10 * @license MIT License 11 11 */ 12 namespace HCaptcha\Vendor \MatthiasMullie\Minify\Exceptions;12 namespace HCaptcha\Vendors\MatthiasMullie\Minify\Exceptions; 13 13 14 14 /** -
hcaptcha-for-forms-and-more/tags/4.4.0/vendors/matthiasmullie/minify/src/JS.php
r3115148 r3129246 10 10 * @license MIT License 11 11 */ 12 namespace HCaptcha\Vendor \MatthiasMullie\Minify;12 namespace HCaptcha\Vendors\MatthiasMullie\Minify; 13 13 14 14 /** … … 117 117 public function __construct() 118 118 { 119 call_user_func_array(array('HCaptcha\Vendor \MatthiasMullie\Minify\Minify', '__construct'), func_get_args());119 call_user_func_array(array('HCaptcha\Vendors\MatthiasMullie\Minify\Minify', '__construct'), func_get_args()); 120 120 $dataDir = __DIR__ . '/../data/js/'; 121 121 $options = \FILE_IGNORE_NEW_LINES | \FILE_SKIP_EMPTY_LINES; -
hcaptcha-for-forms-and-more/tags/4.4.0/vendors/matthiasmullie/minify/src/Minify.php
r3115148 r3129246 10 10 * @license MIT License 11 11 */ 12 namespace HCaptcha\Vendor \MatthiasMullie\Minify;13 14 use HCaptcha\Vendor \MatthiasMullie\Minify\Exceptions\IOException;15 use HCaptcha\Vendor \Psr\Cache\CacheItemInterface;12 namespace HCaptcha\Vendors\MatthiasMullie\Minify; 13 14 use HCaptcha\Vendors\MatthiasMullie\Minify\Exceptions\IOException; 15 use HCaptcha\Vendors\Psr\Cache\CacheItemInterface; 16 16 /** 17 17 * Abstract minifier class. -
hcaptcha-for-forms-and-more/tags/4.4.0/vendors/matthiasmullie/path-converter/src/Converter.php
r3115148 r3129246 1 1 <?php 2 2 3 namespace HCaptcha\Vendor \MatthiasMullie\PathConverter;3 namespace HCaptcha\Vendors\MatthiasMullie\PathConverter; 4 4 5 5 /** -
hcaptcha-for-forms-and-more/tags/4.4.0/vendors/matthiasmullie/path-converter/src/ConverterInterface.php
r3115148 r3129246 1 1 <?php 2 2 3 namespace HCaptcha\Vendor \MatthiasMullie\PathConverter;3 namespace HCaptcha\Vendors\MatthiasMullie\PathConverter; 4 4 5 5 /** -
hcaptcha-for-forms-and-more/tags/4.4.0/vendors/matthiasmullie/path-converter/src/NoConverter.php
r3115148 r3129246 1 1 <?php 2 2 3 namespace HCaptcha\Vendor \MatthiasMullie\PathConverter;3 namespace HCaptcha\Vendors\MatthiasMullie\PathConverter; 4 4 5 5 /** -
hcaptcha-for-forms-and-more/trunk/assets/css/notifications.css
r2949443 r3129246 62 62 } 63 63 64 #hcaptcha-navigation > span { 65 margin-right: 10px; 66 align-self: center; 67 } 68 64 69 #hcaptcha-navigation a { 65 70 width: 30px; -
hcaptcha-for-forms-and-more/trunk/assets/css/notifications.min.css
r2949443 r3129246 1 #hcaptcha-notifications{background:#fff;box-sizing:border-box;margin:5px 0 15px;max-width:760px;padding:15px 20px}#hcaptcha-notifications-header{align-items:center;border-bottom:1px solid #c3c4c7;column-gap:3px;display:flex;font-size:14px;font-weight:600;justify-content:flex-start;line-height:1.3;margin-bottom:10px;padding-bottom:10px}#hcaptcha-notifications-header:before{background-image:url(../images/notification-bell.svg);background-size:cover;content:"";height:30px;position:relative;width:30px}#hcaptcha-notifications-footer{border-top:1px solid #c3c4c7;display:flex;justify-content:space-between;margin-top:10px;padding-top:10px}#hcaptcha-notifications .hcaptcha-notification{margin:0}.hcaptcha-notification .hcaptcha-notification-title{font-weight:600;line-height:1.3;margin:7px 0;padding:2px}.hcaptcha-notification{display:none}#hcaptcha-notifications-header+.hcaptcha-notification{display:block}#hcaptcha-navigation{column-gap:3px;display:flex;justify-content:flex-end}#hcaptcha-navigation a{background:#f6f7f7;border:1px solid #2271b1;border-radius:3px;box-sizing:border-box;cursor:pointer;font-size:16px;height:30px;line-height:25px;text-align:center;width:30px}#hcaptcha-navigation a.disabled{background:#f6f7f7;border-color:#dcdcde;color:#a7aaad;cursor:default}#hcaptcha-navigation a.next:after,#hcaptcha-navigation a.prev:after{font-size:12px}#hcaptcha-navigation a.prev:after{content:"<"}#hcaptcha-navigation a.next:after{content:">"}1 #hcaptcha-notifications{background:#fff;box-sizing:border-box;margin:5px 0 15px;max-width:760px;padding:15px 20px}#hcaptcha-notifications-header{align-items:center;border-bottom:1px solid #c3c4c7;column-gap:3px;display:flex;font-size:14px;font-weight:600;justify-content:flex-start;line-height:1.3;margin-bottom:10px;padding-bottom:10px}#hcaptcha-notifications-header:before{background-image:url(../images/notification-bell.svg);background-size:cover;content:"";height:30px;position:relative;width:30px}#hcaptcha-notifications-footer{border-top:1px solid #c3c4c7;display:flex;justify-content:space-between;margin-top:10px;padding-top:10px}#hcaptcha-notifications .hcaptcha-notification{margin:0}.hcaptcha-notification .hcaptcha-notification-title{font-weight:600;line-height:1.3;margin:7px 0;padding:2px}.hcaptcha-notification{display:none}#hcaptcha-notifications-header+.hcaptcha-notification{display:block}#hcaptcha-navigation{column-gap:3px;display:flex;justify-content:flex-end}#hcaptcha-navigation>span{align-self:center;margin-right:10px}#hcaptcha-navigation a{background:#f6f7f7;border:1px solid #2271b1;border-radius:3px;box-sizing:border-box;cursor:pointer;font-size:16px;height:30px;line-height:25px;text-align:center;width:30px}#hcaptcha-navigation a.disabled{background:#f6f7f7;border-color:#dcdcde;color:#a7aaad;cursor:default}#hcaptcha-navigation a.next:after,#hcaptcha-navigation a.prev:after{font-size:12px}#hcaptcha-navigation a.prev:after{content:"<"}#hcaptcha-navigation a.next:after{content:">"} -
hcaptcha-for-forms-and-more/trunk/assets/js/admin-elementor-pro.js
r2956786 r3129246 66 66 this.filterItem 67 67 ); 68 68 69 elementor.hooks.addFilter( 69 70 'elementor_pro/forms/content_template/field/hcaptcha', -
hcaptcha-for-forms-and-more/trunk/assets/js/apps/hcaptcha.js
r3114572 r3129246 1 (()=>{"use strict";function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(t){return function(t){if(Array.isArray(t))return n(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||r(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(t,e){if(t){if("string"==typeof t)return n(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}}function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function a(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,i(n.key),n)}}function i(e){var r=function(e,r){if("object"!=t(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var a=n.call(e,r||"default");if("object"!=t(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}(e,"string");return"symbol"==t(r)?r:r+""}var o=new(function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.foundForms=[],this.params=null,this.observing=!1,this.darkElement=null,this.darkClass=null,this.callback=this.callback.bind(this),this.validate=this.validate.bind(this)},n=[{key:"generateID",value:function(){var t=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return t()+"-"+t()+"-"+t()+"-"+t()}},{key:"getFoundFormById",value:function(t){return this.foundForms.filter((function(e){return t===e.hCaptchaId}))[0]}},{key:"getWidgetId",value:function(t){var e;if(void 0===t)return"";var r=t.getElementsByClassName("h-captcha")[0];if(void 0===r)return"";var n=r.getElementsByTagName("iframe")[0];return void 0===n?"":null!==(e=n.dataset.hcaptchaWidgetId)&&void 0!==e?e:""}},{key:"reset",value:function(t){var e=this.getWidgetId(t);e&&hcaptcha.reset(e)}},{key:"isSameOrDescendant",value:function(t,e){for(var r=e;r;){if(r===t)return!0;r=r.parentElement}return!1}},{key:"validate",value:function(t){var e=t.currentTarget.closest(this.formSelector),r=this.getFoundFormById(e.dataset.hCaptchaId).submitButtonElement;if(this.isSameOrDescendant(r,t.target)){t.preventDefault(),t.stopPropagation(),this.currentForm={formElement:e,submitButtonElement:r};var n=this.getWidgetId(e);if(n){var a=e.querySelector(".h-captcha iframe").dataset.hcaptchaResponse;""===a?hcaptcha.execute(n):this.callback(a)}}}},{key:"isValidated",value:function(){return void 0!==this.currentForm}},{key:"getForms",value:function(){return e(document.querySelectorAll(this.formSelector))}},{key:"getParams",value:function(){if(null!==this.params)return this.params;var t;try{ t=JSON.parse(HCaptchaMainObject.params)}catch(e){t={}}return t.callback=this.callback,t}},{key:"setParams",value:function(t){this.params=t}},{key:"setDarkData",value:function(){var t={"twenty-twenty-one":{darkStyleId:"twenty-twenty-one-style-css",darkElement:document.body,darkClass:"is-dark-theme"},"wp-dark-mode":{darkStyleId:"wp-dark-mode-frontend-css",darkElement:document.documentElement,darkClass:"wp-dark-mode-active"},"droit-dark-mode":{darkStyleId:"dtdr-public-inline-css",darkElement:document.documentElement,darkClass:"drdt-dark-mode"}};t=wp.hooks.applyFilters("hcaptcha.darkData",t);for(var e=0,r=Object.values(t);e<r.length;e++){var n=r[e];if(document.getElementById(n.darkStyleId))return this.darkElement=n.darkElement,void(this.darkClass=n.darkClass)}}},{key:"observeDarkMode",value:function(){var t=this;this.observing||(this.observing=!0,"auto"!==this.getParams().theme)||(this.setDarkData(),this.darkElement&&this.darkClass&&new MutationObserver((function(e){var n,a=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=r(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var a=0,i=function(){};return{s:i,n:function(){return a>=t.length?{done:!0}:{done:!1,value:t[a++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,u=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return u=t.done,t},e:function(t){s=!0,o=t},f:function(){try{u||null==n.return||n.return()}finally{if(s)throw o}}}}(e);try{var i=function(){var e=n.value.oldValue,r=t.darkElement.getAttribute("class");e=e?e.split(" "):[],(r=r?r.split(" "):[]).filter((function(t){return!e.includes(t)})).concat(e.filter((function(t){return!r.includes(t)}))).includes(t.darkClass)&&t.bindEvents()};for(a.s();!(n=a.n()).done;)i()}catch(t){a.e(t)}finally{a.f()}})).observe(this.darkElement,{attributes:!0,attributeOldValue:!0}))}},{key:"callback",value:function(t){document.dispatchEvent(new CustomEvent("hCaptchaSubmitted",{detail:{token:t}}));var e=this.getParams(),r=document.querySelector('iframe[data-hcaptcha-response="'+t+'"]'),n=r?r.closest(".h-captcha"):null,a=n?n.dataset.force:null;("invisible"===e.size||"true"===a&&this.isValidated())&&this.submit()}},{key:"applyAutoTheme",value:function(t){if("auto"!==t.theme)return t;if(t.theme="light",!this.darkElement)return t;var e=this.darkElement.getAttribute("class");return(e=e||"").includes(this.darkClass)&&(t.theme="dark"),t}},{key:"render",value:function(t){this.observeDarkMode();var e=this.applyAutoTheme(this.getParams());hcaptcha.render(t,e)}},{key:"bindEvents",value:function(){var t=this;"undefined"!=typeof hcaptcha&&(this.formSelector=wp.hooks.applyFilters("hcaptcha.formSelector","form, section.cwginstock-subscribe-form, div.sdm_download_item, .gform_editor, #nf-builder, .wpforms-captcha-preview"),this.submitButtonSelector=wp.hooks.applyFilters("hcaptcha.submitButtonSelector",'*[type="submit"]:not(.quform-default-submit), #check_config, button[type="button"].ff-btn, a.et_pb_newsletter_button.et_pb_button, .forminator-button-submit, .frm_button_submit, a.sdm_download, .uagb-forms-main-submit-button'),this.getForms().map((function(e){var r=e.querySelector(".h-captcha");if(null===r)return e;if(r.classList.contains("hcaptcha-widget-id"))return e;var n=r.querySelector("iframe");if(null!==n&&n.remove(),t.render(r),"invisible"!==r.dataset.size&&"true"!==r.dataset.force)return e;var a=e.querySelectorAll(t.submitButtonSelector)[0];if(!a)return e;var i=t.generateID();return t.foundForms.push({hCaptchaId:i,submitButtonElement:a}),e.dataset.hCaptchaId=i,a.addEventListener("click",t.validate,!0),e}),this))}},{key:"isAjaxSubmitButton",value:function(t){var e=t.getAttribute("type"),r="submit"!==(e=e?e.toLowerCase():"");return wp.hooks.applyFilters("hcaptcha.ajaxSubmitButton",r,t)}},{key:"submit",value:function(){var t=this.currentForm.formElement,e=this.currentForm.submitButtonElement;if("form"!==t.tagName.toLowerCase()||this.isAjaxSubmitButton(e))return e.removeEventListener("click",this.validate,!0),void e.click();t.requestSubmit?t.requestSubmit(e):t.submit()}}],n&&a(t.prototype,n),i&&a(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,i}());window.hCaptcha=o,window.hCaptchaGetWidgetId=function(t){o.getWidgetId(t)},window.hCaptchaReset=function(t){o.reset(t)},window.hCaptchaBindEvents=function(){o.bindEvents()},window.hCaptchaSubmit=function(){o.submit()},window.hCaptchaOnLoad=function(){function t(){window.hCaptchaBindEvents(),document.dispatchEvent(new CustomEvent("hCaptchaLoaded"))}"loading"===document.readyState?window.addEventListener("DOMContentLoaded",t):t()}})();1 (()=>{"use strict";function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(t){return function(t){if(Array.isArray(t))return n(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||r(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(t,e){if(t){if("string"==typeof t)return n(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}}function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function a(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,i(n.key),n)}}function i(e){var r=function(e,r){if("object"!=t(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var a=n.call(e,r||"default");if("object"!=t(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}(e,"string");return"symbol"==t(r)?r:r+""}var o=new(function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.foundForms=[],this.params=null,this.observing=!1,this.darkElement=null,this.darkClass=null,this.callback=this.callback.bind(this),this.validate=this.validate.bind(this)},n=[{key:"generateID",value:function(){var t=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return t()+"-"+t()+"-"+t()+"-"+t()}},{key:"getFoundFormById",value:function(t){return this.foundForms.filter((function(e){return t===e.hCaptchaId}))[0]}},{key:"getWidgetId",value:function(t){var e;if(void 0===t)return"";var r=t.getElementsByClassName("h-captcha")[0];if(void 0===r)return"";var n=r.getElementsByTagName("iframe")[0];return void 0===n?"":null!==(e=n.dataset.hcaptchaWidgetId)&&void 0!==e?e:""}},{key:"reset",value:function(t){var e=this.getWidgetId(t);e&&hcaptcha.reset(e)}},{key:"isSameOrDescendant",value:function(t,e){for(var r=e;r;){if(r===t)return!0;r=r.parentElement}return!1}},{key:"validate",value:function(t){var e=t.currentTarget.closest(this.formSelector),r=this.getFoundFormById(e.dataset.hCaptchaId).submitButtonElement;if(this.isSameOrDescendant(r,t.target)){t.preventDefault(),t.stopPropagation(),this.currentForm={formElement:e,submitButtonElement:r};var n=this.getWidgetId(e);if(n){var a=e.querySelector(".h-captcha iframe").dataset.hcaptchaResponse;""===a?hcaptcha.execute(n):this.callback(a)}}}},{key:"isValidated",value:function(){return void 0!==this.currentForm}},{key:"getForms",value:function(){return e(document.querySelectorAll(this.formSelector))}},{key:"getParams",value:function(){if(null!==this.params)return this.params;var t;try{var e,r;t=JSON.parse(wp.hooks.applyFilters("hcaptcha.params",null!==(e=null===(r=window)||void 0===r||null===(r=r.HCaptchaMainObject)||void 0===r?void 0:r.params)&&void 0!==e?e:""))}catch(e){t={}}return t.callback=this.callback,t}},{key:"setParams",value:function(t){this.params=t}},{key:"setDarkData",value:function(){var t={"twenty-twenty-one":{darkStyleId:"twenty-twenty-one-style-css",darkElement:document.body,darkClass:"is-dark-theme"},"wp-dark-mode":{darkStyleId:"wp-dark-mode-frontend-css",darkElement:document.documentElement,darkClass:"wp-dark-mode-active"},"droit-dark-mode":{darkStyleId:"dtdr-public-inline-css",darkElement:document.documentElement,darkClass:"drdt-dark-mode"}};t=wp.hooks.applyFilters("hcaptcha.darkData",t);for(var e=0,r=Object.values(t);e<r.length;e++){var n=r[e];if(document.getElementById(n.darkStyleId))return this.darkElement=n.darkElement,void(this.darkClass=n.darkClass)}}},{key:"observeDarkMode",value:function(){var t=this;this.observing||(this.observing=!0,"auto"!==this.getParams().theme)||(this.setDarkData(),this.darkElement&&this.darkClass&&new MutationObserver((function(e){var n,a=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=r(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var a=0,i=function(){};return{s:i,n:function(){return a>=t.length?{done:!0}:{done:!1,value:t[a++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,u=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return u=t.done,t},e:function(t){s=!0,o=t},f:function(){try{u||null==n.return||n.return()}finally{if(s)throw o}}}}(e);try{var i=function(){var e=n.value.oldValue,r=t.darkElement.getAttribute("class");e=e?e.split(" "):[],(r=r?r.split(" "):[]).filter((function(t){return!e.includes(t)})).concat(e.filter((function(t){return!r.includes(t)}))).includes(t.darkClass)&&t.bindEvents()};for(a.s();!(n=a.n()).done;)i()}catch(t){a.e(t)}finally{a.f()}})).observe(this.darkElement,{attributes:!0,attributeOldValue:!0}))}},{key:"callback",value:function(t){document.dispatchEvent(new CustomEvent("hCaptchaSubmitted",{detail:{token:t}}));var e=this.getParams(),r=document.querySelector('iframe[data-hcaptcha-response="'+t+'"]'),n=r?r.closest(".h-captcha"):null,a=n?n.dataset.force:null;("invisible"===e.size||"true"===a&&this.isValidated())&&this.submit()}},{key:"applyAutoTheme",value:function(t){if("auto"!==t.theme)return t;if(t.theme="light",!this.darkElement)return t;var e=this.darkElement.getAttribute("class");return(e=e||"").includes(this.darkClass)&&(t.theme="dark"),t}},{key:"render",value:function(t){this.observeDarkMode();var e=this.applyAutoTheme(this.getParams());hcaptcha.render(t,e)}},{key:"bindEvents",value:function(){var t=this;"undefined"!=typeof hcaptcha&&(this.formSelector=wp.hooks.applyFilters("hcaptcha.formSelector","form, section.cwginstock-subscribe-form, div.sdm_download_item, .gform_editor, #nf-builder, .wpforms-captcha-preview"),this.submitButtonSelector=wp.hooks.applyFilters("hcaptcha.submitButtonSelector",'*[type="submit"]:not(.quform-default-submit), #check_config, button[type="button"].ff-btn, a.et_pb_newsletter_button.et_pb_button, .forminator-button-submit, .frm_button_submit, a.sdm_download, .uagb-forms-main-submit-button'),this.getForms().map((function(e){var r=e.querySelector(".h-captcha");if(null===r)return e;if(r.classList.contains("hcaptcha-widget-id"))return e;var n=r.querySelector("iframe");if(null!==n&&n.remove(),t.render(r),"invisible"!==r.dataset.size&&"true"!==r.dataset.force)return e;var a=e.querySelectorAll(t.submitButtonSelector)[0];if(!a)return e;var i=t.generateID();return t.foundForms.push({hCaptchaId:i,submitButtonElement:a}),e.dataset.hCaptchaId=i,a.addEventListener("click",t.validate,!0),e}),this))}},{key:"isAjaxSubmitButton",value:function(t){var e=t.getAttribute("type"),r="submit"!==(e=e?e.toLowerCase():"");return wp.hooks.applyFilters("hcaptcha.ajaxSubmitButton",r,t)}},{key:"submit",value:function(){var t=this.currentForm.formElement,e=this.currentForm.submitButtonElement;if("form"!==t.tagName.toLowerCase()||this.isAjaxSubmitButton(e))return e.removeEventListener("click",this.validate,!0),void e.click();t.requestSubmit?t.requestSubmit(e):t.submit()}}],n&&a(t.prototype,n),i&&a(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,i}());window.hCaptcha=o,window.hCaptchaGetWidgetId=function(t){o.getWidgetId(t)},window.hCaptchaReset=function(t){o.reset(t)},window.hCaptchaBindEvents=function(){o.bindEvents()},window.hCaptchaSubmit=function(){o.submit()},window.hCaptchaOnLoad=function(){function t(){window.hCaptchaBindEvents(),document.dispatchEvent(new CustomEvent("hCaptchaLoaded"))}"loading"===document.readyState?window.addEventListener("DOMContentLoaded",t):t()}})(); -
hcaptcha-for-forms-and-more/trunk/assets/js/hcaptcha-elementor-pro.js
r2956786 r3129246 19 19 } 20 20 21 wp.hooks.addFilter( 22 'hcaptcha.params', 23 'hcaptcha', 24 () => { 25 // noinspection JSUnresolvedReference 26 return window?.parent?.HCaptchaMainObject?.params ?? ''; 27 } 28 ); 29 21 30 elementorFrontend.hooks.addAction( 22 31 'frontend/element_ready/widget', -
hcaptcha-for-forms-and-more/trunk/assets/js/hcaptcha-elementor-pro.min.js
r2956786 r3129246 1 (()=>{jQuery(document).on("ajaxSuccess",(function(e,n,o){var t=new URLSearchParams(o.data);if("elementor_pro_forms_send_form"===t.get("action")){var r=t.get("form_id"),a=jQuery('input[name="form_id"][value="'+r+'"]').closest("form");window.hCaptchaReset(a[0])}}));var e=function(){"undefined"!=typeof elementorFrontend&&elementorFrontend.hooks.addAction("frontend/element_ready/widget",(function(e){e[0].classList.contains("elementor-widget-form")&&hCaptchaBindEvents()}))};window.hCaptchaElementorPro=e,jQuery(document).ready(e)})();1 (()=>{jQuery(document).on("ajaxSuccess",(function(e,n,o){var t=new URLSearchParams(o.data);if("elementor_pro_forms_send_form"===t.get("action")){var a=t.get("form_id"),r=jQuery('input[name="form_id"][value="'+a+'"]').closest("form");window.hCaptchaReset(r[0])}}));var e=function(){"undefined"!=typeof elementorFrontend&&(wp.hooks.addFilter("hcaptcha.params","hcaptcha",(function(){var e,n;return null!==(e=null===(n=window)||void 0===n||null===(n=n.parent)||void 0===n||null===(n=n.HCaptchaMainObject)||void 0===n?void 0:n.params)&&void 0!==e?e:""})),elementorFrontend.hooks.addAction("frontend/element_ready/widget",(function(e){e[0].classList.contains("elementor-widget-form")&&hCaptchaBindEvents()})))};window.hCaptchaElementorPro=e,jQuery(document).ready(e)})(); -
hcaptcha-for-forms-and-more/trunk/assets/js/hcaptcha-nf.js
r3064004 r3129246 3 3 */ 4 4 5 /* global hcaptcha, Marionette, Backbone*/5 /* global hcaptcha, Marionette, nfRadio */ 6 6 7 7 wp.hooks.addFilter( … … 21 21 initialize() { 22 22 // On the Form Submission's field validation. 23 const submitChannel = Backbone.Radio.channel( 'submit' );23 const submitChannel = nfRadio.channel( 'submit' ); 24 24 this.listenTo( submitChannel, 'validate:field', this.updateHcaptcha ); 25 25 this.listenTo( submitChannel, 'validate:field', this.updateHcaptcha ); 26 26 27 27 // On the Field's model value change. 28 const fieldsChannel = Backbone.Radio.channel( 'fields' );28 const fieldsChannel = nfRadio.channel( 'fields' ); 29 29 this.listenTo( fieldsChannel, 'change:modelValue', this.updateHcaptcha ); 30 30 }, … … 39 39 if ( model.get( 'value' ) ) { 40 40 // Remove Error from Model. 41 Backbone.Radio.channel( 'fields' ).request(41 nfRadio.channel( 'fields' ).request( 42 42 'remove:error', 43 43 model.get( 'id' ), … … 70 70 const data = options.data ?? ''; 71 71 72 if ( ! ( typeof data === 'string' || data instanceof String ) ) { 73 return; 74 } 75 72 76 if ( ! data.startsWith( 'action=nf_ajax_submit' ) ) { 73 77 return; -
hcaptcha-for-forms-and-more/trunk/assets/js/hcaptcha-nf.min.js
r3064004 r3129246 1 (()=>{var a;wp.hooks.addFilter("hcaptcha.ajaxSubmitButton","hcaptcha",(function(a, e){return!!e.classList.contains("nf-element")||a})),document.addEventListener("DOMContentLoaded",(function(){var a=Marionette.Object.extend({initialize:function(){var a=Backbone.Radio.channel("submit");this.listenTo(a,"validate:field",this.updateHcaptcha),this.listenTo(a,"validate:field",this.updateHcaptcha);var e=Backbone.Radio.channel("fields");this.listenTo(e,"change:modelValue",this.updateHcaptcha)},updateHcaptcha:function(a){if("hcaptcha-for-ninja-forms"===a.get("type"))if(a.get("value"))Backbone.Radio.channel("fields").request("remove:error",a.get("id"),"required-error");else{var e=a.get("id"),t=document.querySelector('.h-captcha[data-fieldId="'+e+'"] iframe');if(!t)return;var i=t.dataset.hcaptchaWidgetId,n=hcaptcha.getResponse(i);a.set("value",n)}}});window.hCaptchaFieldController=new a})),(a=jQuery).ajaxPrefilter((function(e){var t,i=null!==(t=e.data)&&void 0!==t?t:"";if(i.startsWith("action=nf_ajax_submit")){var n=new URLSearchParams(i),c=JSON.parse(n.get("formData")).id,d=a("#nf-form-"+c+"-cont").find('[name="hcaptcha-widget-id"]').val();d=d||"",e.data+="&hcaptcha-widget-id="+d}}))})();1 (()=>{var a;wp.hooks.addFilter("hcaptcha.ajaxSubmitButton","hcaptcha",(function(a,t){return!!t.classList.contains("nf-element")||a})),document.addEventListener("DOMContentLoaded",(function(){var a=Marionette.Object.extend({initialize:function(){var a=nfRadio.channel("submit");this.listenTo(a,"validate:field",this.updateHcaptcha),this.listenTo(a,"validate:field",this.updateHcaptcha);var t=nfRadio.channel("fields");this.listenTo(t,"change:modelValue",this.updateHcaptcha)},updateHcaptcha:function(a){if("hcaptcha-for-ninja-forms"===a.get("type"))if(a.get("value"))nfRadio.channel("fields").request("remove:error",a.get("id"),"required-error");else{var t=a.get("id"),e=document.querySelector('.h-captcha[data-fieldId="'+t+'"] iframe');if(!e)return;var i=e.dataset.hcaptchaWidgetId,n=hcaptcha.getResponse(i);a.set("value",n)}}});window.hCaptchaFieldController=new a})),(a=jQuery).ajaxPrefilter((function(t){var e,i=null!==(e=t.data)&&void 0!==e?e:"";if(("string"==typeof i||i instanceof String)&&i.startsWith("action=nf_ajax_submit")){var n=new URLSearchParams(i),c=JSON.parse(n.get("formData")).id,d=a("#nf-form-"+c+"-cont").find('[name="hcaptcha-widget-id"]').val();d=d||"",t.data+="&hcaptcha-widget-id="+d}}))})(); -
hcaptcha-for-forms-and-more/trunk/assets/js/hcaptcha-wpdiscuz-comment.js
r3064004 r3129246 3 3 */ 4 4 5 wp.hooks.addFilter( 6 'hcaptcha.ajaxSubmitButton', 7 'hcaptcha', 8 ( isAjaxSubmitButton, submitButtonElement ) => { 9 if ( submitButtonElement.classList.contains( 'wc_comm_submit' ) ) { 10 return true; 5 /* global jQuery */ 6 7 document.addEventListener( 'DOMContentLoaded', function() { 8 wp.hooks.addFilter( 9 'hcaptcha.ajaxSubmitButton', 10 'hcaptcha', 11 ( isAjaxSubmitButton, submitButtonElement ) => { 12 if ( submitButtonElement.classList.contains( 'wc_comm_submit' ) ) { 13 return true; 14 } 15 16 return isAjaxSubmitButton; 11 17 } 18 ); 12 19 13 return isAjaxSubmitButton; 20 const threadsElement = document.getElementById( 'wpd-threads' ); 21 22 if ( ! threadsElement ) { 23 return; 14 24 } 15 ); 25 26 // Define the callback function for the MutationObserver. 27 const observerCallback = function( mutationsList ) { 28 for ( const mutation of mutationsList ) { 29 [ ...mutation.addedNodes ].map( ( node ) => { 30 if ( 31 node.nodeType === Node.ELEMENT_NODE && 32 node.classList.contains( 'wpd-form' ) && 33 node.querySelector( '.h-captcha' ) 34 ) { 35 window.hCaptchaBindEvents(); 36 } 37 38 return node; 39 } ); 40 } 41 }; 42 43 // Create a MutationObserver instance. 44 const observer = new MutationObserver( observerCallback ); 45 46 const config = { 47 childList: true, 48 subtree: true, 49 }; 50 51 // Start observing the #wpd-threads element for child node additions. 52 observer.observe( threadsElement, config ); 53 } ); 54 55 jQuery( document ).on( 'ajaxSuccess', function( event, xhr, settings ) { 56 const params = new URLSearchParams( settings.data ); 57 58 if ( params.get( 'action' ) !== 'wpdAddComment' ) { 59 return; 60 } 61 62 window.hCaptchaBindEvents(); 63 } ); -
hcaptcha-for-forms-and-more/trunk/assets/js/hcaptcha-wpdiscuz-comment.min.js
r3064004 r3129246 1 wp.hooks.addFilter("hcaptcha.ajaxSubmitButton","hcaptcha",(function(t,a){return!!a.classList.contains("wc_comm_submit")||t}));1 (()=>{function t(t){return function(t){if(Array.isArray(t))return e(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||n(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(t,n){if(t){if("string"==typeof t)return e(t,n);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?e(t,n):void 0}}function e(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,r=Array(n);e<n;e++)r[e]=t[e];return r}document.addEventListener("DOMContentLoaded",(function(){wp.hooks.addFilter("hcaptcha.ajaxSubmitButton","hcaptcha",(function(t,n){return!!n.classList.contains("wc_comm_submit")||t}));var e=document.getElementById("wpd-threads");if(e){new MutationObserver((function(e){var r,o=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=n(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var o=0,a=function(){};return{s:a,n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,u=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return u=t.done,t},e:function(t){c=!0,i=t},f:function(){try{u||null==r.return||r.return()}finally{if(c)throw i}}}}(e);try{for(o.s();!(r=o.n()).done;){t(r.value.addedNodes).map((function(t){return t.nodeType===Node.ELEMENT_NODE&&t.classList.contains("wpd-form")&&t.querySelector(".h-captcha")&&window.hCaptchaBindEvents(),t}))}}catch(t){o.e(t)}finally{o.f()}})).observe(e,{childList:!0,subtree:!0})}})),jQuery(document).on("ajaxSuccess",(function(t,n,e){"wpdAddComment"===new URLSearchParams(e.data).get("action")&&window.hCaptchaBindEvents()}))})(); -
hcaptcha-for-forms-and-more/trunk/assets/js/notifications.js
r2991126 r3129246 10 10 11 11 /** 12 * Notification slogic.12 * Notification logic. 13 13 * 14 14 * @param {Object} $ jQuery instance. … … 20 20 const notificationSelector = 'div.hcaptcha-notification'; 21 21 const dismissSelector = notificationsSelector + ' button.notice-dismiss'; 22 const navSpanSelector = '#hcaptcha-navigation span'; 23 const navPageSelector = '#hcaptcha-navigation-page'; 24 const navPagesSelector = '#hcaptcha-navigation-pages'; 22 25 const navPrevSelector = '#hcaptcha-navigation .prev'; 23 26 const navNextSelector = '#hcaptcha-navigation .next'; … … 51 54 52 55 if ( index >= 0 ) { 56 $( navPageSelector ).text( index + 1 ); 57 $( navPagesSelector ).text( $notifications.length ); 58 $( navSpanSelector ).show(); 53 59 $( navSelectors ).removeClass( 'disabled' ); 54 60 } else { 61 $( navSpanSelector ).hide(); 55 62 $( navSelectors ).addClass( 'disabled' ); 56 63 return; -
hcaptcha-for-forms-and-more/trunk/assets/js/notifications.min.js
r2991126 r3129246 1 jQuery(document).ready((function(t){var i,a="form#hcaptcha-options",n="div#hcaptcha-notifications",o="div.hcaptcha-notification",c=n+" button.notice-dismiss",e="#hcaptcha-navigation .prev",s="#hcaptcha-navigation .next",r=e+", "+s,d=".hcaptcha-notification-buttons",h="#hcaptcha-notifications-footer",f=function(){if(!(i=t(o)).length)return!1;var a=0;return i.each((function(i){if(t(this).is(":visible"))return a=i,!1})),a},l=function(){var a=f();a>=0?(t(r).removeClass("disabled"),0===a&&t(e).addClass("disabled"),a===i.length-1&&t(s).addClass("disabled")):t(r).addClass("disabled")},u=function(){var a=f();t(h).find(d).remove(),a<0||t(i[a]).find(d).clone().removeClass("hidden").prependTo(h)};t(a).on("click",c,(function(i){var a=t(i.target).closest(o),c={action:HCaptchaNotificationsObject.dismissNotificationAction,nonce:HCaptchaNotificationsObject.dismissNotificationNonce,id:a.data("id")},e=t(o).index(a)+1;e=e<t(o).length?e:0;var s=t(o).eq(e);return a.remove(),s.show(),l(),u(),0===t(o).length&&t(n).remove(),t.post({url:HCaptchaNotificationsObject.ajaxUrl,data:c}),!1})),t(a).on("click",r,(function(a){var n=1;t(a.target).hasClass("prev")&&(n=-1);var o=f(),c=o+n;o>=0&&c!==o&&c>=0&&c<i.length&&(t(i[o]).hide(),t(i[c]).show(),l(),u())})),t("button#reset_notifications").on("click",(function(){var i={action:HCaptchaNotificationsObject.resetNotificationAction,nonce:HCaptchaNotificationsObject.resetNotificationNonce};t.post({url:HCaptchaNotificationsObject.ajaxUrl,data:i}).success((function(i){i.success&&(t(n).remove(),t(i.data).insertBefore("h3.hcaptcha-section-keys"),u(),t(document).trigger("wp-updates-notice-added"))}))})),u()}));1 jQuery(document).ready((function(t){var a,i="form#hcaptcha-options",n="div#hcaptcha-notifications",c="div.hcaptcha-notification",o=n+" button.notice-dismiss",e="#hcaptcha-navigation span",s="#hcaptcha-navigation .prev",r="#hcaptcha-navigation .next",h=s+", "+r,d=".hcaptcha-notification-buttons",f="#hcaptcha-notifications-footer",p=function(){if(!(a=t(c)).length)return!1;var i=0;return a.each((function(a){if(t(this).is(":visible"))return i=a,!1})),i},l=function(){var i=p();if(!(i>=0))return t(e).hide(),void t(h).addClass("disabled");t("#hcaptcha-navigation-page").text(i+1),t("#hcaptcha-navigation-pages").text(a.length),t(e).show(),t(h).removeClass("disabled"),0===i&&t(s).addClass("disabled"),i===a.length-1&&t(r).addClass("disabled")},v=function(){var i=p();t(f).find(d).remove(),i<0||t(a[i]).find(d).clone().removeClass("hidden").prependTo(f)};t(i).on("click",o,(function(a){var i=t(a.target).closest(c),o={action:HCaptchaNotificationsObject.dismissNotificationAction,nonce:HCaptchaNotificationsObject.dismissNotificationNonce,id:i.data("id")},e=t(c).index(i)+1;e=e<t(c).length?e:0;var s=t(c).eq(e);return i.remove(),s.show(),l(),v(),0===t(c).length&&t(n).remove(),t.post({url:HCaptchaNotificationsObject.ajaxUrl,data:o}),!1})),t(i).on("click",h,(function(i){var n=1;t(i.target).hasClass("prev")&&(n=-1);var c=p(),o=c+n;c>=0&&o!==c&&o>=0&&o<a.length&&(t(a[c]).hide(),t(a[o]).show(),l(),v())})),t("button#reset_notifications").on("click",(function(){var a={action:HCaptchaNotificationsObject.resetNotificationAction,nonce:HCaptchaNotificationsObject.resetNotificationNonce};t.post({url:HCaptchaNotificationsObject.ajaxUrl,data:a}).success((function(a){a.success&&(t(n).remove(),t(a.data).insertBefore("h3.hcaptcha-section-keys"),v(),t(document).trigger("wp-updates-notice-added"))}))})),v()})); -
hcaptcha-for-forms-and-more/trunk/changelog.txt
r3115148 r3129246 1 = 4.4.0 = 2 * Added compatibility with Contact Form 7 Stripe integration. 3 * Added compatibility with WPS Hide Login plugin. 4 * Added compatibility with LoginPress plugin. 5 * Improved compatibility with Wordfence Login Security plugin. 6 * Updated MailPoet integration. 7 * Fixed conflict with Ninja Forms Upload field. 8 * Fixed Ninja Forms Ajax processing. 9 * Fixed error in cron with Matomo Analytics. 10 * Fixed error with the Elementor Checkout Element. 11 * Fixed ignorance of Pro params in the Elementor admin editor. 12 * Fixed inability to activate the Elementor Pro plugin when Elementor plugin is activated. 13 * Fixed sending replies to wpDiscuz comments. 14 * Fixed replies in the WP Dashboard with wpDiscuz active. 15 * Fixed sending several wpDiscuz comments without a page reload. 16 1 17 = 4.3.1 = 2 18 * Added a live form in the Contact Form 7 admin form view. -
hcaptcha-for-forms-and-more/trunk/hcaptcha.php
r3115148 r3129246 11 11 * Plugin URI: https://www.hcaptcha.com/ 12 12 * Description: hCaptcha keeps out bots and spam while putting privacy first. It is a drop-in replacement for reCAPTCHA. 13 * Version: 4. 3.113 * Version: 4.4.0 14 14 * Requires at least: 5.3 15 15 * Requires PHP: 7.2 … … 40 40 * Plugin version. 41 41 */ 42 const HCAPTCHA_VERSION = '4. 3.1';42 const HCAPTCHA_VERSION = '4.4.0'; 43 43 44 44 /** -
hcaptcha-for-forms-and-more/trunk/readme.txt
r3115148 r3129246 5 5 Tested up to: 6.6 6 6 Requires PHP: 7.2 7 Stable tag: 4. 3.17 Stable tag: 4.4.0 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 17 17 Need to keep out bots? hCaptcha protects privacy while offering better protection against spam and abuse. Help build a better web. 18 18 19 [The hCaptcha for WP many advantages over similar captcha plugins](https://kagg.eu/why-choose-hcaptcha-for-wp/). 20 19 21 == How hCaptcha Works == 20 22 … … 29 31 == Screenshots == 30 32 31 1. Login page with hCaptcha widget 32 2. Login page with hCaptcha challenge 33 3. WooCommerce Login/Register page 34 4. Contact Form 7 with hCaptcha 35 5. Contact Form 7 live form in the admin editor. 36 6. General settings page 37 7. Integrations settings page 38 8. Activating plugin from the Integration settings page 39 9. (Optional) Local Forms statistics 40 10. (Optional) Local Events statistics 33 1. Login page with hCaptcha widget. 34 2. Login page with hCaptcha challenge. 35 3. WooCommerce Login/Register page. 36 4. Contact Form 7 with hCaptcha. 37 5. Contact Form 7 live form in the admin editor. 38 6. Elementor Pro Form. 39 7. Elementor Pro From in admin editor. 40 8. General settings page. 41 9. Integrations settings page. 42 10. Activating plugin from the Integration settings page. 43 11. (Optional) Local Forms statistics. 44 12. (Optional) Local Events statistics. 41 45 42 46 == Installation == … … 562 566 == Changelog == 563 567 568 = 4.4.0 = 569 * Added compatibility with Contact Form 7 Stripe integration. 570 * Added compatibility with WPS Hide Login plugin. 571 * Added compatibility with LoginPress plugin. 572 * Improved compatibility with Wordfence Login Security plugin. 573 * Updated MailPoet integration. 574 * Fixed conflict with Ninja Forms Upload field. 575 * Fixed Ninja Forms Ajax processing. 576 * Fixed error in cron with Matomo Analytics. 577 * Fixed error with the Elementor Checkout Element. 578 * Fixed ignorance of Pro params in the Elementor admin editor. 579 * Fixed inability to activate the Elementor Pro plugin when Elementor plugin is activated. 580 * Fixed sending replies to wpDiscuz comments. 581 * Fixed replies in the WP Dashboard with wpDiscuz active. 582 * Fixed sending several wpDiscuz comments without a page reload. 583 564 584 = 4.3.1 = 565 585 * Added a live form in the Contact Form 7 admin form view. -
hcaptcha-for-forms-and-more/trunk/src/php/Admin/Notifications.php
r3114572 r3129246 113 113 $statistics_url = $general_url . '#statistics_1'; 114 114 $force_url = $general_url . '#force_1'; 115 $elementor_edit_form_url = HCAPTCHA_URL . '/assets/images/elementor-edit-form.png'; 115 116 116 117 $notifications = [ … … 270 271 ], 271 272 ], 273 // Added in 4.4.0. 274 'admin-elementor' => [ 275 'title' => __( 'Add hCaptcha to Elementor Pro Form', 'hcaptcha-for-forms-and-more' ), 276 'message' => __( 'Add hCaptcha to Elementor Pro Form in the Elementor admin editor.', 'hcaptcha-for-forms-and-more' ), 277 'button' => [ 278 'url' => $elementor_edit_form_url, 279 'text' => __( 'See an example', 'hcaptcha-for-forms-and-more' ), 280 ], 281 ], 272 282 ]; 273 283 … … 282 292 } 283 293 294 if ( $settings->is_on( 'statistics' ) ) { 295 unset( $notifications['statistics'] ); 296 } 297 298 if ( $settings->is_on( 'statistics' ) && $settings->is_pro() ) { 299 unset( $notifications['events_page'] ); 300 } 301 284 302 if ( $settings->is_on( 'force' ) ) { 285 303 unset( $notifications['force'] ); 286 304 } 287 305 288 return $notifications; 306 if ( ! class_exists( '\ElementorPro\Plugin', false ) ) { 307 unset( $notifications['admin-elementor'] ); 308 } 309 310 // Added in 4.4.0. 311 return array_merge( $notifications, $this->cf7_admin_notification() ); 312 } 313 314 /** 315 * Contact Form 7 admin notification. 316 * 317 * @return array 318 */ 319 private function cf7_admin_notification(): array { 320 if ( ! class_exists( 'WPCF7_ContactForm' ) ) { 321 return []; 322 } 323 324 // Get the latest CF7 form. 325 $args = [ 326 'post_type' => 'wpcf7_contact_form', 327 'posts_per_page' => 1, 328 'orderby' => 'date', 329 'order' => 'DESC', 330 ]; 331 $cf7_forms = get_posts( $args ); 332 333 if ( empty( $cf7_forms ) ) { 334 return []; 335 } 336 337 $form_id = $cf7_forms[0]->ID; 338 $edit_url = admin_url( "?page=wpcf7&post=$form_id&action=edit#postbox-container-live" ); 339 340 return [ 341 'admin-cf7' => [ 342 'title' => __( 'Live form in Contact Form 7 admin', 'hcaptcha-for-forms-and-more' ), 343 'message' => __( 'With the hCaptcha plugin, you can see a live form on the form edit admin page.', 'hcaptcha-for-forms-and-more' ), 344 'button' => [ 345 'url' => $edit_url, 346 'text' => __( 'Use live form', 'hcaptcha-for-forms-and-more' ), 347 ], 348 ], 349 ]; 289 350 } 290 351 … … 358 419 <div id="hcaptcha-notifications-footer"> 359 420 <div id="hcaptcha-navigation"> 421 <span> 422 <span id="hcaptcha-navigation-page">1</span> 423 <?php esc_html_e( 'of', 'hcaptcha-for-forms-and-more' ); ?> 424 <span id="hcaptcha-navigation-pages"><?php echo count( $notifications ); ?></span> 425 </span> 360 426 <a class="prev disabled"></a> 361 427 <a class="next <?php echo esc_attr( $next_disabled ); ?>"></a> -
hcaptcha-for-forms-and-more/trunk/src/php/AutoVerify/AutoVerify.php
r3114572 r3129246 74 74 */ 75 75 public function verify_form(): void { 76 if ( ! Request::is_frontend() ) { 77 return; 78 } 79 80 $request_method = isset( $_SERVER['REQUEST_METHOD'] ) ? filter_var( wp_unslash( $_SERVER['REQUEST_METHOD'] ), FILTER_SANITIZE_FULL_SPECIAL_CHARS ) : ''; 81 82 if ( 'POST' !== $request_method ) { 76 if ( ! Request::is_post() || ! Request::is_frontend() ) { 83 77 return; 84 78 } -
hcaptcha-for-forms-and-more/trunk/src/php/CF7/Admin.php
r3115148 r3129246 47 47 * Current screen. 48 48 * 49 * @param mixed $current_screen Current screen.49 * @param WP_Screen|mixed $current_screen Current screen. 50 50 * 51 51 * @return void … … 54 54 $current_screen_id = $current_screen->id ?? ''; 55 55 56 if ( ! $current_screen ) {56 if ( ! $current_screen_id ) { 57 57 return; 58 58 } … … 109 109 110 110 $form_shortcode = htmlspecialchars_decode( $m[1] ); 111 $live_form = do_shortcode( $form_shortcode ); 112 $stripe_message = ''; 113 114 if ( $this->has_stripe_element( $live_form ) ) { 115 $stripe_message = 116 '<h4><em>' . 117 __( 'The Stripe payment element already contains an invisible hCaptcha. No need to add it to the form.', 'hcaptcha-for-forms-and-more' ) . 118 '</em></h4>'; 119 } 111 120 112 121 $live_container = … … 114 123 '<div id="postbox-container-live" class="postbox-container">' . 115 124 '<div id="form-live">' . 116 '<h3>Live Form</h3>' . 117 do_shortcode( $form_shortcode ) . 125 '<h3>' . __( 'Live Form', 'hcaptcha-for-forms-and-more' ) . '</h3>' . 126 $stripe_message . 127 $live_form . 118 128 '</div>' . 119 129 '</div>' . … … 290 300 * @return bool 291 301 */ 292 pr ivatefunction is_cf7_form_admin_page(): bool {302 protected function is_cf7_form_admin_page(): bool { 293 303 294 304 // phpcs:ignore WordPress.Security.NonceVerification.Recommended -
hcaptcha-for-forms-and-more/trunk/src/php/CF7/Base.php
r3114572 r3129246 43 43 $this->mode_embed = hcaptcha()->settings()->is( 'cf7_status', 'embed' ); 44 44 } 45 46 /** 47 * Whether the form contains a Stripe element. 48 * 49 * @param string $output Output. 50 * 51 * @return bool 52 */ 53 protected function has_stripe_element( string $output ): bool { 54 return false !== strpos( $output, '<div class="wpcf7-stripe">' ); 55 } 45 56 } -
hcaptcha-for-forms-and-more/trunk/src/php/CF7/CF7.php
r3114572 r3129246 59 59 * @param array $m Regular expression match array. 60 60 * 61 * @return string |mixed61 * @return string 62 62 * @noinspection PhpUnusedParameterInspection 63 63 */ 64 public function wpcf7_shortcode( $output, string $tag, $attr, array $m ) { 64 public function wpcf7_shortcode( $output, string $tag, $attr, array $m ): string { 65 $output = (string) $output; 66 65 67 if ( 'contact-form-7' !== $tag ) { 66 68 return $output; 67 69 } 68 70 69 $output = (string) $output; 71 if ( $this->has_stripe_element( $output ) ) { 72 /** 73 * Do not show hCaptcha in the CF7 form having Stripe field. 74 * Stripe payment form has its own hidden hCaptcha field. 75 */ 76 return preg_replace( '/\[cf7-hcaptcha.*?]/', '', $output ); 77 } 78 70 79 $form_id = isset( $attr['id'] ) ? (int) $attr['id'] : 0; 71 80 $cf7_hcap_shortcode = $this->get_cf7_hcap_shortcode( $output ); … … 184 193 } 185 194 195 if ( $this->has_field( $submission, 'stripe' ) ) { 196 /** 197 * Do not verify CF7 form having Stripe field. 198 * Stripe payment form has its own hidden hCaptcha field. 199 */ 200 return $result; 201 } 202 186 203 if ( 187 204 ! $this->mode_auto && 188 ! ( $this->mode_embed && $this->has_ hcaptcha_field( $submission) )205 ! ( $this->mode_embed && $this->has_field( $submission, 'hcaptcha' ) ) 189 206 ) { 190 207 return $result; … … 203 220 204 221 /** 205 * Whether the field is hCaptcha field. 206 * 207 * @param WPCF7_FormTag $field Field. 222 * Whether form has a field of given type. 223 * 224 * @param WPCF7_Submission $submission Submission. 225 * @param string $type Field type. 208 226 * 209 227 * @return bool 210 228 */ 211 private function is_hcaptcha_field( WPCF7_FormTag $field ): bool { 212 return ( 'hcaptcha' === $field->type ); 213 } 214 215 /** 216 * Whether form has its own hCaptcha field. 217 * 218 * @param WPCF7_Submission $submission Submission. 219 * 220 * @return bool 221 */ 222 protected function has_hcaptcha_field( WPCF7_Submission $submission ): bool { 229 protected function has_field( WPCF7_Submission $submission, string $type ): bool { 223 230 $form_fields = $submission->get_contact_form()->scan_form_tags(); 224 231 225 232 foreach ( $form_fields as $form_field ) { 226 if ( $t his->is_hcaptcha_field( $form_field )) {233 if ( $type === $form_field->type ) { 227 234 return true; 228 235 } -
hcaptcha-for-forms-and-more/trunk/src/php/ElementorPro/Login.php
r3114572 r3129246 92 92 $signatures = (string) ob_get_clean(); 93 93 94 $pattern = '/(<div class="elementor-field-group.+ <button type="submit")/s';94 $pattern = '/(<div class="elementor-field-group.+?<button type="submit")/s'; 95 95 $replacement = $hcaptcha . $signatures . "\n$1"; 96 96 $form = preg_replace( $pattern, $replacement, $form ); -
hcaptcha-for-forms-and-more/trunk/src/php/EssentialAddons/Login.php
r3114572 r3129246 82 82 wp_safe_redirect( wp_unslash( $_SERVER['HTTP_REFERER'] ) ); 83 83 84 exit();84 $this->exit(); 85 85 } 86 86 } 87 88 /** 89 * Wrapper for exit(). Used for tests. 90 * 91 * @return void 92 */ 93 protected function exit(): void { 94 // @codeCoverageIgnoreStart 95 exit(); 96 // @codeCoverageIgnoreEnd 97 } 87 98 } -
hcaptcha-for-forms-and-more/trunk/src/php/EssentialAddons/Register.php
r3114572 r3129246 24 24 * Nonce action. 25 25 */ 26 const ACTION = 'hcaptcha_essential_addons_register';26 private const ACTION = 'hcaptcha_essential_addons_register'; 27 27 28 28 /** 29 29 * Nonce name. 30 30 */ 31 const NONCE = 'hcaptcha_essential_addons_register_nonce';31 private const NONCE = 'hcaptcha_essential_addons_register_nonce'; 32 32 33 33 /** … … 98 98 wp_safe_redirect( wp_unslash( $_SERVER['HTTP_REFERER'] ) ); 99 99 100 exit();100 $this->exit(); 101 101 } 102 102 } … … 118 118 HCaptcha::css_display( $css ); 119 119 } 120 121 /** 122 * Wrapper for exit(). Used for tests. 123 * 124 * @return void 125 */ 126 protected function exit(): void { 127 // @codeCoverageIgnoreStart 128 exit(); 129 // @codeCoverageIgnoreEnd 130 } 120 131 } -
hcaptcha-for-forms-and-more/trunk/src/php/GiveWP/Base.php
r3114572 r3129246 15 15 use Give\DonationForms\ValueObjects\DonationFormErrorTypes; 16 16 use HCaptcha\Helpers\HCaptcha; 17 use HCaptcha\Helpers\Request; 17 18 use WP_Error; 18 19 … … 129 130 */ 130 131 public function verify_block(): void { 131 // phpcs:disable WordPress.Security.NonceVerification.Missing, WordPress.Security.NonceVerification.Recommended 132 $request_method = isset( $_SERVER['REQUEST_METHOD'] ) 133 ? sanitize_text_field( wp_unslash( $_SERVER['REQUEST_METHOD'] ) ) 134 : ''; 135 // phpcs:enable WordPress.Security.NonceVerification.Missing, WordPress.Security.NonceVerification.Recommended 136 137 if ( 'POST' !== $request_method ) { 132 if ( ! Request::is_post() ) { 138 133 return; 139 134 } -
hcaptcha-for-forms-and-more/trunk/src/php/Helpers/HCaptcha.php
r3114572 r3129246 13 13 namespace HCaptcha\Helpers; 14 14 15 use HCaptcha\Vendor \MatthiasMullie\Minify\CSS;16 use HCaptcha\Vendor \MatthiasMullie\Minify\JS;15 use HCaptcha\Vendors\MatthiasMullie\Minify\CSS; 16 use HCaptcha\Vendors\MatthiasMullie\Minify\JS; 17 17 use WP_Error; 18 18 … … 167 167 value="<?php echo esc_attr( $widget_id ); ?>"> 168 168 <?php 169 } 170 171 /** 172 * Get signature. 173 * 174 * @param string $class_name Class name. 175 * @param int|string $form_id Form id. 176 * @param bool $hcaptcha_shown The hCaptcha was shown. 177 * 178 * @return string 179 */ 180 public static function get_signature( string $class_name, $form_id, bool $hcaptcha_shown ): string { 181 ob_start(); 182 self::display_signature( $class_name, $form_id, $hcaptcha_shown ); 183 184 return (string) ob_get_clean(); 169 185 } 170 186 -
hcaptcha-for-forms-and-more/trunk/src/php/Helpers/Request.php
r2965110 r3129246 21 21 */ 22 22 public static function is_frontend(): bool { 23 return ! ( self::is_cli() || is_admin() || wp_doing_ajax() || self::is_rest() ); 23 return ! ( 24 self::is_xml_rpc() || self::is_cli() || self::is_wc_ajax() || 25 is_admin() || wp_doing_ajax() || wp_doing_cron() || 26 self::is_rest() 27 ); 28 } 29 30 /** 31 * Check if it is the xml-rpc request. 32 * 33 * @return bool 34 */ 35 public static function is_xml_rpc(): bool { 36 return defined( 'XMLRPC_REQUEST' ) && constant( 'XMLRPC_REQUEST' ); 24 37 } 25 38 … … 31 44 public static function is_cli(): bool { 32 45 return defined( 'WP_CLI' ) && constant( 'WP_CLI' ); 46 } 47 48 /** 49 * Check if it is a WooCommerce AJAX request. 50 * 51 * @return bool 52 */ 53 public static function is_wc_ajax(): bool { 54 // phpcs:ignore WordPress.Security.NonceVerification.Recommended 55 return isset( $_GET['wc-ajax'] ); 33 56 } 34 57 … … 79 102 return 0 === strpos( $current_url, $rest_url ); 80 103 } 104 105 /** 106 * Check if it is a POST request. 107 * 108 * @return bool 109 */ 110 public static function is_post(): bool { 111 $request_method = isset( $_SERVER['REQUEST_METHOD'] ) 112 ? strtoupper( filter_var( wp_unslash( $_SERVER['REQUEST_METHOD'] ), FILTER_SANITIZE_FULL_SPECIAL_CHARS ) ) 113 : ''; 114 115 return 'POST' === $request_method; 116 } 81 117 } -
hcaptcha-for-forms-and-more/trunk/src/php/MailPoet/Form.php
r3114572 r3129246 95 95 */ 96 96 public function verify( API $api ): void { 97 if ( is_admin() ) {97 if ( ! wp_doing_ajax() ) { 98 98 return; 99 99 } -
hcaptcha-for-forms-and-more/trunk/src/php/Main.php
r3114572 r3129246 24 24 use HCaptcha\ElementorPro\HCaptchaHandler; 25 25 use HCaptcha\Helpers\HCaptcha; 26 use HCaptcha\Helpers\Request; 26 27 use HCaptcha\Jetpack\JetpackForm; 27 28 use HCaptcha\Migrations\Migrations; … … 123 124 */ 124 125 public function init(): void { 125 if ( $this->is_xml_rpc() ) {126 if ( Request::is_xml_rpc() ) { 126 127 return; 127 128 } 128 129 130 new Migrations(); 131 132 if ( wp_doing_cron() ) { 133 return; 134 } 135 129 136 ( new Fix() )->init(); 130 131 new Migrations();132 137 133 138 add_action( 'plugins_loaded', [ $this, 'init_hooks' ], -PHP_INT_MAX ); … … 519 524 justify-content: center; 520 525 } 526 .h-captcha[data-size="normal"] { 527 scale: calc(270 / 303); 528 transform: translate(-20px, 0); 529 } 521 530 } 522 531 523 532 @media (min-width: 350px) { 524 #login {533 body #login { 525 534 width: 350px; 535 box-sizing: content-box; 526 536 } 527 537 } … … 1360 1370 ); 1361 1371 } 1362 1363 /**1364 * Check if it is the xml-rpc request.1365 *1366 * @return bool1367 */1368 protected function is_xml_rpc(): bool {1369 return defined( 'XMLRPC_REQUEST' ) && constant( 'XMLRPC_REQUEST' );1370 }1371 1372 } -
hcaptcha-for-forms-and-more/trunk/src/php/Settings/Integrations.php
r3114572 r3129246 1038 1038 $result = $this->activate_plugin_tree( $this->plugins_tree ); 1039 1039 1040 if ( null === $result) {1040 if ( ! is_wp_error( $result ) ) { 1041 1041 // Activate the first available plugin only. 1042 1042 return true; … … 1056 1056 protected function activate_plugin_tree( array &$node ) { 1057 1057 if ( $node['children'] ) { 1058 foreach ( $node['children'] as $child ) {1059 $ result= $this->activate_plugin_tree( $child );1060 1061 if ( null !== $result) {1062 return $ result;1058 foreach ( $node['children'] as & $child ) { 1059 $child['result'] = $this->activate_plugin_tree( $child ); 1060 1061 if ( is_wp_error( $child['result'] ) ) { 1062 return $child['result']; 1063 1063 } 1064 1064 } 1065 1066 unset( $child ); 1065 1067 } 1066 1068 … … 1075 1077 * @param string $plugin Path to the plugin file relative to the plugins' directory. 1076 1078 * 1077 * @return null|true|WP_Error 1079 * @return null|true|WP_Error Null on success, WP_Error on failure. True if the plugin is already active. 1078 1080 */ 1079 1081 protected function activate_plugin( string $plugin ) { … … 1087 1089 1088 1090 ob_start(); 1091 // Null on success, WP_Error on failure. 1089 1092 $result = activate_plugin( $plugin ); 1090 1093 ob_end_clean(); -
hcaptcha-for-forms-and-more/trunk/src/php/WP/LostPassword.php
r3114572 r3129246 14 14 */ 15 15 class LostPassword extends LostPasswordBase { 16 use Base; 16 17 17 18 /** … … 41 42 42 43 /** 43 * WP login URL.44 */45 private const WP_LOGIN_URL = '/wp-login.php';46 47 /**48 44 * WP login action. 49 45 */ … … 56 52 */ 57 53 public function add_captcha(): void { 58 $request_uri = isset( $_SERVER['REQUEST_URI'] ) ? 59 filter_var( wp_unslash( $_SERVER['REQUEST_URI'] ), FILTER_SANITIZE_FULL_SPECIAL_CHARS ) : 60 ''; 61 62 $request_uri = wp_parse_url( $request_uri, PHP_URL_PATH ); 63 64 if ( false === strpos( $request_uri, self::WP_LOGIN_URL ) ) { 65 return; 66 } 67 68 // phpcs:ignore WordPress.Security.NonceVerification.Recommended 69 $action = isset( $_GET['action'] ) ? sanitize_text_field( wp_unslash( $_GET['action'] ) ) : ''; 70 71 if ( self::WP_LOGIN_ACTION !== $action ) { 54 if ( ! $this->is_login_url() || ! $this->is_login_action() ) { 72 55 return; 73 56 } -
hcaptcha-for-forms-and-more/trunk/src/php/WP/Register.php
r3114572 r3129246 15 15 */ 16 16 class Register { 17 18 /** 19 * WP login URL. 20 */ 21 private const WP_LOGIN_URL = '/wp-login.php'; 17 use Base; 22 18 23 19 /** … … 30 26 */ 31 27 private const NONCE = 'hcaptcha_registration_nonce'; 28 29 /** 30 * WP login action. 31 */ 32 private const WP_LOGIN_ACTION = 'register'; 32 33 33 34 /** … … 54 55 */ 55 56 public function add_captcha(): void { 56 $request_uri = isset( $_SERVER['REQUEST_URI'] ) ? 57 filter_var( wp_unslash( $_SERVER['REQUEST_URI'] ), FILTER_SANITIZE_FULL_SPECIAL_CHARS ) : 58 ''; 59 60 $request_uri = wp_parse_url( $request_uri, PHP_URL_PATH ); 61 62 if ( false === strpos( $request_uri, self::WP_LOGIN_URL ) ) { 63 return; 64 } 65 66 // phpcs:ignore WordPress.Security.NonceVerification.Recommended 67 $action = isset( $_GET['action'] ) ? sanitize_text_field( wp_unslash( $_GET['action'] ) ) : ''; 68 69 if ( 'register' !== $action ) { 57 if ( ! $this->is_login_url() || ! $this->is_login_action() ) { 70 58 return; 71 59 } … … 95 83 */ 96 84 public function verify( $errors, string $sanitized_user_login, string $user_email ) { 97 // phpcs:ignore WordPress.Security.NonceVerification.Recommended 98 $action = isset( $_GET['action'] ) ? sanitize_text_field( wp_unslash( $_GET['action'] ) ) : ''; 99 100 if ( 'register' !== $action ) { 85 if ( ! $this->is_login_action() ) { 101 86 return $errors; 102 87 } -
hcaptcha-for-forms-and-more/trunk/src/php/WPDiscuz/Comment.php
r3114572 r3129246 57 57 ?> 58 58 <div class="wpd-field-hcaptcha wpdiscuz-item"> 59 <div class="wpdiscuz-hcaptcha" id="wpdiscuz-hcaptcha"></div>59 <div class="wpdiscuz-hcaptcha"></div> 60 60 <?php HCaptcha::form_display( $args ); ?> 61 61 <div class="clearfix"></div> … … 79 79 */ 80 80 public function verify( $comment_data ) { 81 // Nonce is checked by wpDiscuz. 82 83 // phpcs:disable WordPress.Security.NonceVerification.Missing 84 $action = isset( $_POST['action'] ) 85 ? sanitize_text_field( wp_unslash( $_POST['action'] ) ) 86 : ''; 87 // phpcs:enable WordPress.Security.NonceVerification.Missing 88 89 if ( ! ( 'wpdAddComment' === $action && wp_doing_ajax() ) ) { 90 return $comment_data; 91 } 92 81 93 $wp_discuz = wpDiscuz(); 82 94 83 95 remove_filter( 'preprocess_comment', [ $wp_discuz, 'validateRecaptcha' ] ); 84 85 // Nonce is checked by wpDiscuz.86 96 87 97 // phpcs:disable WordPress.Security.NonceVerification.Missing -
hcaptcha-for-forms-and-more/trunk/src/php/Wordfence/General.php
r3114572 r3129246 8 8 namespace HCaptcha\Wordfence; 9 9 10 use HCaptcha\Helpers\HCaptcha; 10 11 use HCaptcha\WP\Login; 11 12 … … 37 38 add_action( 'plugins_loaded', [ $this, 'remove_wp_login_hcaptcha_hooks' ] ); 38 39 } 40 41 add_action( 'login_head', [ $this, 'print_inline_styles' ], 20 ); 39 42 } 40 43 … … 74 77 remove_filter( 'wp_authenticate_user', [ $wp_login, 'check_signature' ], PHP_INT_MAX ); 75 78 } 79 80 /** 81 * Print inline styles. 82 * 83 * @return void 84 * @noinspection CssUnusedSymbol 85 */ 86 public function print_inline_styles(): void { 87 $css = <<<CSS 88 #loginform[style="position: relative;"] > .h-captcha { 89 visibility: hidden !important; 76 90 } 91 CSS; 92 93 HCaptcha::css_display( $css ); 94 } 95 } -
hcaptcha-for-forms-and-more/trunk/vendor/composer/autoload_classmap.php
r3115148 r3129246 125 125 'HCaptcha\\UsersWP\\Login' => $baseDir . '/src/php/UsersWP/Login.php', 126 126 'HCaptcha\\UsersWP\\Register' => $baseDir . '/src/php/UsersWP/Register.php', 127 'HCaptcha\\Vendor \\MatthiasMullie\\Minify\\CSS' => $baseDir . '/vendors/matthiasmullie/minify/src/CSS.php',128 'HCaptcha\\Vendor \\MatthiasMullie\\Minify\\Exception' => $baseDir . '/vendors/matthiasmullie/minify/src/Exception.php',129 'HCaptcha\\Vendor \\MatthiasMullie\\Minify\\Exceptions\\BasicException' => $baseDir . '/vendors/matthiasmullie/minify/src/Exceptions/BasicException.php',130 'HCaptcha\\Vendor \\MatthiasMullie\\Minify\\Exceptions\\FileImportException' => $baseDir . '/vendors/matthiasmullie/minify/src/Exceptions/FileImportException.php',131 'HCaptcha\\Vendor \\MatthiasMullie\\Minify\\Exceptions\\IOException' => $baseDir . '/vendors/matthiasmullie/minify/src/Exceptions/IOException.php',132 'HCaptcha\\Vendor \\MatthiasMullie\\Minify\\JS' => $baseDir . '/vendors/matthiasmullie/minify/src/JS.php',133 'HCaptcha\\Vendor \\MatthiasMullie\\Minify\\Minify' => $baseDir . '/vendors/matthiasmullie/minify/src/Minify.php',134 'HCaptcha\\Vendor \\MatthiasMullie\\PathConverter\\Converter' => $baseDir . '/vendors/matthiasmullie/path-converter/src/Converter.php',135 'HCaptcha\\Vendor \\MatthiasMullie\\PathConverter\\ConverterInterface' => $baseDir . '/vendors/matthiasmullie/path-converter/src/ConverterInterface.php',136 'HCaptcha\\Vendor \\MatthiasMullie\\PathConverter\\NoConverter' => $baseDir . '/vendors/matthiasmullie/path-converter/src/NoConverter.php',127 'HCaptcha\\Vendors\\MatthiasMullie\\Minify\\CSS' => $baseDir . '/vendors/matthiasmullie/minify/src/CSS.php', 128 'HCaptcha\\Vendors\\MatthiasMullie\\Minify\\Exception' => $baseDir . '/vendors/matthiasmullie/minify/src/Exception.php', 129 'HCaptcha\\Vendors\\MatthiasMullie\\Minify\\Exceptions\\BasicException' => $baseDir . '/vendors/matthiasmullie/minify/src/Exceptions/BasicException.php', 130 'HCaptcha\\Vendors\\MatthiasMullie\\Minify\\Exceptions\\FileImportException' => $baseDir . '/vendors/matthiasmullie/minify/src/Exceptions/FileImportException.php', 131 'HCaptcha\\Vendors\\MatthiasMullie\\Minify\\Exceptions\\IOException' => $baseDir . '/vendors/matthiasmullie/minify/src/Exceptions/IOException.php', 132 'HCaptcha\\Vendors\\MatthiasMullie\\Minify\\JS' => $baseDir . '/vendors/matthiasmullie/minify/src/JS.php', 133 'HCaptcha\\Vendors\\MatthiasMullie\\Minify\\Minify' => $baseDir . '/vendors/matthiasmullie/minify/src/Minify.php', 134 'HCaptcha\\Vendors\\MatthiasMullie\\PathConverter\\Converter' => $baseDir . '/vendors/matthiasmullie/path-converter/src/Converter.php', 135 'HCaptcha\\Vendors\\MatthiasMullie\\PathConverter\\ConverterInterface' => $baseDir . '/vendors/matthiasmullie/path-converter/src/ConverterInterface.php', 136 'HCaptcha\\Vendors\\MatthiasMullie\\PathConverter\\NoConverter' => $baseDir . '/vendors/matthiasmullie/path-converter/src/NoConverter.php', 137 137 'HCaptcha\\WCWishlists\\CreateList' => $baseDir . '/src/php/WCWishlists/CreateList.php', 138 138 'HCaptcha\\WC\\Checkout' => $baseDir . '/src/php/WC/Checkout.php', … … 149 149 'HCaptcha\\WPForo\\Reply' => $baseDir . '/src/php/WPForo/Reply.php', 150 150 'HCaptcha\\WPJobOpenings\\Form' => $baseDir . '/src/php/WPJobOpenings/Form.php', 151 'HCaptcha\\WP\\Base' => $baseDir . '/src/php/WP/Base.php', 151 152 'HCaptcha\\WP\\Comment' => $baseDir . '/src/php/WP/Comment.php', 152 153 'HCaptcha\\WP\\Login' => $baseDir . '/src/php/WP/Login.php', … … 157 158 'KAGG\\Settings\\Abstracts\\SettingsBase' => $baseDir . '/src/php/Settings/Abstracts/SettingsBase.php', 158 159 'KAGG\\Settings\\Abstracts\\SettingsInterface' => $baseDir . '/src/php/Settings/Abstracts/SettingsInterface.php', 159 'MatthiasMullie\\Minify\\CSS' => $vendorDir . '/matthiasmullie/minify/src/CSS.php',160 'MatthiasMullie\\Minify\\Exception' => $vendorDir . '/matthiasmullie/minify/src/Exception.php',161 'MatthiasMullie\\Minify\\Exceptions\\BasicException' => $vendorDir . '/matthiasmullie/minify/src/Exceptions/BasicException.php',162 'MatthiasMullie\\Minify\\Exceptions\\FileImportException' => $vendorDir . '/matthiasmullie/minify/src/Exceptions/FileImportException.php',163 'MatthiasMullie\\Minify\\Exceptions\\IOException' => $vendorDir . '/matthiasmullie/minify/src/Exceptions/IOException.php',164 'MatthiasMullie\\Minify\\JS' => $vendorDir . '/matthiasmullie/minify/src/JS.php',165 'MatthiasMullie\\Minify\\Minify' => $vendorDir . '/matthiasmullie/minify/src/Minify.php',166 'MatthiasMullie\\PathConverter\\Converter' => $vendorDir . '/matthiasmullie/path-converter/src/Converter.php',167 'MatthiasMullie\\PathConverter\\ConverterInterface' => $vendorDir . '/matthiasmullie/path-converter/src/ConverterInterface.php',168 'MatthiasMullie\\PathConverter\\NoConverter' => $vendorDir . '/matthiasmullie/path-converter/src/NoConverter.php',169 160 ); -
hcaptcha-for-forms-and-more/trunk/vendor/composer/autoload_psr4.php
r3115148 r3129246 7 7 8 8 return array( 9 'MatthiasMullie\\PathConverter\\' => array($vendorDir . '/matthiasmullie/path-converter/src'),10 'MatthiasMullie\\Minify\\' => array($vendorDir . '/matthiasmullie/minify/src'),11 9 'KAGG\\Settings\\Abstracts\\' => array($baseDir . '/src/php/Settings/Abstracts'), 12 10 'HCaptcha\\Scoper\\' => array($baseDir . '/.php-scoper/src'), -
hcaptcha-for-forms-and-more/trunk/vendor/composer/autoload_real.php
r3115148 r3129246 23 23 } 24 24 25 require __DIR__ . '/platform_check.php';26 27 25 spl_autoload_register(array('ComposerAutoloaderInita6c3d020c47c988d11030e9a25036470', 'loadClassLoader'), true, true); 28 26 self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); -
hcaptcha-for-forms-and-more/trunk/vendor/composer/autoload_static.php
r3115148 r3129246 8 8 { 9 9 public static $prefixLengthsPsr4 = array ( 10 'M' =>11 array (12 'MatthiasMullie\\PathConverter\\' => 29,13 'MatthiasMullie\\Minify\\' => 22,14 ),15 10 'K' => 16 11 array ( … … 25 20 26 21 public static $prefixDirsPsr4 = array ( 27 'MatthiasMullie\\PathConverter\\' =>28 array (29 0 => __DIR__ . '/..' . '/matthiasmullie/path-converter/src',30 ),31 'MatthiasMullie\\Minify\\' =>32 array (33 0 => __DIR__ . '/..' . '/matthiasmullie/minify/src',34 ),35 22 'KAGG\\Settings\\Abstracts\\' => 36 23 array ( … … 166 153 'HCaptcha\\UsersWP\\Login' => __DIR__ . '/../..' . '/src/php/UsersWP/Login.php', 167 154 'HCaptcha\\UsersWP\\Register' => __DIR__ . '/../..' . '/src/php/UsersWP/Register.php', 168 'HCaptcha\\Vendor \\MatthiasMullie\\Minify\\CSS' => __DIR__ . '/../..' . '/vendors/matthiasmullie/minify/src/CSS.php',169 'HCaptcha\\Vendor \\MatthiasMullie\\Minify\\Exception' => __DIR__ . '/../..' . '/vendors/matthiasmullie/minify/src/Exception.php',170 'HCaptcha\\Vendor \\MatthiasMullie\\Minify\\Exceptions\\BasicException' => __DIR__ . '/../..' . '/vendors/matthiasmullie/minify/src/Exceptions/BasicException.php',171 'HCaptcha\\Vendor \\MatthiasMullie\\Minify\\Exceptions\\FileImportException' => __DIR__ . '/../..' . '/vendors/matthiasmullie/minify/src/Exceptions/FileImportException.php',172 'HCaptcha\\Vendor \\MatthiasMullie\\Minify\\Exceptions\\IOException' => __DIR__ . '/../..' . '/vendors/matthiasmullie/minify/src/Exceptions/IOException.php',173 'HCaptcha\\Vendor \\MatthiasMullie\\Minify\\JS' => __DIR__ . '/../..' . '/vendors/matthiasmullie/minify/src/JS.php',174 'HCaptcha\\Vendor \\MatthiasMullie\\Minify\\Minify' => __DIR__ . '/../..' . '/vendors/matthiasmullie/minify/src/Minify.php',175 'HCaptcha\\Vendor \\MatthiasMullie\\PathConverter\\Converter' => __DIR__ . '/../..' . '/vendors/matthiasmullie/path-converter/src/Converter.php',176 'HCaptcha\\Vendor \\MatthiasMullie\\PathConverter\\ConverterInterface' => __DIR__ . '/../..' . '/vendors/matthiasmullie/path-converter/src/ConverterInterface.php',177 'HCaptcha\\Vendor \\MatthiasMullie\\PathConverter\\NoConverter' => __DIR__ . '/../..' . '/vendors/matthiasmullie/path-converter/src/NoConverter.php',155 'HCaptcha\\Vendors\\MatthiasMullie\\Minify\\CSS' => __DIR__ . '/../..' . '/vendors/matthiasmullie/minify/src/CSS.php', 156 'HCaptcha\\Vendors\\MatthiasMullie\\Minify\\Exception' => __DIR__ . '/../..' . '/vendors/matthiasmullie/minify/src/Exception.php', 157 'HCaptcha\\Vendors\\MatthiasMullie\\Minify\\Exceptions\\BasicException' => __DIR__ . '/../..' . '/vendors/matthiasmullie/minify/src/Exceptions/BasicException.php', 158 'HCaptcha\\Vendors\\MatthiasMullie\\Minify\\Exceptions\\FileImportException' => __DIR__ . '/../..' . '/vendors/matthiasmullie/minify/src/Exceptions/FileImportException.php', 159 'HCaptcha\\Vendors\\MatthiasMullie\\Minify\\Exceptions\\IOException' => __DIR__ . '/../..' . '/vendors/matthiasmullie/minify/src/Exceptions/IOException.php', 160 'HCaptcha\\Vendors\\MatthiasMullie\\Minify\\JS' => __DIR__ . '/../..' . '/vendors/matthiasmullie/minify/src/JS.php', 161 'HCaptcha\\Vendors\\MatthiasMullie\\Minify\\Minify' => __DIR__ . '/../..' . '/vendors/matthiasmullie/minify/src/Minify.php', 162 'HCaptcha\\Vendors\\MatthiasMullie\\PathConverter\\Converter' => __DIR__ . '/../..' . '/vendors/matthiasmullie/path-converter/src/Converter.php', 163 'HCaptcha\\Vendors\\MatthiasMullie\\PathConverter\\ConverterInterface' => __DIR__ . '/../..' . '/vendors/matthiasmullie/path-converter/src/ConverterInterface.php', 164 'HCaptcha\\Vendors\\MatthiasMullie\\PathConverter\\NoConverter' => __DIR__ . '/../..' . '/vendors/matthiasmullie/path-converter/src/NoConverter.php', 178 165 'HCaptcha\\WCWishlists\\CreateList' => __DIR__ . '/../..' . '/src/php/WCWishlists/CreateList.php', 179 166 'HCaptcha\\WC\\Checkout' => __DIR__ . '/../..' . '/src/php/WC/Checkout.php', … … 190 177 'HCaptcha\\WPForo\\Reply' => __DIR__ . '/../..' . '/src/php/WPForo/Reply.php', 191 178 'HCaptcha\\WPJobOpenings\\Form' => __DIR__ . '/../..' . '/src/php/WPJobOpenings/Form.php', 179 'HCaptcha\\WP\\Base' => __DIR__ . '/../..' . '/src/php/WP/Base.php', 192 180 'HCaptcha\\WP\\Comment' => __DIR__ . '/../..' . '/src/php/WP/Comment.php', 193 181 'HCaptcha\\WP\\Login' => __DIR__ . '/../..' . '/src/php/WP/Login.php', … … 198 186 'KAGG\\Settings\\Abstracts\\SettingsBase' => __DIR__ . '/../..' . '/src/php/Settings/Abstracts/SettingsBase.php', 199 187 'KAGG\\Settings\\Abstracts\\SettingsInterface' => __DIR__ . '/../..' . '/src/php/Settings/Abstracts/SettingsInterface.php', 200 'MatthiasMullie\\Minify\\CSS' => __DIR__ . '/..' . '/matthiasmullie/minify/src/CSS.php',201 'MatthiasMullie\\Minify\\Exception' => __DIR__ . '/..' . '/matthiasmullie/minify/src/Exception.php',202 'MatthiasMullie\\Minify\\Exceptions\\BasicException' => __DIR__ . '/..' . '/matthiasmullie/minify/src/Exceptions/BasicException.php',203 'MatthiasMullie\\Minify\\Exceptions\\FileImportException' => __DIR__ . '/..' . '/matthiasmullie/minify/src/Exceptions/FileImportException.php',204 'MatthiasMullie\\Minify\\Exceptions\\IOException' => __DIR__ . '/..' . '/matthiasmullie/minify/src/Exceptions/IOException.php',205 'MatthiasMullie\\Minify\\JS' => __DIR__ . '/..' . '/matthiasmullie/minify/src/JS.php',206 'MatthiasMullie\\Minify\\Minify' => __DIR__ . '/..' . '/matthiasmullie/minify/src/Minify.php',207 'MatthiasMullie\\PathConverter\\Converter' => __DIR__ . '/..' . '/matthiasmullie/path-converter/src/Converter.php',208 'MatthiasMullie\\PathConverter\\ConverterInterface' => __DIR__ . '/..' . '/matthiasmullie/path-converter/src/ConverterInterface.php',209 'MatthiasMullie\\PathConverter\\NoConverter' => __DIR__ . '/..' . '/matthiasmullie/path-converter/src/NoConverter.php',210 188 ); 211 189 -
hcaptcha-for-forms-and-more/trunk/vendor/composer/installed.php
r3115148 r3129246 2 2 'root' => array( 3 3 'name' => 'hcaptcha/hcaptcha-wordpress-plugin', 4 'pretty_version' => '4. 3.1',5 'version' => '4. 3.1.0',6 'reference' => ' ac465ffed1388385455f805823726eaf3543586f',4 'pretty_version' => '4.4.0', 5 'version' => '4.4.0.0', 6 'reference' => '25bdd39c5629233960c20655da571516f475acb3', 7 7 'type' => 'wordpress-plugin', 8 8 'install_path' => __DIR__ . '/../../', … … 12 12 'versions' => array( 13 13 'hcaptcha/hcaptcha-wordpress-plugin' => array( 14 'pretty_version' => '4. 3.1',15 'version' => '4. 3.1.0',16 'reference' => ' ac465ffed1388385455f805823726eaf3543586f',14 'pretty_version' => '4.4.0', 15 'version' => '4.4.0.0', 16 'reference' => '25bdd39c5629233960c20655da571516f475acb3', 17 17 'type' => 'wordpress-plugin', 18 18 'install_path' => __DIR__ . '/../../', -
hcaptcha-for-forms-and-more/trunk/vendors/matthiasmullie/minify/src/CSS.php
r3115148 r3129246 10 10 * @license MIT License 11 11 */ 12 namespace HCaptcha\Vendor \MatthiasMullie\Minify;13 14 use HCaptcha\Vendor \MatthiasMullie\Minify\Exceptions\FileImportException;15 use HCaptcha\Vendor \MatthiasMullie\PathConverter\Converter;16 use HCaptcha\Vendor \MatthiasMullie\PathConverter\ConverterInterface;12 namespace HCaptcha\Vendors\MatthiasMullie\Minify; 13 14 use HCaptcha\Vendors\MatthiasMullie\Minify\Exceptions\FileImportException; 15 use HCaptcha\Vendors\MatthiasMullie\PathConverter\Converter; 16 use HCaptcha\Vendors\MatthiasMullie\PathConverter\ConverterInterface; 17 17 /** 18 18 * CSS minifier. -
hcaptcha-for-forms-and-more/trunk/vendors/matthiasmullie/minify/src/Exception.php
r3115148 r3129246 8 8 * @author Matthias Mullie <minify@mullie.eu> 9 9 */ 10 namespace HCaptcha\Vendor \MatthiasMullie\Minify;10 namespace HCaptcha\Vendors\MatthiasMullie\Minify; 11 11 12 12 /** -
hcaptcha-for-forms-and-more/trunk/vendors/matthiasmullie/minify/src/Exceptions/BasicException.php
r3115148 r3129246 10 10 * @license MIT License 11 11 */ 12 namespace HCaptcha\Vendor \MatthiasMullie\Minify\Exceptions;12 namespace HCaptcha\Vendors\MatthiasMullie\Minify\Exceptions; 13 13 14 use HCaptcha\Vendor \MatthiasMullie\Minify\Exception;14 use HCaptcha\Vendors\MatthiasMullie\Minify\Exception; 15 15 /** 16 16 * Basic Exception Class. -
hcaptcha-for-forms-and-more/trunk/vendors/matthiasmullie/minify/src/Exceptions/FileImportException.php
r3115148 r3129246 10 10 * @license MIT License 11 11 */ 12 namespace HCaptcha\Vendor \MatthiasMullie\Minify\Exceptions;12 namespace HCaptcha\Vendors\MatthiasMullie\Minify\Exceptions; 13 13 14 14 /** -
hcaptcha-for-forms-and-more/trunk/vendors/matthiasmullie/minify/src/Exceptions/IOException.php
r3115148 r3129246 10 10 * @license MIT License 11 11 */ 12 namespace HCaptcha\Vendor \MatthiasMullie\Minify\Exceptions;12 namespace HCaptcha\Vendors\MatthiasMullie\Minify\Exceptions; 13 13 14 14 /** -
hcaptcha-for-forms-and-more/trunk/vendors/matthiasmullie/minify/src/JS.php
r3115148 r3129246 10 10 * @license MIT License 11 11 */ 12 namespace HCaptcha\Vendor \MatthiasMullie\Minify;12 namespace HCaptcha\Vendors\MatthiasMullie\Minify; 13 13 14 14 /** … … 117 117 public function __construct() 118 118 { 119 call_user_func_array(array('HCaptcha\Vendor \MatthiasMullie\Minify\Minify', '__construct'), func_get_args());119 call_user_func_array(array('HCaptcha\Vendors\MatthiasMullie\Minify\Minify', '__construct'), func_get_args()); 120 120 $dataDir = __DIR__ . '/../data/js/'; 121 121 $options = \FILE_IGNORE_NEW_LINES | \FILE_SKIP_EMPTY_LINES; -
hcaptcha-for-forms-and-more/trunk/vendors/matthiasmullie/minify/src/Minify.php
r3115148 r3129246 10 10 * @license MIT License 11 11 */ 12 namespace HCaptcha\Vendor \MatthiasMullie\Minify;13 14 use HCaptcha\Vendor \MatthiasMullie\Minify\Exceptions\IOException;15 use HCaptcha\Vendor \Psr\Cache\CacheItemInterface;12 namespace HCaptcha\Vendors\MatthiasMullie\Minify; 13 14 use HCaptcha\Vendors\MatthiasMullie\Minify\Exceptions\IOException; 15 use HCaptcha\Vendors\Psr\Cache\CacheItemInterface; 16 16 /** 17 17 * Abstract minifier class. -
hcaptcha-for-forms-and-more/trunk/vendors/matthiasmullie/path-converter/src/Converter.php
r3115148 r3129246 1 1 <?php 2 2 3 namespace HCaptcha\Vendor \MatthiasMullie\PathConverter;3 namespace HCaptcha\Vendors\MatthiasMullie\PathConverter; 4 4 5 5 /** -
hcaptcha-for-forms-and-more/trunk/vendors/matthiasmullie/path-converter/src/ConverterInterface.php
r3115148 r3129246 1 1 <?php 2 2 3 namespace HCaptcha\Vendor \MatthiasMullie\PathConverter;3 namespace HCaptcha\Vendors\MatthiasMullie\PathConverter; 4 4 5 5 /** -
hcaptcha-for-forms-and-more/trunk/vendors/matthiasmullie/path-converter/src/NoConverter.php
r3115148 r3129246 1 1 <?php 2 2 3 namespace HCaptcha\Vendor \MatthiasMullie\PathConverter;3 namespace HCaptcha\Vendors\MatthiasMullie\PathConverter; 4 4 5 5 /**
Note: See TracChangeset
for help on using the changeset viewer.