Plugin Directory

Changeset 3129246


Ignore:
Timestamp:
08/01/2024 08:03:43 AM (20 months ago)
Author:
hcaptcha
Message:

Update to version 4.4.0 from GitHub

Location:
hcaptcha-for-forms-and-more
Files:
6 added
2 deleted
101 edited
1 copied

Legend:

Unmodified
Added
Removed
  • hcaptcha-for-forms-and-more/tags/4.4.0/assets/css/notifications.css

    r2949443 r3129246  
    6262}
    6363
     64#hcaptcha-navigation > span {
     65    margin-right: 10px;
     66    align-self: center;
     67}
     68
    6469#hcaptcha-navigation a {
    6570    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  
    6666            this.filterItem
    6767        );
     68
    6869        elementor.hooks.addFilter(
    6970            '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  
    1919    }
    2020
     21    wp.hooks.addFilter(
     22        'hcaptcha.params',
     23        'hcaptcha',
     24        () => {
     25            // noinspection JSUnresolvedReference
     26            return window?.parent?.HCaptchaMainObject?.params ?? '';
     27        }
     28    );
     29
    2130    elementorFrontend.hooks.addAction(
    2231        '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  
    33 */
    44
    5 /* global hcaptcha, Marionette, Backbone */
     5/* global hcaptcha, Marionette, nfRadio */
    66
    77wp.hooks.addFilter(
     
    2121        initialize() {
    2222            // On the Form Submission's field validation.
    23             const submitChannel = Backbone.Radio.channel( 'submit' );
     23            const submitChannel = nfRadio.channel( 'submit' );
    2424            this.listenTo( submitChannel, 'validate:field', this.updateHcaptcha );
    2525            this.listenTo( submitChannel, 'validate:field', this.updateHcaptcha );
    2626
    2727            // On the Field's model value change.
    28             const fieldsChannel = Backbone.Radio.channel( 'fields' );
     28            const fieldsChannel = nfRadio.channel( 'fields' );
    2929            this.listenTo( fieldsChannel, 'change:modelValue', this.updateHcaptcha );
    3030        },
     
    3939            if ( model.get( 'value' ) ) {
    4040                // Remove Error from Model.
    41                 Backbone.Radio.channel( 'fields' ).request(
     41                nfRadio.channel( 'fields' ).request(
    4242                    'remove:error',
    4343                    model.get( 'id' ),
     
    7070        const data = options.data ?? '';
    7171
     72        if ( ! ( typeof data === 'string' || data instanceof String ) ) {
     73            return;
     74        }
     75
    7276        if ( ! data.startsWith( 'action=nf_ajax_submit' ) ) {
    7377            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  
    33 */
    44
    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
     7document.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;
    1117        }
     18    );
    1219
    13         return isAjaxSubmitButton;
     20    const threadsElement = document.getElementById( 'wpd-threads' );
     21
     22    if ( ! threadsElement ) {
     23        return;
    1424    }
    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
     55jQuery( 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  
    1010
    1111/**
    12  * Notifications logic.
     12 * Notification logic.
    1313 *
    1414 * @param {Object} $ jQuery instance.
     
    2020    const notificationSelector = 'div.hcaptcha-notification';
    2121    const dismissSelector = notificationsSelector + ' button.notice-dismiss';
     22    const navSpanSelector = '#hcaptcha-navigation span';
     23    const navPageSelector = '#hcaptcha-navigation-page';
     24    const navPagesSelector = '#hcaptcha-navigation-pages';
    2225    const navPrevSelector = '#hcaptcha-navigation .prev';
    2326    const navNextSelector = '#hcaptcha-navigation .next';
     
    5154
    5255        if ( index >= 0 ) {
     56            $( navPageSelector ).text( index + 1 );
     57            $( navPagesSelector ).text( $notifications.length );
     58            $( navSpanSelector ).show();
    5359            $( navSelectors ).removeClass( 'disabled' );
    5460        } else {
     61            $( navSpanSelector ).hide();
    5562            $( navSelectors ).addClass( 'disabled' );
    5663            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()}));
     1jQuery(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
    117= 4.3.1 =
    218* 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  
    1111 * Plugin URI:           https://www.hcaptcha.com/
    1212 * Description:          hCaptcha keeps out bots and spam while putting privacy first. It is a drop-in replacement for reCAPTCHA.
    13  * Version:              4.3.1
     13 * Version:              4.4.0
    1414 * Requires at least:    5.3
    1515 * Requires PHP:         7.2
     
    4040 * Plugin version.
    4141 */
    42 const HCAPTCHA_VERSION = '4.3.1';
     42const HCAPTCHA_VERSION = '4.4.0';
    4343
    4444/**
  • hcaptcha-for-forms-and-more/tags/4.4.0/readme.txt

    r3115148 r3129246  
    55Tested up to: 6.6
    66Requires PHP: 7.2
    7 Stable tag: 4.3.1
     7Stable tag: 4.4.0
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    1717Need to keep out bots? hCaptcha protects privacy while offering better protection against spam and abuse. Help build a better web.
    1818
     19[The hCaptcha for WP many advantages over similar captcha plugins](https://kagg.eu/why-choose-hcaptcha-for-wp/).
     20
    1921== How hCaptcha Works ==
    2022
     
    2931== Screenshots ==
    3032
    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
     331. Login page with hCaptcha widget.
     342. Login page with hCaptcha challenge.
     353. WooCommerce Login/Register page.
     364. Contact Form 7 with hCaptcha.
     375. Contact Form 7 live form in the admin editor.
     386. Elementor Pro Form.
     397. Elementor Pro From in admin editor.
     408. General settings page.
     419. Integrations settings page.
     4210. Activating plugin from the Integration settings page.
     4311. (Optional) Local Forms statistics.
     4412. (Optional) Local Events statistics.
    4145
    4246== Installation ==
     
    562566== Changelog ==
    563567
     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
    564584= 4.3.1 =
    565585* 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  
    113113        $statistics_url          = $general_url . '#statistics_1';
    114114        $force_url               = $general_url . '#force_1';
     115        $elementor_edit_form_url = HCAPTCHA_URL . '/assets/images/elementor-edit-form.png';
    115116
    116117        $notifications = [
     
    270271                ],
    271272            ],
     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            ],
    272282        ];
    273283
     
    282292        }
    283293
     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
    284302        if ( $settings->is_on( 'force' ) ) {
    285303            unset( $notifications['force'] );
    286304        }
    287305
    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        ];
    289350    }
    290351
     
    358419            <div id="hcaptcha-notifications-footer">
    359420                <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>
    360426                    <a class="prev disabled"></a>
    361427                    <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  
    7474     */
    7575    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() ) {
    8377            return;
    8478        }
  • hcaptcha-for-forms-and-more/tags/4.4.0/src/php/CF7/Admin.php

    r3115148 r3129246  
    4747     * Current screen.
    4848     *
    49      * @param mixed $current_screen Current screen.
     49     * @param WP_Screen|mixed $current_screen Current screen.
    5050     *
    5151     * @return void
     
    5454        $current_screen_id = $current_screen->id ?? '';
    5555
    56         if ( ! $current_screen ) {
     56        if ( ! $current_screen_id ) {
    5757            return;
    5858        }
     
    109109
    110110        $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        }
    111120
    112121        $live_container =
     
    114123            '<div id="postbox-container-live" class="postbox-container">' .
    115124            '<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 .
    118128            '</div>' .
    119129            '</div>' .
     
    290300     * @return bool
    291301     */
    292     private function is_cf7_form_admin_page(): bool {
     302    protected function is_cf7_form_admin_page(): bool {
    293303
    294304        // phpcs:ignore WordPress.Security.NonceVerification.Recommended
  • hcaptcha-for-forms-and-more/tags/4.4.0/src/php/CF7/Base.php

    r3114572 r3129246  
    4343        $this->mode_embed = hcaptcha()->settings()->is( 'cf7_status', 'embed' );
    4444    }
     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    }
    4556}
  • hcaptcha-for-forms-and-more/tags/4.4.0/src/php/CF7/CF7.php

    r3114572 r3129246  
    5959     * @param array        $m      Regular expression match array.
    6060     *
    61      * @return string|mixed
     61     * @return string
    6262     * @noinspection PhpUnusedParameterInspection
    6363     */
    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
    6567        if ( 'contact-form-7' !== $tag ) {
    6668            return $output;
    6769        }
    6870
    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
    7079        $form_id            = isset( $attr['id'] ) ? (int) $attr['id'] : 0;
    7180        $cf7_hcap_shortcode = $this->get_cf7_hcap_shortcode( $output );
     
    184193        }
    185194
     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
    186203        if (
    187204            ! $this->mode_auto &&
    188             ! ( $this->mode_embed && $this->has_hcaptcha_field( $submission ) )
     205            ! ( $this->mode_embed && $this->has_field( $submission, 'hcaptcha' ) )
    189206        ) {
    190207            return $result;
     
    203220
    204221    /**
    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.
    208226     *
    209227     * @return bool
    210228     */
    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 {
    223230        $form_fields = $submission->get_contact_form()->scan_form_tags();
    224231
    225232        foreach ( $form_fields as $form_field ) {
    226             if ( $this->is_hcaptcha_field( $form_field ) ) {
     233            if ( $type === $form_field->type ) {
    227234                return true;
    228235            }
  • hcaptcha-for-forms-and-more/tags/4.4.0/src/php/ElementorPro/Login.php

    r3114572 r3129246  
    9292        $signatures = (string) ob_get_clean();
    9393
    94         $pattern     = '/(<div class="elementor-field-group.+<button type="submit")/s';
     94        $pattern     = '/(<div class="elementor-field-group.+?<button type="submit")/s';
    9595        $replacement = $hcaptcha . $signatures . "\n$1";
    9696        $form        = preg_replace( $pattern, $replacement, $form );
  • hcaptcha-for-forms-and-more/tags/4.4.0/src/php/EssentialAddons/Login.php

    r3114572 r3129246  
    8282            wp_safe_redirect( wp_unslash( $_SERVER['HTTP_REFERER'] ) );
    8383
    84             exit();
     84            $this->exit();
    8585        }
    8686    }
     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    }
    8798}
  • hcaptcha-for-forms-and-more/tags/4.4.0/src/php/EssentialAddons/Register.php

    r3114572 r3129246  
    2424     * Nonce action.
    2525     */
    26     const ACTION = 'hcaptcha_essential_addons_register';
     26    private const ACTION = 'hcaptcha_essential_addons_register';
    2727
    2828    /**
    2929     * Nonce name.
    3030     */
    31     const NONCE = 'hcaptcha_essential_addons_register_nonce';
     31    private const NONCE = 'hcaptcha_essential_addons_register_nonce';
    3232
    3333    /**
     
    9898            wp_safe_redirect( wp_unslash( $_SERVER['HTTP_REFERER'] ) );
    9999
    100             exit();
     100            $this->exit();
    101101        }
    102102    }
     
    118118        HCaptcha::css_display( $css );
    119119    }
     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    }
    120131}
  • hcaptcha-for-forms-and-more/tags/4.4.0/src/php/GiveWP/Base.php

    r3114572 r3129246  
    1515use Give\DonationForms\ValueObjects\DonationFormErrorTypes;
    1616use HCaptcha\Helpers\HCaptcha;
     17use HCaptcha\Helpers\Request;
    1718use WP_Error;
    1819
     
    129130     */
    130131    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() ) {
    138133            return;
    139134        }
  • hcaptcha-for-forms-and-more/tags/4.4.0/src/php/Helpers/HCaptcha.php

    r3114572 r3129246  
    1313namespace HCaptcha\Helpers;
    1414
    15 use HCaptcha\Vendor\MatthiasMullie\Minify\CSS;
    16 use HCaptcha\Vendor\MatthiasMullie\Minify\JS;
     15use HCaptcha\Vendors\MatthiasMullie\Minify\CSS;
     16use HCaptcha\Vendors\MatthiasMullie\Minify\JS;
    1717use WP_Error;
    1818
     
    167167                value="<?php echo esc_attr( $widget_id ); ?>">
    168168        <?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();
    169185    }
    170186
  • hcaptcha-for-forms-and-more/tags/4.4.0/src/php/Helpers/Request.php

    r2965110 r3129246  
    2121     */
    2222    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' );
    2437    }
    2538
     
    3144    public static function is_cli(): bool {
    3245        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'] );
    3356    }
    3457
     
    79102        return 0 === strpos( $current_url, $rest_url );
    80103    }
     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    }
    81117}
  • hcaptcha-for-forms-and-more/tags/4.4.0/src/php/MailPoet/Form.php

    r3114572 r3129246  
    9595     */
    9696    public function verify( API $api ): void {
    97         if ( is_admin() ) {
     97        if ( ! wp_doing_ajax() ) {
    9898            return;
    9999        }
  • hcaptcha-for-forms-and-more/tags/4.4.0/src/php/Main.php

    r3114572 r3129246  
    2424use HCaptcha\ElementorPro\HCaptchaHandler;
    2525use HCaptcha\Helpers\HCaptcha;
     26use HCaptcha\Helpers\Request;
    2627use HCaptcha\Jetpack\JetpackForm;
    2728use HCaptcha\Migrations\Migrations;
     
    123124     */
    124125    public function init(): void {
    125         if ( $this->is_xml_rpc() ) {
     126        if ( Request::is_xml_rpc() ) {
    126127            return;
    127128        }
    128129
     130        new Migrations();
     131
     132        if ( wp_doing_cron() ) {
     133            return;
     134        }
     135
    129136        ( new Fix() )->init();
    130 
    131         new Migrations();
    132137
    133138        add_action( 'plugins_loaded', [ $this, 'init_hooks' ], -PHP_INT_MAX );
     
    519524            justify-content: center;
    520525        }
     526        .h-captcha[data-size="normal"] {
     527            scale: calc(270 / 303);
     528            transform: translate(-20px, 0);
     529        }
    521530    }
    522531
    523532    @media (min-width: 350px) {
    524         #login {
     533        body #login {
    525534            width: 350px;
     535            box-sizing: content-box;
    526536        }
    527537    }
     
    13601370        );
    13611371    }
    1362 
    1363     /**
    1364      * Check if it is the xml-rpc request.
    1365      *
    1366      * @return bool
    1367      */
    1368     protected function is_xml_rpc(): bool {
    1369         return defined( 'XMLRPC_REQUEST' ) && constant( 'XMLRPC_REQUEST' );
    1370     }
    13711372}
  • hcaptcha-for-forms-and-more/tags/4.4.0/src/php/Settings/Integrations.php

    r3114572 r3129246  
    10381038            $result             = $this->activate_plugin_tree( $this->plugins_tree );
    10391039
    1040             if ( null === $result ) {
     1040            if ( ! is_wp_error( $result ) ) {
    10411041                // Activate the first available plugin only.
    10421042                return true;
     
    10561056    protected function activate_plugin_tree( array &$node ) {
    10571057        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'];
    10631063                }
    10641064            }
     1065
     1066            unset( $child );
    10651067        }
    10661068
     
    10751077     * @param string $plugin Path to the plugin file relative to the plugins' directory.
    10761078     *
    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.
    10781080     */
    10791081    protected function activate_plugin( string $plugin ) {
     
    10871089
    10881090        ob_start();
     1091        // Null on success, WP_Error on failure.
    10891092        $result = activate_plugin( $plugin );
    10901093        ob_end_clean();
  • hcaptcha-for-forms-and-more/tags/4.4.0/src/php/WP/LostPassword.php

    r3114572 r3129246  
    1414 */
    1515class LostPassword extends LostPasswordBase {
     16    use Base;
    1617
    1718    /**
     
    4142
    4243    /**
    43      * WP login URL.
    44      */
    45     private const WP_LOGIN_URL = '/wp-login.php';
    46 
    47     /**
    4844     * WP login action.
    4945     */
     
    5652     */
    5753    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() ) {
    7255            return;
    7356        }
  • hcaptcha-for-forms-and-more/tags/4.4.0/src/php/WP/Register.php

    r3114572 r3129246  
    1515 */
    1616class Register {
    17 
    18     /**
    19      * WP login URL.
    20      */
    21     private const WP_LOGIN_URL = '/wp-login.php';
     17    use Base;
    2218
    2319    /**
     
    3026     */
    3127    private const NONCE = 'hcaptcha_registration_nonce';
     28
     29    /**
     30     * WP login action.
     31     */
     32    private const WP_LOGIN_ACTION = 'register';
    3233
    3334    /**
     
    5455     */
    5556    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() ) {
    7058            return;
    7159        }
     
    9583     */
    9684    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() ) {
    10186            return $errors;
    10287        }
  • hcaptcha-for-forms-and-more/tags/4.4.0/src/php/WPDiscuz/Comment.php

    r3114572 r3129246  
    5757        ?>
    5858        <div class="wpd-field-hcaptcha wpdiscuz-item">
    59             <div class="wpdiscuz-hcaptcha" id="wpdiscuz-hcaptcha"></div>
     59            <div class="wpdiscuz-hcaptcha"></div>
    6060            <?php HCaptcha::form_display( $args ); ?>
    6161            <div class="clearfix"></div>
     
    7979     */
    8080    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
    8193        $wp_discuz = wpDiscuz();
    8294
    8395        remove_filter( 'preprocess_comment', [ $wp_discuz, 'validateRecaptcha' ] );
    84 
    85         // Nonce is checked by wpDiscuz.
    8696
    8797        // phpcs:disable WordPress.Security.NonceVerification.Missing
  • hcaptcha-for-forms-and-more/tags/4.4.0/src/php/Wordfence/General.php

    r3114572 r3129246  
    88namespace HCaptcha\Wordfence;
    99
     10use HCaptcha\Helpers\HCaptcha;
    1011use HCaptcha\WP\Login;
    1112
     
    3738            add_action( 'plugins_loaded', [ $this, 'remove_wp_login_hcaptcha_hooks' ] );
    3839        }
     40
     41        add_action( 'login_head', [ $this, 'print_inline_styles' ], 20 );
    3942    }
    4043
     
    7477        remove_filter( 'wp_authenticate_user', [ $wp_login, 'check_signature' ], PHP_INT_MAX );
    7578    }
     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;
    7690}
     91CSS;
     92
     93        HCaptcha::css_display( $css );
     94    }
     95}
  • hcaptcha-for-forms-and-more/tags/4.4.0/vendor/composer/autoload_classmap.php

    r3115148 r3129246  
    125125    'HCaptcha\\UsersWP\\Login' => $baseDir . '/src/php/UsersWP/Login.php',
    126126    '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',
    137137    'HCaptcha\\WCWishlists\\CreateList' => $baseDir . '/src/php/WCWishlists/CreateList.php',
    138138    'HCaptcha\\WC\\Checkout' => $baseDir . '/src/php/WC/Checkout.php',
     
    149149    'HCaptcha\\WPForo\\Reply' => $baseDir . '/src/php/WPForo/Reply.php',
    150150    'HCaptcha\\WPJobOpenings\\Form' => $baseDir . '/src/php/WPJobOpenings/Form.php',
     151    'HCaptcha\\WP\\Base' => $baseDir . '/src/php/WP/Base.php',
    151152    'HCaptcha\\WP\\Comment' => $baseDir . '/src/php/WP/Comment.php',
    152153    'HCaptcha\\WP\\Login' => $baseDir . '/src/php/WP/Login.php',
     
    157158    'KAGG\\Settings\\Abstracts\\SettingsBase' => $baseDir . '/src/php/Settings/Abstracts/SettingsBase.php',
    158159    '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',
    169160);
  • hcaptcha-for-forms-and-more/tags/4.4.0/vendor/composer/autoload_psr4.php

    r3115148 r3129246  
    77
    88return array(
    9     'MatthiasMullie\\PathConverter\\' => array($vendorDir . '/matthiasmullie/path-converter/src'),
    10     'MatthiasMullie\\Minify\\' => array($vendorDir . '/matthiasmullie/minify/src'),
    119    'KAGG\\Settings\\Abstracts\\' => array($baseDir . '/src/php/Settings/Abstracts'),
    1210    'HCaptcha\\Scoper\\' => array($baseDir . '/.php-scoper/src'),
  • hcaptcha-for-forms-and-more/tags/4.4.0/vendor/composer/autoload_real.php

    r3115148 r3129246  
    2323        }
    2424
    25         require __DIR__ . '/platform_check.php';
    26 
    2725        spl_autoload_register(array('ComposerAutoloaderInita6c3d020c47c988d11030e9a25036470', 'loadClassLoader'), true, true);
    2826        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  
    88{
    99    public static $prefixLengthsPsr4 = array (
    10         'M' =>
    11         array (
    12             'MatthiasMullie\\PathConverter\\' => 29,
    13             'MatthiasMullie\\Minify\\' => 22,
    14         ),
    1510        'K' =>
    1611        array (
     
    2520
    2621    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         ),
    3522        'KAGG\\Settings\\Abstracts\\' =>
    3623        array (
     
    166153        'HCaptcha\\UsersWP\\Login' => __DIR__ . '/../..' . '/src/php/UsersWP/Login.php',
    167154        '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',
    178165        'HCaptcha\\WCWishlists\\CreateList' => __DIR__ . '/../..' . '/src/php/WCWishlists/CreateList.php',
    179166        'HCaptcha\\WC\\Checkout' => __DIR__ . '/../..' . '/src/php/WC/Checkout.php',
     
    190177        'HCaptcha\\WPForo\\Reply' => __DIR__ . '/../..' . '/src/php/WPForo/Reply.php',
    191178        'HCaptcha\\WPJobOpenings\\Form' => __DIR__ . '/../..' . '/src/php/WPJobOpenings/Form.php',
     179        'HCaptcha\\WP\\Base' => __DIR__ . '/../..' . '/src/php/WP/Base.php',
    192180        'HCaptcha\\WP\\Comment' => __DIR__ . '/../..' . '/src/php/WP/Comment.php',
    193181        'HCaptcha\\WP\\Login' => __DIR__ . '/../..' . '/src/php/WP/Login.php',
     
    198186        'KAGG\\Settings\\Abstracts\\SettingsBase' => __DIR__ . '/../..' . '/src/php/Settings/Abstracts/SettingsBase.php',
    199187        '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',
    210188    );
    211189
  • hcaptcha-for-forms-and-more/tags/4.4.0/vendor/composer/installed.php

    r3115148 r3129246  
    22    'root' => array(
    33        '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',
    77        'type' => 'wordpress-plugin',
    88        'install_path' => __DIR__ . '/../../',
     
    1212    'versions' => array(
    1313        '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',
    1717            'type' => 'wordpress-plugin',
    1818            'install_path' => __DIR__ . '/../../',
  • hcaptcha-for-forms-and-more/tags/4.4.0/vendors/matthiasmullie/minify/src/CSS.php

    r3115148 r3129246  
    1010 * @license MIT License
    1111 */
    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;
     12namespace HCaptcha\Vendors\MatthiasMullie\Minify;
     13
     14use HCaptcha\Vendors\MatthiasMullie\Minify\Exceptions\FileImportException;
     15use HCaptcha\Vendors\MatthiasMullie\PathConverter\Converter;
     16use HCaptcha\Vendors\MatthiasMullie\PathConverter\ConverterInterface;
    1717/**
    1818 * CSS minifier.
  • hcaptcha-for-forms-and-more/tags/4.4.0/vendors/matthiasmullie/minify/src/Exception.php

    r3115148 r3129246  
    88 * @author Matthias Mullie <minify@mullie.eu>
    99 */
    10 namespace HCaptcha\Vendor\MatthiasMullie\Minify;
     10namespace HCaptcha\Vendors\MatthiasMullie\Minify;
    1111
    1212/**
  • hcaptcha-for-forms-and-more/tags/4.4.0/vendors/matthiasmullie/minify/src/Exceptions/BasicException.php

    r3115148 r3129246  
    1010 * @license MIT License
    1111 */
    12 namespace HCaptcha\Vendor\MatthiasMullie\Minify\Exceptions;
     12namespace HCaptcha\Vendors\MatthiasMullie\Minify\Exceptions;
    1313
    14 use HCaptcha\Vendor\MatthiasMullie\Minify\Exception;
     14use HCaptcha\Vendors\MatthiasMullie\Minify\Exception;
    1515/**
    1616 * Basic Exception Class.
  • hcaptcha-for-forms-and-more/tags/4.4.0/vendors/matthiasmullie/minify/src/Exceptions/FileImportException.php

    r3115148 r3129246  
    1010 * @license MIT License
    1111 */
    12 namespace HCaptcha\Vendor\MatthiasMullie\Minify\Exceptions;
     12namespace HCaptcha\Vendors\MatthiasMullie\Minify\Exceptions;
    1313
    1414/**
  • hcaptcha-for-forms-and-more/tags/4.4.0/vendors/matthiasmullie/minify/src/Exceptions/IOException.php

    r3115148 r3129246  
    1010 * @license MIT License
    1111 */
    12 namespace HCaptcha\Vendor\MatthiasMullie\Minify\Exceptions;
     12namespace HCaptcha\Vendors\MatthiasMullie\Minify\Exceptions;
    1313
    1414/**
  • hcaptcha-for-forms-and-more/tags/4.4.0/vendors/matthiasmullie/minify/src/JS.php

    r3115148 r3129246  
    1010 * @license MIT License
    1111 */
    12 namespace HCaptcha\Vendor\MatthiasMullie\Minify;
     12namespace HCaptcha\Vendors\MatthiasMullie\Minify;
    1313
    1414/**
     
    117117    public function __construct()
    118118    {
    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());
    120120        $dataDir = __DIR__ . '/../data/js/';
    121121        $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  
    1010 * @license MIT License
    1111 */
    12 namespace HCaptcha\Vendor\MatthiasMullie\Minify;
    13 
    14 use HCaptcha\Vendor\MatthiasMullie\Minify\Exceptions\IOException;
    15 use HCaptcha\Vendor\Psr\Cache\CacheItemInterface;
     12namespace HCaptcha\Vendors\MatthiasMullie\Minify;
     13
     14use HCaptcha\Vendors\MatthiasMullie\Minify\Exceptions\IOException;
     15use HCaptcha\Vendors\Psr\Cache\CacheItemInterface;
    1616/**
    1717 * Abstract minifier class.
  • hcaptcha-for-forms-and-more/tags/4.4.0/vendors/matthiasmullie/path-converter/src/Converter.php

    r3115148 r3129246  
    11<?php
    22
    3 namespace HCaptcha\Vendor\MatthiasMullie\PathConverter;
     3namespace HCaptcha\Vendors\MatthiasMullie\PathConverter;
    44
    55/**
  • hcaptcha-for-forms-and-more/tags/4.4.0/vendors/matthiasmullie/path-converter/src/ConverterInterface.php

    r3115148 r3129246  
    11<?php
    22
    3 namespace HCaptcha\Vendor\MatthiasMullie\PathConverter;
     3namespace HCaptcha\Vendors\MatthiasMullie\PathConverter;
    44
    55/**
  • hcaptcha-for-forms-and-more/tags/4.4.0/vendors/matthiasmullie/path-converter/src/NoConverter.php

    r3115148 r3129246  
    11<?php
    22
    3 namespace HCaptcha\Vendor\MatthiasMullie\PathConverter;
     3namespace HCaptcha\Vendors\MatthiasMullie\PathConverter;
    44
    55/**
  • hcaptcha-for-forms-and-more/trunk/assets/css/notifications.css

    r2949443 r3129246  
    6262}
    6363
     64#hcaptcha-navigation > span {
     65    margin-right: 10px;
     66    align-self: center;
     67}
     68
    6469#hcaptcha-navigation a {
    6570    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  
    6666            this.filterItem
    6767        );
     68
    6869        elementor.hooks.addFilter(
    6970            '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  
    1919    }
    2020
     21    wp.hooks.addFilter(
     22        'hcaptcha.params',
     23        'hcaptcha',
     24        () => {
     25            // noinspection JSUnresolvedReference
     26            return window?.parent?.HCaptchaMainObject?.params ?? '';
     27        }
     28    );
     29
    2130    elementorFrontend.hooks.addAction(
    2231        '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  
    33 */
    44
    5 /* global hcaptcha, Marionette, Backbone */
     5/* global hcaptcha, Marionette, nfRadio */
    66
    77wp.hooks.addFilter(
     
    2121        initialize() {
    2222            // On the Form Submission's field validation.
    23             const submitChannel = Backbone.Radio.channel( 'submit' );
     23            const submitChannel = nfRadio.channel( 'submit' );
    2424            this.listenTo( submitChannel, 'validate:field', this.updateHcaptcha );
    2525            this.listenTo( submitChannel, 'validate:field', this.updateHcaptcha );
    2626
    2727            // On the Field's model value change.
    28             const fieldsChannel = Backbone.Radio.channel( 'fields' );
     28            const fieldsChannel = nfRadio.channel( 'fields' );
    2929            this.listenTo( fieldsChannel, 'change:modelValue', this.updateHcaptcha );
    3030        },
     
    3939            if ( model.get( 'value' ) ) {
    4040                // Remove Error from Model.
    41                 Backbone.Radio.channel( 'fields' ).request(
     41                nfRadio.channel( 'fields' ).request(
    4242                    'remove:error',
    4343                    model.get( 'id' ),
     
    7070        const data = options.data ?? '';
    7171
     72        if ( ! ( typeof data === 'string' || data instanceof String ) ) {
     73            return;
     74        }
     75
    7276        if ( ! data.startsWith( 'action=nf_ajax_submit' ) ) {
    7377            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  
    33 */
    44
    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
     7document.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;
    1117        }
     18    );
    1219
    13         return isAjaxSubmitButton;
     20    const threadsElement = document.getElementById( 'wpd-threads' );
     21
     22    if ( ! threadsElement ) {
     23        return;
    1424    }
    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
     55jQuery( 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  
    1010
    1111/**
    12  * Notifications logic.
     12 * Notification logic.
    1313 *
    1414 * @param {Object} $ jQuery instance.
     
    2020    const notificationSelector = 'div.hcaptcha-notification';
    2121    const dismissSelector = notificationsSelector + ' button.notice-dismiss';
     22    const navSpanSelector = '#hcaptcha-navigation span';
     23    const navPageSelector = '#hcaptcha-navigation-page';
     24    const navPagesSelector = '#hcaptcha-navigation-pages';
    2225    const navPrevSelector = '#hcaptcha-navigation .prev';
    2326    const navNextSelector = '#hcaptcha-navigation .next';
     
    5154
    5255        if ( index >= 0 ) {
     56            $( navPageSelector ).text( index + 1 );
     57            $( navPagesSelector ).text( $notifications.length );
     58            $( navSpanSelector ).show();
    5359            $( navSelectors ).removeClass( 'disabled' );
    5460        } else {
     61            $( navSpanSelector ).hide();
    5562            $( navSelectors ).addClass( 'disabled' );
    5663            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()}));
     1jQuery(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
    117= 4.3.1 =
    218* Added a live form in the Contact Form 7 admin form view.
  • hcaptcha-for-forms-and-more/trunk/hcaptcha.php

    r3115148 r3129246  
    1111 * Plugin URI:           https://www.hcaptcha.com/
    1212 * Description:          hCaptcha keeps out bots and spam while putting privacy first. It is a drop-in replacement for reCAPTCHA.
    13  * Version:              4.3.1
     13 * Version:              4.4.0
    1414 * Requires at least:    5.3
    1515 * Requires PHP:         7.2
     
    4040 * Plugin version.
    4141 */
    42 const HCAPTCHA_VERSION = '4.3.1';
     42const HCAPTCHA_VERSION = '4.4.0';
    4343
    4444/**
  • hcaptcha-for-forms-and-more/trunk/readme.txt

    r3115148 r3129246  
    55Tested up to: 6.6
    66Requires PHP: 7.2
    7 Stable tag: 4.3.1
     7Stable tag: 4.4.0
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    1717Need to keep out bots? hCaptcha protects privacy while offering better protection against spam and abuse. Help build a better web.
    1818
     19[The hCaptcha for WP many advantages over similar captcha plugins](https://kagg.eu/why-choose-hcaptcha-for-wp/).
     20
    1921== How hCaptcha Works ==
    2022
     
    2931== Screenshots ==
    3032
    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
     331. Login page with hCaptcha widget.
     342. Login page with hCaptcha challenge.
     353. WooCommerce Login/Register page.
     364. Contact Form 7 with hCaptcha.
     375. Contact Form 7 live form in the admin editor.
     386. Elementor Pro Form.
     397. Elementor Pro From in admin editor.
     408. General settings page.
     419. Integrations settings page.
     4210. Activating plugin from the Integration settings page.
     4311. (Optional) Local Forms statistics.
     4412. (Optional) Local Events statistics.
    4145
    4246== Installation ==
     
    562566== Changelog ==
    563567
     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
    564584= 4.3.1 =
    565585* 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  
    113113        $statistics_url          = $general_url . '#statistics_1';
    114114        $force_url               = $general_url . '#force_1';
     115        $elementor_edit_form_url = HCAPTCHA_URL . '/assets/images/elementor-edit-form.png';
    115116
    116117        $notifications = [
     
    270271                ],
    271272            ],
     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            ],
    272282        ];
    273283
     
    282292        }
    283293
     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
    284302        if ( $settings->is_on( 'force' ) ) {
    285303            unset( $notifications['force'] );
    286304        }
    287305
    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        ];
    289350    }
    290351
     
    358419            <div id="hcaptcha-notifications-footer">
    359420                <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>
    360426                    <a class="prev disabled"></a>
    361427                    <a class="next <?php echo esc_attr( $next_disabled ); ?>"></a>
  • hcaptcha-for-forms-and-more/trunk/src/php/AutoVerify/AutoVerify.php

    r3114572 r3129246  
    7474     */
    7575    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() ) {
    8377            return;
    8478        }
  • hcaptcha-for-forms-and-more/trunk/src/php/CF7/Admin.php

    r3115148 r3129246  
    4747     * Current screen.
    4848     *
    49      * @param mixed $current_screen Current screen.
     49     * @param WP_Screen|mixed $current_screen Current screen.
    5050     *
    5151     * @return void
     
    5454        $current_screen_id = $current_screen->id ?? '';
    5555
    56         if ( ! $current_screen ) {
     56        if ( ! $current_screen_id ) {
    5757            return;
    5858        }
     
    109109
    110110        $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        }
    111120
    112121        $live_container =
     
    114123            '<div id="postbox-container-live" class="postbox-container">' .
    115124            '<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 .
    118128            '</div>' .
    119129            '</div>' .
     
    290300     * @return bool
    291301     */
    292     private function is_cf7_form_admin_page(): bool {
     302    protected function is_cf7_form_admin_page(): bool {
    293303
    294304        // phpcs:ignore WordPress.Security.NonceVerification.Recommended
  • hcaptcha-for-forms-and-more/trunk/src/php/CF7/Base.php

    r3114572 r3129246  
    4343        $this->mode_embed = hcaptcha()->settings()->is( 'cf7_status', 'embed' );
    4444    }
     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    }
    4556}
  • hcaptcha-for-forms-and-more/trunk/src/php/CF7/CF7.php

    r3114572 r3129246  
    5959     * @param array        $m      Regular expression match array.
    6060     *
    61      * @return string|mixed
     61     * @return string
    6262     * @noinspection PhpUnusedParameterInspection
    6363     */
    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
    6567        if ( 'contact-form-7' !== $tag ) {
    6668            return $output;
    6769        }
    6870
    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
    7079        $form_id            = isset( $attr['id'] ) ? (int) $attr['id'] : 0;
    7180        $cf7_hcap_shortcode = $this->get_cf7_hcap_shortcode( $output );
     
    184193        }
    185194
     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
    186203        if (
    187204            ! $this->mode_auto &&
    188             ! ( $this->mode_embed && $this->has_hcaptcha_field( $submission ) )
     205            ! ( $this->mode_embed && $this->has_field( $submission, 'hcaptcha' ) )
    189206        ) {
    190207            return $result;
     
    203220
    204221    /**
    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.
    208226     *
    209227     * @return bool
    210228     */
    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 {
    223230        $form_fields = $submission->get_contact_form()->scan_form_tags();
    224231
    225232        foreach ( $form_fields as $form_field ) {
    226             if ( $this->is_hcaptcha_field( $form_field ) ) {
     233            if ( $type === $form_field->type ) {
    227234                return true;
    228235            }
  • hcaptcha-for-forms-and-more/trunk/src/php/ElementorPro/Login.php

    r3114572 r3129246  
    9292        $signatures = (string) ob_get_clean();
    9393
    94         $pattern     = '/(<div class="elementor-field-group.+<button type="submit")/s';
     94        $pattern     = '/(<div class="elementor-field-group.+?<button type="submit")/s';
    9595        $replacement = $hcaptcha . $signatures . "\n$1";
    9696        $form        = preg_replace( $pattern, $replacement, $form );
  • hcaptcha-for-forms-and-more/trunk/src/php/EssentialAddons/Login.php

    r3114572 r3129246  
    8282            wp_safe_redirect( wp_unslash( $_SERVER['HTTP_REFERER'] ) );
    8383
    84             exit();
     84            $this->exit();
    8585        }
    8686    }
     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    }
    8798}
  • hcaptcha-for-forms-and-more/trunk/src/php/EssentialAddons/Register.php

    r3114572 r3129246  
    2424     * Nonce action.
    2525     */
    26     const ACTION = 'hcaptcha_essential_addons_register';
     26    private const ACTION = 'hcaptcha_essential_addons_register';
    2727
    2828    /**
    2929     * Nonce name.
    3030     */
    31     const NONCE = 'hcaptcha_essential_addons_register_nonce';
     31    private const NONCE = 'hcaptcha_essential_addons_register_nonce';
    3232
    3333    /**
     
    9898            wp_safe_redirect( wp_unslash( $_SERVER['HTTP_REFERER'] ) );
    9999
    100             exit();
     100            $this->exit();
    101101        }
    102102    }
     
    118118        HCaptcha::css_display( $css );
    119119    }
     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    }
    120131}
  • hcaptcha-for-forms-and-more/trunk/src/php/GiveWP/Base.php

    r3114572 r3129246  
    1515use Give\DonationForms\ValueObjects\DonationFormErrorTypes;
    1616use HCaptcha\Helpers\HCaptcha;
     17use HCaptcha\Helpers\Request;
    1718use WP_Error;
    1819
     
    129130     */
    130131    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() ) {
    138133            return;
    139134        }
  • hcaptcha-for-forms-and-more/trunk/src/php/Helpers/HCaptcha.php

    r3114572 r3129246  
    1313namespace HCaptcha\Helpers;
    1414
    15 use HCaptcha\Vendor\MatthiasMullie\Minify\CSS;
    16 use HCaptcha\Vendor\MatthiasMullie\Minify\JS;
     15use HCaptcha\Vendors\MatthiasMullie\Minify\CSS;
     16use HCaptcha\Vendors\MatthiasMullie\Minify\JS;
    1717use WP_Error;
    1818
     
    167167                value="<?php echo esc_attr( $widget_id ); ?>">
    168168        <?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();
    169185    }
    170186
  • hcaptcha-for-forms-and-more/trunk/src/php/Helpers/Request.php

    r2965110 r3129246  
    2121     */
    2222    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' );
    2437    }
    2538
     
    3144    public static function is_cli(): bool {
    3245        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'] );
    3356    }
    3457
     
    79102        return 0 === strpos( $current_url, $rest_url );
    80103    }
     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    }
    81117}
  • hcaptcha-for-forms-and-more/trunk/src/php/MailPoet/Form.php

    r3114572 r3129246  
    9595     */
    9696    public function verify( API $api ): void {
    97         if ( is_admin() ) {
     97        if ( ! wp_doing_ajax() ) {
    9898            return;
    9999        }
  • hcaptcha-for-forms-and-more/trunk/src/php/Main.php

    r3114572 r3129246  
    2424use HCaptcha\ElementorPro\HCaptchaHandler;
    2525use HCaptcha\Helpers\HCaptcha;
     26use HCaptcha\Helpers\Request;
    2627use HCaptcha\Jetpack\JetpackForm;
    2728use HCaptcha\Migrations\Migrations;
     
    123124     */
    124125    public function init(): void {
    125         if ( $this->is_xml_rpc() ) {
     126        if ( Request::is_xml_rpc() ) {
    126127            return;
    127128        }
    128129
     130        new Migrations();
     131
     132        if ( wp_doing_cron() ) {
     133            return;
     134        }
     135
    129136        ( new Fix() )->init();
    130 
    131         new Migrations();
    132137
    133138        add_action( 'plugins_loaded', [ $this, 'init_hooks' ], -PHP_INT_MAX );
     
    519524            justify-content: center;
    520525        }
     526        .h-captcha[data-size="normal"] {
     527            scale: calc(270 / 303);
     528            transform: translate(-20px, 0);
     529        }
    521530    }
    522531
    523532    @media (min-width: 350px) {
    524         #login {
     533        body #login {
    525534            width: 350px;
     535            box-sizing: content-box;
    526536        }
    527537    }
     
    13601370        );
    13611371    }
    1362 
    1363     /**
    1364      * Check if it is the xml-rpc request.
    1365      *
    1366      * @return bool
    1367      */
    1368     protected function is_xml_rpc(): bool {
    1369         return defined( 'XMLRPC_REQUEST' ) && constant( 'XMLRPC_REQUEST' );
    1370     }
    13711372}
  • hcaptcha-for-forms-and-more/trunk/src/php/Settings/Integrations.php

    r3114572 r3129246  
    10381038            $result             = $this->activate_plugin_tree( $this->plugins_tree );
    10391039
    1040             if ( null === $result ) {
     1040            if ( ! is_wp_error( $result ) ) {
    10411041                // Activate the first available plugin only.
    10421042                return true;
     
    10561056    protected function activate_plugin_tree( array &$node ) {
    10571057        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'];
    10631063                }
    10641064            }
     1065
     1066            unset( $child );
    10651067        }
    10661068
     
    10751077     * @param string $plugin Path to the plugin file relative to the plugins' directory.
    10761078     *
    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.
    10781080     */
    10791081    protected function activate_plugin( string $plugin ) {
     
    10871089
    10881090        ob_start();
     1091        // Null on success, WP_Error on failure.
    10891092        $result = activate_plugin( $plugin );
    10901093        ob_end_clean();
  • hcaptcha-for-forms-and-more/trunk/src/php/WP/LostPassword.php

    r3114572 r3129246  
    1414 */
    1515class LostPassword extends LostPasswordBase {
     16    use Base;
    1617
    1718    /**
     
    4142
    4243    /**
    43      * WP login URL.
    44      */
    45     private const WP_LOGIN_URL = '/wp-login.php';
    46 
    47     /**
    4844     * WP login action.
    4945     */
     
    5652     */
    5753    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() ) {
    7255            return;
    7356        }
  • hcaptcha-for-forms-and-more/trunk/src/php/WP/Register.php

    r3114572 r3129246  
    1515 */
    1616class Register {
    17 
    18     /**
    19      * WP login URL.
    20      */
    21     private const WP_LOGIN_URL = '/wp-login.php';
     17    use Base;
    2218
    2319    /**
     
    3026     */
    3127    private const NONCE = 'hcaptcha_registration_nonce';
     28
     29    /**
     30     * WP login action.
     31     */
     32    private const WP_LOGIN_ACTION = 'register';
    3233
    3334    /**
     
    5455     */
    5556    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() ) {
    7058            return;
    7159        }
     
    9583     */
    9684    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() ) {
    10186            return $errors;
    10287        }
  • hcaptcha-for-forms-and-more/trunk/src/php/WPDiscuz/Comment.php

    r3114572 r3129246  
    5757        ?>
    5858        <div class="wpd-field-hcaptcha wpdiscuz-item">
    59             <div class="wpdiscuz-hcaptcha" id="wpdiscuz-hcaptcha"></div>
     59            <div class="wpdiscuz-hcaptcha"></div>
    6060            <?php HCaptcha::form_display( $args ); ?>
    6161            <div class="clearfix"></div>
     
    7979     */
    8080    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
    8193        $wp_discuz = wpDiscuz();
    8294
    8395        remove_filter( 'preprocess_comment', [ $wp_discuz, 'validateRecaptcha' ] );
    84 
    85         // Nonce is checked by wpDiscuz.
    8696
    8797        // phpcs:disable WordPress.Security.NonceVerification.Missing
  • hcaptcha-for-forms-and-more/trunk/src/php/Wordfence/General.php

    r3114572 r3129246  
    88namespace HCaptcha\Wordfence;
    99
     10use HCaptcha\Helpers\HCaptcha;
    1011use HCaptcha\WP\Login;
    1112
     
    3738            add_action( 'plugins_loaded', [ $this, 'remove_wp_login_hcaptcha_hooks' ] );
    3839        }
     40
     41        add_action( 'login_head', [ $this, 'print_inline_styles' ], 20 );
    3942    }
    4043
     
    7477        remove_filter( 'wp_authenticate_user', [ $wp_login, 'check_signature' ], PHP_INT_MAX );
    7578    }
     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;
    7690}
     91CSS;
     92
     93        HCaptcha::css_display( $css );
     94    }
     95}
  • hcaptcha-for-forms-and-more/trunk/vendor/composer/autoload_classmap.php

    r3115148 r3129246  
    125125    'HCaptcha\\UsersWP\\Login' => $baseDir . '/src/php/UsersWP/Login.php',
    126126    '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',
    137137    'HCaptcha\\WCWishlists\\CreateList' => $baseDir . '/src/php/WCWishlists/CreateList.php',
    138138    'HCaptcha\\WC\\Checkout' => $baseDir . '/src/php/WC/Checkout.php',
     
    149149    'HCaptcha\\WPForo\\Reply' => $baseDir . '/src/php/WPForo/Reply.php',
    150150    'HCaptcha\\WPJobOpenings\\Form' => $baseDir . '/src/php/WPJobOpenings/Form.php',
     151    'HCaptcha\\WP\\Base' => $baseDir . '/src/php/WP/Base.php',
    151152    'HCaptcha\\WP\\Comment' => $baseDir . '/src/php/WP/Comment.php',
    152153    'HCaptcha\\WP\\Login' => $baseDir . '/src/php/WP/Login.php',
     
    157158    'KAGG\\Settings\\Abstracts\\SettingsBase' => $baseDir . '/src/php/Settings/Abstracts/SettingsBase.php',
    158159    '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',
    169160);
  • hcaptcha-for-forms-and-more/trunk/vendor/composer/autoload_psr4.php

    r3115148 r3129246  
    77
    88return array(
    9     'MatthiasMullie\\PathConverter\\' => array($vendorDir . '/matthiasmullie/path-converter/src'),
    10     'MatthiasMullie\\Minify\\' => array($vendorDir . '/matthiasmullie/minify/src'),
    119    'KAGG\\Settings\\Abstracts\\' => array($baseDir . '/src/php/Settings/Abstracts'),
    1210    'HCaptcha\\Scoper\\' => array($baseDir . '/.php-scoper/src'),
  • hcaptcha-for-forms-and-more/trunk/vendor/composer/autoload_real.php

    r3115148 r3129246  
    2323        }
    2424
    25         require __DIR__ . '/platform_check.php';
    26 
    2725        spl_autoload_register(array('ComposerAutoloaderInita6c3d020c47c988d11030e9a25036470', 'loadClassLoader'), true, true);
    2826        self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
  • hcaptcha-for-forms-and-more/trunk/vendor/composer/autoload_static.php

    r3115148 r3129246  
    88{
    99    public static $prefixLengthsPsr4 = array (
    10         'M' =>
    11         array (
    12             'MatthiasMullie\\PathConverter\\' => 29,
    13             'MatthiasMullie\\Minify\\' => 22,
    14         ),
    1510        'K' =>
    1611        array (
     
    2520
    2621    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         ),
    3522        'KAGG\\Settings\\Abstracts\\' =>
    3623        array (
     
    166153        'HCaptcha\\UsersWP\\Login' => __DIR__ . '/../..' . '/src/php/UsersWP/Login.php',
    167154        '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',
    178165        'HCaptcha\\WCWishlists\\CreateList' => __DIR__ . '/../..' . '/src/php/WCWishlists/CreateList.php',
    179166        'HCaptcha\\WC\\Checkout' => __DIR__ . '/../..' . '/src/php/WC/Checkout.php',
     
    190177        'HCaptcha\\WPForo\\Reply' => __DIR__ . '/../..' . '/src/php/WPForo/Reply.php',
    191178        'HCaptcha\\WPJobOpenings\\Form' => __DIR__ . '/../..' . '/src/php/WPJobOpenings/Form.php',
     179        'HCaptcha\\WP\\Base' => __DIR__ . '/../..' . '/src/php/WP/Base.php',
    192180        'HCaptcha\\WP\\Comment' => __DIR__ . '/../..' . '/src/php/WP/Comment.php',
    193181        'HCaptcha\\WP\\Login' => __DIR__ . '/../..' . '/src/php/WP/Login.php',
     
    198186        'KAGG\\Settings\\Abstracts\\SettingsBase' => __DIR__ . '/../..' . '/src/php/Settings/Abstracts/SettingsBase.php',
    199187        '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',
    210188    );
    211189
  • hcaptcha-for-forms-and-more/trunk/vendor/composer/installed.php

    r3115148 r3129246  
    22    'root' => array(
    33        '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',
    77        'type' => 'wordpress-plugin',
    88        'install_path' => __DIR__ . '/../../',
     
    1212    'versions' => array(
    1313        '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',
    1717            'type' => 'wordpress-plugin',
    1818            'install_path' => __DIR__ . '/../../',
  • hcaptcha-for-forms-and-more/trunk/vendors/matthiasmullie/minify/src/CSS.php

    r3115148 r3129246  
    1010 * @license MIT License
    1111 */
    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;
     12namespace HCaptcha\Vendors\MatthiasMullie\Minify;
     13
     14use HCaptcha\Vendors\MatthiasMullie\Minify\Exceptions\FileImportException;
     15use HCaptcha\Vendors\MatthiasMullie\PathConverter\Converter;
     16use HCaptcha\Vendors\MatthiasMullie\PathConverter\ConverterInterface;
    1717/**
    1818 * CSS minifier.
  • hcaptcha-for-forms-and-more/trunk/vendors/matthiasmullie/minify/src/Exception.php

    r3115148 r3129246  
    88 * @author Matthias Mullie <minify@mullie.eu>
    99 */
    10 namespace HCaptcha\Vendor\MatthiasMullie\Minify;
     10namespace HCaptcha\Vendors\MatthiasMullie\Minify;
    1111
    1212/**
  • hcaptcha-for-forms-and-more/trunk/vendors/matthiasmullie/minify/src/Exceptions/BasicException.php

    r3115148 r3129246  
    1010 * @license MIT License
    1111 */
    12 namespace HCaptcha\Vendor\MatthiasMullie\Minify\Exceptions;
     12namespace HCaptcha\Vendors\MatthiasMullie\Minify\Exceptions;
    1313
    14 use HCaptcha\Vendor\MatthiasMullie\Minify\Exception;
     14use HCaptcha\Vendors\MatthiasMullie\Minify\Exception;
    1515/**
    1616 * Basic Exception Class.
  • hcaptcha-for-forms-and-more/trunk/vendors/matthiasmullie/minify/src/Exceptions/FileImportException.php

    r3115148 r3129246  
    1010 * @license MIT License
    1111 */
    12 namespace HCaptcha\Vendor\MatthiasMullie\Minify\Exceptions;
     12namespace HCaptcha\Vendors\MatthiasMullie\Minify\Exceptions;
    1313
    1414/**
  • hcaptcha-for-forms-and-more/trunk/vendors/matthiasmullie/minify/src/Exceptions/IOException.php

    r3115148 r3129246  
    1010 * @license MIT License
    1111 */
    12 namespace HCaptcha\Vendor\MatthiasMullie\Minify\Exceptions;
     12namespace HCaptcha\Vendors\MatthiasMullie\Minify\Exceptions;
    1313
    1414/**
  • hcaptcha-for-forms-and-more/trunk/vendors/matthiasmullie/minify/src/JS.php

    r3115148 r3129246  
    1010 * @license MIT License
    1111 */
    12 namespace HCaptcha\Vendor\MatthiasMullie\Minify;
     12namespace HCaptcha\Vendors\MatthiasMullie\Minify;
    1313
    1414/**
     
    117117    public function __construct()
    118118    {
    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());
    120120        $dataDir = __DIR__ . '/../data/js/';
    121121        $options = \FILE_IGNORE_NEW_LINES | \FILE_SKIP_EMPTY_LINES;
  • hcaptcha-for-forms-and-more/trunk/vendors/matthiasmullie/minify/src/Minify.php

    r3115148 r3129246  
    1010 * @license MIT License
    1111 */
    12 namespace HCaptcha\Vendor\MatthiasMullie\Minify;
    13 
    14 use HCaptcha\Vendor\MatthiasMullie\Minify\Exceptions\IOException;
    15 use HCaptcha\Vendor\Psr\Cache\CacheItemInterface;
     12namespace HCaptcha\Vendors\MatthiasMullie\Minify;
     13
     14use HCaptcha\Vendors\MatthiasMullie\Minify\Exceptions\IOException;
     15use HCaptcha\Vendors\Psr\Cache\CacheItemInterface;
    1616/**
    1717 * Abstract minifier class.
  • hcaptcha-for-forms-and-more/trunk/vendors/matthiasmullie/path-converter/src/Converter.php

    r3115148 r3129246  
    11<?php
    22
    3 namespace HCaptcha\Vendor\MatthiasMullie\PathConverter;
     3namespace HCaptcha\Vendors\MatthiasMullie\PathConverter;
    44
    55/**
  • hcaptcha-for-forms-and-more/trunk/vendors/matthiasmullie/path-converter/src/ConverterInterface.php

    r3115148 r3129246  
    11<?php
    22
    3 namespace HCaptcha\Vendor\MatthiasMullie\PathConverter;
     3namespace HCaptcha\Vendors\MatthiasMullie\PathConverter;
    44
    55/**
  • hcaptcha-for-forms-and-more/trunk/vendors/matthiasmullie/path-converter/src/NoConverter.php

    r3115148 r3129246  
    11<?php
    22
    3 namespace HCaptcha\Vendor\MatthiasMullie\PathConverter;
     3namespace HCaptcha\Vendors\MatthiasMullie\PathConverter;
    44
    55/**
Note: See TracChangeset for help on using the changeset viewer.