iubenda Cookie Solution for GDPR - Version 1.14.0-beta1

Version Description

Download this release

Release Info

Developer Facens
Plugin Icon 128x128 iubenda Cookie Solution for GDPR
Version 1.14.0-beta1
Comparing to
See all releases

Code changes from version 1.14.0-beta to 1.14.0-beta1

css/admin.css ADDED
@@ -0,0 +1,152 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #iubenda-view {
2
+ display: table;
3
+
4
+ width: 90%;
5
+ margin: 50px auto;
6
+ padding-bottom: 30px;
7
+
8
+ border-radius: 2px;
9
+ background-color: #FFFFFF;
10
+ box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.1)
11
+ }
12
+ #iubenda-tabs {
13
+ display: table;
14
+ width: 80%;
15
+ margin: 0 auto;
16
+ }
17
+ .iubenda-tab {
18
+ cursor: pointer;
19
+
20
+ display: inline-table;
21
+ padding: 10px 15px;
22
+ padding-top: 0;
23
+ margin-right: 10px;
24
+
25
+ background-color: #FFFFFF;
26
+ border-top: 2px solid #454545;
27
+ box-shadow: 0 -2px 3px 0 rgba(5, 5, 5, 0.2);
28
+
29
+ color: #454545
30
+ }
31
+ .iubenda-tab:before, .iubenda-tab::before {
32
+ content: "";
33
+
34
+ display: table;
35
+ margin: auto;
36
+ margin-bottom: 8px;
37
+
38
+ border-style: solid;
39
+ border-width: 5px 5px 0;
40
+ border-color: transparent transparent;
41
+ }
42
+ #iubenda-code-it, #iubenda-code-de, #iubenda-code-ru, #iubenda-code-es, #iubenda-code-pt-br, #iubenda-code-en, #iubenda-code-fr {
43
+ display: none;
44
+
45
+ width: 100%;
46
+
47
+ background-color: #FFFFFF;
48
+ box-shadow: 0 0 3px 0 rgba(5, 5, 5, 0.2);
49
+ }
50
+ #iubenda-information {
51
+ width: 100%;
52
+ padding-top: 25px;
53
+ padding-bottom: 25px;
54
+
55
+
56
+ text-indent: 20px;
57
+
58
+ background-color: #FFFFFF;
59
+ box-shadow: 0 0 3px 0 rgba(5, 5, 5, 0.2);
60
+ }
61
+ .iubenda-textarea {
62
+ display: block;
63
+ width: 95%; height: 300px;
64
+ margin: 20px auto;
65
+
66
+ overflow-y: scroll;
67
+
68
+ outline: none;
69
+ resize: vertical
70
+ }
71
+ .iubenda-textarea-single {
72
+ width: 100%;
73
+ box-shadow: 0 0 3px 0 rgba(5, 5, 5, 0.2);
74
+ }
75
+ [data-active-tab] {
76
+ border-color: #1FAD81;
77
+
78
+ color: #1FAD81
79
+ }
80
+ [data-active-tab]:before, [data-active-tab]::before {
81
+ border-color: #1FAD81 transparent
82
+ }
83
+ #iubenda-logo {
84
+ display: table;
85
+ }
86
+ .iubenda-link {
87
+ display: table;
88
+ margin: 55px auto;
89
+ }
90
+ #iubenda-save {
91
+ transition: background-color 300ms, box-shadow 300ms;
92
+ cursor: pointer;
93
+
94
+ display: table;
95
+ margin: 20px 0;
96
+ padding: 5px 10px;
97
+
98
+ background-color: #1FAD81;
99
+ border: none;
100
+ border-radius: 1px;
101
+ box-shadow: 0 0 3px 0 rgba(5, 5, 5, 0.2);
102
+
103
+ color: #FFFFFF
104
+ }
105
+ #iubenda-save:hover {
106
+ background-color: #199C71;
107
+ box-shadow: 0 0 4px 0 rgba(5, 5, 5, 0.5);
108
+ }
109
+ #iubenda-saved {
110
+ display: table;
111
+ margin: 10px 0;
112
+ width: 100%; height: 30px;
113
+
114
+ background-color: #199C71;
115
+ border-radius: 1px;
116
+ box-shadow: 0 0 3px 0 rgba(5, 5, 5, 0.2);
117
+ }
118
+ #iubenda-saved p {
119
+ display: table;
120
+ margin: 10px;
121
+
122
+ color: #FFFFFF
123
+ }
124
+ .iubenda-text {
125
+ display: table;
126
+ width: 80%;
127
+ margin: 5px auto;
128
+
129
+ color: #434149
130
+ }
131
+ .iubenda-title {
132
+ display: table;
133
+ margin-top: 10px;
134
+
135
+ font-weight: bold;
136
+ }
137
+ .iubenda-url {
138
+ display: inline-table;
139
+ margin-bottom: 10px;
140
+ }
141
+ #parser_engine label input {
142
+ margin-right: 5px
143
+ }
144
+ #parser_engine, #par_skip_parsing, #par_iubenda_output_filter {
145
+ margin-left: 30px;
146
+ }
147
+ .wp-admin .iubenda-checkbox-options p label input[type=checkbox], .iubenda-checkbox-options label span {
148
+ display: inline-block;
149
+ vertical-align: top;
150
+ margin-top: 0;
151
+ line-height: 1.2;
152
+ }
index.php ADDED
@@ -0,0 +1,2 @@
 
 
1
+ <?php
2
+ // Silence is golden.
iubenda_cookie_solution.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin URI: https://www.iubenda.com
5
  * Description: Iubenda Cookie Solution permette di gestire tutti gli aspetti della cookie law su WP.
6
  * Author: iubenda
7
- * Version: 1.14.0-beta
8
  * Text Domain: iubenda-cookie-law-solution
9
  * Author URI: https://www.iubenda.com
10
  */
4
  * Plugin URI: https://www.iubenda.com
5
  * Description: Iubenda Cookie Solution permette di gestire tutti gli aspetti della cookie law su WP.
6
  * Author: iubenda
7
+ * Version: 1.14.0-beta1
8
  * Text Domain: iubenda-cookie-law-solution
9
  * Author URI: https://www.iubenda.com
10
  */
