Changeset 3417494
- Timestamp:
- 12/11/2025 02:54:18 PM (7 weeks ago)
- Location:
- wpconsent-cookies-banner-privacy-suite/trunk
- Files:
-
- 13 edited
-
build/frontend.asset.php (modified) (1 diff)
-
build/frontend.js (modified) (1 diff)
-
includes/admin/pages/class-wpconsent-admin-page-cookies.php (modified) (3 diffs)
-
includes/class-wpconsent-banner.php (modified) (3 diffs)
-
includes/class-wpconsent-cookie-blocking.php (modified) (2 diffs)
-
includes/class-wpconsent-cookies.php (modified) (1 diff)
-
includes/compatibility/loader.php (modified) (1 diff)
-
includes/frontend-scripts.php (modified) (2 diffs)
-
includes/lite/admin/class-wpconsent-admin-page-loader-lite.php (modified) (1 diff)
-
languages/wpconsent-cookies-banner-privacy-suite.pot (modified) (15 diffs)
-
readme.txt (modified) (2 diffs)
-
src/frontend/banner.js (modified) (2 diffs)
-
wpconsent.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
wpconsent-cookies-banner-privacy-suite/trunk/build/frontend.asset.php
r3399711 r3417494 1 <?php return array('dependencies' => array(), 'version' => ' 8f8c3a8d0fd6d1309dae');1 <?php return array('dependencies' => array(), 'version' => '7c914cea7e8bb8e2ae45'); -
wpconsent-cookies-banner-privacy-suite/trunk/build/frontend.js
r3399711 r3417494 1 (()=>{var e={799:()=>{window.WPConsent={displayChecks:[],checksPassed:!0,settingsHooks:[],settingsProcessed:!1,registerDisplayCheck:function(e){this.displayChecks.push(e),this.checksPassed=!1},registerSettingsHook:function(e){this.settingsHooks.push(e),this.settingsProcessed=!1},runDisplayChecks:function(){return 0===this.displayChecks.length?(this.checksPassed=!0,Promise.resolve()):Promise.all(this.displayChecks.map((e=>e()))).then((()=>(this.checksPassed=!0,Promise.resolve()))).catch((e=>(console.error("Error in WPConsent display check:",e),this.checksPassed=!0,Promise.resolve())))},runSettingsHooks:function(){return 0===this.settingsHooks.length?(this.settingsProcessed=!0,Promise.resolve()):Promise.all(this.settingsHooks.map((e=>e(window.wpconsent)))).then((()=>(this.settingsProcessed=!0,Promise.resolve()))).catch((e=>(console.error("Error in WPConsent settings hook:",e),this.settingsProcessed=!0,Promise.resolve())))},hooks:{beforeShowPreferences:[],afterShowPreferences:[],beforeHideBanner:[],afterHideBanner:[],beforeShowBanner:[],afterShowBanner:[],accordionToggled:[]},addHook:function(e,t){this.hooks[e]&&this.hooks[e].push(t)},runHooks:function(e,...t){this.hooks[e]&&this.hooks[e].length>0&&this.hooks[e].forEach((n=>{try{n(...t)}catch(t){console.error(`Error in WPConsent hook ${e}:`,t)}}))},acceptAll:function(){const e={};Array.isArray(wpconsent.slugs)&&wpconsent.slugs.forEach((t=>{e[t]=!0})),this.savePreferences(e),this.closePreferences()},checkGPC:function(){if(!wpconsent.respect_gpc||!0!==navigator.globalPrivacyControl)return;const e=this.getCookie("wpconsent_preferences");let t={};if(e)try{t=JSON.parse(e)}catch(e){console.error("WPConsent: Error parsing existing preferences:",e)}if(t.hasOwnProperty("respect_gpc"))return;const n={};wpconsent.slugs.forEach((e=>{const t=this.shadowRoot?.querySelector(`#wpconsent-preferences-modal input[type="checkbox"][id="cookie-service-${e}"]`);t&&t.disabled?n[e]=!0:n[e]=!1})),n.essential=!0,n.respect_gpc=!0,this.savePreferences(n,!0),this.checksPassed=!1},savePreferences:function(e,t=!1){const n=this.getCookie("wpconsent_preferences");let o=!1,s=null;if(n)try{s=JSON.parse(n)}catch(e){console.error("WPConsent: Error parsing existing preferences:",e)}(s&&JSON.stringify(s)!==JSON.stringify(e)||wpconsent.default_allow&&Object.values(e).some((e=>!1===e)))&&(this.clearCookies(),o=!0),wpconsent.respect_gpc&&!t&&s&&s.hasOwnProperty("respect_gpc")&&(e.respect_gpc=!1),this.setCookie("wpconsent_preferences",JSON.stringify(e),wpconsent.consent_duration),this.hideBanner(),this.closePreferences(),this.unlockScripts(e),this.unlockIframes(e),this.showFloatingButtonIfEnabled(),this.updateWordPressConsent(e),window.dispatchEvent(new CustomEvent("wpconsent_consent_saved",{detail:e})),n&&window.dispatchEvent(new CustomEvent("wpconsent_consent_updated",{detail:e})),o&&(Object.defineProperty(document,"cookie",{get:function(){return""},set:function(e){}}),window.location.reload())},showPreferences:function(){const e=this.shadowRoot?.querySelector("#wpconsent-preferences-modal");if(e){e.style.display="flex",this.setupFocusTrap(e),this.runHooks("afterShowPreferences");const t=this.shadowRoot?.querySelector("#wpconsent-preferences-title");t&&setTimeout((()=>{t.focus({preventScroll:!0}),this.lastFocusedElement=t}),100);const n=this.getCookie("wpconsent_preferences");if(n)try{const e=JSON.parse(n);this.shadowRoot.querySelectorAll('#wpconsent-preferences-modal input[type="checkbox"]').forEach((t=>{let n=null;n=t.id.startsWith("cookie-category-")?t.id.replace("cookie-category-",""):t.id.startsWith("cookie-service-")?t.id.replace("cookie-service-",""):t.value,n&&n in e&&(t.checked=e[n])}))}catch(e){console.error("Error parsing WPConsent preferences:",e)}}},closePreferences:function(){const e=this.shadowRoot?.querySelector("#wpconsent-preferences-modal");e&&(e.style.display="none",this.removeFocusTrap(),this.previouslyFocusedElement&&(this.previouslyFocusedElement.focus({preventScroll:!0}),this.previouslyFocusedElement=null))},showBanner:function(){if(!wpconsent.enable_consent_banner)return;const e=this.shadowRoot?.querySelector("#wpconsent-banner-holder");e&&(this.runHooks("beforeShowBanner"),e.classList.add("wpconsent-banner-visible"),this.updateButtonVisibility(wpconsent),this.setupFocusTrap(e),this.runHooks("afterShowBanner"))},hideBanner:function(){const e=this.shadowRoot?.querySelector("#wpconsent-banner-holder");e&&(this.runHooks("beforeHideBanner"),e.classList.remove("wpconsent-banner-visible"),this.removeFocusTrap(),this.previouslyFocusedElement&&(this.previouslyFocusedElement.focus({preventScroll:!0}),this.previouslyFocusedElement=null),this.runHooks("afterHideBanner"))},setCookie:function(e,t,n){let o="";if(n>0){const e=new Date;e.setTime(e.getTime()+24*n*60*60*1e3),o="expires="+e.toUTCString()+";"}const s=this.getCookieDomain();document.cookie=e+"="+t+";"+o+s+"path=/"},getCookieDomain:function(){return wpconsent.enable_shared_consent&&wpconsent.cookie_domain&&""!==wpconsent.cookie_domain?"domain="+(wpconsent.cookie_domain.startsWith(".")?wpconsent.cookie_domain:"."+wpconsent.cookie_domain)+";":""},getCookie:function(e){const t=`; ${document.cookie}`.split(`; ${e}=`);if(2===t.length)return t.pop().split(";").shift()},hasConsent:function(e){const t=this.getCookie("wpconsent_preferences");if(!t)return!1;try{const n=JSON.parse(t);return"essential"===e||!0===n[e]}catch(e){return console.error("Error parsing WPConsent preferences:",e),!1}},shouldUnlockContent:function(e,t,n){return"essential"===n||(wpconsent.manual_toggle_services?!(!t||void 0===e[t])&&e[t]:!0===e[n])},unlockScripts:function(e){document.querySelectorAll('script[type="text/plain"]').forEach((t=>{const n=t.getAttribute("data-wpconsent-category"),o=t.getAttribute("data-wpconsent-name");if(this.shouldUnlockContent(e,o,n)){const e=document.createElement("script");t.getAttributeNames().forEach((n=>{"type"!==n&&e.setAttribute(n,t.getAttribute(n))}));const n=t.getAttribute("data-wpconsent-src");n?e.src=n:e.text=t.text,t.parentNode.replaceChild(e,t)}})),document.dispatchEvent(new CustomEvent("wpconsent_consent_processed",{detail:e})), window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"wpconsent_consent_processed",wpconsentPreferences:e})},unlockIframes:function(e){document.querySelectorAll("iframe[data-wpconsent-src]").forEach((t=>{const n=t.getAttribute("data-wpconsent-category"),o=t.getAttribute("data-wpconsent-name");if(this.shouldUnlockContent(e,o,n)){const e=t.getAttribute("data-wpconsent-src");e&&(t.src=e),t.removeAttribute("data-wpconsent-src"),t.removeAttribute("data-wpconsent-name"),t.removeAttribute("data-wpconsent-category")}})),document.querySelectorAll(".wpconsent-iframe-placeholder").forEach((t=>{const n=t.getAttribute("data-wpconsent-category"),o=t.getAttribute("data-wpconsent-name");if(this.shouldUnlockContent(e,o,n)){const e=t.querySelector(".wpconsent-iframe-thumbnail"),n=t.querySelector(".wpconsent-iframe-overlay-content");e&&e.remove(),n&&n.remove(),t.classList.remove("wpconsent-iframe-placeholder")}}))},init:function(){this.runSettingsHooks().then((()=>{this.initWordPress(),this.updateButtonVisibility(wpconsent);const e=document.getElementById("wpconsent-container"),t=document.getElementById("wpconsent-template");if(this.shadowRoot=e.shadowRoot,this.shadowRoot)this.runDisplayChecks().then((()=>{this.processBannerDisplay()}));else{this.shadowRoot=e.attachShadow({mode:"open"});const n=t.content.cloneNode(!0);this.shadowRoot.appendChild(n),t.remove(),this.initializeEventListeners(),this.initializeAccordions(),this.initializeKeyboardHandlers(),this.runDisplayChecks().then((()=>{this.loadExternalCSS(e).then((()=>{this.processBannerDisplay()}))}))}}))},processBannerDisplay:function(){const e=this.getCookie("wpconsent_preferences");if(e){let t={};try{if(t=JSON.parse(e),wpconsent.slugs&&Array.isArray(wpconsent.slugs)&&!wpconsent.slugs.every((e=>t.hasOwnProperty(e))))return this.setCookie("wpconsent_preferences","",-1),this.checkGPC(),void(this.checksPassed&&this.showBanner());this.unlockScripts(t),this.unlockIframes(t)}catch(e){console.error("Error parsing WPConsent preferences:",e)}this.showFloatingButtonIfEnabled()}else if(this.checkGPC(),this.checksPassed&&this.showBanner(),wpconsent.default_allow||!wpconsent.enable_script_blocking){const e={};wpconsent.slugs.forEach((t=>{e[t]=!0})),this.unlockScripts(e),this.unlockIframes(e)}window.dispatchEvent(new CustomEvent("wpconsent_banner_initialized"))},loadExternalCSS:function(e){return new Promise(((t,n)=>{try{const n=`${wpconsent.css_url}?ver=${wpconsent.css_version}`;fetch(n).then((e=>e.text())).then((n=>{const o=document.createElement("style");o.textContent=n,this.shadowRoot.appendChild(o),e.style.display="block",t()})).catch((e=>{console.error("Failed to load WPConsent styles:",e),t()}))}catch(e){console.error("Failed to load WPConsent styles:",e),t()}}))},initializeEventListeners:function(){this.shadowRoot.querySelectorAll(".wpconsent-accept-all").forEach((e=>e.addEventListener("click",(()=>this.acceptAll())))),this.shadowRoot.querySelectorAll(".wpconsent-cancel-cookies").forEach((e=>e.addEventListener("click",(()=>{const e={};wpconsent.slugs.forEach((t=>{const n=this.shadowRoot.querySelector(`#wpconsent-preferences-modal input[type="checkbox"][id="cookie-service-${t}"]`);n&&n.disabled?e[t]=!0:e[t]=!1})),e.essential=!0,this.savePreferences(e)})))),this.shadowRoot.querySelector("#wpconsent-banner-close")?.addEventListener("click",(()=>this.hideBanner())),this.shadowRoot.querySelector("#wpconsent-preferences-all")?.addEventListener("click",(()=>this.showPreferences()));const e=this.shadowRoot.querySelector("#wpconsent-consent-floating");e&&e.addEventListener("click",(()=>this.showPreferences())),this.initializeCheckboxListeners(),document.addEventListener("click",(e=>{const t=e.target.closest(".wpconsent-iframe-accept-button");if(t){const e=t.getAttribute("data-category"),n=t.closest(".wpconsent-iframe-placeholder"),o=n?.getAttribute("data-wpconsent-name");if(e){let t={};try{t=JSON.parse(this.getCookie("wpconsent_preferences")||"{}")}catch(e){console.error("Failed to parse wpconsent_preferences cookie:",e)}const n={...t,essential:!0,[e]:!0};o&&(n[o]=!0),this.savePreferences(n)}}})),this.shadowRoot.querySelector(".wpconsent-preferences-header-close")?.addEventListener("click",(()=>this.closePreferences())),this.shadowRoot.querySelector(".wpconsent-save-preferences")?.addEventListener("click",(()=>{const e=this.shadowRoot.querySelectorAll('#wpconsent-preferences-modal input[type="checkbox"]'),t=Array.from(e).filter((e=>e.checked)).map((e=>e.value)),n={};wpconsent.slugs.forEach((e=>{n[e]=t.includes(e)})),n.essential=!0,this.savePreferences(n)})),this.shadowRoot.querySelector(".wpconsent-close-preferences")?.addEventListener("click",(()=>this.closePreferences())),window.addEventListener("wpconsent_consent_saved",(function(e){const t=e.detail;WPConsent.localGtag("consent","update",{ad_storage:t.marketing?"granted":"denied",analytics_storage:t.statistics?"granted":"denied",ad_user_data:t.marketing?"granted":"denied",ad_personalization:t.marketing?"granted":"denied",security_storage:"granted",functionality_storage:"granted"})})),window.addEventListener("wpconsent_consent_saved",(function(e){if("function"!=typeof window.clarity)return;const t=e.detail;window.clarity("consentv2",{ad_Storage:t.marketing?"granted":"denied",analytics_Storage:t.statistics?"granted":"denied"})}))},localGtag:function(){window.dataLayer=window.dataLayer||[],function(){dataLayer.push(arguments)}.apply(window,arguments)},initializeCheckboxListeners:function(){this.shadowRoot.querySelectorAll('#wpconsent-preferences-modal input[type="checkbox"][id^="cookie-category-"]').forEach((e=>{e.addEventListener("change",(e=>{this.handleCategoryCheckboxChange(e.target)}))})),this.shadowRoot.querySelectorAll('#wpconsent-preferences-modal input[type="checkbox"][id^="cookie-service-"]').forEach((e=>{e.addEventListener("change",(e=>{this.handleServiceCheckboxChange(e.target)}))}))},handleCategoryCheckboxChange:function(e){const t=e.id.replace("cookie-category-","");this.shadowRoot.querySelectorAll('#wpconsent-preferences-modal input[type="checkbox"][id^="cookie-service-"]').forEach((n=>{n.closest(`.wpconsent-cookie-category-${t}`)&&(n.checked=e.checked)}))},handleServiceCheckboxChange:function(e){const t=e.closest(".wpconsent-cookie-category");if(!t)return;const n=t.querySelector('input[type="checkbox"][id^="cookie-category-"]');if(!n)return;const o=t.querySelectorAll('input[type="checkbox"][id^="cookie-service-"]');let s=!1;o.forEach((e=>{e.checked&&(s=!0)})),n.checked=s},initializeAccordions(){this.shadowRoot.querySelectorAll(".wpconsent-preferences-accordion-item").forEach((e=>{const t=e.querySelector(".wpconsent-preferences-accordion-header"),n=e.querySelector(".wpconsent-preferences-accordion-content");t&&n&&t.addEventListener("click",(t=>{t.target.closest(".wpconsent-preferences-checkbox-toggle")||this.toggleAccordion(e,n)}))}))},toggleAccordion(e,t){e.classList.contains("active");const n=e.parentElement,o=e.classList.contains("wpconsent-cookie-service"),s=e.classList.contains("wpconsent-cookie-category");s?n&&n.querySelectorAll(":scope > .wpconsent-preferences-accordion-item.wpconsent-cookie-category").forEach((t=>{if(t!==e){t.classList.remove("active");const e=t.querySelector(".wpconsent-preferences-accordion-toggle");e&&e.setAttribute("aria-expanded","false"),t.querySelectorAll(".wpconsent-cookie-service").forEach((e=>{e.classList.remove("active");const t=e.querySelector(".wpconsent-preferences-accordion-toggle");t&&t.setAttribute("aria-expanded","false"),this.runHooks("accordionToggled",{accordion:e,content:e.querySelector(".wpconsent-preferences-accordion-content"),isActive:!1,isService:!0,isCategory:!1})}))}})):o&&n&&n.querySelectorAll(":scope > .wpconsent-preferences-accordion-item.wpconsent-cookie-service").forEach((t=>{if(t!==e){t.classList.remove("active");const e=t.querySelector(".wpconsent-preferences-accordion-toggle");e&&e.setAttribute("aria-expanded","false"),this.runHooks("accordionToggled",{accordion:t,content:t.querySelector(".wpconsent-preferences-accordion-content"),isActive:!1,isService:!0,isCategory:!1})}})),e.classList.toggle("active");const c=e.querySelector(".wpconsent-preferences-accordion-toggle");if(c){const t=e.classList.contains("active");c.setAttribute("aria-expanded",t?"true":"false")}const r=e.classList.contains("active");this.runHooks("accordionToggled",{accordion:e,content:t,isActive:r,isService:o,isCategory:s})},initializeKeyboardHandlers:function(){document.addEventListener("keydown",(e=>{"Tab"===e.key?this.handleTabKey(e):"Escape"===e.key&&this.handleEscapeKey(e)}))},handleEscapeKey:function(e){const t=this.shadowRoot?.querySelector("#wpconsent-preferences-modal"),n=this.shadowRoot?.querySelector("#wpconsent-banner-holder");t&&"flex"===t.style.display?this.closePreferences():n&&n.classList.contains("wpconsent-banner-visible")&&this.hideBanner()},handleTabKey:function(e){const t=this.shadowRoot?.querySelector("#wpconsent-banner-holder"),n=this.shadowRoot?.querySelector("#wpconsent-preferences-modal"),o=t&&t.classList.contains("wpconsent-banner-visible"),s=n&&"flex"===n.style.display;if(!o&&!s)return;const c=s?n:t,r=this.getFocusableElements(c);if(0===r.length)return;e.preventDefault();const i=r[0],a=r[r.length-1];let l;this.lastFocusedElement&&r.includes(this.lastFocusedElement)?l=this.lastFocusedElement:(l=i,this.lastFocusedElement=l);const d=r.indexOf(l);let h;h=e.shiftKey?d<=0?a:r[d-1]:d>=r.length-1?i:r[d+1],h.focus({preventScroll:!0}),this.lastFocusedElement=h},setupFocusTrap:function(e){this.previouslyFocusedElement=document.activeElement,this.lastFocusedElement=null},removeFocusTrap:function(){this.lastFocusedElement=null},setInitialFocus:function(e){const t=this.getFocusableElements(e);t.length>0&&setTimeout((()=>{t[0].focus({preventScroll:!0}),this.lastFocusedElement=t[0]}),100)},getFocusableElements:function(e){return Array.from(e.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')).filter((t=>{let n=t;for(;n&&n!==e;){const e=window.getComputedStyle(n);if("none"===e.display||"hidden"===e.visibility||"0"===e.opacity||n.disabled||"true"===n.getAttribute("aria-hidden"))return!1;n=n.parentElement}return!0}))},isElementInContainer:function(e,t){return!(!e||!t)&&(t.shadowRoot?t.shadowRoot.contains(e):t.contains(e))},clearCookies:function(){for(var e=document.cookie.split("; "),t=0;t<e.length;t++)for(var n=window.location.hostname.split(".");n.length>0;){var o=encodeURIComponent(e[t].split(";")[0].split("=")[0])+"=; expires=Thu, 01-Jan-1970 00:00:01 GMT; domain="+n.join(".")+" ;path=",s=location.pathname.split("/");for(document.cookie=o+"/";s.length>0;)document.cookie=o+s.join("/"),s.pop();n.shift()}},initWordPress:function(){window.wp_consent_type=wpconsent.consent_type;let e=new CustomEvent("wp_consent_type_defined");document.dispatchEvent(e)},showFloatingButtonIfEnabled:function(){if(wpconsent.enable_consent_floating){const e=this.shadowRoot?.querySelector("#wpconsent-consent-floating");e&&(e.style.display="block")}},updateButtonVisibility:function(e){this.shadowRoot&&["accept","cancel","preferences"].forEach((t=>{const n=this.shadowRoot.querySelector(`#wpconsent-${t}-all`);n&&(e[`${t}_button_enabled`]?(n.classList.remove("wpconsent-button-disabled"),n.removeAttribute("data-disabled")):(n.classList.add("wpconsent-button-disabled"),n.setAttribute("data-disabled","true")))}))},updateWordPressConsent:function(e){"function"==typeof wp_set_consent&&(wp_set_consent("functional","allow"),wp_set_consent("preferences","allow"),wp_set_consent("statistics",e.statistics?"allow":"deny"),wp_set_consent("statistics-anonymous",e.statistics?"allow":"deny"),wp_set_consent("marketing",e.marketing?"allow":"deny"))}},document.addEventListener("DOMContentLoaded",(()=>WPConsent.init()))}},t={};function n(o){var s=t[o];if(void 0!==s)return s.exports;var c=t[o]={exports:{}};return e[o](c,c.exports,n),c.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";n(799)})()})();1 (()=>{var e={799:()=>{window.WPConsent={displayChecks:[],checksPassed:!0,settingsHooks:[],settingsProcessed:!1,registerDisplayCheck:function(e){this.displayChecks.push(e),this.checksPassed=!1},registerSettingsHook:function(e){this.settingsHooks.push(e),this.settingsProcessed=!1},runDisplayChecks:function(){return 0===this.displayChecks.length?(this.checksPassed=!0,Promise.resolve()):Promise.all(this.displayChecks.map((e=>e()))).then((()=>(this.checksPassed=!0,Promise.resolve()))).catch((e=>(console.error("Error in WPConsent display check:",e),this.checksPassed=!0,Promise.resolve())))},runSettingsHooks:function(){return 0===this.settingsHooks.length?(this.settingsProcessed=!0,Promise.resolve()):Promise.all(this.settingsHooks.map((e=>e(window.wpconsent)))).then((()=>(this.settingsProcessed=!0,Promise.resolve()))).catch((e=>(console.error("Error in WPConsent settings hook:",e),this.settingsProcessed=!0,Promise.resolve())))},hooks:{beforeShowPreferences:[],afterShowPreferences:[],beforeHideBanner:[],afterHideBanner:[],beforeShowBanner:[],afterShowBanner:[],accordionToggled:[]},addHook:function(e,t){this.hooks[e]&&this.hooks[e].push(t)},runHooks:function(e,...t){this.hooks[e]&&this.hooks[e].length>0&&this.hooks[e].forEach((n=>{try{n(...t)}catch(t){console.error(`Error in WPConsent hook ${e}:`,t)}}))},acceptAll:function(){const e={};Array.isArray(wpconsent.slugs)&&wpconsent.slugs.forEach((t=>{e[t]=!0})),this.savePreferences(e),this.closePreferences()},checkGPC:function(){if(!wpconsent.respect_gpc||!0!==navigator.globalPrivacyControl)return;const e=this.getCookie("wpconsent_preferences");let t={};if(e)try{t=JSON.parse(e)}catch(e){console.error("WPConsent: Error parsing existing preferences:",e)}if(t.hasOwnProperty("respect_gpc"))return;const n={};wpconsent.slugs.forEach((e=>{const t=this.shadowRoot?.querySelector(`#wpconsent-preferences-modal input[type="checkbox"][id="cookie-service-${e}"]`);t&&t.disabled?n[e]=!0:n[e]=!1})),n.essential=!0,n.respect_gpc=!0,this.savePreferences(n,!0),this.checksPassed=!1},savePreferences:function(e,t=!1){const n=this.getCookie("wpconsent_preferences");let o=!1,s=null;if(n)try{s=JSON.parse(n)}catch(e){console.error("WPConsent: Error parsing existing preferences:",e)}(s&&JSON.stringify(s)!==JSON.stringify(e)||wpconsent.default_allow&&Object.values(e).some((e=>!1===e)))&&(this.clearCookies(),o=!0),wpconsent.respect_gpc&&!t&&s&&s.hasOwnProperty("respect_gpc")&&(e.respect_gpc=!1),this.setCookie("wpconsent_preferences",JSON.stringify(e),wpconsent.consent_duration),this.hideBanner(),this.closePreferences(),this.unlockScripts(e),this.unlockIframes(e),this.showFloatingButtonIfEnabled(),this.updateWordPressConsent(e),window.dispatchEvent(new CustomEvent("wpconsent_consent_saved",{detail:e})),n&&window.dispatchEvent(new CustomEvent("wpconsent_consent_updated",{detail:e})),o&&(Object.defineProperty(document,"cookie",{get:function(){return""},set:function(e){}}),window.location.reload())},showPreferences:function(){const e=this.shadowRoot?.querySelector("#wpconsent-preferences-modal");if(e){e.style.display="flex",this.setupFocusTrap(e),this.runHooks("afterShowPreferences");const t=this.shadowRoot?.querySelector("#wpconsent-preferences-title");t&&setTimeout((()=>{t.focus({preventScroll:!0}),this.lastFocusedElement=t}),100);const n=this.getCookie("wpconsent_preferences");if(n)try{const e=JSON.parse(n);this.shadowRoot.querySelectorAll('#wpconsent-preferences-modal input[type="checkbox"]').forEach((t=>{let n=null;n=t.id.startsWith("cookie-category-")?t.id.replace("cookie-category-",""):t.id.startsWith("cookie-service-")?t.id.replace("cookie-service-",""):t.value,n&&n in e&&(t.checked=e[n])}))}catch(e){console.error("Error parsing WPConsent preferences:",e)}}},closePreferences:function(){const e=this.shadowRoot?.querySelector("#wpconsent-preferences-modal");e&&(e.style.display="none",this.removeFocusTrap(),this.previouslyFocusedElement&&(this.previouslyFocusedElement.focus({preventScroll:!0}),this.previouslyFocusedElement=null))},showBanner:function(){if(!wpconsent.enable_consent_banner)return;const e=this.shadowRoot?.querySelector("#wpconsent-banner-holder");e&&(this.runHooks("beforeShowBanner"),e.classList.add("wpconsent-banner-visible"),this.updateButtonVisibility(wpconsent),this.setupFocusTrap(e),this.runHooks("afterShowBanner"))},hideBanner:function(){const e=this.shadowRoot?.querySelector("#wpconsent-banner-holder");e&&(this.runHooks("beforeHideBanner"),e.classList.remove("wpconsent-banner-visible"),this.removeFocusTrap(),this.previouslyFocusedElement&&(this.previouslyFocusedElement.focus({preventScroll:!0}),this.previouslyFocusedElement=null),this.runHooks("afterHideBanner"))},setCookie:function(e,t,n){let o="";if(n>0){const e=new Date;e.setTime(e.getTime()+24*n*60*60*1e3),o="expires="+e.toUTCString()+";"}const s=this.getCookieDomain();document.cookie=e+"="+t+";"+o+s+"path=/"},getCookieDomain:function(){return wpconsent.enable_shared_consent&&wpconsent.cookie_domain&&""!==wpconsent.cookie_domain?"domain="+(wpconsent.cookie_domain.startsWith(".")?wpconsent.cookie_domain:"."+wpconsent.cookie_domain)+";":""},getCookie:function(e){const t=`; ${document.cookie}`.split(`; ${e}=`);if(2===t.length)return t.pop().split(";").shift()},hasConsent:function(e){const t=this.getCookie("wpconsent_preferences");if(!t)return!1;try{const n=JSON.parse(t);return"essential"===e||!0===n[e]}catch(e){return console.error("Error parsing WPConsent preferences:",e),!1}},shouldUnlockContent:function(e,t,n){return"essential"===n||(wpconsent.manual_toggle_services?!(!t||void 0===e[t])&&e[t]:!0===e[n])},unlockScripts:function(e){document.querySelectorAll('script[type="text/plain"]').forEach((t=>{const n=t.getAttribute("data-wpconsent-category"),o=t.getAttribute("data-wpconsent-name");if(this.shouldUnlockContent(e,o,n)){const e=document.createElement("script");t.getAttributeNames().forEach((n=>{"type"!==n&&e.setAttribute(n,t.getAttribute(n))}));const n=t.getAttribute("data-wpconsent-src");n?e.src=n:e.text=t.text,t.parentNode.replaceChild(e,t)}})),document.dispatchEvent(new CustomEvent("wpconsent_consent_processed",{detail:e})),WPConsent.localGtag("set","developer_id.dMmRkYz",!0),WPConsent.localGtag("consent","update",{ad_storage:e.marketing?"granted":"denied",analytics_storage:e.statistics?"granted":"denied",ad_user_data:e.marketing?"granted":"denied",ad_personalization:e.marketing?"granted":"denied"}),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"wpconsent_consent_processed",wpconsentPreferences:e})},unlockIframes:function(e){document.querySelectorAll("iframe[data-wpconsent-src]").forEach((t=>{const n=t.getAttribute("data-wpconsent-category"),o=t.getAttribute("data-wpconsent-name");if(this.shouldUnlockContent(e,o,n)){const e=t.getAttribute("data-wpconsent-src");e&&(t.src=e),t.removeAttribute("data-wpconsent-src"),t.removeAttribute("data-wpconsent-name"),t.removeAttribute("data-wpconsent-category")}})),document.querySelectorAll(".wpconsent-iframe-placeholder").forEach((t=>{const n=t.getAttribute("data-wpconsent-category"),o=t.getAttribute("data-wpconsent-name");if(this.shouldUnlockContent(e,o,n)){const e=t.querySelector(".wpconsent-iframe-thumbnail"),n=t.querySelector(".wpconsent-iframe-overlay-content");e&&e.remove(),n&&n.remove(),t.classList.remove("wpconsent-iframe-placeholder")}}))},init:function(){this.runSettingsHooks().then((()=>{this.initWordPress(),this.updateButtonVisibility(wpconsent);const e=document.getElementById("wpconsent-container"),t=document.getElementById("wpconsent-template");if(this.shadowRoot=e.shadowRoot,this.shadowRoot)this.runDisplayChecks().then((()=>{this.processBannerDisplay()}));else{this.shadowRoot=e.attachShadow({mode:"open"});const n=t.content.cloneNode(!0);this.shadowRoot.appendChild(n),t.remove(),this.initializeEventListeners(),this.initializeAccordions(),this.initializeKeyboardHandlers(),this.runDisplayChecks().then((()=>{this.loadExternalCSS(e).then((()=>{this.processBannerDisplay()}))}))}}))},processBannerDisplay:function(){const e=this.getCookie("wpconsent_preferences");if(e){let t={};try{if(t=JSON.parse(e),wpconsent.slugs&&Array.isArray(wpconsent.slugs)&&!wpconsent.slugs.every((e=>t.hasOwnProperty(e))))return this.setCookie("wpconsent_preferences","",-1),this.checkGPC(),void(this.checksPassed&&this.showBanner());this.unlockScripts(t),this.unlockIframes(t)}catch(e){console.error("Error parsing WPConsent preferences:",e)}this.showFloatingButtonIfEnabled()}else if(this.checkGPC(),this.checksPassed&&this.showBanner(),wpconsent.default_allow||!wpconsent.enable_script_blocking){const e={};wpconsent.slugs.forEach((t=>{e[t]=!0})),this.unlockScripts(e),this.unlockIframes(e)}window.dispatchEvent(new CustomEvent("wpconsent_banner_initialized"))},loadExternalCSS:function(e){return new Promise(((t,n)=>{try{const n=`${wpconsent.css_url}?ver=${wpconsent.css_version}`;fetch(n).then((e=>e.text())).then((n=>{const o=document.createElement("style");o.textContent=n,this.shadowRoot.appendChild(o),e.style.display="block",t()})).catch((e=>{console.error("Failed to load WPConsent styles:",e),t()}))}catch(e){console.error("Failed to load WPConsent styles:",e),t()}}))},initializeEventListeners:function(){this.shadowRoot.querySelectorAll(".wpconsent-accept-all").forEach((e=>e.addEventListener("click",(()=>this.acceptAll())))),this.shadowRoot.querySelectorAll(".wpconsent-cancel-cookies").forEach((e=>e.addEventListener("click",(()=>{const e={};wpconsent.slugs.forEach((t=>{const n=this.shadowRoot.querySelector(`#wpconsent-preferences-modal input[type="checkbox"][id="cookie-service-${t}"]`);n&&n.disabled?e[t]=!0:e[t]=!1})),e.essential=!0,this.savePreferences(e)})))),this.shadowRoot.querySelector("#wpconsent-banner-close")?.addEventListener("click",(()=>this.hideBanner())),this.shadowRoot.querySelector("#wpconsent-preferences-all")?.addEventListener("click",(()=>this.showPreferences()));const e=this.shadowRoot.querySelector("#wpconsent-consent-floating");e&&e.addEventListener("click",(()=>this.showPreferences())),this.initializeCheckboxListeners(),document.addEventListener("click",(e=>{const t=e.target.closest(".wpconsent-iframe-accept-button");if(t){const e=t.getAttribute("data-category"),n=t.closest(".wpconsent-iframe-placeholder"),o=n?.getAttribute("data-wpconsent-name");if(e){let t={};try{t=JSON.parse(this.getCookie("wpconsent_preferences")||"{}")}catch(e){console.error("Failed to parse wpconsent_preferences cookie:",e)}const n={...t,essential:!0,[e]:!0};o&&(n[o]=!0),this.savePreferences(n)}}})),this.shadowRoot.querySelector(".wpconsent-preferences-header-close")?.addEventListener("click",(()=>this.closePreferences())),this.shadowRoot.querySelector(".wpconsent-save-preferences")?.addEventListener("click",(()=>{const e=this.shadowRoot.querySelectorAll('#wpconsent-preferences-modal input[type="checkbox"]'),t=Array.from(e).filter((e=>e.checked)).map((e=>e.value)),n={};wpconsent.slugs.forEach((e=>{n[e]=t.includes(e)})),n.essential=!0,this.savePreferences(n)})),this.shadowRoot.querySelector(".wpconsent-close-preferences")?.addEventListener("click",(()=>this.closePreferences())),window.addEventListener("wpconsent_consent_saved",(function(e){if("function"!=typeof window.clarity)return;const t=e.detail;window.clarity("consentv2",{ad_Storage:t.marketing?"granted":"denied",analytics_Storage:t.statistics?"granted":"denied"})}))},localGtag:function(){window.dataLayer=window.dataLayer||[],function(){dataLayer.push(arguments)}.apply(window,arguments)},initializeCheckboxListeners:function(){this.shadowRoot.querySelectorAll('#wpconsent-preferences-modal input[type="checkbox"][id^="cookie-category-"]').forEach((e=>{e.addEventListener("change",(e=>{this.handleCategoryCheckboxChange(e.target)}))})),this.shadowRoot.querySelectorAll('#wpconsent-preferences-modal input[type="checkbox"][id^="cookie-service-"]').forEach((e=>{e.addEventListener("change",(e=>{this.handleServiceCheckboxChange(e.target)}))}))},handleCategoryCheckboxChange:function(e){const t=e.id.replace("cookie-category-","");this.shadowRoot.querySelectorAll('#wpconsent-preferences-modal input[type="checkbox"][id^="cookie-service-"]').forEach((n=>{n.closest(`.wpconsent-cookie-category-${t}`)&&(n.checked=e.checked)}))},handleServiceCheckboxChange:function(e){const t=e.closest(".wpconsent-cookie-category");if(!t)return;const n=t.querySelector('input[type="checkbox"][id^="cookie-category-"]');if(!n)return;const o=t.querySelectorAll('input[type="checkbox"][id^="cookie-service-"]');let s=!1;o.forEach((e=>{e.checked&&(s=!0)})),n.checked=s},initializeAccordions(){this.shadowRoot.querySelectorAll(".wpconsent-preferences-accordion-item").forEach((e=>{const t=e.querySelector(".wpconsent-preferences-accordion-header"),n=e.querySelector(".wpconsent-preferences-accordion-content");t&&n&&t.addEventListener("click",(t=>{t.target.closest(".wpconsent-preferences-checkbox-toggle")||this.toggleAccordion(e,n)}))}))},toggleAccordion(e,t){e.classList.contains("active");const n=e.parentElement,o=e.classList.contains("wpconsent-cookie-service"),s=e.classList.contains("wpconsent-cookie-category");s?n&&n.querySelectorAll(":scope > .wpconsent-preferences-accordion-item.wpconsent-cookie-category").forEach((t=>{if(t!==e){t.classList.remove("active");const e=t.querySelector(".wpconsent-preferences-accordion-toggle");e&&e.setAttribute("aria-expanded","false"),t.querySelectorAll(".wpconsent-cookie-service").forEach((e=>{e.classList.remove("active");const t=e.querySelector(".wpconsent-preferences-accordion-toggle");t&&t.setAttribute("aria-expanded","false"),this.runHooks("accordionToggled",{accordion:e,content:e.querySelector(".wpconsent-preferences-accordion-content"),isActive:!1,isService:!0,isCategory:!1})}))}})):o&&n&&n.querySelectorAll(":scope > .wpconsent-preferences-accordion-item.wpconsent-cookie-service").forEach((t=>{if(t!==e){t.classList.remove("active");const e=t.querySelector(".wpconsent-preferences-accordion-toggle");e&&e.setAttribute("aria-expanded","false"),this.runHooks("accordionToggled",{accordion:t,content:t.querySelector(".wpconsent-preferences-accordion-content"),isActive:!1,isService:!0,isCategory:!1})}})),e.classList.toggle("active");const c=e.querySelector(".wpconsent-preferences-accordion-toggle");if(c){const t=e.classList.contains("active");c.setAttribute("aria-expanded",t?"true":"false")}const r=e.classList.contains("active");this.runHooks("accordionToggled",{accordion:e,content:t,isActive:r,isService:o,isCategory:s})},initializeKeyboardHandlers:function(){document.addEventListener("keydown",(e=>{"Tab"===e.key?this.handleTabKey(e):"Escape"===e.key&&this.handleEscapeKey(e)}))},handleEscapeKey:function(e){const t=this.shadowRoot?.querySelector("#wpconsent-preferences-modal"),n=this.shadowRoot?.querySelector("#wpconsent-banner-holder");t&&"flex"===t.style.display?this.closePreferences():n&&n.classList.contains("wpconsent-banner-visible")&&this.hideBanner()},handleTabKey:function(e){const t=this.shadowRoot?.querySelector("#wpconsent-banner-holder"),n=this.shadowRoot?.querySelector("#wpconsent-preferences-modal"),o=t&&t.classList.contains("wpconsent-banner-visible"),s=n&&"flex"===n.style.display;if(!o&&!s)return;const c=s?n:t,r=this.getFocusableElements(c);if(0===r.length)return;e.preventDefault();const i=r[0],a=r[r.length-1];let l;this.lastFocusedElement&&r.includes(this.lastFocusedElement)?l=this.lastFocusedElement:(l=i,this.lastFocusedElement=l);const d=r.indexOf(l);let h;h=e.shiftKey?d<=0?a:r[d-1]:d>=r.length-1?i:r[d+1],h.focus({preventScroll:!0}),this.lastFocusedElement=h},setupFocusTrap:function(e){this.previouslyFocusedElement=document.activeElement,this.lastFocusedElement=null},removeFocusTrap:function(){this.lastFocusedElement=null},setInitialFocus:function(e){const t=this.getFocusableElements(e);t.length>0&&setTimeout((()=>{t[0].focus({preventScroll:!0}),this.lastFocusedElement=t[0]}),100)},getFocusableElements:function(e){return Array.from(e.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')).filter((t=>{let n=t;for(;n&&n!==e;){const e=window.getComputedStyle(n);if("none"===e.display||"hidden"===e.visibility||"0"===e.opacity||n.disabled||"true"===n.getAttribute("aria-hidden"))return!1;n=n.parentElement}return!0}))},isElementInContainer:function(e,t){return!(!e||!t)&&(t.shadowRoot?t.shadowRoot.contains(e):t.contains(e))},clearCookies:function(){for(var e=document.cookie.split("; "),t=0;t<e.length;t++)for(var n=window.location.hostname.split(".");n.length>0;){var o=encodeURIComponent(e[t].split(";")[0].split("=")[0])+"=; expires=Thu, 01-Jan-1970 00:00:01 GMT; domain="+n.join(".")+" ;path=",s=location.pathname.split("/");for(document.cookie=o+"/";s.length>0;)document.cookie=o+s.join("/"),s.pop();n.shift()}},initWordPress:function(){window.wp_consent_type=wpconsent.consent_type;let e=new CustomEvent("wp_consent_type_defined");document.dispatchEvent(e)},showFloatingButtonIfEnabled:function(){if(wpconsent.enable_consent_floating){const e=this.shadowRoot?.querySelector("#wpconsent-consent-floating");e&&(e.style.display="block")}},updateButtonVisibility:function(e){this.shadowRoot&&["accept","cancel","preferences"].forEach((t=>{const n=this.shadowRoot.querySelector(`#wpconsent-${t}-all`);n&&(e[`${t}_button_enabled`]?(n.classList.remove("wpconsent-button-disabled"),n.removeAttribute("data-disabled")):(n.classList.add("wpconsent-button-disabled"),n.setAttribute("data-disabled","true")))}))},updateWordPressConsent:function(e){"function"==typeof wp_set_consent&&(wp_set_consent("functional","allow"),wp_set_consent("preferences","allow"),wp_set_consent("statistics",e.statistics?"allow":"deny"),wp_set_consent("statistics-anonymous",e.statistics?"allow":"deny"),wp_set_consent("marketing",e.marketing?"allow":"deny"))}},document.addEventListener("DOMContentLoaded",(()=>WPConsent.init()))}},t={};function n(o){var s=t[o];if(void 0!==s)return s.exports;var c=t[o]={exports:{}};return e[o](c,c.exports,n),c.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";n(799)})()})(); -
wpconsent-cookies-banner-privacy-suite/trunk/includes/admin/pages/class-wpconsent-admin-page-cookies.php
r3399711 r3417494 1066 1066 1067 1067 /** 1068 * Get the display rules content for Lite (blurred preview). 1069 * 1070 * @return string 1071 */ 1072 public function get_display_rules_content_lite() { 1073 ob_start(); 1074 ?> 1075 <div class="wpconsent-input-area-description"> 1076 <p><?php esc_html_e( 'Control where and to whom the cookie banner is displayed. Hide the banner for specific user roles or on certain pages.', 'wpconsent-cookies-banner-privacy-suite' ); ?></p> 1077 </div> 1078 1079 <div class="wpconsent-metabox-form-row"> 1080 <div class="wpconsent-metabox-form-row-label"> 1081 <label> 1082 <?php esc_html_e( 'Logged-in', 'wpconsent-cookies-banner-privacy-suite' ); ?> 1083 </label> 1084 </div> 1085 <div class="wpconsent-metabox-form-row-input"> 1086 <div class="wpconsent-toggle-switch"> 1087 <input type="checkbox" disabled> 1088 <label></label> 1089 </div> 1090 <p><?php esc_html_e( 'Hide the banner for all logged-in users, regardless of their role.', 'wpconsent-cookies-banner-privacy-suite' ); ?></p> 1091 </div> 1092 </div> 1093 1094 <div class="wpconsent-metabox-form-row wpconsent-metabox-form-row-separator"></div> 1095 1096 <div class="wpconsent-metabox-form-row"> 1097 <div class="wpconsent-metabox-form-row-label"> 1098 <label> 1099 <?php esc_html_e( 'User Roles', 'wpconsent-cookies-banner-privacy-suite' ); ?> 1100 </label> 1101 </div> 1102 <div class="wpconsent-metabox-form-row-input"> 1103 <select class="wpconsent-choices" disabled multiple style="pointer-events: none;"> 1104 <option><?php esc_html_e( 'Select user roles...', 'wpconsent-cookies-banner-privacy-suite' ); ?></option> 1105 </select> 1106 <p><?php esc_html_e( 'Select user roles that should not see the banner. Users with multiple roles will hide the banner if any selected role matches.', 'wpconsent-cookies-banner-privacy-suite' ); ?></p> 1107 </div> 1108 </div> 1109 1110 <div class="wpconsent-metabox-form-row wpconsent-metabox-form-row-separator"></div> 1111 1112 <div class="wpconsent-metabox-form-row"> 1113 <div class="wpconsent-metabox-form-row-label"> 1114 <label> 1115 <?php esc_html_e( 'Pages', 'wpconsent-cookies-banner-privacy-suite' ); ?> 1116 </label> 1117 </div> 1118 <div class="wpconsent-metabox-form-row-input"> 1119 <select class="wpconsent-choices" disabled multiple style="pointer-events: none;"> 1120 <option><?php esc_html_e( 'Start typing to select pages...', 'wpconsent-cookies-banner-privacy-suite' ); ?></option> 1121 </select> 1122 <p><?php esc_html_e( 'Select specific pages where the banner should be hidden. Useful for login pages, checkout pages, or admin-facing pages.', 'wpconsent-cookies-banner-privacy-suite' ); ?></p> 1123 </div> 1124 </div> 1125 <?php 1126 return ob_get_clean(); 1127 } 1128 1129 /** 1068 1130 * Output a single language item in the language selector. 1069 1131 * … … 1292 1354 wp_nonce_field( 'wpconsent_save_settings', 'wpconsent_save_settings_nonce' ); 1293 1355 ?> 1356 1357 <!-- Custom Iframe/Scripts - Individual PRO metabox --> 1294 1358 <div style="position: relative"> 1295 1359 <div class="wpconsent-blur-area"> … … 1298 1362 <?php 1299 1363 echo self::get_upsell_box( // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 1300 esc_html__( 'Custom Scripts/iFrames is a PRO feature', 'wpconsent-cookies-banner-privacy-suite' ),1301 '<p>' . esc_html__( 'Upgrade to WPConsent PRO today and easily manage custom scripts and iframes. Take full control and block any scripts and iframes from loading until users give consent.', 'wpconsent-cookies-banner-privacy-suite' ) . '</p>',1302 array(1303 'text' => esc_html__( 'Upgrade to PRO and Unlock Custom Scripts', 'wpconsent-cookies-banner-privacy-suite' ),1304 'url' => esc_url( wpconsent_utm_url( 'https://wpconsent.com/lite/', 'advanced-page', 'main' ) ),1305 ),1306 array(1307 'text' => esc_html__( 'Learn more about all the features', 'wpconsent-cookies-banner-privacy-suite' ),1308 'url' => esc_url( wpconsent_utm_url( 'https://wpconsent.com/lite/', 'advanced-page', 'features' ) ),1309 )1364 esc_html__( 'Custom Scripts/iFrames is a PRO feature', 'wpconsent-cookies-banner-privacy-suite' ), 1365 '<p>' . esc_html__( 'Upgrade to WPConsent PRO today and easily manage custom scripts and iframes. Take full control and block any scripts and iframes from loading until users give consent.', 'wpconsent-cookies-banner-privacy-suite' ) . '</p>', 1366 array( 1367 'text' => esc_html__( 'Upgrade to PRO and Unlock Custom Scripts', 'wpconsent-cookies-banner-privacy-suite' ), 1368 'url' => esc_url( wpconsent_utm_url( 'https://wpconsent.com/lite/', 'advanced-page', 'main' ) ), 1369 ), 1370 array( 1371 'text' => esc_html__( 'Learn more about all the features', 'wpconsent-cookies-banner-privacy-suite' ), 1372 'url' => esc_url( wpconsent_utm_url( 'https://wpconsent.com/lite/', 'advanced-page', 'features' ) ), 1373 ) 1310 1374 ); 1311 1375 ?> 1312 1376 </div> 1377 1378 <!-- Hide Banner Rules - Individual PRO metabox --> 1379 <div style="position: relative; margin-bottom: 20px;"> 1380 <div class="wpconsent-blur-area"> 1381 <?php $this->metabox( __( 'Hide Banner Rules', 'wpconsent-cookies-banner-privacy-suite' ), $this->get_display_rules_content_lite() ); ?> 1382 </div> 1383 <?php 1384 echo self::get_upsell_box( // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 1385 esc_html__( 'Hide Banner Rules is a PRO feature', 'wpconsent-cookies-banner-privacy-suite' ), 1386 '<p>' . esc_html__( 'Control where and to whom the cookie banner is displayed. Hide the banner for specific user roles or on certain pages to improve user experience.', 'wpconsent-cookies-banner-privacy-suite' ) . '</p>', 1387 array( 1388 'text' => esc_html__( 'Upgrade to PRO and Unlock Hide Banner Rules', 'wpconsent-cookies-banner-privacy-suite' ), 1389 'url' => esc_url( wpconsent_utm_url( 'https://wpconsent.com/lite/', 'advanced-page', 'hide-banner-rules' ) ), 1390 ), 1391 array( 1392 'text' => esc_html__( 'Learn more about all the features', 'wpconsent-cookies-banner-privacy-suite' ), 1393 'url' => esc_url( wpconsent_utm_url( 'https://wpconsent.com/lite/', 'advanced-page', 'features' ) ), 1394 ) 1395 ); 1396 ?> 1397 </div> 1398 1313 1399 <?php 1400 // Advanced Settings - Available to Lite users (no blur) 1314 1401 $this->metabox( 1315 __( 'Advanced Settings', 'wpconsent-cookies-banner-privacy-suite' ),1316 $this->get_advanced_settings_content()1402 __( 'Advanced Settings', 'wpconsent-cookies-banner-privacy-suite' ), 1403 $this->get_advanced_settings_content() 1317 1404 ); 1318 1405 ?> -
wpconsent-cookies-banner-privacy-suite/trunk/includes/class-wpconsent-banner.php
r3399711 r3417494 35 35 36 36 /** 37 * Check if the banner should be hidden. 38 * 39 * @return bool 40 */ 41 protected function should_hide_banner() { 42 return false; 43 } 44 45 /** 37 46 * Output the banner if enabled. 38 47 * … … 54 63 } 55 64 56 // Filter to prevent the banner from being output. 57 if ( apply_filters( 'wpconsent_banner_output', true ) === false ) { 65 // Filter to control whether the banner should be output. Child classes can override should_hide_banner(). 66 $should_output = ! $this->should_hide_banner(); 67 if ( ! apply_filters( 'wpconsent_banner_output', $should_output ) ) { 58 68 return; 59 69 } … … 372 382 // Render categories in this group. 373 383 foreach ( $group['categories'] as $category_slug => $category ) { 384 // Skip empty categories (no cookies and no services) unless it's the essential category. 385 $category_cookies = isset( $all_cookies[ $category['id'] ] ) ? $all_cookies[ $category['id'] ] : array(); 386 $has_cookies = ! empty( $category_cookies['cookies'] ); 387 $has_services = ! empty( $category_cookies['services'] ); 388 389 if ( 'essential' !== $category_slug && ! $has_cookies && ! $has_services ) { 390 continue; 391 } 392 374 393 $html .= $this->render_category_item( $category_slug, $category, $all_cookies, $default_allow ); 375 394 } -
wpconsent-cookies-banner-privacy-suite/trunk/includes/class-wpconsent-cookie-blocking.php
r3399711 r3417494 76 76 */ 77 77 public function process_output( $buffer ) { 78 // Check content type at output time since headers may have changed after buffer started. 79 if ( ! $this->is_html_response( $buffer ) ) { 80 return $buffer; 81 } 82 78 83 $scripts_by_category = $this->find_scripts_by_category( $buffer ); 79 84 … … 247 252 248 253 /** 254 * Check if the response is HTML content that should be processed. 255 * 256 * This method performs runtime checks on the buffer content and headers 257 * to determine if we should process it. This is needed because the initial 258 * should_process() check happens when the buffer starts, but the content 259 * type may change during the request (e.g., AJAX responses). 260 * 261 * @param string $buffer The output buffer content. 262 * 263 * @return bool Whether this appears to be HTML content. 264 */ 265 private function is_html_response( $buffer ) { 266 // Check content type header at output time. 267 $headers_list = headers_list(); 268 foreach ( $headers_list as $header ) { 269 if ( 0 === stripos( $header, 'Content-Type:' ) ) { 270 // If JSON content type, skip processing. 271 if ( false !== stripos( $header, 'application/json' ) ) { 272 return false; 273 } 274 // If explicitly HTML, we're good. 275 if ( false !== stripos( $header, 'text/html' ) ) { 276 return true; 277 } 278 } 279 } 280 281 // If no content type header, check the buffer content itself. 282 $trimmed = ltrim( $buffer ); 283 284 // Skip if buffer looks like JSON (starts with { or [). 285 if ( '' !== $trimmed && ( '{' === $trimmed[0] || '[' === $trimmed[0] ) ) { 286 return false; 287 } 288 289 // Skip if buffer doesn't look like HTML (should start with <). 290 if ( '' !== $trimmed && '<' !== $trimmed[0] ) { 291 return false; 292 } 293 294 return true; 295 } 296 297 /** 249 298 * Get the Google Consent Mode. 250 299 * -
wpconsent-cookies-banner-privacy-suite/trunk/includes/class-wpconsent-cookies.php
r3399711 r3417494 641 641 } 642 642 643 // If SiteKit plugin has the consent mode enabled we don't need to add the default state script. 644 if ( 'enabled' === apply_filters( 'googlesitekit_consent_mode_status', 'disabled' ) ) { 645 return false; 646 } 647 643 648 // Check if we have a cached result. 644 649 $cached_result = get_transient( 'wpconsent_needs_google_consent' ); -
wpconsent-cookies-banner-privacy-suite/trunk/includes/compatibility/loader.php
r3399711 r3417494 37 37 } 38 38 } 39 add_action( 'plugins_loaded', 'wpconsent_load_compatibility_files' );39 add_action( 'plugins_loaded', 'wpconsent_load_compatibility_files', 3 ); -
wpconsent-cookies-banner-privacy-suite/trunk/includes/frontend-scripts.php
r3399711 r3417494 92 92 } 93 93 94 $default = intval( wpconsent()->settings->get_option( 'default_allow', 0 ) ); 94 $default_allow = intval( wpconsent()->settings->get_option( 'default_allow', 0 ) ); 95 $default_state = $default_allow ? 'granted' : 'denied'; 95 96 96 97 // We need to load the Google consent script earlier than other tracking scripts for it to take effect correctly. … … 99 100 (function () { 100 101 window.dataLayer = window.dataLayer || [];function gtag(){dataLayer.push(arguments);} 101 102 let preferences = { 103 marketing: {$default}, 104 statistics: {$default}, 105 } 106 107 // Get preferences directly from cookie 108 const value = `; ` + document.cookie; 109 const parts = value.split(`; wpconsent_preferences=`); 110 if (parts.length === 2) { 111 try { 112 preferences = JSON.parse(parts.pop().split(';').shift()); 113 } catch (e) { 114 console.error('Error parsing WPConsent preferences:', e); 115 } 116 } 117 102 103 // Set the developer ID. 104 gtag('set', 'developer_id.dMmRkYz', true); 105 106 // Set default consent state based on plugin settings. 118 107 gtag('consent', 'default', { 119 'ad_storage': preferences.marketing ? 'granted' : 'denied',120 'analytics_storage': preferences.statistics ? 'granted' : 'denied',121 'ad_user_data': preferences.marketing ? 'granted' : 'denied',122 'ad_personalization': preferences.marketing ? 'granted' : 'denied',108 'ad_storage': '{$default_state}', 109 'analytics_storage': '{$default_state}', 110 'ad_user_data': '{$default_state}', 111 'ad_personalization': '{$default_state}', 123 112 'security_storage': 'granted', 124 'functionality_storage': 'granted' 113 'functionality_storage': 'granted', 114 'wait_for_update': 500, 125 115 }); 126 116 })(); -
wpconsent-cookies-banner-privacy-suite/trunk/includes/lite/admin/class-wpconsent-admin-page-loader-lite.php
r3399711 r3417494 36 36 esc_html__( 'Upgrade to Pro', 'wpconsent-cookies-banner-privacy-suite' ), 37 37 'manage_options', 38 esc_url( wpconsent_utm_url( 'https://wpconsent.com/lite/', ' wpconsent-admin', 'admin-side-menu' ) )38 esc_url( wpconsent_utm_url( 'https://wpconsent.com/lite/', 'admin-side-menu', 'wpconsent-admin' ) ) 39 39 ); 40 40 } -
wpconsent-cookies-banner-privacy-suite/trunk/languages/wpconsent-cookies-banner-privacy-suite.pot
r3399711 r3417494 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: WPConsent 1.1. 1\n"5 "Project-Id-Version: WPConsent 1.1.2\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wpconsent-cookies-banner-privacy-suite\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 2025-1 1-20T12:12:26+00:00\n"12 "POT-Creation-Date: 2025-12-11T14:14:13+00:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 14 "X-Generator: WP-CLI 2.5.0\n" … … 147 147 #: includes/admin/pages/class-wpconsent-admin-page-dashboard.php:94 148 148 #: includes/admin/pages/class-wpconsent-admin-page-tools.php:861 149 #: includes/class-wpconsent-banner.php:4 12150 #: includes/class-wpconsent-banner.php:4 19149 #: includes/class-wpconsent-banner.php:431 150 #: includes/class-wpconsent-banner.php:438 151 151 #: includes/class-wpconsent-strings.php:33 152 152 msgid "Cookie Policy" … … 294 294 295 295 #: includes/admin/admin-scripts.php:84 296 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1 491296 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1578 297 297 msgid "Reset to Defaults" 298 298 msgstr "" … … 693 693 694 694 #: includes/admin/pages/class-wpconsent-admin-page-banner.php:523 695 #: includes/class-wpconsent-banner.php:8 08695 #: includes/class-wpconsent-banner.php:827 696 696 msgid "Cookie Settings" 697 697 msgstr "" … … 868 868 #: includes/admin/pages/class-wpconsent-admin-page-consent-logs.php:78 869 869 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1059 870 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1307 871 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1573 870 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1371 871 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1392 872 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1660 872 873 #: includes/admin/pages/class-wpconsent-admin-page-do-not-track.php:77 873 874 #: includes/admin/pages/class-wpconsent-admin-page-geolocation.php:51 … … 1007 1008 1008 1009 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:218 1009 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1 3211010 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1 8851010 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1408 1011 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1972 1011 1012 #: includes/admin/pages/class-wpconsent-admin-page-do-not-track.php:507 1012 1013 msgid "Save Changes" … … 1219 1220 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:654 1220 1221 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:746 1221 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:14 001222 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1487 1222 1223 msgid "Actions" 1223 1224 msgstr "" … … 1248 1249 1249 1250 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:863 1250 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1 3961251 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1483 1251 1252 msgid "Service" 1252 1253 msgstr "" … … 1299 1300 msgstr "" 1300 1301 1301 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1101 1302 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1076 1303 msgid "Control where and to whom the cookie banner is displayed. Hide the banner for specific user roles or on certain pages." 1304 msgstr "" 1305 1306 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1082 1307 msgid "Logged-in" 1308 msgstr "" 1309 1310 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1090 1311 msgid "Hide the banner for all logged-in users, regardless of their role." 1312 msgstr "" 1313 1314 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1099 1315 msgid "User Roles" 1316 msgstr "" 1317 1318 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1104 1319 msgid "Select user roles..." 1320 msgstr "" 1321 1322 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1106 1323 msgid "Select user roles that should not see the banner. Users with multiple roles will hide the banner if any selected role matches." 1324 msgstr "" 1325 1326 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1115 1327 msgid "Pages" 1328 msgstr "" 1329 1330 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1120 1331 msgid "Start typing to select pages..." 1332 msgstr "" 1333 1334 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1122 1335 msgid "Select specific pages where the banner should be hidden. Useful for login pages, checkout pages, or admin-facing pages." 1336 msgstr "" 1337 1338 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1163 1302 1339 msgid "Default" 1303 1340 msgstr "" 1304 1341 1305 1342 #. Translators: %s is the current WordPress language name. 1306 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1 1621343 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1224 1307 1344 msgid "Select the languages you want to make available for your content. The default language (%s) will be used for the current settings until you configure translations." 1308 1345 msgstr "" 1309 1346 1310 1347 #. Translators: %s is the icon for the language switcher. 1311 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1 1711348 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1233 1312 1349 msgid "Easily switch between languages using the globe icon (%s) in the header of any WPConsent admin page." 1313 1350 msgstr "" 1314 1351 1315 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1 1841352 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1246 1316 1353 msgid "The \"Translate\" button appears for languages that are supported by our translation service. Click the button to start the automatic translation process for your consent banner content. Translation happens asynchronously in the background, and you will be notified when the process is complete." 1317 1354 msgstr "" 1318 1355 1319 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1 1931356 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1255 1320 1357 msgid "Search languages..." 1321 1358 msgstr "" 1322 1359 1323 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:12 031360 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1265 1324 1361 msgid "Selected Languages" 1325 1362 msgstr "" 1326 1363 1327 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:12 201364 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1282 1328 1365 msgid "Available Languages" 1329 1366 msgstr "" 1330 1367 1331 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:12 351368 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1297 1332 1369 msgid "Language Picker" 1333 1370 msgstr "" 1334 1371 1335 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1 2391372 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1301 1336 1373 msgid "Show a language picker in the consent banner" 1337 1374 msgstr "" 1338 1375 1339 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1 2441376 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1306 1340 1377 msgid "This will show a globe icon in the header of the consent banner, allowing users to switch between languages just for the banner/preferences panel even if you do not use a translation plugin. If you are using a translation plugin the banner should automatically display the content in the selected language, if available." 1341 1378 msgstr "" 1342 1379 1343 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1 2961380 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1360 1344 1381 msgid "Custom Iframe/Scripts" 1345 1382 msgstr "" 1346 1383 1347 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:13 001384 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1364 1348 1385 msgid "Custom Scripts/iFrames is a PRO feature" 1349 1386 msgstr "" 1350 1387 1351 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:13 011388 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1365 1352 1389 #: includes/admin/pages/class-wpconsent-admin-page-tools.php:67 1353 1390 msgid "Upgrade to WPConsent PRO today and easily manage custom scripts and iframes. Take full control and block any scripts and iframes from loading until users give consent." 1354 1391 msgstr "" 1355 1392 1356 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:13 031393 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1367 1357 1394 msgid "Upgrade to PRO and Unlock Custom Scripts" 1358 1395 msgstr "" 1359 1396 1360 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1315 1397 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1381 1398 msgid "Hide Banner Rules" 1399 msgstr "" 1400 1401 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1385 1402 msgid "Hide Banner Rules is a PRO feature" 1403 msgstr "" 1404 1405 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1386 1406 msgid "Control where and to whom the cookie banner is displayed. Hide the banner for specific user roles or on certain pages to improve user experience." 1407 msgstr "" 1408 1409 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1388 1410 msgid "Upgrade to PRO and Unlock Hide Banner Rules" 1411 msgstr "" 1412 1413 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1402 1361 1414 msgid "Advanced Settings" 1362 1415 msgstr "" 1363 1416 1364 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1 3371417 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1424 1365 1418 msgid "Add custom iframes or scripts that should be blocked until consent is given." 1366 1419 msgstr "" 1367 1420 1368 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1 3391421 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1426 1369 1422 #: includes/cookie-policy-shortcode.php:71 1370 1423 msgid "Learn more" 1371 1424 msgstr "" 1372 1425 1373 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1 3701374 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1 3761426 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1457 1427 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1463 1375 1428 msgid "Scripts" 1376 1429 msgstr "" 1377 1430 1378 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1 3711431 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1458 1379 1432 msgid "Add scripts for analytics and statistics tracking." 1380 1433 msgstr "" 1381 1434 1382 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1 3771435 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1464 1383 1436 msgid "Add scripts for marketing and advertising purposes." 1384 1437 msgstr "" 1385 1438 1386 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1 3971439 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1484 1387 1440 msgid "Type" 1388 1441 msgstr "" 1389 1442 1390 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1 3981443 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1485 1391 1444 msgid "Script" 1392 1445 msgstr "" 1393 1446 1394 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1 3991447 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1486 1395 1448 msgid "Blocked Elements" 1396 1449 msgstr "" 1397 1450 1398 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1 4371451 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1524 1399 1452 msgid "Add Custom iFrame/Script" 1400 1453 msgstr "" 1401 1454 1402 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1 4541455 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1541 1403 1456 msgid "Clarity Consent Mode" 1404 1457 msgstr "" 1405 1458 1406 1459 #. translators: %1$s is an opening link tag, %2$s is a closing link tag. 1407 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1 4601460 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1547 1408 1461 msgid "Use Microsoft Clarity without cookies until consent is given. %1$sLearn More%2$s" 1409 1462 msgstr "" 1410 1463 1411 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1 4641464 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1551 1412 1465 msgid "Clarity Consent Mode will not be loaded if the banner is disabled." 1413 1466 msgstr "" 1414 1467 1415 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1 4691468 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1556 1416 1469 msgid "Shared Consent" 1417 1470 msgstr "" 1418 1471 1419 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1 4731472 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1560 1420 1473 msgid "Share cookie preferences across all subdomains. MUST be enabled on all subdomain sites using WPConsent." 1421 1474 msgstr "" 1422 1475 1423 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1 4741476 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1561 1424 1477 msgid "Preferences set on example.com will automatically apply to blog.example.com, shop.example.com, and any other subdomain. All subdomain sites must have this setting enabled." 1425 1478 msgstr "" 1426 1479 1427 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1 4791480 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1566 1428 1481 msgid "Respect Global Privacy Controls" 1429 1482 msgstr "" 1430 1483 1431 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1 4831484 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1570 1432 1485 msgid "Automatically respect Global Privacy Control (GPC) signals from user browsers." 1433 1486 msgstr "" 1434 1487 1435 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1 4841488 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1571 1436 1489 msgid "When enabled, users with GPC enabled in their browser will automatically have non-essential cookies declined and will not see the consent banner. This helps comply with privacy regulations by respecting user-set privacy preferences." 1437 1490 msgstr "" 1438 1491 1439 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:15 021492 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1589 1440 1493 msgid "Remove all data" 1441 1494 msgstr "" 1442 1495 1443 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:15 061496 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1593 1444 1497 msgid "Remove all data when uninstalling the plugin." 1445 1498 msgstr "" 1446 1499 1447 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:15 071500 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1594 1448 1501 msgid "All cookie data and configuration will be unrecoverable." 1449 1502 msgstr "" 1450 1503 1451 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1 5241504 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1611 1452 1505 msgid "Reset Content to Defaults" 1453 1506 msgstr "" 1454 1507 1455 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1 5281508 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1615 1456 1509 msgid "This will reset all banner content and default categories/cookies (banner messages, preferences panel, button texts, categories, etc.) to the default English state. This action cannot be undone." 1457 1510 msgstr "" 1458 1511 1459 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1 5411512 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1628 1460 1513 msgid "Allow Usage Tracking" 1461 1514 msgstr "" 1462 1515 1463 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1 5451516 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1632 1464 1517 msgid "By allowing us to track usage data, we can better help you, as we will know which WordPress configurations, themes, and plugins we should test." 1465 1518 msgstr "" 1466 1519 1467 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1 5661520 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1653 1468 1521 msgid "IAB TCF is a PRO feature" 1469 1522 msgstr "" 1470 1523 1471 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1 5671524 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1654 1472 1525 msgid "Upgrade to WPConsent PRO today to enable IAB Transparency & Consent Framework v2.2 support. Manage vendor consents, publisher restrictions, and ensure compliance with the TCF specification." 1473 1526 msgstr "" 1474 1527 1475 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1 5691528 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1656 1476 1529 msgid "Upgrade to PRO and Unlock IAB TCF" 1477 1530 msgstr "" 1478 1531 1479 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1 6291532 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1716 1480 1533 msgid "Enable TCF on Frontend" 1481 1534 msgstr "" 1482 1535 1483 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1 6341536 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1721 1484 1537 msgid "Enable this setting to load the IAB TCF (Transparency and Consent Framework) on the frontend of your website." 1485 1538 msgstr "" 1486 1539 1487 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1 6381540 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1725 1488 1541 msgid "TCF Activation" 1489 1542 msgstr "" 1490 1543 1491 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1 6631492 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:19 111544 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1750 1545 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1998 1493 1546 msgid "Allow Legitimate Interest (Default)" 1494 1547 msgstr "" 1495 1548 1496 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1 6641497 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:19 121549 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1751 1550 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1999 1498 1551 msgid "Disallow Legitimate Interest for All Purposes" 1499 1552 msgstr "" 1500 1553 1501 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1 6651502 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php: 19131554 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1752 1555 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:2000 1503 1556 msgid "Disallow Legitimate Interest for Specific Purposes" 1504 1557 msgstr "" 1505 1558 1506 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1 6691507 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php: 19171559 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1756 1560 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:2004 1508 1561 msgid "Legitimate Interest" 1509 1562 msgstr "" 1510 1563 1511 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1 6741512 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php: 19221564 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1761 1565 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:2009 1513 1566 msgid "Control whether vendors can use legitimate interest as a legal basis for data processing." 1514 1567 msgstr "" 1515 1568 1516 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1 6801517 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php: 19311569 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1767 1570 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:2018 1518 1571 msgid "Select Purposes" 1519 1572 msgstr "" 1520 1573 1521 1574 #. Translators: 1: Purpose ID, 2: Purpose Name. 1522 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1 6911523 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php: 19421575 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1778 1576 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:2029 1524 1577 msgid "Purpose %1$d: %2$s" 1525 1578 msgstr "" 1526 1579 1527 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1 6981528 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php: 19491580 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1785 1581 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:2036 1529 1582 msgid "Select specific purposes for which legitimate interest should be disallowed globally." 1530 1583 msgstr "" 1531 1584 1532 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:17 071533 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php: 19581585 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1794 1586 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:2045 1534 1587 msgid "Global Vendor Restrictions" 1535 1588 msgstr "" 1536 1589 1537 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:17 091538 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php: 19601590 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1796 1591 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:2047 1539 1592 msgid "Apply restrictions to all vendors at once. These settings allow you to enforce stricter data policies across all selected vendors." 1540 1593 msgstr "" 1541 1594 1542 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1 7331543 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php: 19961595 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1820 1596 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:2083 1544 1597 msgid "Declare which TCF purposes this website (as a first party) uses for its own data processing. These declarations are separate from vendor consents and communicate your website's data processing activities to vendors via the TC String." 1545 1598 msgstr "" 1546 1599 1547 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1 7411548 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:20 041600 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1828 1601 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:2091 1549 1602 msgid "Purposes (Consent)" 1550 1603 msgstr "" 1551 1604 1552 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1 7421553 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:20 051605 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1829 1606 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:2092 1554 1607 msgid "selected" 1555 1608 msgstr "" 1556 1609 1557 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1 7471558 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:20 101610 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1834 1611 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:2097 1559 1612 msgid "Select each purpose this website requests consent for." 1560 1613 msgstr "" 1561 1614 1562 1615 #. Translators: Purpose ID. 1563 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1 7611564 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1 8151565 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:2 0241566 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:2 0751616 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1848 1617 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1902 1618 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:2111 1619 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:2162 1567 1620 msgid "Purpose %d" 1568 1621 msgstr "" 1569 1622 1570 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1 7791571 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:2 0381623 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1866 1624 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:2125 1572 1625 msgid "Purposes (Legitimate Interest)" 1573 1626 msgstr "" … … 1575 1628 #. Translators: 1: number of selected purposes, 2: total number of available purposes. 1576 1629 #. translators: 1: number of selected purposes, 2: total number of available purposes 1577 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1 7871578 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:2 0471630 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1874 1631 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:2134 1579 1632 msgid "(%1$d/%2$d selected)" 1580 1633 msgstr "" 1581 1634 1582 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1 7971583 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:2 0571635 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1884 1636 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:2144 1584 1637 msgid "Select each purpose this website claims legitimate interest for. Only certain purposes allow legitimate interest under TCF policy." 1585 1638 msgstr "" 1586 1639 1587 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1 8281588 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:2 0881640 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1915 1641 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:2175 1589 1642 msgid "Publisher Data Processing Declarations" 1590 1643 msgstr "" 1591 1644 1592 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1 8301593 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:2 0901645 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1917 1646 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:2177 1594 1647 msgid "Declare which TCF purposes your website uses for its own data processing. These declarations are encoded in the TC String and communicated to vendors." 1595 1648 msgstr "" 1596 1649 1597 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1 8481650 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1935 1598 1651 msgid "Search vendors by name or ID..." 1599 1652 msgstr "" 1600 1653 1601 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1 8521654 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1939 1602 1655 msgid "Search" 1603 1656 msgstr "" 1604 1657 1605 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1 8551658 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1942 1606 1659 msgid "Clear" 1607 1660 msgstr "" 1608 1661 1609 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1 8601662 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1947 1610 1663 msgid "All Vendors" 1611 1664 msgstr "" 1612 1665 1613 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1 8611666 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1948 1614 1667 msgid "Selected" 1615 1668 msgstr "" 1616 1669 1617 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1 8621670 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1949 1618 1671 msgid "Not Selected" 1619 1672 msgstr "" 1620 1673 1621 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1 8651674 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1952 1622 1675 msgid "Name A-Z" 1623 1676 msgstr "" 1624 1677 1625 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1 8661678 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1953 1626 1679 msgid "Name Z-A" 1627 1680 msgstr "" 1628 1681 1629 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1 8671682 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1954 1630 1683 msgid "ID Low-High" 1631 1684 msgstr "" 1632 1685 1633 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1 8681686 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1955 1634 1687 msgid "ID High-Low" 1635 1688 msgstr "" 1636 1689 1637 1690 #. Translators: %d is the total number of vendors. 1638 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1 8771691 #: includes/admin/pages/class-wpconsent-admin-page-cookies.php:1964 1639 1692 msgid "Showing %d vendors" 1640 1693 msgstr "" … … 2606 2659 msgstr "" 2607 2660 2608 #: includes/class-wpconsent-banner.php:2 162661 #: includes/class-wpconsent-banner.php:226 2609 2662 msgid "Cookie Consent" 2610 2663 msgstr "" 2611 2664 2612 #: includes/class-wpconsent-banner.php:2 532613 #: includes/class-wpconsent-banner.php:3 112665 #: includes/class-wpconsent-banner.php:263 2666 #: includes/class-wpconsent-banner.php:321 2614 2667 #: includes/class-wpconsent-strings.php:36 2615 2668 msgid "Close" … … 2619 2672 #. translators: %s: Category name 2620 2673 #. translators: %s: Service name 2621 #: includes/class-wpconsent-banner.php: 3952622 #: includes/class-wpconsent-banner.php:5 482623 #: includes/class-wpconsent-banner.php:6 742674 #: includes/class-wpconsent-banner.php:414 2675 #: includes/class-wpconsent-banner.php:567 2676 #: includes/class-wpconsent-banner.php:693 2624 2677 msgid "Toggle %s" 2625 2678 msgstr "" 2626 2679 2627 2680 #. translators: 1: Cookie policy URL, 2: Privacy policy URL 2628 #: includes/class-wpconsent-banner.php:4 112681 #: includes/class-wpconsent-banner.php:430 2629 2682 msgid "You can find more information about our %1$s and %2$s." 2630 2683 msgstr "" 2631 2684 2632 #: includes/class-wpconsent-banner.php:4 132685 #: includes/class-wpconsent-banner.php:432 2633 2686 msgid "Privacy Policy" 2634 2687 msgstr "" 2635 2688 2636 2689 #. translators: %s: Cookie policy URL 2637 #: includes/class-wpconsent-banner.php:4 182690 #: includes/class-wpconsent-banner.php:437 2638 2691 msgid "You can find more information in our %s." 2639 2692 msgstr "" 2640 2693 2641 2694 #. translators: %1$s: Service URL label, %2$s: Service URL 2642 #: includes/class-wpconsent-banner.php:7 162695 #: includes/class-wpconsent-banner.php:735 2643 2696 msgid "%1$s: %2$s" 2644 2697 msgstr "" 2645 2698 2646 #: includes/class-wpconsent-banner.php:7 182647 #: includes/class-wpconsent-banner.php: 7852699 #: includes/class-wpconsent-banner.php:737 2700 #: includes/class-wpconsent-banner.php:804 2648 2701 msgid "(opens in a new window)" 2649 2702 msgstr "" 2650 2703 2651 2704 #. translators: %1$s and %2$s add a tag used for hiding the text on small screens and %3$s is the WPConsent logo svg 2652 #: includes/class-wpconsent-banner.php:7 802705 #: includes/class-wpconsent-banner.php:799 2653 2706 msgid "%1$sPowered by%2$s %3$s" 2654 2707 msgstr "" 2655 2708 2656 #: includes/class-wpconsent-banner.php:8 032709 #: includes/class-wpconsent-banner.php:822 2657 2710 #: includes/class-wpconsent-cookies.php:371 2658 #: includes/class-wpconsent-cookies.php: 7992711 #: includes/class-wpconsent-cookies.php:804 2659 2712 #: includes/class-wpconsent-strings.php:31 2660 2713 msgid "Cookie Preferences" … … 2668 2721 #. translators: %s: The category name (e.g., analytics, marketing) 2669 2722 #: includes/class-wpconsent-content-placeholder.php:195 2670 #: includes/class-wpconsent-cookie-blocking.php: 3892723 #: includes/class-wpconsent-cookie-blocking.php:438 2671 2724 msgid "Click here to accept %s cookies and load this content" 2672 2725 msgstr "" … … 2697 2750 2698 2751 #: includes/class-wpconsent-cookies.php:372 2699 #: includes/class-wpconsent-cookies.php:80 02752 #: includes/class-wpconsent-cookies.php:805 2700 2753 msgid "This cookie is used to store the user's cookie consent preferences." 2701 2754 msgstr "" -
wpconsent-cookies-banner-privacy-suite/trunk/readme.txt
r3399711 r3417494 3 3 Tags: consent, cookie, cookie notice, cookie consent, gdpr 4 4 Requires at least: 5.6 5 Tested up to: 6. 85 Tested up to: 6.9 6 6 Requires PHP: 7.0 7 Stable tag: 1.1. 17 Stable tag: 1.1.2 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 136 136 137 137 == Changelog == 138 139 = 1.1.2 = 140 * Tweak: We adjusted our Google Consent Mode v2 implementation for better default consent handling. 141 * Tweak: We added an extra check in our script blocking functionality to avoid conflicts with other plugins that use output buffering in WP 6.9. 142 * Fix: Empty categories are no longer displayed in the preferences panel. 138 143 139 144 = 1.1.1 = -
wpconsent-cookies-banner-privacy-suite/trunk/src/frontend/banner.js
r3399711 r3417494 446 446 // Send a custom event on the document when consent is processed. 447 447 document.dispatchEvent( new CustomEvent( 'wpconsent_consent_processed', {detail: preferences} ) ); 448 449 // Include our developer id. 450 WPConsent.localGtag( 'set', 'developer_id.dMmRkYz', true ); 451 452 // Update gtag consent state. 453 WPConsent.localGtag( 454 'consent', 455 'update', 456 { 457 'ad_storage': preferences.marketing ? 'granted' : 'denied', 458 'analytics_storage': preferences.statistics ? 'granted' : 'denied', 459 'ad_user_data': preferences.marketing ? 'granted' : 'denied', 460 'ad_personalization': preferences.marketing ? 'granted' : 'denied' 461 } 462 ); 448 463 449 464 // Push event to GTM dataLayer for tag triggering. … … 710 725 } ); 711 726 this.shadowRoot.querySelector( '.wpconsent-close-preferences' )?.addEventListener( 'click', () => this.closePreferences() ); 712 713 window.addEventListener( 'wpconsent_consent_saved', function ( event ) {714 // Passed detail is preferences.715 const preferences = event.detail;716 WPConsent.localGtag( 'consent', 'update', {717 'ad_storage': preferences.marketing ? 'granted' : 'denied',718 'analytics_storage': preferences.statistics ? 'granted' : 'denied',719 'ad_user_data': preferences.marketing ? 'granted' : 'denied',720 'ad_personalization': preferences.marketing ? 'granted' : 'denied',721 'security_storage': 'granted',722 'functionality_storage': 'granted'723 } );724 } );725 727 726 728 window.addEventListener( 'wpconsent_consent_saved', function ( event ) { -
wpconsent-cookies-banner-privacy-suite/trunk/wpconsent.php
r3399711 r3417494 3 3 * Plugin Name: WPConsent 4 4 * Description: Improve your WordPress website privacy compliance. Custom cookie banner, website scanner, automatic script blocking, and easy cookie configuration. 5 * Version: 1.1. 15 * Version: 1.1.2 6 6 * Author: WPConsent 7 7 * Author URI: https://wpconsent.com
Note: See TracChangeset
for help on using the changeset viewer.