Ginger – EU Cookie Law - Version 2.2

Version Description

Download this release

Release Info

Developer manafactory
Plugin Icon 128x128 Ginger – EU Cookie Law
Version 2.2
Comparing to
See all releases

Code changes from version 2.1 to 2.2

addon/polylang/ginger.polylang.php ADDED
@@ -0,0 +1,348 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ add_action("ginger_add_menu", "ginger_polylang_menu");
3
+
4
+ function ginger_polylang_menu(){
5
+
6
+ add_submenu_page( 'ginger-setup', "polylang", __("Polylang", "ginger"), 'manage_options', 'ginger-polylang', 'ginger_polylang_menu_page');
7
+
8
+
9
+ }
10
+
11
+ function ginger_polylang_menu_page(){
12
+ // global $sitepress;
13
+ global $polylang;
14
+ // $current_lang = $sitepress->get_current_language(); //save current language
15
+ $current_lang = pll_current_language();
16
+
17
+ $key = "ginger_polylang_options";
18
+ if(isset($_POST["submit"]) && !wp_verify_nonce($_POST['ginger_options'], 'save_ginger_polylang_options')){
19
+ return;
20
+ }
21
+
22
+ if(isset($_POST["submit"])){
23
+
24
+ $params = $_POST;
25
+ unset($params["submit"]);
26
+ unset($params["ginger_options"]);
27
+ unset($params["_wp_http_referer"]);
28
+
29
+
30
+ // print_r($params);
31
+ update_option($key, $params);
32
+
33
+ echo '<div class="updated"><p>'.__( 'Updated!', 'ginger' ).'</p></div>';
34
+ }
35
+ $options = get_option($key);
36
+
37
+ // print_r($options);
38
+ ?>
39
+ <div class="wrap">
40
+ <h2>polylang - Ginger setup</h2>
41
+ <hr>
42
+
43
+ <?php
44
+ if (!function_exists('icl_get_languages')) {
45
+ echo "<h3>";
46
+ _e("polylang is disabled!", "ginger");
47
+ echo "</h3>";
48
+
49
+ _e("Enable here:", "ginger");
50
+ echo " <a href='".get_bloginfo("url")."/wp-admin/plugins.php'>"._("Plugins")."</a>";
51
+ }else{
52
+ ?>
53
+ <form method="post" action="admin.php?page=<?php echo $_GET["page"]; ?>">
54
+
55
+ <table class="form-table striped">
56
+ <thead>
57
+ <tr>
58
+ <td colspan="2">
59
+ <h2><?php _e("Banner Multilanguage Setup", "ginger"); ?></h2>
60
+ <?php _e("Overwrite default banner rules", "ginger"); ?>
61
+ </td>
62
+ </tr>
63
+ </thead>
64
+ <tbody>
65
+
66
+ <?php wp_nonce_field('save_ginger_polylang_options', 'ginger_options'); ?>
67
+ <?php
68
+ // $languages = icl_get_languages('skip_missing=0');
69
+ if (isset($polylang))
70
+ $languages = $polylang->model->get_languages_list() ;
71
+
72
+ //print_r($languages);
73
+ $c=0;
74
+ foreach ($languages as $language) {
75
+ $langcode=$language->slug;
76
+ $langval["native_name"] = $language->name;
77
+ $langval["slug"] = $language->slug;
78
+
79
+ ?>
80
+ <tr style="background-color:#F99A30; ">
81
+ <th scope="row" style="padding-left:20px;"></th>
82
+ <td>
83
+ <h2><?php echo $langval["native_name"]; ?></h2>
84
+ </td>
85
+ </tr>
86
+
87
+ <tr>
88
+ <th scope="row" style="padding-left:20px;"><?php _e("Banner Text", "ginger"); ?> - <?php echo $langval["native_name"]; ?></th>
89
+ <td>
90
+ <fieldset>
91
+ <legend class="screen-reader-text"><span><?php _e("Banner Text", "ginger"); ?></span></legend>
92
+ <p><label><?php
93
+ if(!isset($options["ginger_banner_text"][$langcode]))
94
+ $options["ginger_banner_text"][$langcode] = "";
95
+ if (function_exists("wp_editor"))
96
+ wp_editor(stripslashes($options["ginger_banner_text"][$langcode]), "ginger_bar_text_".$langcode."", array('textarea_name' => "ginger_banner_text[".$langcode."]", 'media_buttons' => false, 'textarea_rows' => 3, 'teeny' => true));
97
+ else
98
+ echo '<textarea name = "ginger_banner_text['.$langcode.']" >' . $options["ginger_banner_text"][$langcode] . '</textarea>';
99
+ ?>
100
+ <br>
101
+ <small><?php _e('You can use syntax <code>{{privacy_page}}</code> to link Privacy Police Page defined in <a href="admin.php?page=ginger-setup&tab=policy">Privacy Policy Tab</a>', "ginger"); ?></small>
102
+ </label>
103
+ </p>
104
+ </fieldset>
105
+ </td>
106
+ </tr>
107
+
108
+ <tr>
109
+ <th scope="row" style="padding-left:20px;"><?php _e('Privacy Policy page', 'ginger'); ?> - <?php echo $langval["native_name"]; ?></th>
110
+ <td>
111
+ <fieldset>
112
+ <p><label>
113
+ <?php
114
+ // $sitepress->switch_lang($langcode);
115
+ $args = array(
116
+ 'sort_order' => 'asc',
117
+ 'sort_column' => 'post_title',
118
+ 'hierarchical' => 1,
119
+ 'number' => '',
120
+ 'offset' => 0,
121
+ 'post_type' => 'page',
122
+ 'post_status' => 'publish',
123
+ 'lang' => $langcode
124
+ );
125
+ // print_r($args);
126
+
127
+ $p = new WP_Query( $args );
128
+ if(!isset($options["ginger_privacy_page"][$langcode]))$options["ginger_privacy_page"][$langcode] = "";
129
+ ?>
130
+ <select name="ginger_privacy_page[<?php echo $langcode; ?>]" id="privacy_page_select_<?php echo $langcode; ?>" >
131
+ <option value=""><?php _e('Select page', 'ginger'); ?></option>
132
+ <?php
133
+ while ( $p->have_posts() ) :
134
+ $p->next_post();
135
+ ?>
136
+ <option value="<?php echo $p->post->ID; ?>" <?php if ($options["ginger_privacy_page"][$langcode] == $p->post->ID) echo ' selected="selected" '; ?>><?php echo $p->post->post_title; ?></option>
137
+ <?php
138
+ endwhile;
139
+ ?>
140
+ </select>
141
+ <?php
142
+ // $sitepress->switch_lang($current_lang); //restore previous language
143
+ ?>
144
+
145
+ </label></p>
146
+ </fieldset>
147
+ </td>
148
+ </tr>
149
+
150
+
151
+
152
+ <tr>
153
+ <th scope="row" style="padding-left:20px;"><?php _e("Iframe Text", "ginger"); ?> - <?php echo $langval["native_name"]; ?></th>
154
+ <td>
155
+ <fieldset>
156
+ <legend class="screen-reader-text"><span><?php _e("Iframe Text", "ginger"); ?></span></legend>
157
+ <p><label><?php
158
+ if(!isset($options["ginger_Iframe_text"][$langcode]))
159
+ $options["ginger_Iframe_text"][$langcode] = "";
160
+ if (function_exists("wp_editor"))
161
+ wp_editor(stripslashes($options["ginger_Iframe_text"][$langcode]), "ginger_Iframe_text_".$langcode."", array('textarea_name' => "ginger_Iframe_text[".$langcode."]", 'media_buttons' => false, 'textarea_rows' => 3, 'teeny' => true));
162
+ else
163
+ echo '<textarea name = "ginger_Iframe_text['.$langcode.']" >' . $options["ginger_Iframe_text"][$langcode] . '</textarea>';
164
+
165
+ ?></label></p>
166
+ </fieldset>
167
+ </td>
168
+ </tr>
169
+
170
+ <tr>
171
+ <th scope="row" style="padding-left:20px;"><?php _e("Customize your banner buttons", "ginger"); ?> - <?php echo $langval["native_name"]; ?></th>
172
+ <td>
173
+ <fieldset>
174
+ <legend class="screen-reader-text"><span><?php _e("Iframe Text", "ginger"); ?></span></legend>
175
+ <p>
176
+ <label><b><?php _e("Accept cookie Button", "ginger"); ?></b></label>
177
+ </p>
178
+
179
+ <p>
180
+ <label><?php _e("Text", "ginger"); ?></label>
181
+ <?php
182
+ if(!isset($options['accept_cookie_button_text'][$langcode]))$options['accept_cookie_button_text'][$langcode] = "";
183
+ ?>
184
+ <input name="accept_cookie_button_text[<?php echo $langcode; ?>]" id="accept_cookie_button_text_<?php echo $langcode; ?>" type="text"
185
+ value="<?php if ($options['accept_cookie_button_text'][$langcode] != "") {
186
+ echo $options['accept_cookie_button_text'][$langcode];
187
+ } else {
188
+ echo _e('Accept Cookie', 'ginger');
189
+ } ?>">
190
+ </p>
191
+
192
+ <p>
193
+ <label><b><?php _e("Disable cookie Button", "ginger"); ?></b></label>
194
+ </p>
195
+
196
+ <p>
197
+ <label><?php _e("Text", "ginger"); ?></label>
198
+ <input name="disable_cookie_button_text[<?php echo $langcode; ?>]" id="disable_cookie_button_text_<?php echo $langcode; ?>" type="text"
199
+ value="<?php if (isset($options['disable_cookie_button_text'][$langcode]) && $options['disable_cookie_button_text'][$langcode] != "") {
200
+ echo $options['disable_cookie_button_text'][$langcode];
201
+ } else {
202
+ echo _e('Disable Cookie', 'ginger');
203
+ } ?>" <?php if (!(isset($options['disable_cookie_button_status'][$langcode]) && $options['disable_cookie_button_status'][$langcode] == "1")) {
204
+ echo 'disabled=true';
205
+ } ?>>
206
+ <?php echo _e('Enable:', 'ginger') ?>&nbsp;
207
+ <input type="checkbox" id="disable_cookie_button_status_<?php echo $langcode; ?>" name="disable_cookie_button_status[<?php echo $langcode; ?>]"
208
+ value="1" <?php if (isset($options['disable_cookie_button_status'][$langcode]) && $options['disable_cookie_button_status'][$langcode] == "1") {
209
+ echo 'checked';
210
+ } ?>
211
+ onclick="en_dis_able_text_banner_button('disable_cookie_button_status_<?php echo $langcode; ?>','disable_cookie_button_text_<?php echo $langcode; ?>','img_disable_cookie_button_status_<?php echo $langcode; ?>');">
212
+
213
+
214
+ <img id="img_disable_cookie_button_status_<?php echo $langcode; ?>"
215
+ src="<?php if (isset($options['disable_cookie_button_status'][$langcode]) && $options['disable_cookie_button_status'][$langcode] == "1") {
216
+ echo plugins_url("ginger/img/ok.png");
217
+ } else {
218
+ echo plugins_url("ginger/img/xx.png");
219
+ } ?>" style="max-width: 20px; max-height: 20px; vertical-align: middle">
220
+
221
+
222
+ </p>
223
+ </fieldset>
224
+ </td>
225
+ </tr>
226
+
227
+
228
+
229
+
230
+ <?php
231
+
232
+ }
233
+ ?>
234
+ </tbody>
235
+ </table>
236
+ <p class="submit"><input type="submit" name="submit" id="submit" class="button button-primary" value="<?php _e("Save Changes", "ginger"); ?>"></p>
237
+ </form>
238
+ <?php
239
+
240
+ }// check polylang active
241
+ ?>
242
+
243
+
244
+
245
+ </div>
246
+
247
+ <?php
248
+
249
+ }
250
+
251
+
252
+ add_filter("ginger_text_iframe", "ginger_polylang_text_iframe");
253
+ function ginger_polylang_text_iframe($text){
254
+ $key = "ginger_polylang_options";
255
+ $options = get_option($key);
256
+ if($options == "") return $text;
257
+ if (!function_exists('icl_get_languages')) return $text;
258
+
259
+ /* global $sitepress;
260
+ $current_lang = $sitepress->get_current_language(); //save current language
261
+ */
262
+
263
+ $current_lang = pll_current_language();
264
+ if(trim(strip_tags($options['ginger_Iframe_text'][$current_lang]))):
265
+ $ginger_iframe_text = $options['ginger_Iframe_text'][$current_lang];
266
+ $ginger_iframe_text = str_replace('</', '<\/', $ginger_iframe_text);
267
+ $ginger_iframe_text = str_replace( array("\n", "\r"), "<br \/>", $ginger_iframe_text );
268
+ return $ginger_iframe_text;
269
+ endif;
270
+
271
+ return $text;
272
+ }
273
+
274
+
275
+ add_filter("ginger_text_banner", "ginger_polylang_text_banner");
276
+ function ginger_polylang_text_banner($text)
277
+ {
278
+ $key = "ginger_polylang_options";
279
+ $options = get_option($key);
280
+ if ($options == "") return $text;
281
+ if (!function_exists('icl_get_languages')) return $text;
282
+
283
+ // global $sitepress;
284
+ // $current_lang = $sitepress->get_current_language(); //save current language
285
+ $current_lang = pll_current_language();
286
+
287
+ if (trim(strip_tags($options['ginger_banner_text'][$current_lang])) != ""):
288
+ $ginger_text = $options['ginger_banner_text'][$current_lang];
289
+ $ginger_text = str_replace('</', '<\/', $ginger_text);
290
+ $ginger_text = str_replace(array("\n", "\r"), "<br \/>", $ginger_text);
291
+
292
+ //Recupero privacy policy se presente
293
+ if (strpos($ginger_text, '{{privacy_page}}') !== false):
294
+ $privacy_policy = $options['ginger_privacy_page'][$current_lang];
295
+ if ($privacy_policy) {
296
+
297
+ $privacy_policy = get_post($privacy_policy);
298
+ $privacy_policy = ' <a href="' . get_permalink($privacy_policy->ID) . '">' . addslashes($privacy_policy->post_title) . '<\/a>';
299
+ $ginger_text = str_replace('{{privacy_page}}', $privacy_policy, $ginger_text);
300
+ }
301
+ endif;
302
+ return $ginger_text;
303
+ endif;
304
+
305
+ return $text;
306
+ }
307
+
308
+ add_filter("ginger_label_accept_cookie", "ginger_polylang_label_accept_cookie");
309
+ function ginger_polylang_label_accept_cookie($text){
310
+ $key = "ginger_polylang_options";
311
+ $options = get_option($key);
312
+ if($options == "") return $text;
313
+ if (!function_exists('icl_get_languages')) return $text;
314
+
315
+ // global $sitepress;
316
+ // $current_lang = $sitepress->get_current_language();
317
+ $current_lang = pll_current_language();
318
+
319
+ if(trim($options['accept_cookie_button_text'][$current_lang])):
320
+ $label_accept_cookie = $options['accept_cookie_button_text'][$current_lang];
321
+ return $label_accept_cookie;
322
+ endif;
323
+
324
+ return $text;
325
+ }
326
+
327
+ add_filter("ginger_label_disable_cookie", "ginger_polylang_label_disable_cookie");
328
+ function ginger_polylang_label_disable_cookie($text){
329
+ $key = "ginger_polylang_options";
330
+ $options = get_option($key);
331
+ if($options == "") return $text;
332
+ if (!function_exists('icl_get_languages')) return $text;
333
+
334
+ // global $sitepress;
335
+ // $current_lang = $sitepress->get_current_language(); //save current language
336
+ $current_lang = pll_current_language();
337
+
338
+ if(isset($options['disable_cookie_button_status'][$current_lang])):
339
+ if(trim($options['disable_cookie_button_text'][$current_lang])):
340
+ $label_disable_cookie = $options['disable_cookie_button_text'][$current_lang];
341
+ return $label_disable_cookie;
342
+ endif;
343
+ endif;
344
+
345
+ return $text;
346
+ }
347
+
348
+
addon/polylang/index.php ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ //polylang
3
+ $option_polylang = get_option('gingerpolylang');
4
+ if($option_polylang && $option_polylang['activated'] == 1):
5
+ require_once('ginger.polylang.php');
6
+ endif;
7
+
8
+ add_action("ginger_addon_activation_page", "ginger_polylang_activation_page");
9
+
10
+ function ginger_polylang_activation_page()
11
+ {
12
+ $appname = "polylang";
13
+ $app_data = ginger_app_data($appname);
14
+ $option_ginger_polylang = get_option('gingerpolylang');
15
+ ?>
16
+ <div class="ginger-addon">
17
+ <table class="form-table striped">
18
+ <thead>
19
+ <tr>
20
+ <td colspan="2">
21
+ <img class="ginger-thumb" src="<?php echo $app_data["thumb"]; ?>" />
22
+
23
+ <h3><?php _e("polylang", "ginger"); ?>
24
+ <?php
25
+ ginger_app_price($appname, $app_data);
26
+ ?></h3>
27
+ <small><?php _e("polylang add-on will adapt Ginger for polylang multilanguage websites .", "ginger"); ?></small>
28
+ <br style="clear: both" />
29
+ <p>
30
+ <a href="http://www.ginger-cookielaw.com/prodotto/<?php echo $appname; ?>/" target="_BLANK" class="button button-primary" <?php if ($option_ginger_polylang && $option_ginger_polylang['activated'] == 1){ echo "disabled='disabled' "; } ?>><?php _e("Get Activation Code", "ginger"); ?></a>
31
+ </p>
32
+
33
+ </td>
34
+ </tr>
35
+ </thead>
36
+ <tbody>
37
+ <tr>
38
+
39
+ <td>
40
+ <fieldset>
41
+ <legend class="screen-reader-text"><span><?php _e("polylang", "ginger"); ?></span></legend>
42
+ <p>
43
+ <label>
44
+ <?php _e("Active add-on", "ginger");?>:&nbsp;
45
+ </label>
46
+
47
+ <?php if ($option_ginger_polylang && $option_ginger_polylang['activated'] == 1): ?>
48
+ <img id="img_google_polylang"
49
+ src="<?php echo plugins_url('/ginger/img/ok.png'); ?>"
50
+ style="max-width: 20px; max-height: 20px; vertical-align: middle">
51
+
52
+ <form method="get" action="<?php echo admin_url('admin.php?page=ginger-add-on'); ?>">
53
+ <input type="hidden" name="page" value="ginger-add-on">
54
+ <input id="activationcode" type="text" name="activationcode"
55
+ value="<?php echo $option_ginger_polylang['licence_key']; ?>" placeholder=""
56
+ size="30px">
57
+ <input id="activationmail" type="text" name="activationmail"
58
+ value="<?php echo $option_ginger_polylang['email']; ?>" placeholder="" size="30px">
59
+ <input type="hidden" name="product_id" value="gingerpolylang">
60
+ <input type="hidden" name="request" value="deactivation">
61
+ <input type="submit" class="button" value="<?php _e('Deactivate', 'ginger') ?>">
62
+ </form>
63
+ <?php else: ?>
64
+ <img id="img_google_polylang"
65
+ src="<?php echo plugins_url('/ginger/img/xx.png'); ?>"
66
+ style="max-width: 20px; max-height: 20px; vertical-align: middle">
67
+ <form method="get" action="<?php echo admin_url('admin.php?page=ginger-add-on'); ?>">
68
+ <input type="hidden" name="page" value="ginger-add-on">
69
+ <input id="activationcode" type="text" name="activationcode" value=""
70
+ placeholder="<?php _e('Insert here the add-on activation code.', 'ginger') ?>"
71
+ size="30px">
72
+ <input id="activationmail" type="text" name="activationmail" value=""
73
+ placeholder="<?php _e('Insert here your activation mail.', 'ginger') ?>" size="30px">
74
+ <input type="hidden" name="product_id" value="gingerpolylang">
75
+ <input type="hidden" name="request" value="activation">
76
+ <input type="submit" class="button" value="<?php _e('Activate', 'ginger') ?>">
77
+ </form>
78
+ <?php endif; ?>
79
+ </p>
80
+ </fieldset>
81
+ </td>
82
+ </tr>
83
+
84
+ </tbody>
85
+ </table>
86
+
87
+ </div>
88
+ <?php
89
+
90
+ }
addon/wpml/ginger.wpml.php CHANGED
@@ -10,7 +10,12 @@ function ginger_wpml_menu(){
10
 
11
  function ginger_wpml_menu_page(){
12
  global $sitepress;
 
13
  $current_lang = $sitepress->get_current_language(); //save current language
 
 
 
 
14
 
15
  $key = "ginger_wpml_options";
16
  if(isset($_POST["submit"]) && !wp_verify_nonce($_POST['ginger_options'], 'save_ginger_wpml_options')){
@@ -238,7 +243,10 @@ function ginger_wpml_text_iframe($text){
238
  if (!function_exists('icl_get_languages')) return $text;
239
 
240
  global $sitepress;
241
- $current_lang = $sitepress->get_current_language(); //save current language
 
 
 
242
 
243
  if(trim(strip_tags($options['ginger_Iframe_text'][$current_lang]))):
244
  $ginger_iframe_text = $options['ginger_Iframe_text'][$current_lang];
@@ -260,8 +268,10 @@ function ginger_wpml_text_banner($text)
260
  if (!function_exists('icl_get_languages')) return $text;
261
 
262
  global $sitepress;
 
263
  $current_lang = $sitepress->get_current_language(); //save current language
264
-
 
265
  if (trim(strip_tags($options['ginger_banner_text'][$current_lang])) != ""):
266
  $ginger_text = $options['ginger_banner_text'][$current_lang];
267
  $ginger_text = str_replace('</', '<\/', $ginger_text);
@@ -291,7 +301,10 @@ function ginger_wpml_label_accept_cookie($text){
291
  if (!function_exists('icl_get_languages')) return $text;
292
 
293
  global $sitepress;
294
- $current_lang = $sitepress->get_current_language();
 
 
 
295
 
296
  if(trim($options['accept_cookie_button_text'][$current_lang])):
297
  $label_accept_cookie = $options['accept_cookie_button_text'][$current_lang];
@@ -309,7 +322,10 @@ function ginger_wpml_label_disable_cookie($text){
309
  if (!function_exists('icl_get_languages')) return $text;
310
 
311
  global $sitepress;
 
312
  $current_lang = $sitepress->get_current_language(); //save current language
 
 
313
  if($options['disable_cookie_button_status'][$current_lang]):
314
  if(trim($options['disable_cookie_button_text'][$current_lang])):
315
  $label_disable_cookie = $options['disable_cookie_button_text'][$current_lang];
10
 
11
  function ginger_wpml_menu_page(){
12
  global $sitepress;
13
+ if($sitepress){
14
  $current_lang = $sitepress->get_current_language(); //save current language
15
+ }else{
16
+ echo '<div class="wrap"><h2>WPML - Ginger setup</h2><hr><p>'.__("WPML not found!", "ginger").'</p></div>';
17
+ exit;
18
+ }
19
 
20
  $key = "ginger_wpml_options";
21
  if(isset($_POST["submit"]) && !wp_verify_nonce($_POST['ginger_options'], 'save_ginger_wpml_options')){
243
  if (!function_exists('icl_get_languages')) return $text;
244
 
245
  global $sitepress;
246
+ if($sitepress)
247
+ $current_lang = $sitepress->get_current_language(); //save current language
248
+ else
249
+ return $text;
250
 
251
  if(trim(strip_tags($options['ginger_Iframe_text'][$current_lang]))):
252
  $ginger_iframe_text = $options['ginger_Iframe_text'][$current_lang];
268
  if (!function_exists('icl_get_languages')) return $text;
269
 
270
  global $sitepress;
271
+ if($sitepress)
272
  $current_lang = $sitepress->get_current_language(); //save current language
273
+ else
274
+ return $text;
275
  if (trim(strip_tags($options['ginger_banner_text'][$current_lang])) != ""):
276
  $ginger_text = $options['ginger_banner_text'][$current_lang];
277
  $ginger_text = str_replace('</', '<\/', $ginger_text);
301
  if (!function_exists('icl_get_languages')) return $text;
302
 
303
  global $sitepress;
304
+ if($sitepress)
305
+ $current_lang = $sitepress->get_current_language();
306
+ else
307
+ return $text;
308
 
309
  if(trim($options['accept_cookie_button_text'][$current_lang])):
310
  $label_accept_cookie = $options['accept_cookie_button_text'][$current_lang];
322
  if (!function_exists('icl_get_languages')) return $text;
323
 
324
  global $sitepress;
325
+ if($sitepress)
326
  $current_lang = $sitepress->get_current_language(); //save current language
327
+ else
328
+ return $text;
329
  if($options['disable_cookie_button_status'][$current_lang]):
330
  if(trim($options['disable_cookie_button_text'][$current_lang])):
331
  $label_disable_cookie = $options['disable_cookie_button_text'][$current_lang];
ginger-eu-cookie-law.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Ginger - EU Cookie Law
4
  Plugin URI: http://manafactory.it/
5
  Description: Make your website compliant with EU Cookie Policy.
6
- Version: 2.1
7
  Author: Manafactory
8
  Author URI: http://manafactory.it/
9
  License: GPLv2 or later
3
  Plugin Name: Ginger - EU Cookie Law
4
  Plugin URI: http://manafactory.it/
5
  Description: Make your website compliant with EU Cookie Policy.
6
+ Version: 2.2
7
  Author: Manafactory
8
  Author URI: http://manafactory.it/
9
  License: GPLv2 or later
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: manafactory, webgrafia, matteobarale
3
  Donate link: http://www.ginger-cookielaw.com/
4
  Tags: EU Cookie Law, cookie law, block cookie, cookie consent, cookie law, cookie policy, privacy policy, cookie banner, italian cookie law, cookie italia
5
  Requires at least: 3.0.1
6
- Tested up to: 4.2.2
7
- Stable tag: 2.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -33,15 +33,18 @@ The aim of Ginger is to be a **complete plug'n play solution** that make your we
33
  * vimeo
34
  * Disqus
35
  * ShareThis
 
 
36
  * Adsense
 
37
  * WPML
38
- * Custom Javascript url
39
- * Custom Iframe url
40
 
41
  = Coming soon: =
42
  * **Privacy Policy** Generator
43
  * **Logger** addon
44
- * **Multisite**
45
 
46
  More information [here: ginger-cookielaw.com](http://www.ginger-cookielaw.com/)
47
 
3
  Donate link: http://www.ginger-cookielaw.com/
4
  Tags: EU Cookie Law, cookie law, block cookie, cookie consent, cookie law, cookie policy, privacy policy, cookie banner, italian cookie law, cookie italia
5
  Requires at least: 3.0.1
6
+ Tested up to: 4.2.3
7
+ Stable tag: 2.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
33
  * vimeo
34
  * Disqus
35
  * ShareThis
36
+
37
+ = Activable Addons: =
38
  * Adsense
39
+ * Analytics
40
  * WPML
41
+ * Polylang
42
+ * Custom Javascript url & Custom Iframe url
43
 
44
  = Coming soon: =
45
  * **Privacy Policy** Generator
46
  * **Logger** addon
47
+ * **Multisite** addon
48
 
49
  More information [here: ginger-cookielaw.com](http://www.ginger-cookielaw.com/)
50
 
uninstall.php CHANGED
@@ -19,5 +19,8 @@ delete_option('gingeradsense');
19
  delete_option('gingerwpml');
20
  delete_option('ginger_wpml_options');
21
 
 
 
 
22
  delete_option('gingeranalytics');
23
  delete_option('gingeranalytics_option');
19
  delete_option('gingerwpml');
20
  delete_option('ginger_wpml_options');
21
 
22
+ delete_option('gingerpolylang');
23
+ delete_option('ginger_polylang_options');
24
+
25
  delete_option('gingeranalytics');
26
  delete_option('gingeranalytics_option');