js/admin.js ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ( function ( $ ) {
2
+
3
+ $( document ).ready( function () {
4
+
5
+ } );
6
+
7
+ } )( jQuery );
8
+
9
+ function iubendaGetLanguage( str ) {
10
+ var languages = [ "it", "de", "en", "es", "pt-br", "ru", "fr" ];
11
+
12
+ for ( var i = 0; i < languages.length; i++ ) {
13
+ var tab = document.getElementById( "iubenda-code-" + languages[i] );
14
+
15
+ var active_tab = document.querySelector( ".iubenda-code-" + languages[i] );
16
+
17
+ if ( active_tab )
18
+ active_tab.removeAttribute( "data-active-tab" );
19
+
20
+ if ( tab )
21
+ tab.style.display = "none";
22
+ }
23
+
24
+ var tab = document.getElementById( "iubenda-code-" + str );
25
+ var active_tab = document.querySelector( ".iubenda-code-" + str );
26
+
27
+ if ( tab )
28
+ tab.style.display = "table";
29
+ if ( active_tab )
30
+ active_tab.setAttribute( "data-active-tab", "" );
31
+
32
+ document.getElementById( "iubenda-information" ).style.display = "none";
33
+ }
34
+
35
+ window.addEventListener(
36
+ "DOMContentLoaded", function () {
37
+ var firstTab = document.querySelector( "[data-iubenda-button]" );
38
+
39
+ if ( firstTab )
40
+ jQuery( firstTab ).trigger( "click" );
41
+
42
+ var engine = document.getElementById( "parser_type" );
43
+
44
+ engine.onchange = function () {
45
+ if ( this.checked ) {
46
+ document.getElementById( "iubenda_parse_child" ).style.display = "block";
47
+ } else {
48
+ document.getElementById( "iubenda_parse_child" ).style.display = "none";
49
+ }
50
+ }
51
+
52
+ jQuery( engine ).trigger( "change" );
53
+ }
54
+ );
55
+
56
+ setTimeout(
57
+ function () {
58
+ var x = document.getElementById( "iubenda-saved" );
59
+
60
+ if ( x )
61
+ x.style.display = "none";
62
+ }, 3000
63
+ );
languages/iubenda-cookie-law-solution-it.mo ADDED
Binary file
languages/iubenda-cookie-law-solution-it.po ADDED
@@ -0,0 +1,199 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Iubenda Cookie Solution\n"
4
+ "POT-Creation-Date: 2016-11-16 18:33+0100\n"
5
+ "PO-Revision-Date: 2016-11-16 18:38+0100\n"
6
+ "Last-Translator: \n"
7
+ "Language-Team: \n"
8
+ "Language: it\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Generator: Poedit 1.8.4\n"
13
+ "X-Poedit-Basepath: ..\n"
14
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
15
+ "X-Poedit-SourceCharset: UTF-8\n"
16
+ "X-Poedit-KeywordsList: __\n"
17
+ "X-Poedit-SearchPath-0: .\n"
18
+
19
+ #: iubenda_cookie_solution.php:333
20
+ msgid "You don't have permission to access this page."
21
+ msgstr "Non disponi dell'autorizzazione per accedere a questa pagina."
22
+
23
+ #: iubenda_cookie_solution.php:459
24
+ msgid ""
25
+ "This plugin is the easiest and most comprehensive way to adapt your "
26
+ "WordPress site to the European cookie law. Upon your user's first visit, the "
27
+ "plugin will take care of collecting their consent, of blocking the most "
28
+ "popular among the scripts that install cookies and subsequently reactivate "
29
+ "these scripts as soon as consent is provided. The basic settings include "
30
+ "obtaining consent by a simple scroll action (the most effective method) and "
31
+ "script reactivation without refreshing the page."
32
+ msgstr ""
33
+ "Questo plugin è il modo più semplice e completo per adeguare il tuo sito "
34
+ "Wordpress alla cookie law. Alla prima visita dell'utente il plugin si "
35
+ "occuperà di raccoglierne il consenso, di bloccare i più popolari fra gli "
36
+ "script che installano cookie e di riattivarli non appena il consenso viene "
37
+ "fornito. Le impostazioni di base includono la raccolta del consenso tramite "
38
+ "il semplice scroll (il metodo più efficace) e la riattivazione senza il "
39
+ "refresh della pagina."
40
+
41
+ #: iubenda_cookie_solution.php:460
42
+ msgid "Would you like to know more about the cookie law?"
43
+ msgstr "Vuoi capire di più sulla cookie law?"
44
+
45
+ #: iubenda_cookie_solution.php:461
46
+ #, php-format
47
+ msgid ""
48
+ "Read our <a href=\"%s\" class=\"iubenda-url\" target=\"_blank\">complete "
49
+ "guide to the cookie law.</a>"
50
+ msgstr ""
51
+ "Consulta la nostra <a href=\"%s\" class=\"iubenda-url\" target=\"_blank"
52
+ "\">guida completa alla cookie law</a>."
53
+
54
+ #: iubenda_cookie_solution.php:462
55
+ msgid "What’s the full functionality of the plugin?"
56
+ msgstr "Quali sono le funzionalità complete del plugin?"
57
+
58
+ #: iubenda_cookie_solution.php:463
59
+ #, php-format
60
+ msgid ""
61
+ "Visit our <a href=\"%s\" class=\"iubenda-url\" target=\"_blank\">plugin page."
62
+ "</a>"
63
+ msgstr ""
64
+ "Visita la <a href=\"%s\" class=\"iubenda-url\" target=\"_blank\">nostra "
65
+ "pagina dedicata</a> al plugin."
66
+
67
+ #: iubenda_cookie_solution.php:464
68
+ msgid "Enter the iubenda code for the Cookie Solution below."
69
+ msgstr "Inserisci qui sotto il codice di iubenda per la Cookie Solution."
70
+
71
+ #: iubenda_cookie_solution.php:465
72
+ #, php-format
73
+ msgid ""
74
+ "In order to run the plugin, you need to enter the iubenda code that "
75
+ "activates the cookie law banner and the cookie policy in the form below. "
76
+ "This code can be generated on www.iubenda.com, following <a href=\"%s\" "
77
+ "class=\"iubenda-url\" target=\"_blank\">this guide.</a>"
78
+ msgstr ""
79
+ "Per far funzionare il plugin, è necessario inserire nel form sottostante il "
80
+ "codice di iubenda che attiva il banner cookie law e la cookie policy. Questo "
81
+ "codice può essere generato su www.iubenda.com, <a href=\"%s\" class="
82
+ "\"iubenda-url\" target=\"_blank\">seguendo questa guida</a> ."
83
+
84
+ #: iubenda_cookie_solution.php:471
85
+ msgid "Settings applied successfully"
86
+ msgstr "Impostazioni salvate con successo"
87
+
88
+ #: iubenda_cookie_solution.php:498
89
+ msgid "Select a language to correctly pair it with your script"
90
+ msgstr "Seleziona una lingua a cui associare il tuo codice"
91
+
92
+ #: iubenda_cookie_solution.php:511
93
+ msgid "Automatically blocks scripts detected by the plugin"
94
+ msgstr "Effettua il blocco automatico degli script rilevati dal plugin"
95
+
96
+ #: iubenda_cookie_solution.php:512
97
+ #, php-format
98
+ msgid ""
99
+ "see <a href=\"%s\" class=\"iubenda-url\" target=\"_blank\">our "
100
+ "documentation</a> for the list of detected scripts."
101
+ msgstr ""
102
+ "consulta la <a href=\"%s\" class=\"iubenda-url\" target=\"_blank\">nostra "
103
+ "documentazione</a> per la lista di script rilevati."
104
+
105
+ #: iubenda_cookie_solution.php:519
106
+ msgid "Parsing engine"
107
+ msgstr "Parsing engine"
108
+
109
+ #: iubenda_cookie_solution.php:520
110
+ msgid "Default"
111
+ msgstr "Default"
112
+
113
+ #: iubenda_cookie_solution.php:521
114
+ msgid "Experimental (enhances performance)"
115
+ msgstr "Sperimentale (performance migliorata)"
116
+
117
+ #: iubenda_cookie_solution.php:527
118
+ msgid ""
119
+ "Leaves scripts untouched on the page if the user has already given consent"
120
+ msgstr ""
121
+ "Lascia intatti gli script della pagina se l'utente ha già dato il consenso"
122
+
123
+ #: iubenda_cookie_solution.php:528
124
+ msgid ""
125
+ "improves performance, highly recommended, to be deactivated only if your "
126
+ "site uses a caching system"
127
+ msgstr ""
128
+ "migliora le prestazioni, altamente consigliato, da disattivare solo qualora "
129
+ "il tuo sito utilizzi un sistema di cache"
130
+
131
+ #: iubenda_cookie_solution.php:536
132
+ msgid "Applies special optimizations in cases with faulty output"
133
+ msgstr "Applica ottimizzazioni speciali in caso di errori con l'output"
134
+
135
+ #: iubenda_cookie_solution.php:537
136
+ msgid ""
137
+ "only select this option if you had performance problems or if you notice "
138
+ "that the blocking of code is run several times"
139
+ msgstr ""
140
+ "attiva questa opzione solo qualora avessi problemi di performance o notassi "
141
+ "che il blocco dei codici viene applicato più volte"
142
+
143
+ #: iubenda_cookie_solution.php:549
144
+ msgid ""
145
+ "Restrict the plugin to run only for requests that have \"Content-type: "
146
+ "text / html\" (recommended)"
147
+ msgstr ""
148
+ "Restringi l'esecuzione del plugin alle sole richieste che presentano "
149
+ "\"Content-type: text/html\" (consigliato)"
150
+
151
+ #: iubenda_cookie_solution.php:557
152
+ msgid "Do not run the plugin inside the RSS feed (recommended)"
153
+ msgstr "Non eseguire il plugin all'interno dei Feed RSS (consigliato)"
154
+
155
+ #: iubenda_cookie_solution.php:562
156
+ msgid "Save"
157
+ msgstr "Salva"
158
+
159
+ #: iubenda_cookie_solution.php:567
160
+ msgid "Need support for this plugin?"
161
+ msgstr "Hai bisogno di supporto su questo plugin?"
162
+
163
+ #: iubenda_cookie_solution.php:568
164
+ #, php-format
165
+ msgid ""
166
+ "Visit our <a href=\"%s\" class=\"iubenda-url\" target=\"_blank\">support "
167
+ "forum.</a>"
168
+ msgstr ""
169
+ "Visita il nostro <a href=\"%s\" class=\"iubenda-url\" target=\"_blank"
170
+ "\">forum di supporto</a>."
171
+
172
+ #: iubenda_cookie_solution.php:571
173
+ msgid "Want to try a beta version of this plugin with the latest features?"
174
+ msgstr ""
175
+ "Vuoi provare una versione Beta di questo plugin, con le funzionalità più "
176
+ "recenti?"
177
+
178
+ #: iubenda_cookie_solution.php:572
179
+ #, php-format
180
+ msgid ""
181
+ "Visit our <a href=\"%s\" class=\"iubenda-url\" target=\"_blank"
182
+ "\">documentation pages</a> and follow the instructions to install a beta "
183
+ "version."
184
+ msgstr ""
185
+ "Visita la <a href=\"%s\" class=\"iubenda-url\" target=\"_blank\">nostra "
186
+ "documentazione</a> e segui le istruzioni per installare una versione Beta."
187
+
188
+ #~ msgid "Parsed with iubenda experimental class in %s sec."
189
+ #~ msgstr "Parsed with iubenda experimental class in %s sec."
190
+
191
+ #~ msgid "Parsed with iubenda default class in %s sec."
192
+ #~ msgstr "Parsed with iubenda default class in %s sec."
193
+
194
+ #~ msgid ""
195
+ #~ "see <a href=\"%s\" class=\"iubenda-url\" target=\"_blank\">our "
196
+ #~ "documentation</a> for the list of detected scripts this guide."
197
+ #~ msgstr ""
198
+ #~ "consulta la <a href=\"%s\" class=\"iubenda-url\" target=\"_blank\">nostra "
199
+ #~ "documentazione</a> per la lista di script rilevati."
languages/iubenda-cookie-law-solution.pot ADDED
@@ -0,0 +1,156 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #, fuzzy
2
+ msgid ""
3
+ msgstr ""
4
+ "Project-Id-Version: Iubenda Cookie Solution\n"
5
+ "POT-Creation-Date: 2016-11-16 18:28+0100\n"
6
+ "PO-Revision-Date: 2015-08-12 10:36+0200\n"
7
+ "Last-Translator: \n"
8
+ "Language-Team: \n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Generator: Poedit 1.8.11\n"
13
+ "X-Poedit-Basepath: ..\n"
14
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
15
+ "X-Poedit-SourceCharset: UTF-8\n"
16
+ "X-Poedit-KeywordsList: __\n"
17
+ "X-Poedit-SearchPath-0: .\n"
18
+
19
+ #: iubenda_cookie_solution.php:333
20
+ msgid "You don't have permission to access this page."
21
+ msgstr ""
22
+
23
+ #: iubenda_cookie_solution.php:459
24
+ msgid ""
25
+ "This plugin is the easiest and most comprehensive way to adapt your "
26
+ "WordPress site to the European cookie law. Upon your user's first visit, "
27
+ "the plugin will take care of collecting their consent, of blocking the most "
28
+ "popular among the scripts that install cookies and subsequently reactivate "
29
+ "these scripts as soon as consent is provided. The basic settings include "
30
+ "obtaining consent by a simple scroll action (the most effective method) and "
31
+ "script reactivation without refreshing the page."
32
+ msgstr ""
33
+
34
+ #: iubenda_cookie_solution.php:460
35
+ msgid "Would you like to know more about the cookie law?"
36
+ msgstr ""
37
+
38
+ #: iubenda_cookie_solution.php:461
39
+ #, php-format
40
+ msgid ""
41
+ "Read our <a href=\"%s\" class=\"iubenda-url\" target=\"_blank\">complete "
42
+ "guide to the cookie law.</a>"
43
+ msgstr ""
44
+
45
+ #: iubenda_cookie_solution.php:462
46
+ msgid "What’s the full functionality of the plugin?"
47
+ msgstr ""
48
+
49
+ #: iubenda_cookie_solution.php:463
50
+ #, php-format
51
+ msgid ""
52
+ "Visit our <a href=\"%s\" class=\"iubenda-url\" target=\"_blank\">plugin "
53
+ "page.</a>"
54
+ msgstr ""
55
+
56
+ #: iubenda_cookie_solution.php:464
57
+ msgid "Enter the iubenda code for the Cookie Solution below."
58
+ msgstr ""
59
+
60
+ #: iubenda_cookie_solution.php:465
61
+ #, php-format
62
+ msgid ""
63
+ "In order to run the plugin, you need to enter the iubenda code that "
64
+ "activates the cookie law banner and the cookie policy in the form below. "
65
+ "This code can be generated on www.iubenda.com, following <a href=\"%s\" "
66
+ "class=\"iubenda-url\" target=\"_blank\">this guide.</a>"
67
+ msgstr ""
68
+
69
+ #: iubenda_cookie_solution.php:471
70
+ msgid "Settings applied successfully"
71
+ msgstr ""
72
+
73
+ #: iubenda_cookie_solution.php:498
74
+ msgid "Select a language to correctly pair it with your script"
75
+ msgstr ""
76
+
77
+ #: iubenda_cookie_solution.php:511
78
+ msgid "Automatically blocks scripts detected by the plugin"
79
+ msgstr ""
80
+
81
+ #: iubenda_cookie_solution.php:512
82
+ #, php-format
83
+ msgid ""
84
+ "see <a href=\"%s\" class=\"iubenda-url\" target=\"_blank\">our "
85
+ "documentation</a> for the list of detected scripts."
86
+ msgstr ""
87
+
88
+ #: iubenda_cookie_solution.php:519
89
+ msgid "Parsing engine"
90
+ msgstr ""
91
+
92
+ #: iubenda_cookie_solution.php:520
93
+ msgid "Default"
94
+ msgstr ""
95
+
96
+ #: iubenda_cookie_solution.php:521
97
+ msgid "Experimental (enhances performance)"
98
+ msgstr ""
99
+
100
+ #: iubenda_cookie_solution.php:527
101
+ msgid ""
102
+ "Leaves scripts untouched on the page if the user has already given consent"
103
+ msgstr ""
104
+
105
+ #: iubenda_cookie_solution.php:528
106
+ msgid ""
107
+ "improves performance, highly recommended, to be deactivated only if your "
108
+ "site uses a caching system"
109
+ msgstr ""
110
+
111
+ #: iubenda_cookie_solution.php:536
112
+ msgid "Applies special optimizations in cases with faulty output"
113
+ msgstr ""
114
+
115
+ #: iubenda_cookie_solution.php:537
116
+ msgid ""
117
+ "only select this option if you had performance problems or if you notice "
118
+ "that the blocking of code is run several times"
119
+ msgstr ""
120
+
121
+ #: iubenda_cookie_solution.php:549
122
+ msgid ""
123
+ "Restrict the plugin to run only for requests that have \"Content-type: "
124
+ "text / html\" (recommended)"
125
+ msgstr ""
126
+
127
+ #: iubenda_cookie_solution.php:557
128
+ msgid "Do not run the plugin inside the RSS feed (recommended)"
129
+ msgstr ""
130
+
131
+ #: iubenda_cookie_solution.php:562
132
+ msgid "Save"
133
+ msgstr ""
134
+
135
+ #: iubenda_cookie_solution.php:567
136
+ msgid "Need support for this plugin?"
137
+ msgstr ""
138
+
139
+ #: iubenda_cookie_solution.php:568
140
+ #, php-format
141
+ msgid ""
142
+ "Visit our <a href=\"%s\" class=\"iubenda-url\" target=\"_blank\">support "
143
+ "forum.</a>"
144
+ msgstr ""
145
+
146
+ #: iubenda_cookie_solution.php:571
147
+ msgid "Want to try a beta version of this plugin with the latest features?"
148
+ msgstr ""
149
+
150
+ #: iubenda_cookie_solution.php:572
151
+ #, php-format
152
+ msgid ""
153
+ "Visit our <a href=\"%s\" class=\"iubenda-url\" target=\"_blank"
154
+ "\">documentation pages</a> and follow the instructions to install a beta "
155
+ "version."
156
+ msgstr ""
languages/iubenda-cookie-wp-plugin-en_US.mo DELETED
Binary file
languages/iubenda-cookie-wp-plugin-en_US.po DELETED
@@ -1,131 +0,0 @@
1
- msgid ""
2
- msgstr ""
3
- "Project-Id-Version: Iubenda Cookie Solution\n"
4
- "POT-Creation-Date: 2015-08-12 10:53+0200\n"
5
- "PO-Revision-Date: 2015-08-12 15:49+0200\n"
6
- "Language-Team: \n"
7
- "MIME-Version: 1.0\n"
8
- "Content-Type: text/plain; charset=UTF-8\n"
9
- "Content-Transfer-Encoding: 8bit\n"
10
- "X-Generator: Poedit 1.8.4\n"
11
- "X-Poedit-Basepath: ../Sites/iub/wp-content/plugins/iubenda-cookie-wp-plugin\n"
12
- "Plural-Forms: nplurals=2; plural=(n != 1);\n"
13
- "X-Poedit-SourceCharset: UTF-8\n"
14
- "X-Poedit-KeywordsList: __\n"
15
- "Last-Translator: \n"
16
- "Language: en\n"
17
- "X-Poedit-SearchPath-0: iubenda_cookie_solution.php\n"
18
-
19
- #: iubenda_cookie_solution.php:201 iubenda_cookie_solution.php:661
20
- msgid "Codice iubenda"
21
- msgstr "Paste iubenda cookie banner script below"
22
-
23
- #: iubenda_cookie_solution.php:206 iubenda_cookie_solution.php:666
24
- msgid "Salta il parsing della pagina se l'utente ha già dato il consenso (migliora le prestazioni, altamente consigliato)."
25
- msgstr "Skip parsing of the page if the user has already given consent (improves performance, highly recommended)."
26
-
27
- #: iubenda_cookie_solution.php:278
28
- msgid "You are not allowed to access this part of the site"
29
- msgstr "You are not allowed to access this part of the site"
30
-
31
- #: iubenda_cookie_solution.php:327
32
- #, php-format
33
- msgid "Cookie policy %s associata correttamente."
34
- msgstr "Cookie policy %s correctly associated."
35
-
36
- #: iubenda_cookie_solution.php:331 iubenda_cookie_solution.php:392 iubenda_cookie_solution.php:423 iubenda_cookie_solution.php:474 iubenda_cookie_solution.php:511
37
- #: iubenda_cookie_solution.php:537
38
- msgid "Torna alla home"
39
- msgstr "Return to home"
40
-
41
- #: iubenda_cookie_solution.php:342
42
- msgid "Associa la tua cookie policy"
43
- msgstr "Associate your cookie policy"
44
-
45
- #: iubenda_cookie_solution.php:343
46
- msgid "E\\' stata rilevata questa cookie policy installata prima dell\\'installazione di WPML."
47
- msgstr "This cookie policy was found to have been installed before the installation of WPML."
48
-
49
- #: iubenda_cookie_solution.php:344
50
- msgid "E' necessario</strong> che gli venga associata una lingua per il corretto funzionamento con WPML."
51
- msgstr "It's necessary</strong> to associate a language to it for the correct functioning with WMPL."
52
-
53
- #: iubenda_cookie_solution.php:353
54
- msgid "Associa lingua:"
55
- msgstr "Associate language:"
56
-
57
- #: iubenda_cookie_solution.php:359
58
- msgid "Associa lingua"
59
- msgstr "Associate language"
60
-
61
- #: iubenda_cookie_solution.php:388
62
- #, php-format
63
- msgid "Cookie policy %s impostata come default correttamente."
64
- msgstr "Cookie policy %s successfully set up as default."
65
-
66
- #: iubenda_cookie_solution.php:420
67
- msgid "Cancellata correttamente."
68
- msgstr "Deleted successfully."
69
-
70
- #: iubenda_cookie_solution.php:457
71
- msgid "Modificata correttamente."
72
- msgstr "Modified successfully."
73
-
74
- #: iubenda_cookie_solution.php:466
75
- #, php-format
76
- msgid "Modifica cookie policy %s"
77
- msgstr "Modify cookie policy %s"
78
-
79
- #: iubenda_cookie_solution.php:468 iubenda_cookie_solution.php:507 iubenda_cookie_solution.php:576 iubenda_cookie_solution.php:617
80
- msgid "Modifica"
81
- msgstr "Modify"
82
-
83
- #: iubenda_cookie_solution.php:471
84
- msgid "Cancella cookie policy"
85
- msgstr "Delete cookie policy"
86
-
87
- #: iubenda_cookie_solution.php:504
88
- msgid "Questa cookie policy è stata già aggiunta, puoi modificare quella creata."
89
- msgstr "This cookie policy has already been added, you can modify the one created."
90
-
91
- #: iubenda_cookie_solution.php:529
92
- msgid "Aggiunta correttamente"
93
- msgstr "Added successfully"
94
-
95
- #: iubenda_cookie_solution.php:532
96
- msgid "Modificala"
97
- msgstr "Modify it"
98
-
99
- #: iubenda_cookie_solution.php:547
100
- msgid "Aggiungi cookie policy"
101
- msgstr "Add cookie policy"
102
-
103
- #: iubenda_cookie_solution.php:549
104
- msgid "Aggiungi"
105
- msgstr "Add"
106
-
107
- #: iubenda_cookie_solution.php:561
108
- msgid "Modifica cookie policy"
109
- msgstr "Modify cookie policy"
110
-
111
- #: iubenda_cookie_solution.php:565 iubenda_cookie_solution.php:598
112
- msgid "Seleziona cookie policy"
113
- msgstr "Select cookie policy"
114
-
115
- #: iubenda_cookie_solution.php:593
116
- msgid "Seleziona una cookie policy da usare di default quando non disponibile una cookie policy della lingua fornita da WPML."
117
- msgstr "Select a default cookie policy for when there's no cookie policy for a language supplied by WPML. "
118
-
119
- #: iubenda_cookie_solution.php:628
120
- msgid "Non puoi visualizzare questa parte del sito"
121
- msgstr "You can't visualize this part of the site"
122
-
123
- #: iubenda_cookie_solution.php:643
124
- msgid "Opzioni salvate"
125
- msgstr "Saved options"
126
-
127
- #: iubenda_cookie_solution.php:676
128
- msgid ""
129
- "Per informazioni ed istruzioni su questo plugin, visita questa guida: <br /><a href=\"https://www.iubenda.com/it/help/posts/810\">https://www.iubenda.com/it/help/posts/810</a>"
130
- msgstr ""
131
- "For information and instructions regarding this plugin, visit this guide: <br /><a href=\"https://www.iubenda.com/help/posts/1215\">https://www.iubenda.com/help/posts/1215</a>"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
languages/iubenda-cookie-wp-plugin.pot DELETED
@@ -1,140 +0,0 @@
1
- msgid ""
2
- msgstr ""
3
- "Project-Id-Version: Iubenda Cookie Solution\n"
4
- "POT-Creation-Date: 2015-08-12 10:25+0200\n"
5
- "PO-Revision-Date: 2015-08-12 10:36+0200\n"
6
- "Last-Translator: \n"
7
- "Language-Team: \n"
8
- "MIME-Version: 1.0\n"
9
- "Content-Type: text/plain; charset=UTF-8\n"
10
- "Content-Transfer-Encoding: 8bit\n"
11
- "X-Generator: Poedit 1.8.4\n"
12
- "X-Poedit-Basepath: ../Sites/iub/wp-content/plugins/iubenda-cookie-wp-"
13
- "plugin\n"
14
- "Plural-Forms: nplurals=2; plural=(n != 1);\n"
15
- "X-Poedit-SourceCharset: UTF-8\n"
16
- "X-Poedit-KeywordsList: __\n"
17
- "X-Poedit-SearchPath-0: iubenda_cookie_solution.php\n"
18
-
19
- #: iubenda_cookie_solution.php:201 iubenda_cookie_solution.php:661
20
- msgid "Codice iubenda"
21
- msgstr ""
22
-
23
- #: iubenda_cookie_solution.php:206 iubenda_cookie_solution.php:666
24
- msgid ""
25
- "Salta il parsing della pagina se l'utente ha già dato il consenso (migliora "
26
- "le prestazioni, altamente consigliato)."
27
- msgstr ""
28
-
29
- #: iubenda_cookie_solution.php:278
30
- msgid "You are not allowed to access this part of the site"
31
- msgstr ""
32
-
33
- #: iubenda_cookie_solution.php:327
34
- #, php-format
35
- msgid "Cookie policy %s associata correttamente."
36
- msgstr ""
37
-
38
- #: iubenda_cookie_solution.php:331 iubenda_cookie_solution.php:392
39
- #: iubenda_cookie_solution.php:423 iubenda_cookie_solution.php:474
40
- #: iubenda_cookie_solution.php:511 iubenda_cookie_solution.php:537
41
- msgid "Torna alla home"
42
- msgstr ""
43
-
44
- #: iubenda_cookie_solution.php:342
45
- msgid "Associa la tua cookie policy"
46
- msgstr ""
47
-
48
- #: iubenda_cookie_solution.php:343
49
- msgid ""
50
- "E\\' stata rilevata questa cookie policy installata prima dell"
51
- "\\'installazione di WPML."
52
- msgstr ""
53
-
54
- #: iubenda_cookie_solution.php:344
55
- msgid ""
56
- "E' necessario</strong> che gli venga associata una lingua per il corretto "
57
- "funzionamento con WPML."
58
- msgstr ""
59
-
60
- #: iubenda_cookie_solution.php:353
61
- msgid "Associa lingua:"
62
- msgstr ""
63
-
64
- #: iubenda_cookie_solution.php:359
65
- msgid "Associa lingua"
66
- msgstr ""
67
-
68
- #: iubenda_cookie_solution.php:388
69
- #, php-format
70
- msgid "Cookie policy %s impostata come default correttamente."
71
- msgstr ""
72
-
73
- #: iubenda_cookie_solution.php:420
74
- msgid "Cancellata correttamente."
75
- msgstr ""
76
-
77
- #: iubenda_cookie_solution.php:457
78
- msgid "Modificata correttamente."
79
- msgstr ""
80
-
81
- #: iubenda_cookie_solution.php:466
82
- #, php-format
83
- msgid "Modifica cookie policy %s"
84
- msgstr ""
85
-
86
- #: iubenda_cookie_solution.php:468 iubenda_cookie_solution.php:507
87
- #: iubenda_cookie_solution.php:576 iubenda_cookie_solution.php:617
88
- msgid "Modifica"
89
- msgstr ""
90
-
91
- #: iubenda_cookie_solution.php:471
92
- msgid "Cancella cookie policy"
93
- msgstr ""
94
-
95
- #: iubenda_cookie_solution.php:504
96
- msgid ""
97
- "Questa cookie policy è stata già aggiunta, puoi modificare quella creata."
98
- msgstr ""
99
-
100
- #: iubenda_cookie_solution.php:529
101
- msgid "Aggiunta correttamente"
102
- msgstr ""
103
-
104
- #: iubenda_cookie_solution.php:532
105
- msgid "Modificala"
106
- msgstr ""
107
-
108
- #: iubenda_cookie_solution.php:547
109
- msgid "Aggiungi cookie policy"
110
- msgstr ""
111
-
112
- #: iubenda_cookie_solution.php:549
113
- msgid "Aggiungi"
114
- msgstr ""
115
-
116
- #: iubenda_cookie_solution.php:561
117
- msgid "Modifica cookie policy"
118
- msgstr ""
119
-
120
- #: iubenda_cookie_solution.php:565 iubenda_cookie_solution.php:598
121
- msgid "Seleziona cookie policy"
122
- msgstr ""
123
-
124
- #: iubenda_cookie_solution.php:593
125
- msgid ""
126
- "Seleziona una cookie policy da usare di default quando non disponibile una "
127
- "cookie policy della lingua fornita da WPML."
128
- msgstr ""
129
-
130
- #: iubenda_cookie_solution.php:628
131
- msgid "Non puoi visualizzare questa parte del sito"
132
- msgstr ""
133
-
134
- #: iubenda_cookie_solution.php:643
135
- msgid "Opzioni salvate"
136
- msgstr ""
137
-
138
- #: iubenda_cookie_solution.php:676
139
- msgid "Per informazioni ed istruzioni su questo plugin, visita questa guida:"
140
- msgstr ""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lib/iubenda.class.faster.php ADDED
@@ -0,0 +1,171 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * iubenda.class.php
4
+ * version: 2.0.2
5
+ * codename: Faster
6
+ * @author: Copyright 2015 iubenda
7
+ * @license GNU/GPL
8
+ * This program is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ *
19
+ * You should have received a copy of the GNU General Public License
20
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
21
+ */
22
+
23
+ class iubendaFaster {
24
+ /*
25
+ Variables
26
+ */
27
+
28
+ private $getBlack = array(
29
+ array(
30
+ /*
31
+ Domains
32
+ */
33
+
34
+ "platform.twitter.com/widgets.js",
35
+ "apis.google.com/js/plusone.js",
36
+ "apis.google.com/js/platform.js",
37
+ "connect.facebook.net",
38
+ "www.youtube.com/iframe_api",
39
+ "pagead2.googlesyndication.com/pagead/js/adsbygoogle.js",
40
+ "sharethis.com/button/buttons.js",
41
+ "addthis.com/js/",
42
+ /*
43
+ JavaScript
44
+ */
45
+ "window.adsbygoogle"
46
+ ),
47
+ array
48
+ (
49
+ "youtube.com",
50
+ "platform.twitter.com",
51
+ "www.facebook.com/plugins/like.php",
52
+ "www.facebook.com/plugins/likebox.php",
53
+ "apis.google.com",
54
+ "www.google.com/maps/embed/",
55
+ "player.vimeo.com/video",
56
+ "maps.google.it/maps",
57
+ "www.google.com/maps/embed"
58
+ )
59
+ );
60
+
61
+ /**/
62
+ private $getBlank = "//cdn.iubenda.com/cookie_solution/empty.html";
63
+ private $getClass = array( "_iub_cs_activate", "_iub_cs_activate-inline" );
64
+
65
+ /*
66
+ Methods
67
+ */
68
+
69
+ public function isBlack( $offender, $blacklist ) {
70
+ /*
71
+ Check if a string is in the black list.
72
+ */
73
+
74
+ if ( empty( $offender ) || empty( $blacklist ) ) {
75
+
76
+ return false;
77
+ }
78
+
79
+ /**/
80
+
81
+ foreach ( $blacklist as $black ) {
82
+ if ( strpos( $offender, $black ) !== false ) {
83
+
84
+ return true;
85
+ }
86
+ }
87
+
88
+ /**/
89
+
90
+ return false;
91
+ }
92
+
93
+ /**/
94
+
95
+ public function isParse( $offender ) {
96
+ /*
97
+ Parse the entrie document and search for black elements.
98
+ */
99
+
100
+ libxml_use_internal_errors( true );
101
+
102
+ /**/
103
+
104
+ $src = "";
105
+
106
+ $blank = $this->getBlank;
107
+ $class = $this->getClass;
108
+
109
+ $list_1 = $this->getBlack[0];
110
+ $list_2 = $this->getBlack[1];
111
+
112
+ $document = new DOMDocument();
113
+
114
+ /**/
115
+
116
+ $document->formatOutput = true;
117
+ $document->preserveWhiteSpace = false;
118
+
119
+ /**/
120
+
121
+ $document->loadHTML( $offender );
122
+
123
+ /**/
124
+
125
+ $scripts = $document->getElementsByTagName( "script" );
126
+ $iframes = $document->getElementsByTagName( "iframe" );
127
+
128
+ /*
129
+ Parse the founded elements and check who is in black.
130
+ */
131
+
132
+ foreach ( $scripts as $script ) {
133
+ $src = $script->getAttribute( "src" );
134
+
135
+ /**/
136
+
137
+ if ( $this->isBlack( $src, $list_1 ) ) {
138
+ $script->setAttribute( "type", "text/plain" );
139
+ $script->setAttribute( "class", $script->getAttribute( "class" ) . " " . $class[0] );
140
+ } elseif ( $this->isBlack( $script->nodeValue, $list_1 ) ) {
141
+ $script->setAttribute( "type", "text/plain" );
142
+ $script->setAttribute( "class", $script->getAttribute( "class" ) . " " . $class[1] );
143
+ }
144
+ }
145
+ foreach ( $iframes as $iframe ) {
146
+
147
+ $src = $iframe->getAttribute( "src" );
148
+
149
+ /**/
150
+
151
+ if ( $this->isBlack( $src, $list_2 ) ) {
152
+ $iframe->setAttribute( "src", $blank );
153
+ $iframe->setAttribute( "suppressedsrc", $src );
154
+ $iframe->setAttribute( "class", $iframe->getAttribute( "class" ) . " " . $class[0] );
155
+ }
156
+ }
157
+
158
+ /**/
159
+
160
+ $offender = $document->saveHTML();
161
+
162
+ /**/
163
+
164
+ libxml_use_internal_errors( false );
165
+
166
+ /**/
167
+
168
+ return $offender;
169
+ }
170
+
171
+ }
lib/iubenda.class.php ADDED
@@ -0,0 +1,379 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * iubenda.class.php
4
+ * version: 1.0.2
5
+ * @author: Copyright 2015 iubenda
6
+ * @license GNU/GPL
7
+ * This program is free software: you can redistribute it and/or modify
8
+ * it under the terms of the GNU General Public License as published by
9
+ * the Free Software Foundation, either version 3 of the License, or
10
+ * (at your option) any later version.
11
+ *
12
+ * This program is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ * GNU General Public License for more details.
16
+ *
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
20
+ */
21
+
22
+ class iubendaPage {
23
+
24
+ const IUB_REGEX_PATTERN = '/<!--\s*IUB_COOKIE_POLICY_START\s*-->(.*?)<!--\s*IUB_COOKIE_POLICY_END\s*-->/sU';
25
+
26
+ public $auto_script_tags = array(
27
+ 'platform.twitter.com/widgets.js',
28
+ 'apis.google.com/js/plusone.js',
29
+ 'apis.google.com/js/platform.js',
30
+ 'connect.facebook.net',
31
+ 'www.youtube.com/iframe_api',
32
+ 'pagead2.googlesyndication.com/pagead/js/adsbygoogle.js',
33
+ 'sharethis.com/button/buttons.js',
34
+ 'addthis.com/js/',
35
+ 'window.adsbygoogle'
36
+ );
37
+ public $auto_iframe_tags = array(
38
+ 'youtube.com',
39
+ 'platform.twitter.com',
40
+ 'www.facebook.com/plugins/like.php',
41
+ 'www.facebook.com/plugins/likebox.php',
42
+ 'apis.google.com',
43
+ 'www.google.com/maps/embed/',
44
+ 'player.vimeo.com/video',
45
+ 'maps.google.it/maps',
46
+ 'www.google.com/maps/embed',
47
+ 'window.adsbygoogle'
48
+ );
49
+ public $iub_comments_detected = array();
50
+ public $iframe_detected = array();
51
+ public $iframe_converted = array();
52
+ public $scripts_detected = array();
53
+ public $scripts_inline_detected = array();
54
+ public $scripts_inline_converted = array();
55
+ public $scripts_converted = array();
56
+
57
+ /*
58
+ construct: the whole HTML output of the page
59
+ */
60
+
61
+ public function __construct( $content_page ) {
62
+ $this->original_content_page = $content_page;
63
+ $this->content_page = $content_page;
64
+ }
65
+
66
+ /*
67
+ print iubenda banner, parameter: the script code of iubenda to print the banner
68
+ */
69
+
70
+ public function print_banner( $banner ) {
71
+ return $banner.= "\n
72
+ <script>
73
+ var iCallback = function(){};
74
+
75
+ if('callback' in _iub.csConfiguration) {
76
+ if('onConsentGiven' in _iub.csConfiguration.callback) iCallback = _iub.csConfiguration.callback.onConsentGiven;
77
+
78
+ _iub.csConfiguration.callback.onConsentGiven = function()
79
+ {
80
+ iCallback();
81
+
82
+ /*
83
+ * Separator
84
+ */
85
+
86
+ jQuery('noscript._no_script_iub').each(function (a, b) { var el = jQuery(b); el.after(el.html()); });
87
+ };
88
+ };
89
+ </script>";
90
+ }
91
+
92
+ /*
93
+ Static, detect bot & crawler
94
+ */
95
+
96
+ static function bot_detected() {
97
+ return (isset( $_SERVER['HTTP_USER_AGENT'] ) && preg_match( '/bot|crawl|slurp|spider|google|yahoo/i', $_SERVER['HTTP_USER_AGENT'] ));
98
+ }
99
+
100
+ /*
101
+ Static, utility function: Return true if the user has already given consent on the page
102
+ */
103
+
104
+ static function consent_given() {
105
+ foreach ( $_COOKIE as $key => $value ) {
106
+ if ( iubendaPage::strpos_array( $key, array( '_iub_cs-s', '_iub_cs' ) ) ) {
107
+ return true;
108
+ }
109
+ }
110
+ return false;
111
+ }
112
+
113
+ /*
114
+ Static, utility function: strpos for array
115
+ */
116
+
117
+ static function strpos_array( $haystack, $needle ) {
118
+ if ( is_array( $needle ) ) {
119
+ foreach ( $needle as $need ) {
120
+ if ( strpos( $haystack, $need ) !== false ) {
121
+ return true;
122
+ }
123
+ }
124
+ } else {
125
+ if ( strpos( $haystack, $need ) !== false ) {
126
+ return true;
127
+ }
128
+ }
129
+ return false;
130
+ }
131
+
132
+ /* Convert scripts, iframe and other code inside IUBENDAs comment in text/plain to not generate cookies */
133
+
134
+ public function create_tags( $html ) {
135
+
136
+ $elements = $html->find( "*" );
137
+ $js = '';
138
+
139
+ if ( is_array( $elements ) ) {
140
+ $count = count( $elements );
141
+ for ( $j = 0; $j < $count; $j ++ ) {
142
+ $e = $elements[$j];
143
+ switch ( $e->tag ) {
144
+ case 'script':
145
+ $class = $e->class;
146
+ $e->class = $class . ' _iub_cs_activate';
147
+ $e->type = 'text/plain';
148
+ $js.= $e->outertext;
149
+ break;
150
+
151
+ case 'iframe':
152
+ $new_src = "//cdn.iubenda.com/cookie_solution/empty.html";
153
+ $class = $e->class;
154
+ $e->suppressedsrc = $e->src;
155
+ $e->src = $new_src;
156
+ $e->class = $class . ' _iub_cs_activate';
157
+ $js.= $e->outertext;
158
+ break;
159
+
160
+ default:
161
+ $js = $html;
162
+ break;
163
+ }
164
+ }
165
+ }
166
+ return $js;
167
+ }
168
+
169
+ /* Parse all IUBENDAs comment and convert the code inside with create_tags method */
170
+
171
+ public function parse_iubenda_comments() {
172
+ preg_match_all( self::IUB_REGEX_PATTERN, $this->content_page, $scripts );
173
+ if ( is_array( $scripts[1] ) ) {
174
+ $count = count( $scripts[1] );
175
+ $js_scripts = array();
176
+ for ( $j = 0; $j < $count; $j ++ ) {
177
+ $this->iub_comments_detected[] = $scripts[1][$j];
178
+ $html = str_get_html( $scripts[1][$j], $lowercase = true, $forceTagsClosed = true, $stripRN = false );
179
+ $js_scripts[] = $this->create_tags( $html );
180
+ }
181
+
182
+ if ( is_array( $scripts[1] ) && is_array( $js_scripts ) ) {
183
+ if ( count( $scripts[1] ) >= 1 && count( $js_scripts ) >= 1 ) {
184
+ $this->content_page = strtr( $this->content_page, array_combine( $scripts[1], $js_scripts ) );
185
+ }
186
+ }
187
+ }
188
+ }
189
+
190
+ /* Parse automatically all the scripts in the page and converts it in text/plain
191
+ if src or the whole output has inside one of the elements in $auto_script_tags array */
192
+
193
+ public function parse_scripts() {
194
+
195
+ $html = str_get_html( $this->content_page, $lowercase = true, $forceTagsClosed = true, $stripRN = false );
196
+ if ( is_object( $html ) ) {
197
+ $scripts = $html->find( "script" );
198
+ if ( is_array( $scripts ) ) {
199
+ $count = count( $scripts );
200
+ for ( $j = 0; $j < $count; $j ++ ) {
201
+ $s = $scripts[$j];
202
+ if ( ! empty( $s->innertext ) ) {
203
+ $this->scripts_detected[] = $s->innertext;
204
+ if ( iubendaPage::strpos_array( $s->innertext, $this->auto_script_tags ) !== false ) {
205
+ $class = $s->class;
206
+ $s->class = $class . ' _iub_cs_activate-inline';
207
+ $s->type = 'text/plain';
208
+ $this->scripts_converted[] = $s->innertext;
209
+ }
210
+ } else {
211
+ $src = $s->src;
212
+ if ( $src ) {
213
+ $this->scripts_inline_detected[] = $src;
214
+ if ( iubendaPage::strpos_array( $src, $this->auto_script_tags ) !== false ) {
215
+ $class = $s->class;
216
+ $s->class = $class . ' _iub_cs_activate';
217
+ $s->type = 'text/plain';
218
+ $this->scripts_inline_converted[] = $src;
219
+ }
220
+ }
221
+ }
222
+ }
223
+ }
224
+
225
+ /*
226
+ * AdSense check by Peste Vasile Alexandru, AdSense here
227
+ */
228
+
229
+ $ad_found = false;
230
+
231
+ while ( preg_match( "#google_ad_client =(.*?);#i", $html ) ) {
232
+ $ad_found = true;
233
+ $ad_client = null;
234
+ $ad_slot = null;
235
+ $ad_width = null;
236
+ $ad_height = null;
237
+ $ad_block = null;
238
+
239
+ /**/
240
+
241
+ preg_match( "#google_ad_client =(.*?);#i", $html, $ad_client );
242
+ preg_match( "#google_ad_slot =(.*?);#i", $html, $ad_slot );
243
+ preg_match( "#google_ad_width =(.*?);#i", $html, $ad_width );
244
+ preg_match( "#google_ad_height =(.*?);#i", $html, $ad_height );
245
+
246
+ /**/
247
+
248
+ $html = preg_replace( "#google_ad_client =(.*?);#i", "", $html, 1 );
249
+ $html = preg_replace( "#google_ad_slot =(.*?);#i", "", $html, 1 );
250
+ $html = preg_replace( "#google_ad_width =(.*?);#i", "", $html, 1 );
251
+ $html = preg_replace( "#google_ad_height =(.*?);#i", "", $html, 1 );
252
+
253
+ /**/
254
+
255
+ $ad_client = trim( $ad_client[1] );
256
+ $ad_slot = trim( $ad_slot[1] );
257
+ $ad_width = trim( $ad_width[1] );
258
+ $ad_height = trim( $ad_height[1] );
259
+
260
+ /**/
261
+
262
+ $ad_class = 'class="_iub_cs_activate_google_ads"';
263
+ $ad_style = 'style="width:' . $ad_width . 'px; height:' . $ad_height . 'px;"';
264
+
265
+ $ad_client = 'data-client=' . $ad_client;
266
+ $ad_slot = 'data-slot=' . $ad_slot;
267
+ $ad_width = 'data-width="' . $ad_width . '"';
268
+ $ad_height = 'data-height="' . $ad_height . '"';
269
+
270
+ /**/
271
+
272
+ $ad_block = "<div $ad_style $ad_class $ad_width $ad_height $ad_slot $ad_client></div>";
273
+
274
+ /**/
275
+
276
+ $html = preg_replace( '#(<[^>]+) src="//pagead2.googlesyndication.com/pagead/show_ads.js"(.*?)</script>#i', $ad_block, $html, 1 );
277
+ }
278
+
279
+ /**/
280
+
281
+ if ( $ad_found ) {
282
+ $adsense_callback = "
283
+ <script>
284
+ function iubenda_adsense_unblock(){
285
+ var t = 1;
286
+ jQuery('._iub_cs_activate_google_ads').each(function() {
287
+ var banner = jQuery(this);
288
+ setTimeout(function(){
289
+ var client = banner.data('client');
290
+ var slot = banner.data('slot');
291
+ var width = banner.data('width');
292
+ var height = banner.data('height');
293
+ var adsense_script = '<scr'+'ipt>'
294
+ + 'google_ad_client = " . chr( 34 ) . "'+client+'" . chr( 34 ) . ";'
295
+ + 'google_ad_slot = '+slot+';'
296
+ + 'google_ad_width = '+width+';'
297
+ + 'google_ad_height = '+height+';'
298
+ + '</scr'+'ipt>';
299
+ var script = document.createElement('script');
300
+ var ads = document.createElement('ads');
301
+ var w = document.write;
302
+ script.setAttribute('type', 'text/javascript');
303
+ script.setAttribute('src', 'http://pagead2.googlesyndication.com/pagead/show_ads.js');
304
+ document.write = (function(params) {
305
+ ads.innerHTML = params;
306
+ document.write = w;
307
+ });
308
+ banner.html(adsense_script).append(ads).append(script);
309
+ }, t);
310
+ t += 300;
311
+ });
312
+ }
313
+ if('callback' in _iub.csConfiguration) {
314
+ _iub.csConfiguration.callback.onConsentGiven = iubenda_adsense_unblock;
315
+ }
316
+ else
317
+ {
318
+ _iub.csConfiguration.callback = {};
319
+
320
+ _iub.csConfiguration.callback.onConsentGiven = iubenda_adsense_unblock;
321
+ }
322
+ </script>
323
+ ";
324
+
325
+ $html = str_replace( "</body>", $adsense_callback . "</body>", $html );
326
+ }
327
+
328
+ /**/
329
+
330
+ $this->content_page = $html;
331
+ }
332
+ }
333
+
334
+ /* Parse automatically all the iframe in the page and change the src to suppressedsrc
335
+ if src has inside one of the elements in $auto_iframe_tags array */
336
+
337
+ public function parse_iframe() {
338
+ $html = str_get_html( $this->content_page, $lowercase = true, $forceTagsClosed = true, $stripRN = false );
339
+ if ( is_object( $html ) ) {
340
+ $iframes = $html->find( "iframe" );
341
+ if ( is_array( $iframes ) ) {
342
+ $count = count( $iframes );
343
+ for ( $j = 0; $j < $count; $j ++ ) {
344
+ $i = $iframes[$j];
345
+ $src = $i->src;
346
+ $this->iframe_detected[] = $src;
347
+ if ( iubendaPage::strpos_array( $src, $this->auto_iframe_tags ) !== false ) {
348
+ $new_src = "//cdn.iubenda.com/cookie_solution/empty.html";
349
+ $class = $i->class;
350
+ $i->suppressedsrc = $src;
351
+ $i->src = $new_src;
352
+ $i->class = $class . ' _iub_cs_activate';
353
+ $this->iframe_converted[] = $src;
354
+ }
355
+ }
356
+ }
357
+ $this->content_page = $html;
358
+ }
359
+ }
360
+
361
+ /*
362
+ Call three methods to parse the page, iubendas comment, scripts + iframe
363
+ */
364
+
365
+ public function parse() {
366
+ $this->parse_iubenda_comments();
367
+ $this->parse_scripts();
368
+ $this->parse_iframe();
369
+ }
370
+
371
+ /*
372
+ Return the final page to output
373
+ */
374
+
375
+ public function get_converted_page() {
376
+ return $this->content_page;
377
+ }
378
+
379
+ }
lib/simple_html_dom.php ADDED