Changeset 2697591
- Timestamp:
- 03/22/2022 10:05:58 AM (4 years ago)
- Location:
- consent-manager
- Files:
-
- 19 added
- 5 edited
-
tags/2.0.5 (added)
-
tags/2.0.5/ConsentManagerMain.php (added)
-
tags/2.0.5/assets (added)
-
tags/2.0.5/assets/css (added)
-
tags/2.0.5/assets/css/admin.css (added)
-
tags/2.0.5/assets/images (added)
-
tags/2.0.5/assets/images/cmpcdn.png (added)
-
tags/2.0.5/assets/images/cmpcodeid.png (added)
-
tags/2.0.5/assets/images/cmphost.png (added)
-
tags/2.0.5/assets/images/cmpid.png (added)
-
tags/2.0.5/assets/images/logo20.png (added)
-
tags/2.0.5/assets/images/logo_neu.jpg (added)
-
tags/2.0.5/assets/images/logo_neu.png (added)
-
tags/2.0.5/consentmanager.php (added)
-
tags/2.0.5/readme.txt (added)
-
tags/2.0.5/views (added)
-
tags/2.0.5/views/admin.php (added)
-
trunk/ConsentManagerMain.php (modified) (3 diffs)
-
trunk/assets/css/admin.css (modified) (3 diffs)
-
trunk/assets/images/cmpcdn.png (added)
-
trunk/assets/images/cmphost.png (added)
-
trunk/consentmanager.php (modified) (8 diffs)
-
trunk/readme.txt (modified) (1 diff)
-
trunk/views/admin.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
consent-manager/trunk/ConsentManagerMain.php
r2680970 r2697591 9 9 const OPTION_ID = 'consent_manager_id'; 10 10 const OPTION_CODEID = 'consent_manager_code_id'; 11 const OPTION_HOST = 'consent_manager_host'; 12 const OPTION_CDN = 'consent_manager_cdn'; 11 13 const OPTION_MODE = 'consent_manager_mode'; 12 14 const OPTION_IGNORE_DOMAINS = 'consent_manager_ignore_domains'; … … 45 47 { 46 48 return self::OPTION_CODEID; 49 } 50 51 /** 52 * @return string 53 */ 54 public static function getOptionHost() 55 { 56 return self::OPTION_HOST; 57 } 58 59 /** 60 * @return string 61 */ 62 public static function getOptionCDN() 63 { 64 return self::OPTION_CDN; 47 65 } 48 66 … … 88 106 89 107 /** 90 * @param int $id 91 * @param string $codeID 108 * @param $id 109 * @param $codeID 110 * @param $host 111 * @param $cdn 92 112 * @return string 93 113 */ 94 static function getSemiBlockingCode($id, $codeID )114 static function getSemiBlockingCode($id, $codeID, $host, $cdn) 95 115 { 96 return '<script>window.gdprAppliesGlobally=true;if(!("cmp_id" in window)||window.cmp_id<1){window.cmp_id=' . $id . '}if(!("cmp_cdid" in window)){window.cmp_cdid="' . $codeID . '"}if(!("cmp_params" in window)){window.cmp_params=""}if(!("cmp_host" in window)){window.cmp_host="' . self::getHost() . '"}if(!("cmp_cdn" in window)){window.cmp_cdn="' . self::getCDN(). '"}if(!("cmp_proto" in window)){window.cmp_proto="https:"}if(!("cmp_codesrc" in window)){window.cmp_codesrc="10"}window.cmp_getsupportedLangs=function(){var b=["DE","EN","FR","IT","NO","DA","FI","ES","PT","RO","BG","ET","EL","GA","HR","LV","LT","MT","NL","PL","SV","SK","SL","CS","HU","RU","SR","ZH","TR","UK","AR","BS"];if("cmp_customlanguages" in window){for(var a=0;a<window.cmp_customlanguages.length;a++){b.push(window.cmp_customlanguages[a].l.toUpperCase())}}return b};window.cmp_getRTLLangs=function(){return["AR"]};window.cmp_getlang=function(j){if(typeof(j)!="boolean"){j=true}if(j&&typeof(cmp_getlang.usedlang)=="string"&&cmp_getlang.usedlang!==""){return cmp_getlang.usedlang}var g=window.cmp_getsupportedLangs();var c=[];var f=location.hash;var e=location.search;var a="languages" in navigator?navigator.languages:[];if(f.indexOf("cmplang=")!=-1){c.push(f.substr(f.indexOf("cmplang=")+8,2).toUpperCase())}else{if(e.indexOf("cmplang=")!=-1){c.push(e.substr(e.indexOf("cmplang=")+8,2).toUpperCase())}else{if("cmp_setlang" in window&&window.cmp_setlang!=""){c.push(window.cmp_setlang.toUpperCase())}else{if(a.length>0){for(var d=0;d<a.length;d++){c.push(a[d])}}}}}if("language" in navigator){c.push(navigator.language)}if("userLanguage" in navigator){c.push(navigator.userLanguage)}var h="";for(var d=0;d<c.length;d++){var b=c[d].toUpperCase();if(g.indexOf(b)!=-1){h=b;break}if(b.indexOf("-")!=-1){b=b.substr(0,2)}if(g.indexOf(b)!=-1){h=b;break}}if(h==""&&typeof(cmp_getlang.defaultlang)=="string"&&cmp_getlang.defaultlang!==""){return cmp_getlang.defaultlang}else{if(h==""){h="EN"}}h=h.toUpperCase();return h};(function(){var n=document;var p=window;var f="";var b="_en";if("cmp_getlang" in p){f=p.cmp_getlang().toLowerCase();if("cmp_customlanguages" in p){for(var h=0;h<p.cmp_customlanguages.length;h++){if(p.cmp_customlanguages[h].l.toUpperCase()==f.toUpperCase()){f="en";break}}}b="_"+f}function g(e,d){var l="";e+="=";var i=e.length;if(location.hash.indexOf(e)!=-1){l=location.hash.substr(location.hash.indexOf(e)+i,9999)}else{if(location.search.indexOf(e)!=-1){l=location.search.substr(location.search.indexOf(e)+i,9999)}else{return d}}if(l.indexOf("&")!=-1){l=l.substr(0,l.indexOf("&"))}return l}var j=("cmp_proto" in p)?p.cmp_proto:"https:";var o=["cmp_id","cmp_params","cmp_host","cmp_cdn","cmp_proto"];for(var h=0;h<o.length;h++){if(g(o[h],"%%%")!="%%%"){window[o[h]]=g(o[h],"")}}var k=("cmp_ref" in p)?p.cmp_ref:location.href;var q=n.createElement("script");q.setAttribute("data-cmp-ab","1");var c=g("cmpdesign","");var a=g("cmpregulationkey","");q.src=j+"//"+p.cmp_host+"/delivery/cmp.php?"+("cmp_id" in p&&p.cmp_id>0?"id="+p.cmp_id:"")+("cmp_cdid" in p?"cdid="+p.cmp_cdid:"")+"&h="+encodeURIComponent(k)+(c!=""?"&cmpdesign="+encodeURIComponent(c):"")+(a!=""?"&cmpregulationkey="+encodeURIComponent(a):"")+("cmp_params" in p?"&"+p.cmp_params:"")+(n.cookie.length>0?"&__cmpfcc=1":"")+"&l="+f.toLowerCase()+"&o="+(new Date()).getTime();q.type="text/javascript";q.async=true;if(n.currentScript){n.currentScript.parentElement.appendChild(q)}else{if(n.body){n.body.appendChild(q)}else{var m=n.getElementsByTagName("body");if(m.length==0){m=n.getElementsByTagName("div")}if(m.length==0){m=n.getElementsByTagName("span")}if(m.length==0){m=n.getElementsByTagName("ins")}if(m.length==0){m=n.getElementsByTagName("script")}if(m.length==0){m=n.getElementsByTagName("head")}if(m.length>0){m[0].appendChild(q)}}}var q=n.createElement("script");q.src=j+"//"+p.cmp_cdn+"/delivery/js/cmp"+b+".min.js";q.type="text/javascript";q.setAttribute("data-cmp-ab","1");q.async=true;if(n.currentScript){n.currentScript.parentElement.appendChild(q)}else{if(n.body){n.body.appendChild(q)}else{var m=n.getElementsByTagName("body");if(m.length==0){m=n.getElementsByTagName("div")}if(m.length==0){m=n.getElementsByTagName("span")}if(m.length==0){m=n.getElementsByTagName("ins")}if(m.length==0){m=n.getElementsByTagName("script")}if(m.length==0){m=n.getElementsByTagName("head")}if(m.length>0){m[0].appendChild(q)}}}})();window.cmp_addFrame=function(b){if(!window.frames[b]){if(document.body){var a=document.createElement("iframe");a.style.cssText="display:none";a.name=b;document.body.appendChild(a)}else{window.setTimeout(window.cmp_addFrame,10,b)}}};window.cmp_rc=function(h){var b=document.cookie;var f="";var d=0;while(b!=""&&d<100){d++;while(b.substr(0,1)==" "){b=b.substr(1,b.length)}var g=b.substring(0,b.indexOf("="));if(b.indexOf(";")!=-1){var c=b.substring(b.indexOf("=")+1,b.indexOf(";"))}else{var c=b.substr(b.indexOf("=")+1,b.length)}if(h==g){f=c}var e=b.indexOf(";")+1;if(e==0){e=b.length}b=b.substring(e,b.length)}return(f)};window.cmp_stub=function(){var a=arguments;__cmapi.a=__cmapi.a||[];if(!a.length){return __cmapi.a}else{if(a[0]==="ping"){if(a[1]===2){a[2]({gdprApplies:gdprAppliesGlobally,cmpLoaded:false,cmpStatus:"stub",displayStatus:"hidden",apiVersion:"2.0",cmpId:31},true)}else{a[2](false,true)}}else{if(a[0]==="getUSPData"){a[2]({version:1,uspString:window.cmp_rc("")},true)}else{if(a[0]==="getTCData"){__cmapi.a.push([].slice.apply(a))}else{if(a[0]==="addEventListener"||a[0]==="removeEventListener"){__cmapi.a.push([].slice.apply(a))}else{if(a.length==4&&a[3]===false){a[2]({},false)}else{__cmapi.a.push([].slice.apply(a))}}}}}}};window.cmp_msghandler=function(d){var a=typeof d.data==="string";try{var c=a?JSON.parse(d.data):d.data}catch(f){var c=null}if(typeof(c)==="object"&&c!==null&&"__cmpCall" in c){var b=c.__cmpCall;window.__cmp(b.command,b.parameter,function(h,g){var e={__cmpReturn:{returnValue:h,success:g,callId:b.callId}};d.source.postMessage(a?JSON.stringify(e):e,"*")})}if(typeof(c)==="object"&&c!==null&&"__cmapiCall" in c){var b=c.__cmapiCall;window.__cmapi(b.command,b.parameter,function(h,g){var e={__cmapiReturn:{returnValue:h,success:g,callId:b.callId}};d.source.postMessage(a?JSON.stringify(e):e,"*")})}if(typeof(c)==="object"&&c!==null&&"__uspapiCall" in c){var b=c.__uspapiCall;window.__uspapi(b.command,b.version,function(h,g){var e={__uspapiReturn:{returnValue:h,success:g,callId:b.callId}};d.source.postMessage(a?JSON.stringify(e):e,"*")})}if(typeof(c)==="object"&&c!==null&&"__tcfapiCall" in c){var b=c.__tcfapiCall;window.__tcfapi(b.command,b.version,function(h,g){var e={__tcfapiReturn:{returnValue:h,success:g,callId:b.callId}};d.source.postMessage(a?JSON.stringify(e):e,"*")},b.parameter)}};window.cmp_setStub=function(a){if(!(a in window)||(typeof(window[a])!=="function"&&typeof(window[a])!=="object"&&(typeof(window[a])==="undefined"||window[a]!==null))){window[a]=window.cmp_stub;window[a].msgHandler=window.cmp_msghandler;window.addEventListener("message",window.cmp_msghandler,false)}};window.cmp_addFrame("__cmapiLocator");window.cmp_addFrame("__cmpLocator");window.cmp_addFrame("__uspapiLocator");window.cmp_addFrame("__tcfapiLocator");window.cmp_setStub("__cmapi");window.cmp_setStub("__cmp");window.cmp_setStub("__tcfapi");window.cmp_setStub("__uspapi");</script>';116 return '<script>window.gdprAppliesGlobally=true;if(!("cmp_id" in window)||window.cmp_id<1){window.cmp_id=' . $id . '}if(!("cmp_cdid" in window)){window.cmp_cdid="' . $codeID . '"}if(!("cmp_params" in window)){window.cmp_params=""}if(!("cmp_host" in window)){window.cmp_host="' . $host . '"}if(!("cmp_cdn" in window)){window.cmp_cdn="' . $cdn . '"}if(!("cmp_proto" in window)){window.cmp_proto="https:"}if(!("cmp_codesrc" in window)){window.cmp_codesrc="10"}window.cmp_getsupportedLangs=function(){var b=["DE","EN","FR","IT","NO","DA","FI","ES","PT","RO","BG","ET","EL","GA","HR","LV","LT","MT","NL","PL","SV","SK","SL","CS","HU","RU","SR","ZH","TR","UK","AR","BS"];if("cmp_customlanguages" in window){for(var a=0;a<window.cmp_customlanguages.length;a++){b.push(window.cmp_customlanguages[a].l.toUpperCase())}}return b};window.cmp_getRTLLangs=function(){return["AR"]};window.cmp_getlang=function(j){if(typeof(j)!="boolean"){j=true}if(j&&typeof(cmp_getlang.usedlang)=="string"&&cmp_getlang.usedlang!==""){return cmp_getlang.usedlang}var g=window.cmp_getsupportedLangs();var c=[];var f=location.hash;var e=location.search;var a="languages" in navigator?navigator.languages:[];if(f.indexOf("cmplang=")!=-1){c.push(f.substr(f.indexOf("cmplang=")+8,2).toUpperCase())}else{if(e.indexOf("cmplang=")!=-1){c.push(e.substr(e.indexOf("cmplang=")+8,2).toUpperCase())}else{if("cmp_setlang" in window&&window.cmp_setlang!=""){c.push(window.cmp_setlang.toUpperCase())}else{if(a.length>0){for(var d=0;d<a.length;d++){c.push(a[d])}}}}}if("language" in navigator){c.push(navigator.language)}if("userLanguage" in navigator){c.push(navigator.userLanguage)}var h="";for(var d=0;d<c.length;d++){var b=c[d].toUpperCase();if(g.indexOf(b)!=-1){h=b;break}if(b.indexOf("-")!=-1){b=b.substr(0,2)}if(g.indexOf(b)!=-1){h=b;break}}if(h==""&&typeof(cmp_getlang.defaultlang)=="string"&&cmp_getlang.defaultlang!==""){return cmp_getlang.defaultlang}else{if(h==""){h="EN"}}h=h.toUpperCase();return h};(function(){var n=document;var p=window;var f="";var b="_en";if("cmp_getlang" in p){f=p.cmp_getlang().toLowerCase();if("cmp_customlanguages" in p){for(var h=0;h<p.cmp_customlanguages.length;h++){if(p.cmp_customlanguages[h].l.toUpperCase()==f.toUpperCase()){f="en";break}}}b="_"+f}function g(e,d){var l="";e+="=";var i=e.length;if(location.hash.indexOf(e)!=-1){l=location.hash.substr(location.hash.indexOf(e)+i,9999)}else{if(location.search.indexOf(e)!=-1){l=location.search.substr(location.search.indexOf(e)+i,9999)}else{return d}}if(l.indexOf("&")!=-1){l=l.substr(0,l.indexOf("&"))}return l}var j=("cmp_proto" in p)?p.cmp_proto:"https:";var o=["cmp_id","cmp_params","cmp_host","cmp_cdn","cmp_proto"];for(var h=0;h<o.length;h++){if(g(o[h],"%%%")!="%%%"){window[o[h]]=g(o[h],"")}}var k=("cmp_ref" in p)?p.cmp_ref:location.href;var q=n.createElement("script");q.setAttribute("data-cmp-ab","1");var c=g("cmpdesign","");var a=g("cmpregulationkey","");q.src=j+"//"+p.cmp_host+"/delivery/cmp.php?"+("cmp_id" in p&&p.cmp_id>0?"id="+p.cmp_id:"")+("cmp_cdid" in p?"cdid="+p.cmp_cdid:"")+"&h="+encodeURIComponent(k)+(c!=""?"&cmpdesign="+encodeURIComponent(c):"")+(a!=""?"&cmpregulationkey="+encodeURIComponent(a):"")+("cmp_params" in p?"&"+p.cmp_params:"")+(n.cookie.length>0?"&__cmpfcc=1":"")+"&l="+f.toLowerCase()+"&o="+(new Date()).getTime();q.type="text/javascript";q.async=true;if(n.currentScript){n.currentScript.parentElement.appendChild(q)}else{if(n.body){n.body.appendChild(q)}else{var m=n.getElementsByTagName("body");if(m.length==0){m=n.getElementsByTagName("div")}if(m.length==0){m=n.getElementsByTagName("span")}if(m.length==0){m=n.getElementsByTagName("ins")}if(m.length==0){m=n.getElementsByTagName("script")}if(m.length==0){m=n.getElementsByTagName("head")}if(m.length>0){m[0].appendChild(q)}}}var q=n.createElement("script");q.src=j+"//"+p.cmp_cdn+"/delivery/js/cmp"+b+".min.js";q.type="text/javascript";q.setAttribute("data-cmp-ab","1");q.async=true;if(n.currentScript){n.currentScript.parentElement.appendChild(q)}else{if(n.body){n.body.appendChild(q)}else{var m=n.getElementsByTagName("body");if(m.length==0){m=n.getElementsByTagName("div")}if(m.length==0){m=n.getElementsByTagName("span")}if(m.length==0){m=n.getElementsByTagName("ins")}if(m.length==0){m=n.getElementsByTagName("script")}if(m.length==0){m=n.getElementsByTagName("head")}if(m.length>0){m[0].appendChild(q)}}}})();window.cmp_addFrame=function(b){if(!window.frames[b]){if(document.body){var a=document.createElement("iframe");a.style.cssText="display:none";a.name=b;document.body.appendChild(a)}else{window.setTimeout(window.cmp_addFrame,10,b)}}};window.cmp_rc=function(h){var b=document.cookie;var f="";var d=0;while(b!=""&&d<100){d++;while(b.substr(0,1)==" "){b=b.substr(1,b.length)}var g=b.substring(0,b.indexOf("="));if(b.indexOf(";")!=-1){var c=b.substring(b.indexOf("=")+1,b.indexOf(";"))}else{var c=b.substr(b.indexOf("=")+1,b.length)}if(h==g){f=c}var e=b.indexOf(";")+1;if(e==0){e=b.length}b=b.substring(e,b.length)}return(f)};window.cmp_stub=function(){var a=arguments;__cmapi.a=__cmapi.a||[];if(!a.length){return __cmapi.a}else{if(a[0]==="ping"){if(a[1]===2){a[2]({gdprApplies:gdprAppliesGlobally,cmpLoaded:false,cmpStatus:"stub",displayStatus:"hidden",apiVersion:"2.0",cmpId:31},true)}else{a[2](false,true)}}else{if(a[0]==="getUSPData"){a[2]({version:1,uspString:window.cmp_rc("")},true)}else{if(a[0]==="getTCData"){__cmapi.a.push([].slice.apply(a))}else{if(a[0]==="addEventListener"||a[0]==="removeEventListener"){__cmapi.a.push([].slice.apply(a))}else{if(a.length==4&&a[3]===false){a[2]({},false)}else{__cmapi.a.push([].slice.apply(a))}}}}}}};window.cmp_msghandler=function(d){var a=typeof d.data==="string";try{var c=a?JSON.parse(d.data):d.data}catch(f){var c=null}if(typeof(c)==="object"&&c!==null&&"__cmpCall" in c){var b=c.__cmpCall;window.__cmp(b.command,b.parameter,function(h,g){var e={__cmpReturn:{returnValue:h,success:g,callId:b.callId}};d.source.postMessage(a?JSON.stringify(e):e,"*")})}if(typeof(c)==="object"&&c!==null&&"__cmapiCall" in c){var b=c.__cmapiCall;window.__cmapi(b.command,b.parameter,function(h,g){var e={__cmapiReturn:{returnValue:h,success:g,callId:b.callId}};d.source.postMessage(a?JSON.stringify(e):e,"*")})}if(typeof(c)==="object"&&c!==null&&"__uspapiCall" in c){var b=c.__uspapiCall;window.__uspapi(b.command,b.version,function(h,g){var e={__uspapiReturn:{returnValue:h,success:g,callId:b.callId}};d.source.postMessage(a?JSON.stringify(e):e,"*")})}if(typeof(c)==="object"&&c!==null&&"__tcfapiCall" in c){var b=c.__tcfapiCall;window.__tcfapi(b.command,b.version,function(h,g){var e={__tcfapiReturn:{returnValue:h,success:g,callId:b.callId}};d.source.postMessage(a?JSON.stringify(e):e,"*")},b.parameter)}};window.cmp_setStub=function(a){if(!(a in window)||(typeof(window[a])!=="function"&&typeof(window[a])!=="object"&&(typeof(window[a])==="undefined"||window[a]!==null))){window[a]=window.cmp_stub;window[a].msgHandler=window.cmp_msghandler;window.addEventListener("message",window.cmp_msghandler,false)}};window.cmp_addFrame("__cmapiLocator");window.cmp_addFrame("__cmpLocator");window.cmp_addFrame("__uspapiLocator");window.cmp_addFrame("__tcfapiLocator");window.cmp_setStub("__cmapi");window.cmp_setStub("__cmp");window.cmp_setStub("__tcfapi");window.cmp_setStub("__uspapi");</script>'; 97 117 } 98 118 -
consent-manager/trunk/assets/css/admin.css
r2632638 r2697591 9 9 .consentmanager_admin label { 10 10 min-width: 175px; 11 max-width: 175px;12 width: 1 75px;11 max-width: 350px; 12 width: 100%; 13 13 vertical-align: top; 14 14 display: inline-block; … … 52 52 background-color: #d5d5d5; 53 53 } 54 .consentmanager_admin #help_btn{55 position: absolute;56 bottom: 20px;57 right: 20px;58 }59 54 .consentmanager_admin .container_half{ 60 55 width: calc(50% - 2px); … … 65 60 vertical-align: top; 66 61 } 62 .consentmanager_flex{ 63 display: flex; 64 } 65 .consentmanager_img{ 66 width: 100%; 67 max-width: 400px; 68 } -
consent-manager/trunk/consentmanager.php
r2685053 r2697591 5 5 Plugin Name: consentmanager 6 6 Description: consentmanager is the easiest way to reach the new privacy standard | GDPR/CCPA/PIPEDA/LGPD/PIPA Cookie Solution | Consent Management Provider 7 Version: 2.0. 47 Version: 2.0.5 8 8 Author: consentmanager 9 9 Author URI: https://www.consentmanager.net … … 16 16 function consentmanager_add_autoblocking() 17 17 { 18 19 18 $cmpID = intval(get_option(ConsentManagerMain::getOptionID(), 0)); 20 19 $cmpCodeID = esc_attr(get_option(ConsentManagerMain::getOptionCodeID(), '')); 21 20 22 if (!empty($cmpCodeID)) { 23 $src = 'https://' . ConsentManagerMain::getCDN() . '/delivery/autoblocking/' . $cmpCodeID . '.js'; 21 $removeProtocol = ['http://', 'https://']; 22 23 $host = esc_attr(get_option(ConsentManagerMain::getOptionHost(), '')); 24 if ($host == '') { 25 $host = esc_attr(get_option(ConsentManagerMain::getHost(), 'delivery.consentmanager.net')); 24 26 } else { 25 $src = 'https://' . ConsentManagerMain::getCDN() . '/delivery/autoblock/' . $cmpID . '.js'; 26 } 27 28 if (empty($cmpCodeID)) { 27 $host = str_replace($removeProtocol, '', $host); 28 } 29 30 $cdn = esc_attr(get_option(ConsentManagerMain::getOptionCDN(), '')); 31 if ($cdn == '') { 32 $cdn = esc_attr(get_option(ConsentManagerMain::getCDN(), 'cdn.consentmanager.net')); 33 } else { 34 $cdn = str_replace($removeProtocol, '', $cdn); 35 } 36 37 if ($cmpCodeID != '') { 38 $src = 'https://' . $cdn . '/delivery/autoblocking/' . $cmpCodeID . '.js'; 39 } else { 40 $src = 'https://' . $cdn . '/delivery/autoblock/' . $cmpID . '.js'; 41 } 42 43 if ($cmpCodeID == '') { 29 44 $dataCmpID = 'data-cmp-id="' . $cmpID . '"'; 30 45 } else { … … 32 47 } 33 48 ?> 34 <script type="text/javascript" src="<?php echo esc_url($src); ?>" data-cmp-ab="1" data-cmp-host="<?php echo esc_attr(ConsentManagerMain::getHost()) ?>" data-cmp-cdn="<?php echo esc_attr(ConsentManagerMain::getCDN()); ?>" data-cmp-codesrc="10" <?php echo $dataCmpID ?>></script> 49 <script type="text/javascript" src="<?php echo esc_url($src); ?>" data-cmp-ab="1" 50 data-cmp-host="<?php echo $host; ?>" 51 data-cmp-cdn="<?php echo $cdn; ?>" 52 data-cmp-codesrc="10" <?php echo $dataCmpID ?>></script> 35 53 <?php 36 54 } … … 74 92 */ 75 93 76 wp_enqueue_style('consentmanager_registerStyle', esc_url('https://' . ConsentManagerMain::getCDN() . '/delivery/cmp.min.css'));77 94 add_action('wp_print_scripts', 'consentmanager_semiblocking'); 78 95 } … … 91 108 $cmpCodeID = esc_attr(get_option(ConsentManagerMain::getOptionCodeID(), '')); 92 109 $mode = intval(get_option(ConsentManagerMain::getOptionMode(), 0)); 93 94 if ($cmpID > 0 || !empty($cmpCodeID)) { 110 $host = esc_attr(get_option(ConsentManagerMain::getOptionHost(), '')); 111 if ($host == '') { 112 $host = esc_attr(get_option(ConsentManagerMain::getHost(), 'delivery.consentmanager.net')); 113 } 114 $cdn = esc_attr(get_option(ConsentManagerMain::getOptionCDN(), '')); 115 if ($cdn == '') { 116 $cdn = esc_attr(get_option(ConsentManagerMain::getCDN(), 'cdn.consentmanager.net')); 117 } 118 119 if ($cmpID > 0 || $cmpCodeID != '') { 95 120 //serverside automatic & clientside semi automatic 96 121 if ($mode != 1) { 97 echo ConsentManagerMain::getSemiBlockingCode($cmpID, $cmpCodeID );122 echo ConsentManagerMain::getSemiBlockingCode($cmpID, $cmpCodeID, $host, $cdn); 98 123 } 99 124 } … … 113 138 $cmpID = intval(get_option(ConsentManagerMain::getOptionID(), 0)); 114 139 $cmpCodeID = esc_attr(get_option(ConsentManagerMain::getOptionCodeID(), '')); 115 116 if (!empty($cmpCodeID)) { 117 $src = esc_url('https://' . ConsentManagerMain::getHost() . '/delivery/vendorlist.php?cdid=' . $cmpCodeID); 140 $host = esc_attr(get_option(ConsentManagerMain::getOptionHost(), '')); 141 if ($host == '') { 142 $host = esc_attr(get_option(ConsentManagerMain::getHost(), 'delivery.consentmanager.net')); 143 } 144 145 if ($cmpCodeID != '') { 146 $src = esc_url('https://' . $host . '/delivery/vendorlist.php?cdid=' . $cmpCodeID); 118 147 return esc_html('<div id="cmpvendorlist"></div><script src="' . $src . '" type="text/javascript" async></script>'); 119 148 } else if ($cmpID > 0) { 120 $src = esc_url('https://' . ConsentManagerMain::getHost(). '/delivery/vendorlist.php?id=' . $cmpID);149 $src = esc_url('https://' . $host . '/delivery/vendorlist.php?id=' . $cmpID); 121 150 return esc_html('<div id="cmpvendorlist"></div><script src="' . $src . '" type="text/javascript" async></script>'); 122 151 } … … 134 163 $cmpID = intval(get_option(ConsentManagerMain::getOptionID(), 0)); 135 164 $cmpCodeID = esc_attr(get_option(ConsentManagerMain::getOptionCodeID(), '')); 136 137 if (!empty($cmpCodeID)) { 138 $src = esc_url('https://' . ConsentManagerMain::getHost() . '/delivery/cookieinfo.php?cdid=' . $cmpCodeID); 165 $host = esc_attr(get_option(ConsentManagerMain::getOptionHost(), '')); 166 if ($host == '') { 167 $host = esc_attr(get_option(ConsentManagerMain::getHost(), 'delivery.consentmanager.net')); 168 } 169 170 if ($cmpCodeID != '') { 171 $src = esc_url('https://' . $host . '/delivery/cookieinfo.php?cdid=' . $cmpCodeID); 139 172 return esc_html('<div id="cmpcookieinfo"></div><script src="' . $src . '" type="text/javascript" async></script>'); 140 173 } else if ($cmpID > 0) { 141 $src = esc_url('https://' . ConsentManagerMain::getHost(). '/delivery/cookieinfo.php?id=' . $cmpID);174 $src = esc_url('https://' . $host . '/delivery/cookieinfo.php?id=' . $cmpID); 142 175 return esc_html('<div id="cmpcookieinfo"></div><script src="' . $src . '" type="text/javascript" async></script>'); 143 176 } … … 247 280 } 248 281 } 282 283 249 284 250 285 -
consent-manager/trunk/readme.txt
r2677000 r2697591 1 1 === consentmanager === 2 Contributors: andrelange2 Contributors: Falko Berg 3 3 Donate link: no donate-link provided 4 4 Tags: privacy, DSGVO, GDPR, IAB, CMP, consent, advertising, cookie, banner, CCPA, data protection, eprivacy, TCF 5 5 Requires at least: 3.0 6 6 Tested up to: 5.9 7 Stable tag: 2.0. 47 Stable tag: 2.0.5 8 8 Requires PHP: 5.4 9 9 License: GPLv2 -
consent-manager/trunk/views/admin.php
r2681349 r2697591 15 15 check_admin_referer(ConsentManagerMain::getAdminUrl()) 16 16 ) { 17 // temporary deactivated until found perfomance solution for serverside blocking 18 // $ignoreDomains = isset($_POST['consent_manager_ignore_domains']) ? sanitize_text_field($_POST['consent_manager_ignore_domains']) : ''; 17 19 $mode = intval($_POST['consent_manager_mode']); 18 20 $cmpID = intval($_POST['consent_manager_id']); 19 21 $cmpCodeID = sanitize_text_field($_POST['consent_manager_code_id']); 20 // temporary deactivated until found perfomance solution for serverside blocking 21 // $ignoreDomains = isset($_POST['consent_manager_ignore_domains']) ? sanitize_text_field($_POST['consent_manager_ignore_domains']) : ''; 22 22 $host = isset($_POST['consent_manager_host']) ? sanitize_text_field($_POST['consent_manager_host']) : ''; 23 $cdn = isset($_POST['consent_manager_cdn']) ? sanitize_text_field($_POST['consent_manager_cdn']) : ''; 23 24 $hideOnEditor = isset($_POST['consent_manager_hide_on_editor']) ? intval($_POST['consent_manager_hide_on_editor']) : 0; 24 25 … … 27 28 update_option(ConsentManagerMain::getOptionCodeID(), $cmpCodeID); 28 29 update_option(ConsentManagerMain::getOptionMode(), $mode); 29 //temporary deactivated until found perfomance solution for serverside blocking 30 update_option(ConsentManagerMain::getHideOnEditor(), $hideOnEditor); 31 update_option(ConsentManagerMain::getOptionHost(), $host); 32 update_option(ConsentManagerMain::getOptionCDN(), $cdn); 33 //temporary deactivated until found perfomance solution for serverside blocking 30 34 // update_option(ConsentManagerMain::getOptionIgnoreDomains(), $ignoreDomains); 31 update_option(ConsentManagerMain::getHideOnEditor(), $hideOnEditor);32 35 } catch (Exception $e) { 33 36 $error = $e->getMessage(); … … 65 68 <?php endif; ?> 66 69 <div clasS="wrapper"> 67 <div class="container_half">70 <div> 68 71 <p><i>Please insert your consentmanager Credentials here:</i></p> 69 72 … … 72 75 <?php echo wp_nonce_field(esc_url(ConsentManagerMain::getAdminUrl())) ?> 73 76 74 <p> 75 <label>CMP ID:<br><i>(consentmanager account => CMPs => get Code => ID)</i></label> 76 <input placeholder="Example: 123456" type="text" name="consent_manager_id" id="consent_manager_id" 77 value="<?php echo intval(get_option(ConsentManagerMain::OPTION_ID, 0)); ?>"/> 78 <br> 79 <br> 80 <img width="430px" 77 <div class="consentmanager_flex"> 78 <div> 79 <label>CMP ID:</label> 80 <input placeholder="Example: 123456" type="text" name="consent_manager_id" id="consent_manager_id" 81 value="<?php echo intval(get_option(ConsentManagerMain::OPTION_ID, 0)); ?>"/> 82 <br> 83 <i>(consentmanager account => CMPs => get Code => ID)</i> 84 </div> 85 <img class="consentmanager_img" 81 86 src="<?php echo esc_url(plugin_dir_url(__DIR__) . '/assets/images/cmpid.png', '__FILE__'); ?>" 82 87 alt="CMP ID"/> 83 </p> 84 <p> 85 <label>CMP Code-ID:<i>(consentmanager account => CMPs => get Code => Code-ID)</i></label> 86 <input placeholder="Example: asdf5hk783" type="text" name="consent_manager_code_id" 87 id="consent_manager_code_id" 88 value="<?php echo esc_attr(get_option(ConsentManagerMain::OPTION_CODEID, '')); ?>"/> 89 <br> 90 <br> 91 <img width="430px" 88 </div> 89 <hr> 90 <div class="consentmanager_flex"> 91 <div> 92 <label>CMP Code-ID:</label> 93 <input placeholder="Example: asdf5hk783" type="text" name="consent_manager_code_id" 94 id="consent_manager_code_id" 95 value="<?php echo esc_attr(get_option(ConsentManagerMain::OPTION_CODEID, '')); ?>"/> 96 <br> 97 <i>(consentmanager account => CMPs => get Code => Code-ID)</i> 98 </div> 99 <img class="consentmanager_img" 92 100 src="<?php echo esc_url(plugin_dir_url(__DIR__) . 'assets/images/cmpcodeid.png', '__FILE__'); ?>" 93 101 alt="CMP Code ID"/> 94 </p> 95 <p> 96 <label>Blocking Mode:</label> 97 <select name="consent_manager_mode" id="consent_manager_mode"> 98 <option value="1" <?php echo intval(get_option(ConsentManagerMain::getOptionMode(), 0)) == 1 ? 'selected' : ''; ?>><?php _e("Automatic clientside blocking"); ?></option> 99 <option value="3" <?php echo intval(get_option(ConsentManagerMain::getOptionMode(), 0)) == 3 ? 'selected' : ''; ?>><?php _e("Semiautomatic Code"); ?></option> 100 </select> 101 </p> 102 <p> 103 <label for="consent_manager_hide_on_editor">Hide for logged-in users?</label> 104 <input value="1" type="checkbox" id="consent_manager_hide_on_editor" 105 name="consent_manager_hide_on_editor" <?php echo((intval(get_option(ConsentManagerMain::getHideOnEditor(), 0)) == 1) ? 'checked="checked"' : ''); ?>> 106 </p> 102 </div> 103 <hr> 104 <div class="consentmanager_flex"> 105 <div> 106 <label>Host:</label> 107 <input placeholder="Example: delivery.consentmanager.net" type="text" name="consent_manager_host" 108 id="consent_manager_host" 109 value="<?php echo esc_attr(get_option(ConsentManagerMain::OPTION_HOST, '')); ?>"/> 110 <br> 111 <i>(consentmanager account => CMPs => get Code => Host)</i> 112 </div> 113 <img class="consentmanager_img" 114 src="<?php echo esc_url(plugin_dir_url(__DIR__) . 'assets/images/cmphost.png', '__FILE__'); ?>" 115 alt="CMP host"/> 116 </div> 117 <hr> 118 <div class="consentmanager_flex"> 119 <div> 120 <label>CDN:</label> 121 <input placeholder="Example: cdn.consentmanager.net" type="text" name="consent_manager_cdn" 122 id="consent_manager_cdn" 123 value="<?php echo esc_attr(get_option(ConsentManagerMain::OPTION_CDN, '')); ?>"/> 124 <br> 125 <i>(consentmanager account => CMPs => get Code => CDN)</i> 126 </div> 127 <img class="consentmanager_img" 128 src="<?php echo esc_url(plugin_dir_url(__DIR__) . 'assets/images/cmpcdn.png', '__FILE__'); ?>" 129 alt="CMP CDN"/> 130 </div> 131 <hr> 132 <div class="consentmanager_flex"> 133 <div> 134 <label>Blocking Mode:</label> 135 <select name="consent_manager_mode" id="consent_manager_mode"> 136 <option value="1" <?php echo intval(get_option(ConsentManagerMain::getOptionMode(), 0)) == 1 ? 'selected' : ''; ?>><?php _e("Automatic clientside blocking"); ?></option> 137 <option value="3" <?php echo intval(get_option(ConsentManagerMain::getOptionMode(), 0)) == 3 ? 'selected' : ''; ?>><?php _e("Semiautomatic Code"); ?></option> 138 </select> 139 </div> 140 <div> 141 <h4>Automatic Clientside</h4> 142 <p>Javascript based blocking of 3rd party scripts listed in your consentmanager account.</p> 143 <h4>Semiautomatic Clientside</h4> 144 <p>Blocks all scripts that you marked in your code.</p> 145 <a target="_blank" 146 href="https://help.consentmanager.net/books/cmp/page/how-to-block-third-party-codes-cookies-if-no-consent-is-given">Difference 147 between blocking modes</a> 148 </div> 149 </div> 150 <hr> 151 <div class="consentmanager_flex"> 152 <div> 153 <label for="consent_manager_hide_on_editor">Hide for logged-in users?</label> 154 <input value="1" type="checkbox" id="consent_manager_hide_on_editor" 155 name="consent_manager_hide_on_editor" <?php echo((intval(get_option(ConsentManagerMain::getHideOnEditor(), 0)) == 1) ? 'checked="checked"' : ''); ?>> 156 </div> 157 </div> 107 158 108 159 <?php submit_button(); ?> 109 160 110 161 </form> 111 < p>162 <div> 112 163 <i>If you don’t yet have an ID, please get in touch with us at: <a target="_blank" 113 164 href="mailto:[email protected]">[email protected]</a></i> 114 </p> 165 <br> 166 <a target="_blank" 167 href="https://help.consentmanager.net/">consentmanager documentation & Help</a> 168 </div> 115 169 </div> 116 <div class="container_half">117 <h4>Automatic Clientside</h4>118 <p>Javascript based blocking of 3rd party scripts listed in your consentmanager account.</p>119 <h4>Semiautomatic Clientside</h4>120 <p>Blocks all scripts that you marked in your code.</p>121 </div>122 <a target="_blank"123 href="https://help.consentmanager.net/books/cmp/page/how-to-integrate-the-cmp-into-a-wordpress-website"124 id="help_btn" class="btn">consentmanager Wordpress Integration Help</a><br>125 <a target="_blank"126 href="https://help.consentmanager.net/books/cmp/page/how-to-block-third-party-codes-cookies-if-no-consent-is-given"127 id="help_btn" class="btn">Difference between blocking modes</a><br>128 170 </div>
Note: See TracChangeset
for help on using the changeset viewer.