Ginger – EU Cookie Law - Version 3.0

Version Description

  • Removed policy violation
Download this release

Release Info

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

Code changes from version 2.3.6 to 3.0

addon/adsense/ginger.adsense.php DELETED
@@ -1,64 +0,0 @@
1
- <?php
2
- /**
3
- * Created by PhpStorm.
4
- * User: matteobarale
5
- * Date: 26/06/15
6
- * Time: 12:02
7
- */
8
-
9
- add_action('ginger_add_menu', 'add_ginger_adsense');
10
- function add_ginger_adsense(){
11
- add_submenu_page( 'ginger-setup', "Ginger Adsense", __("Google Adsense", "ginger"), 'manage_options', 'ginger-adsense', 'ginger_adsense');
12
- }
13
-
14
- function ginger_adsense(){
15
-
16
- $wp_root = dirname(dirname( dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) ));
17
- if ( file_exists( $wp_root . '/wp-load.php' ) ) {
18
- require_once( $wp_root . "/wp-load.php" );
19
- } else {
20
- exit;
21
- }
22
-
23
- if ( ! current_user_can( 'manage_options' ) ) die();
24
-
25
-
26
- $option_analitycs = get_option('gingeradsense');
27
- $activationemail = $option_analitycs['email'];
28
- $activationcode = $option_analitycs['licence_key'];
29
- $product_id = $option_analitycs['product_id'];
30
- $instance = $option_analitycs['instance'];
31
-
32
-
33
- $args = array(
34
- 'wc-api' => 'software-api',
35
- 'request' => 'check',
36
- 'email' => $activationemail,
37
- 'licence_key' => $activationcode,
38
- 'product_id' => $product_id,
39
- 'instance' => $instance
40
- );
41
-
42
- $data = execute_request( $args );
43
- if($data->success == 1): //Inizio Verifica ?>
44
- <div class="wrap">
45
- <h2>Ginger - Adsense Add On</h2>
46
- <p><?php _e("No configuration required!", "ginger"); ?></p>
47
-
48
- </div>
49
- <?php else: //La licenza sembra non essere valida; ?>
50
- <?php $option = get_option('gingeradsense');
51
- $option['activated'] = 0; update_option('gingeradsense', $option); ?>
52
- <div class="wrap">
53
- <h2>Ginger - Adsense Add On</h2>
54
- <p><?php _e("Licence key look inactive. Addon disabled", "ginger"); ?></p>
55
- <p><?php _e("If you think is an error contact us here:", "ginger"); ?> <a href="http://www.ginger-cookielaw.com/">www.ginger-cookielaw.com/</a></p>
56
- </div>
57
- <?php endif; ?>
58
-
59
-
60
- <?php }
61
- add_filter('ginger_script_async_tags', 'ginger_addsesneremover',10,3);
62
- function ginger_addsesneremover($array){
63
- return array_merge($array, array('adsbygoogle', 'googlesyndication'));
64
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
addon/adsense/index.php DELETED
@@ -1,87 +0,0 @@
1
- <?php
2
- //Adsense
3
- $option_adsense = get_option('gingeradsense');
4
- if($option_adsense && $option_adsense['activated'] == 1):
5
- require_once('ginger.adsense.php');
6
- endif;
7
-
8
- add_action("ginger_addon_activation_page", "ginger_adsense_activation_page");
9
-
10
- function ginger_adsense_activation_page()
11
- {
12
- $appname = "adsense";
13
- $app_data = ginger_app_data($appname);
14
- $option_ginger_analitics = get_option('gingeradsense');
15
- ?>
16
-
17
- <div class="ginger-addon">
18
- <table class="form-table striped">
19
- <thead>
20
- <tr>
21
- <td colspan="2">
22
- <img class="ginger-thumb" src="<?php echo $app_data["thumb"]; ?>" />
23
- <h3><?php _e("Google AdSense", "ginger"); ?>
24
- <?php
25
- ginger_app_price($appname, $app_data);
26
- ?></h3>
27
- <small><?php _e("This add-on blocks cookies and ads created by Google AdSense, until user's acceptation.", "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_analitics && $option_ginger_analitics['activated'] == 1){ echo "disabled='disabled' "; } ?>><?php _e("Get Activation Code", "ginger"); ?></a>
31
- </p>
32
- </td>
33
- </tr>
34
- </thead>
35
- <tbody>
36
- <tr>
37
-
38
- <td>
39
- <fieldset>
40
- <legend class="screen-reader-text"><span><?php _e("Google AdSense", "ginger"); ?></span></legend>
41
- <p>
42
- <label>
43
- <?php _e("Active add-on", "ginger");?>:&nbsp;
44
- </label>
45
- <?php if ($option_ginger_analitics && $option_ginger_analitics['activated'] == 1): ?>
46
- <img id="img_google_analytics"
47
- src="<?php echo plugins_url('/ginger/img/ok.png'); ?>"
48
- style="max-width: 20px; max-height: 20px; vertical-align: middle">
49
-
50
- <form method="get" action="<?php echo admin_url('admin.php?page=ginger-add-on'); ?>">
51
- <input type="hidden" name="page" value="ginger-add-on">
52
- <input id="activationcode" type="text" name="activationcode"
53
- value="<?php echo $option_ginger_analitics['licence_key']; ?>" placeholder=""
54
- size="30px">
55
- <input id="activationmail" type="text" name="activationmail"
56
- value="<?php echo $option_ginger_analitics['email']; ?>" placeholder="" size="30px">
57
- <input type="hidden" name="product_id" value="gingeradsense">
58
- <input type="hidden" name="request" value="deactivation">
59
- <input type="submit" class="button" value="<?php _e('Deactivate', 'ginger') ?>">
60
- </form>
61
- <?php else: ?>
62
- <img id="img_google_analytics"
63
- src="<?php echo plugins_url('/ginger/img/xx.png'); ?>"
64
- style="max-width: 20px; max-height: 20px; vertical-align: middle">
65
- <form method="get" action="<?php echo admin_url('admin.php?page=ginger-add-on'); ?>">
66
- <input type="hidden" name="page" value="ginger-add-on">
67
- <input id="activationcode" type="text" name="activationcode" value=""
68
- placeholder="<?php _e('Insert here the add-on activation code.', 'ginger') ?>"
69
- size="30px">
70
- <input id="activationmail" type="text" name="activationmail" value=""
71
- placeholder="<?php _e('Insert here your activation mail.', 'ginger') ?>" size="30px">
72
- <input type="hidden" name="product_id" value="gingeradsense">
73
- <input type="hidden" name="request" value="activation">
74
- <input type="submit" class="button" value="<?php _e('Activate', 'ginger') ?>">
75
- </form>
76
- <?php endif; ?>
77
- </p>
78
- </fieldset>
79
- </td>
80
- </tr>
81
-
82
- </tbody>
83
- </table>
84
- </div>
85
- <?php
86
-
87
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
addon/analytics/ginger.analytics.php DELETED
@@ -1,159 +0,0 @@
1
- <?php
2
- /**
3
- * Created by PhpStorm.
4
- * User: matteobarale
5
- * Date: 26/06/15
6
- * Time: 12:02
7
- */
8
-
9
- add_action('ginger_add_menu', 'add_ginger_analytics');
10
- function add_ginger_analytics(){
11
- add_submenu_page( 'ginger-setup', "Ginger Analytics", __("Google Analytics", "ginger"), 'manage_options', 'ginger-analytics', 'ginger_analytics');
12
- }
13
-
14
- function ginger_analytics(){
15
-
16
- $wp_root = dirname(dirname( dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) ));
17
- if ( file_exists( $wp_root . '/wp-load.php' ) ) {
18
- require_once( $wp_root . "/wp-load.php" );
19
- } else {
20
- exit;
21
- }
22
-
23
- if ( ! current_user_can( 'manage_options' ) ) die();
24
-
25
-
26
- $option_analitycs = get_option('gingeranalytics');
27
- $activationemail = $option_analitycs['email'];
28
- $activationcode = $option_analitycs['licence_key'];
29
- $product_id = $option_analitycs['product_id'];
30
- $instance = $option_analitycs['instance'];
31
-
32
-
33
- $args = array(
34
- 'wc-api' => 'software-api',
35
- 'request' => 'check',
36
- 'email' => $activationemail,
37
- 'licence_key' => $activationcode,
38
- 'product_id' => $product_id,
39
- 'instance' => $instance
40
- );
41
-
42
- $data = execute_request( $args );
43
- if($data->success == 1): //Inizio Verifica ?>
44
- <?php
45
- if($_POST):
46
- if(isset($_POST['enable_ginger_analytics']) && $_POST['enable_ginger_analytics'] == 1):
47
- $content = file_get_contents(get_bloginfo('url') .'/?analytics=check');
48
- $array_to_check = array(
49
- 'www.google-analytics.com/analytics.js',
50
- 'google-analytics.com/ga.js',
51
- '_getTracker',
52
- );
53
-
54
- foreach($array_to_check as $check):
55
- if(strpos( $content, $check) !== false):
56
- $find = 'trovatocodice';
57
- $_POST['enable_ginger_analytics'] = 0;
58
- break;
59
- endif;
60
- endforeach;
61
-
62
- endif;
63
- $args = array(
64
- 'enable_ginger_analytics' => $_POST['enable_ginger_analytics'],
65
- 'ginger_analytics_code' => $_POST['ginger_analytics_code'],
66
- 'anonymize_ginger_analytics' => $_POST['anonymize_ginger_analytics']
67
- );
68
- update_option('gingeranalytics_option', $args);
69
- endif;
70
- ?>
71
- <div class="wrap">
72
- <?php $option = get_option('gingeranalytics_option');?>
73
- <h2>Ginger - Analytics Add On</h2>
74
- <?php if(isset($find)): ?>
75
- <h3><?php _e("Attenzione è stato trovato un codice analytics nella pagina", "ginger"); ?></h3>
76
- <?php endif; ?>
77
- <form method="post" action="admin.php?page=<?php echo $_GET["page"]; ?>">
78
- <?php wp_nonce_field('save_ginger_analytics_options', 'ginger_analytics_options'); ?>
79
- <table class="form-table striped">
80
- <thead>
81
- <tr>
82
- <td colspan="2">
83
- <h3><?php _e('Impostazioni Add on', 'ginger'); ?></h3>
84
- </td>
85
- </tr>
86
- </thead>
87
- <tr>
88
- <th scope="row" style="padding-left:20px;"><?php _e("Enable Ginger Analytics", "ginger"); ?></th>
89
- <td>
90
- <fieldset>
91
- <legend class="screen-reader-text"><span><?php _e("Enable Ginger Analytics", "ginger"); ?></span></legend>
92
- <p>
93
- <label>
94
- <input name="enable_ginger_analytics" type="radio" value="1" class="tog" <?php if(isset($option['enable_ginger_analytics']) && $option['enable_ginger_analytics'] == 1 ): echo 'checked'; endif;?>>Abilitato
95
- </label>
96
- </p>
97
- <p>
98
- <label>
99
- <input name="enable_ginger_analytics" type="radio" value="0" class="tog" <?php if(isset($option['enable_ginger_analytics']) && $option['enable_ginger_analytics'] == 0 ): echo 'checked'; endif;?>>Disabilitato
100
- </label>
101
- </p>
102
- </fieldset>
103
- </td>
104
- </tr>
105
- <tr>
106
- <th scope="row" style="padding-left:20px;"><?php _e("Codice Analytics (Ex: UA-XXXXXXX-X)", "ginger"); ?></th>
107
- <td>
108
- <fieldset>
109
- <legend class="screen-reader-text"><span><?php _e("Codice Analytics (Ex: UA-XXXXXXX-X)", "ginger"); ?></span></legend>
110
- <p>
111
- <label>
112
- <input name="ginger_analytics_code" type="text" value="<?php if(isset($option['ginger_analytics_code']) && $option['ginger_analytics_code'] != '' ): echo $option['ginger_analytics_code']; endif;?>" placeholder="<?php _e('Inserisci qui il tuo traking code', 'ginger'); ?>">
113
- </label>
114
- </p>
115
- </fieldset>
116
- </td>
117
- </tr>
118
- </table>
119
- <p class="submit"><input type="submit" name="submit" id="submit" class="button button-primary" value="<?php _e("Save Changes", "ginger"); ?>"></p>
120
- </form>
121
- </div>
122
- <?php else: //La licenza sembra non essere valida; ?>
123
- <?php $option = get_option('gingeranalytics'); $option['activated'] = 0; update_option('gingeranalytics', $option); ?>
124
- <div class="wrap">
125
- <h2>Ginger - Analytics Add On</h2>
126
- <p>Il codice di licenza sembra non essere attivo per questo sito l'add-on verra disinstallato</p>
127
- <p>Se ritieni ci sia stato un errore in questa verifica contattaci</p>
128
- </div>
129
- <?php endif; ?>
130
-
131
-
132
- <?php }
133
-
134
-
135
- add_action( 'wp_head', 'ginger_anyltics_script_anonymize');
136
- function ginger_anyltics_script_anonymize(){ ?>
137
- <?php $option = get_option('gingeranalytics_option');?>
138
- <script>gingeranalytics('<?php if(isset($option['ginger_analytics_code']) && $option['ginger_analytics_code'] != '' ): echo $option['ginger_analytics_code']; endif;?>')</script>
139
- <?php }
140
-
141
- // Registro script per il controllo dello script Analytics
142
- add_action( 'wp_enqueue_scripts', 'ginger_analytics_style_script' );
143
- function ginger_analytics_style_script() {
144
- wp_register_script( 'ginger-analytics_script', plugin_dir_url( __FILE__ ) . 'gingeranalytics.min.js' );
145
- wp_enqueue_script( 'ginger-analytics_script' );
146
- }
147
-
148
- add_filter('ginger_script_tags', 'ginger_analytics_remover',10,3);
149
- function ginger_analytics_remover($array){
150
- $option = get_option('gingeranalytics_option');
151
- if(isset($option['enable_ginger_analytics']) && $option['enable_ginger_analytics'] == 1 ):
152
- $pos = array_search('www.google-analytics.com/analytics.js', $array);
153
- unset($array[$pos]);
154
- $pos = array_search('google-analytics.com/ga.js', $array);
155
- unset($array[$pos]);
156
- return $array;
157
- endif;
158
- return $array;
159
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
addon/analytics/gingeranalytics.min.js DELETED
@@ -1 +0,0 @@
1
- function gingeranalytics(e){if(console.log(e),console.log(getCookie("ginger-cookie")),"Y"==getCookie("ginger-cookie"))var t="ga('create', '"+e+"', 'auto'); ga('send', 'pageview');";else var t="ga('create', '"+e+"', 'auto'); ga('set', 'anonymizeIP', true); ga('send', 'pageview');";var n=document.createElement("script");n.type="text/javascript",n.innerHTML="(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)})(window,document,'script','//www.google-analytics.com/analytics.js','ga');"+t,console.log(n),document.getElementsByTagName("head")[0].appendChild(n)}function getCookie(e){for(var t=e+"=",n=document.cookie.split(";"),a=0;a<n.length;a++){for(var o=n[a];" "==o.charAt(0);)o=o.substring(1);if(0==o.indexOf(t))return o.substring(t.length,o.length)}return""}
 
addon/analytics/index.php DELETED
@@ -1,89 +0,0 @@
1
- <?php
2
- //Analitycs
3
- $option_analitycs = get_option('gingeranalytics');
4
- if($option_analitycs && $option_analitycs['activated'] == 1):
5
- require_once('ginger.analytics.php');
6
- endif;
7
-
8
- add_action("ginger_addon_activation_page", "ginger_analytics_activation_page");
9
-
10
- function ginger_analytics_activation_page()
11
- {
12
- $appname = "google-analytics";
13
- $app_data = ginger_app_data($appname);
14
- $option_ginger_analitics = get_option('gingeranalytics');
15
- ?>
16
-
17
- <div class="ginger-addon">
18
- <table class="form-table striped">
19
- <thead>
20
- <tr>
21
- <td colspan="2">
22
- <img class="ginger-thumb" src="<?php echo $app_data["thumb"]; ?>" />
23
-
24
- <h3><?php _e("Google Analytics", "ginger"); ?>
25
- <?php
26
- ginger_app_price($appname, $app_data);
27
- ?></h3>
28
- <small><?php _e("Google Analytics Add-on will add analytics tracking code to your site, switching automatically between anonymized/not anonymized mode based on user cookies acceptance.", "ginger"); ?></small>
29
- <br style="clear: both" />
30
- <p>
31
- <a href="http://www.ginger-cookielaw.com/prodotto/<?php echo $appname; ?>/" target="_BLANK" class="button button-primary" <?php if($option_ginger_analitics && $option_ginger_analitics['activated'] == 1){ echo "disabled='disabled' "; } ?>><?php _e("Get Activation Code", "ginger"); ?></a>
32
- </p>
33
- </td>
34
- </tr>
35
- </thead>
36
- <tbody>
37
- <tr>
38
-
39
- <td>
40
- <fieldset>
41
- <legend class="screen-reader-text"><span><?php _e("Google Analytics", "ginger"); ?></span></legend>
42
-
43
- <p>
44
- <label>
45
- <?php _e("Active add-on", "ginger");?>:&nbsp;
46
- </label>
47
- <?php if ($option_ginger_analitics && $option_ginger_analitics['activated'] == 1): ?>
48
- <img id="img_google_analytics"
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_analitics['licence_key']; ?>" placeholder=""
56
- size="30px">
57
- <input id="activationmail" type="text" name="activationmail"
58
- value="<?php echo $option_ginger_analitics['email']; ?>" placeholder="" size="30px">
59
- <input type="hidden" name="product_id" value="gingeranalytics">
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_analytics"
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="gingeranalytics">
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
- </div>
87
- <?php
88
-
89
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
addon/exporter/index.php DELETED
@@ -1,67 +0,0 @@
1
- <?php
2
- /**
3
- * Import/Export tool
4
- */
5
-
6
- add_action('ginger_add_menu', 'add_ginger_export', 100);
7
- function add_ginger_export(){
8
- add_submenu_page( 'ginger-setup', "Import Export", __("Import/Export", "ginger"), 'manage_options', 'ginger-export', 'ginger_export');
9
- }
10
-
11
-
12
- function ginger_export(){
13
- if(isset($_POST["submit"]) && !wp_verify_nonce($_POST['save_ginger_export_options'], 'ginger_export_options')){
14
- return;
15
- }
16
- if(isset($_POST["action"]) && $_POST["action"] == "import"){
17
- if($newconf = @unserialize(stripslashes($_POST["data"]))) {
18
- foreach($newconf as $key => $val){
19
- update_option($key, $val);
20
- }
21
- echo '<div class="updated"><p>'.__( 'All done! Your configuration was saved!', 'ginger' ).'</p></div>';
22
- }else{
23
- echo '<div class="updated error"><p>'.__( 'Error! Copied text is wrong...', 'ginger' ).'</p></div>';
24
- }
25
- }
26
- ?>
27
- <div class="wrap">
28
- <h2>Ginger - Import/Export</h2>
29
- <h3><?php _e("Export", "ginger"); ?></h3>
30
- <p><?php _e("You can export your configuration and import it on a Ginger Managed websites!", "ginger"); ?></p>
31
- <p><?php _e("Simply copy & paste this code in Import Textarea:", "ginger"); ?></p>
32
- <textarea style="width:100%;" rows="10" ><?php
33
- $export = array();
34
-
35
- $export["ginger_general"] = get_option('ginger_general');
36
- $export["ginger_banner"] = get_option('ginger_banner');
37
- // $ $export["ginger_policy"] = get_option('ginger_policy');
38
- $export["gingerjscustom"] = get_option('gingerjscustom');
39
- $export["ginger_jscustom"]= get_option('ginger_jscustom_options');
40
- $export["gingeradsense"] = get_option('gingeradsense');
41
- $export["gingerwpml"] = get_option('gingerwpml');
42
- $export["ginger_wpml_options"] = get_option('ginger_wpml_options');
43
- $export["gingerpolylang"] = get_option('gingerpolylang');
44
- $export["ginger_polylang_options"] = get_option('ginger_polylang_options');
45
- $export["gingeranalytics"] = get_option('gingeranalytics');
46
- $export["gingeranalytics_option"] = get_option('gingeranalytics_option');
47
- echo serialize($export);
48
- ?></textarea>
49
-
50
- <input type="hidden" name="action" value="export">
51
-
52
- <br>
53
- <hr>
54
- <h3><?php _e("Import", "ginger"); ?></h3>
55
-
56
- <p><?php _e("Upload here the export file to overwrite existing settings!", "ginger"); ?></p>
57
- <form method="post" action="admin.php?page=<?php echo $_GET["page"]; ?>">
58
- <?php wp_nonce_field('save_ginger_export_options', 'ginger_export_options'); ?>
59
- <input type="hidden" name="action" value="import" >
60
- <textarea name="data" style="width:100%;" rows="10" ></textarea>
61
- <p> <small><b><?php _e("Attention: you must define manually a privacy policy page if you are using {{privacy_policy}} shortcode!", "ginger"); ?></b></small></p>
62
-
63
- <input type="submit" value="<?php _e("Import Configuration", "ginger"); ?>" class="button" />
64
- </form>
65
- </div>
66
- <?php
67
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
addon/ginger.addon.utils.php DELETED
@@ -1,206 +0,0 @@
1
- <?php
2
- /*
3
- * Option Analitics: gingeranalytics_option -> Contine l'array con le impostazioni del plugin - gingeranalytics -> Contine le optin con il serial number e l'attivazione;
4
- *
5
- *
6
- */
7
-
8
- $addons = ginger_include_addons();
9
-
10
- function ginger_include_addons(){
11
- // check native gallery types
12
- $addons = array();
13
- $addondir = plugin_dir_path( __FILE__ );
14
-
15
- $files = scandir($addondir);
16
-
17
-
18
- foreach($files as $file){
19
- if(is_dir($addondir.'/'.$file) && $file != "." && $file != ".."){
20
- if(file_exists($addondir.'/'.$file.'/index.php')){
21
- require_once($addondir.'/'.$file.'/index.php');
22
- $addons[]=$file;
23
- }
24
- }
25
- }
26
-
27
- return $addons;
28
- }
29
-
30
-
31
- //// Ginger check api
32
- function execute_request( $args ) {
33
- $target_url = create_url( $args );
34
- $data = wp_remote_get( $target_url );
35
- if ( is_wp_error( $data ) ) {
36
- return $data;
37
- }else{
38
- $data = json_decode(strip_tags(wp_remote_retrieve_body( $data )));
39
- return $data;
40
- }
41
-
42
- }
43
-
44
- // Create an url based on
45
- function create_url( $args ) {
46
- global $base_url;
47
- $base_url = 'http://www.ginger-cookielaw.com/';
48
- $base_url = add_query_arg( 'wc-api', 'software-api', $base_url );
49
- return $base_url . '&' . http_build_query( $args );
50
- //exit;
51
-
52
- }
53
- add_action('ginger_add_menu', 'add_ginger_add_on');
54
- function add_ginger_add_on(){
55
- add_submenu_page( 'ginger-setup', "Add-on", __("Add-on", "ginger"), 'manage_options', 'ginger-add-on', 'ginger_add_on_menu_page');
56
- }
57
-
58
- function ginger_add_on_menu_page(){
59
-
60
- $wp_root = dirname( dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) );
61
- if ( file_exists( $wp_root . '/wp-load.php' ) ) {
62
- // require_once( $wp_root . "/wp-load.php" );
63
- } else {
64
- exit;
65
- }
66
-
67
- if ( ! current_user_can( 'manage_options' ) ) die();
68
-
69
-
70
- $request = ( isset( $_GET['request'] ) ) ? $_GET['request'] : '';
71
- $activationemail = ( isset( $_GET['activationmail'] ) ) ? $_GET['activationmail'] : '';
72
- $activationcode = ( isset( $_GET['activationcode'] ) ) ? $_GET['activationcode'] : '';
73
- $product_id = ( isset( $_GET['product_id'] ) ) ? $_GET['product_id'] : '';
74
-
75
-
76
- // Valid activation request
77
- $notice = false;
78
- if ( $request == 'activation' && $activationcode != '' && $activationemail != '' && $product_id != '' ) {
79
- $args = array(
80
- 'request' => 'activation',
81
- 'email' => $activationemail,
82
- 'licence_key' => $activationcode,
83
- 'product_id' => $product_id,
84
- 'instance' => get_bloginfo('url'),
85
- );
86
-
87
- $data = execute_request( $args );
88
- if($data->activated == 1){
89
- $args = array(
90
- 'activated' => 1,
91
- 'email' => $activationemail,
92
- 'licence_key' => $activationcode,
93
- 'product_id' => $product_id,
94
- 'instance' => get_bloginfo('url'),
95
- );
96
- $array_activate = update_option($product_id, $args);
97
- $notice = $data->message;
98
- do_action("ginger_activated_addon", $product_id);
99
-
100
- }else{
101
- $notice = $data->error;
102
- }
103
- }else if($request == 'activation' && ($activationcode == '' || $activationemail == '' || $product_id == '' )){
104
-
105
- $notice = __("Fill all required fields!", "ginger");
106
- }
107
-
108
-
109
- // Valid check request
110
- if ( $request == 'check' ) {
111
- $args = array(
112
- 'wc-api' => 'software-api',
113
- 'request' => 'check',
114
- 'email' => $activationemail,
115
- 'licence_key' => $activationcode,
116
- 'product_id' => $product_id
117
- );
118
-
119
- $data = execute_request( $args );
120
-
121
- }
122
-
123
- // Valid activation reset request
124
- if ( $request == 'activation_reset' ) {
125
- $args = array(
126
- 'request' => 'activation_reset',
127
- 'email' => $activationemail,
128
- 'licence_key' => $activationcode,
129
- 'product_id' => $product_id,
130
- 'secret_key' => $secret_key,
131
- );
132
-
133
- $notice = __("Valid activation reset request", "ginger");
134
- $data = execute_request( $args );
135
- //echo('<pre>');
136
- //print_r(json_decode($data['body']));
137
- //echo('</pre>');
138
- }
139
-
140
-
141
-
142
- //
143
- // Valid deactivation reset request
144
- if ( $request == 'deactivation' && $activationcode != '' && $activationemail != '' && $product_id != '' ) {
145
- $args = array(
146
- 'request' => 'deactivation',
147
- 'email' => $activationemail,
148
- 'licence_key' => $activationcode,
149
- 'product_id' => $product_id,
150
- 'instance' => get_bloginfo('url'),
151
- );
152
- $notice = __("Valid deactivation request", "ginger");
153
- execute_request( $args );
154
- delete_option( $product_id );
155
- }
156
-
157
- if($notice){
158
- ?>
159
- <script type="text/javascript">
160
- location.href='admin.php?page=<?php echo $_GET["page"]; ?>&notice=<?php echo urlencode($notice); ?>';
161
- </script>
162
- <?php
163
- }
164
-
165
- if(isset($_GET["notice"]) && $_GET["notice"])$notice=$_GET["notice"];
166
- ?>
167
- <style>
168
- .ginger-addon{
169
- width: 44%;
170
- min-width: 420px;
171
- float:left;
172
- background-color:#FCDCAB;
173
- margin: 0px 10px 10px 0px;
174
- min-height:300px
175
- }
176
- .ginger-thumb{
177
- width: 120px;
178
- float:left;
179
- margin-right: 20px;
180
- margin-bottom: 10px;
181
- }
182
- .ginger-addon tbody tr{
183
- background-color:#FBD69D !important;
184
- }
185
-
186
- .ginger-addon thead tr{
187
- background-color:#FCDCAB !important;
188
- }
189
- .ginger-addon h3{
190
- margin-top:0px
191
- }
192
- </style>
193
- <div class="wrap">
194
- <?php
195
- if($notice){
196
- echo '<div class="updated"><p>'.$notice.'</p></div>';
197
- }
198
- ?>
199
- <h2><?php _e("Ginger Available Add-ons", "ginger"); ?></h2>
200
- <hr>
201
- <?php do_action("ginger_addon_activation_page"); ?>
202
- </div>
203
- <?php
204
- }
205
-
206
- require_once('ginger.addoncheck.php');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
addon/ginger.addoncheck.php DELETED
@@ -1,34 +0,0 @@
1
- <?php
2
-
3
- if ( ! wp_next_scheduled( 'ginger_check_hook' ) ) {
4
- wp_schedule_event( time(), 'daily', 'ginger_check_hook' );
5
- }
6
-
7
- add_action( 'ginger_check_hook', 'ginger_check_function' );
8
-
9
- function ginger_check_function() {
10
- $ginger_addon = array(
11
- 'gingeranalytics',
12
- 'gingeradsense',
13
- 'gingercustomurl',
14
- 'gingerwpml'
15
- );
16
- foreach($ginger_addon as $addon):
17
- $addon_to_check = get_option($addon);
18
- if($addon_to_check && $addon_to_check['activated'] == 1):
19
- $args = array(
20
- 'wc-api' => 'software-api',
21
- 'request' => 'check',
22
- 'email' => $addon_to_check['email'],
23
- 'licence_key' => $addon_to_check['licence_key'],
24
- 'product_id' => $addon_to_check['product_id'],
25
- 'instance' => $addon_to_check['instance']
26
- );
27
-
28
- $data = execute_request( $args );
29
- if(!$data->success && !is_wp_error($data)):
30
- $addon_to_check['activated'] = 0; update_option('gingeranalytics', $addon_to_check);
31
- endif;
32
- endif;
33
- endforeach;
34
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
addon/jscustom/ginger.jscustom.php DELETED
@@ -1,97 +0,0 @@
1
- <?php
2
-
3
-
4
- add_action('ginger_add_menu', 'add_ginger_jscustom');
5
- function add_ginger_jscustom(){
6
- add_submenu_page( 'ginger-setup', "Ginger JsCustom", __("Custom JS", "ginger"), 'manage_options', 'ginger-jscustom', 'ginger_jscustom_menu_page');
7
- add_submenu_page( 'ginger-setup', "Ginger Iframe Custom", __("Custom Iframe", "ginger"), 'manage_options', 'ginger-iframe', 'ginger_iframe_menu_page');
8
- }
9
-
10
-
11
- function ginger_jscustom_menu_page(){
12
-
13
-
14
- $key = "ginger_jscustom_options";
15
- if(isset($_POST["submit"]) && !wp_verify_nonce($_POST['ginger_options'], 'save_ginger_jscustom')){
16
- return;
17
- }
18
-
19
- if(isset($_REQUEST["action"]) && $_REQUEST["action"] == "saveurl"){
20
- $params = $_POST["ginger_urls"];
21
- update_option($key, $params);
22
- echo '<div class="updated"><p>'.__( 'Updated!', 'ginger' ).'</p></div>';
23
- }
24
-
25
- $options = get_option($key);
26
- include("page/ginger-jscustom.php");
27
-
28
- }
29
-
30
-
31
- function ginger_iframe_menu_page(){
32
-
33
- $key = "ginger_iframecustom_options";
34
- if(isset($_POST["submit"]) && !wp_verify_nonce($_POST['ginger_options'], 'save_ginger_jscustom')){
35
- return;
36
- }
37
-
38
- if(isset($_REQUEST["action"]) && $_REQUEST["action"] == "saveurl"){
39
- $params = $_POST["ginger_urls"];
40
- update_option($key, $params);
41
- echo '<div class="updated"><p>'.__( 'Updated!', 'ginger' ).'</p></div>';
42
- }
43
-
44
- $options = get_option($key);
45
-
46
- include("page/ginger-iframe.php");
47
-
48
-
49
- }
50
-
51
-
52
- add_filter("ginger_script_tags", "ginger_jscustom_tags");
53
- function ginger_jscustom_tags($array){
54
- $key = "ginger_jscustom_options";
55
- $options = get_option($key);
56
- if($options == "") return $array;
57
- // cicle over params to get sync
58
- foreach ($options as $option) {
59
- if(isset($option["ginger_url_enable"][0]) && $option["ginger_url_enable"][0]){
60
- if(!isset($option["ginger_url_async"][0]) || !$option["ginger_url_async"][0]){
61
- $array[]=$option["ginger_url"];
62
- }
63
- }
64
- }
65
- return $array;
66
- }
67
-
68
-
69
- add_filter("ginger_script_async_tags", "ginger_jscustom_async_tags");
70
- function ginger_jscustom_async_tags($array){
71
- $key = "ginger_jscustom_options";
72
- $options = get_option($key);
73
- if($options == "") return $array;
74
- // cicle over params to get sync
75
- foreach ($options as $option) {
76
- if(isset($option["ginger_url_enable"][0]) && $option["ginger_url_enable"][0]){
77
- if(isset($option["ginger_url_async"][0]) && $option["ginger_url_async"][0]){
78
- $array[]=$option["ginger_url"];
79
- }
80
- }
81
- }
82
- return $array;
83
- }
84
-
85
- add_filter("ginger_add_iframe", "ginger_iframe_async_tags");
86
- function ginger_iframe_async_tags($array){
87
- $key = "ginger_iframecustom_options";
88
- $options = get_option($key);
89
- if($options == "") return $array;
90
- // cicle over params to get sync
91
- foreach ($options as $option) {
92
- if($option["ginger_url_enable"][0]){
93
- $array[]=$option["ginger_url"];
94
- }
95
- }
96
- return $array;
97
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
addon/jscustom/index.php DELETED
@@ -1,91 +0,0 @@
1
- <?php
2
- //jscustom
3
- $option_jscustom = get_option('gingercustomurl');
4
- if($option_jscustom && $option_jscustom['activated'] == 1):
5
- require_once('ginger.jscustom.php');
6
- endif;
7
-
8
- add_action("ginger_addon_activation_page", "ginger_jscustom_activation_page");
9
-
10
- function ginger_jscustom_activation_page()
11
- {
12
- $appname = "jscustom";
13
- $app_data = ginger_app_data($appname);
14
- $option_ginger_jscustom = get_option('gingercustomurl');
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("Custom Javascript / Iframe Configurator", "ginger"); ?>
24
- <?php
25
- ginger_app_price($appname, $app_data);
26
- ?></h3>
27
- <small><?php _e("This add-on let you add custom js and iframe url to extend Ginger power.", "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_jscustom && $option_ginger_jscustom['activated'] == 1){ echo "disabled='disabled' "; } ?>><?php _e("Get Activation Code", "ginger"); ?></a>
31
- </p>
32
- </td>
33
- </tr>
34
- </thead>
35
- <tbody>
36
- <tr>
37
-
38
- <td>
39
- <fieldset>
40
- <legend class="screen-reader-text"><span><?php _e("Custom Javascript Configurator", "ginger"); ?></span></legend>
41
- <p>
42
- <label>
43
- <?php _e("Active add-on", "ginger");?>:&nbsp;
44
- </label>
45
-
46
- <?php if ($option_ginger_jscustom && $option_ginger_jscustom['activated'] == 1): ?>
47
- <img id="img_google_jscustom"
48
- src="<?php echo plugins_url('/ginger/img/ok.png'); ?>"
49
- style="max-width: 20px; max-height: 20px; vertical-align: middle">
50
-
51
- <form method="get" action="<?php echo admin_url('admin.php?page=ginger-add-on'); ?>">
52
- <input type="hidden" name="page" value="ginger-add-on">
53
- <input id="activationcode" type="text" name="activationcode"
54
- value="<?php echo $option_ginger_jscustom['licence_key']; ?>" placeholder=""
55
- size="30px">
56
- <input id="activationmail" type="text" name="activationmail"
57
- value="<?php echo $option_ginger_jscustom['email']; ?>" placeholder="" size="30px">
58
- <input type="hidden" name="product_id" value="gingercustomurl">
59
- <input type="hidden" name="request" value="deactivation">
60
- <input type="submit" class="button" value="<?php _e('Deactivate', 'ginger') ?>">
61
- </form>
62
- <?php else: ?>
63
- <img id="img_google_jscustom"
64
- src="<?php echo plugins_url('/ginger/img/xx.png'); ?>"
65
- style="max-width: 20px; max-height: 20px; vertical-align: middle">
66
- <form method="get" action="<?php echo admin_url('admin.php?page=ginger-add-on'); ?>">
67
- <input type="hidden" name="page" value="ginger-add-on">
68
- <input id="activationcode" type="text" name="activationcode" value=""
69
- placeholder="<?php _e('Insert here the add-on activation code.', 'ginger') ?>"
70
- size="30px">
71
- <input id="activationmail" type="text" name="activationmail" value=""
72
- placeholder="<?php _e('Insert here your activation mail.', 'ginger') ?>" size="30px">
73
- <input type="hidden" name="product_id" value="gingercustomurl">
74
- <input type="hidden" name="request" value="activation">
75
- <input type="submit" class="button" value="<?php _e('Activate', 'ginger') ?>">
76
- </form>
77
- <?php endif; ?>
78
- </p>
79
- </fieldset>
80
- </td>
81
- </tr>
82
-
83
- </tbody>
84
- </table>
85
- </div>
86
- <?php
87
-
88
- }
89
-
90
-
91
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
addon/jscustom/page/ginger-iframe.php DELETED
@@ -1,78 +0,0 @@
1
- <div class="wrap">
2
- <h2><?php _e("Custom Iframe Configuration", "ginger"); ?></h2>
3
-
4
- <p><?php _e("Add here the iframe url that you want to block in relation to user's choice (if are not included in default ginger setup)", "ginger"); ?></p>
5
- <hr>
6
-
7
- <form method="post" action="admin.php?page=<?php echo $_GET["page"]; ?>" class="repeater" >
8
- <?php wp_nonce_field('save_ginger_jscustom', 'ginger_options'); ?>
9
-
10
- <div data-repeater-list="ginger_urls">
11
- <?php
12
-
13
- if (is_array($options)) {
14
- foreach ($options as $option) {
15
- ?>
16
- <div data-repeater-item style="margin-top: 20px;">
17
-
18
- <small><?php _e("URL", "ginger"); ?>:</small> <input type="text" name="ginger_url" id="ginger_url" value="<?php echo $option["ginger_url"]; ?>" size="40"/>
19
-
20
- | <small><?php _e("Enable", "ginger"); ?>:</small> <input type="checkbox" name="ginger_url_enable" value="1" <?php if($option["ginger_url_enable"][0]) echo ' checked="checked"'; ?> >
21
- | <input data-repeater-delete type="button" value="Delete" class="button button-primary small" />
22
- </div>
23
-
24
- <?php
25
- }
26
- }else{
27
- ?>
28
- <div data-repeater-item style="margin-top: 20px;">
29
-
30
- <small><?php _e("URL", "ginger"); ?>:</small> <input type="text" name="ginger_url" id="ginger_url" value="" size="40"/>
31
-
32
- | <small><?php _e("Enable", "ginger"); ?>:</small> <input type="checkbox" name="ginger_url_enable" value="1" checked="checked">
33
- | <input data-repeater-delete type="button" value="Delete" class="button button-primary small" />
34
- </div>
35
- <?php
36
-
37
- }
38
- ?>
39
-
40
-
41
- </div>
42
- <p style="margin-top: 20px"><input data-repeater-create type="button" class="button button-secondary" value=" + Add Url + "/></p>
43
- <input type="hidden" name="action" value="saveurl">
44
- <p class="submit"><input type="submit" name="submit" id="submit" class="button button-primary" value="<?php _e("Save Changes", "ginger"); ?>"></p>
45
-
46
-
47
- </form>
48
-
49
-
50
-
51
- <script src="../wp-content/plugins/ginger/admin/js/jquery.repeater-master/jquery.repeater.js"></script>
52
- <script>
53
- jQuery(document).ready(function () {
54
- 'use strict';
55
- jQuery('.repeater').repeater({
56
- defaultValues: {
57
- //'textarea-input': 'foo',
58
- 'ginger_url': '',
59
- //'select-input': 'B',
60
- //'checkbox-input': ['A', 'B'],
61
- 'ginger_url_enable': '1'
62
- },
63
- show: function () {
64
- jQuery(this).slideDown();
65
- },
66
- hide: function (deleteElement) {
67
- if(confirm('Are you sure you want to delete this element?')) {
68
- jQuery(this).slideUp(deleteElement);
69
-
70
- }
71
-
72
- }
73
- });
74
- });
75
- </script>
76
-
77
-
78
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
addon/jscustom/page/ginger-jscustom.php DELETED
@@ -1,87 +0,0 @@
1
- <?php
2
- /**
3
- * Date: 22/07/15
4
- * Time: 23.05
5
- */
6
- ?>
7
-
8
- <div class="wrap">
9
- <h2><?php _e("Custom Javascript Configuration", "ginger"); ?></h2>
10
-
11
- <p><?php _e("Add here the javascript url that you want to block in relation to user's choice (if are not included in default ginger setup). <br>Mark <i>asynchronous</i> mode only if standard mode is not working properly!", "ginger"); ?></p>
12
- <hr>
13
-
14
- <form method="post" action="admin.php?page=<?php echo $_GET["page"]; ?>" class="repeater" >
15
- <?php wp_nonce_field('save_ginger_jscustom', 'ginger_options'); ?>
16
-
17
- <div data-repeater-list="ginger_urls">
18
- <?php
19
-
20
- if (is_array($options)) {
21
- foreach ($options as $option) {
22
- ?>
23
- <div data-repeater-item style="margin-top: 20px;">
24
-
25
- <small><?php _e("URL", "ginger"); ?>:</small> <input type="text" name="ginger_url" id="ginger_url" value="<?php echo $option["ginger_url"]; ?>" size="40"/>
26
-
27
- | <small><?php _e("Enable", "ginger"); ?>:</small> <input type="checkbox" name="ginger_url_enable" value="1" <?php if(isset($option["ginger_url_enable"][0]) && $option["ginger_url_enable"][0]) echo ' checked="checked"'; ?> >
28
- | <small><?php _e("Asynchronous mode", "ginger"); ?>:</small> <input type="checkbox" name="ginger_url_async" value="1" <?php if(isset($option["ginger_url_async"][0]) && $option["ginger_url_async"][0]) echo ' checked="checked"'; ?> >
29
- | <input data-repeater-delete type="button" value="Delete" class="button button-primary small" />
30
- </div>
31
-
32
- <?php
33
- }
34
- }else{
35
- ?>
36
- <div data-repeater-item style="margin-top: 20px;">
37
-
38
- <small><?php _e("URL", "ginger"); ?>:</small> <input type="text" name="ginger_url" id="ginger_url" value="" size="40"/>
39
-
40
- | <small><?php _e("Enable", "ginger"); ?>:</small> <input type="checkbox" name="ginger_url_enable" value="1" checked="checked">
41
- | <small><?php _e("Asynchronous mode", "ginger"); ?>:</small> <input type="checkbox" name="ginger_url_async" value="1" >
42
- | <input data-repeater-delete type="button" value="Delete" class="button button-primary small" />
43
- </div>
44
- <?php
45
-
46
- }
47
- ?>
48
-
49
-
50
- </div>
51
- <p style="margin-top: 20px"><input data-repeater-create type="button" class="button button-secondary" value=" + Add Url + "/></p>
52
- <input type="hidden" name="action" value="saveurl">
53
- <p class="submit"><input type="submit" name="submit" id="submit" class="button button-primary" value="<?php _e("Save Changes", "ginger"); ?>"></p>
54
-
55
-
56
- </form>
57
-
58
-
59
-
60
- <script src="../wp-content/plugins/ginger/admin/js/jquery.repeater-master/jquery.repeater.js"></script>
61
- <script>
62
- jQuery(document).ready(function () {
63
- 'use strict';
64
- jQuery('.repeater').repeater({
65
- defaultValues: {
66
- //'textarea-input': 'foo',
67
- 'ginger_url': '',
68
- //'select-input': 'B',
69
- //'checkbox-input': ['A', 'B'],
70
- 'ginger_url_enable': '1'
71
- },
72
- show: function () {
73
- jQuery(this).slideDown();
74
- },
75
- hide: function (deleteElement) {
76
- if(confirm('Are you sure you want to delete this element?')) {
77
- jQuery(this).slideUp(deleteElement);
78
-
79
- }
80
-
81
- }
82
- });
83
- });
84
- </script>
85
-
86
-
87
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
addon/logger/ginger.logger.php DELETED
@@ -1,197 +0,0 @@
1
- <?php
2
-
3
- add_action('ginger_add_menu', 'add_ginger_logger');
4
- function add_ginger_logger(){
5
- add_submenu_page( 'ginger-setup', "Ginger Logger", __("Activity Logger", "ginger"), 'manage_options', 'ginger-logger', 'ginger_logger');
6
- }
7
-
8
- function ginger_logger(){
9
- global $wpdb;
10
- $wp_root = dirname(dirname( dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) ));
11
- if ( file_exists( $wp_root . '/wp-load.php' ) ) {
12
- require_once( $wp_root . "/wp-load.php" );
13
- } else {
14
- exit;
15
- }
16
-
17
- if ( ! current_user_can( 'manage_options' ) ) die();
18
-
19
- if(isset($_POST["submit"]) && !wp_verify_nonce($_POST['ginger_options'], 'save_ginger_logger')){
20
- return;
21
- }
22
-
23
- if(isset($_POST["action"]) && $_POST["action"] == "deleteall"){
24
- $wpdb->query( "DELETE FROM {$wpdb->prefix}logger_ginger WHERE 1" );
25
- }
26
-
27
- $option_logger = get_option('gingerlogger');
28
- $activationemail = $option_logger['email'];
29
- $activationcode = $option_logger['licence_key'];
30
- $product_id = $option_logger['product_id'];
31
- $instance = $option_logger['instance'];
32
-
33
-
34
- $args = array(
35
- 'wc-api' => 'software-api',
36
- 'request' => 'check',
37
- 'email' => $activationemail,
38
- 'licence_key' => $activationcode,
39
- 'product_id' => $product_id,
40
- 'instance' => $instance
41
- );
42
-
43
- $data = execute_request( $args );
44
- if($data->success == 1): ?>
45
- <div class="wrap">
46
- <h2>Ginger - Logger Add On</h2>
47
- <?php
48
-
49
-
50
-
51
- $pagenum = isset( $_GET['pagenum'] ) ? absint( $_GET['pagenum'] ) : 1;
52
- $limit = 20;
53
- $offset = ( $pagenum - 1 ) * $limit;
54
- $entries = $wpdb->get_results( "SELECT * FROM {$wpdb->prefix}logger_ginger WHERE 1 ORDER BY id DESC LIMIT $offset, $limit" );
55
-
56
- echo '<div class="wrap">';
57
-
58
- ?>
59
- <table class="widefat">
60
- <thead>
61
- <tr>
62
- <th scope="col" class="manage-column column-name" style="">Time</th>
63
- <th scope="col" class="manage-column column-name" style="">IP</th>
64
- <th scope="col" class="manage-column column-name" style="">url</th>
65
- <th scope="col" class="manage-column column-name" style="">Cookie</th>
66
- </tr>
67
- </thead>
68
-
69
- <tfoot>
70
- <tr>
71
- <th scope="col" class="manage-column column-name" style="">Time</th>
72
- <th scope="col" class="manage-column column-name" style="">IP</th>
73
- <th scope="col" class="manage-column column-name" style="">url</th>
74
- <th scope="col" class="manage-column column-name" style="">Cookie</th>
75
- </tr>
76
- </tfoot>
77
-
78
- <tbody>
79
- <?php if( $entries ) { ?>
80
-
81
- <?php
82
- $count = 1;
83
- $class = '';
84
- foreach( $entries as $entry ) {
85
- $class = ( $count % 2 == 0 ) ? ' class="alternate"' : '';
86
- ?>
87
-
88
- <tr<?php echo $class; ?>>
89
- <td><?php echo $entry->time; ?></td>
90
- <td><?php echo $entry->ipaddress; ?></td>
91
- <td><?php echo $entry->url; ?></td>
92
- <td><?php echo $entry->status; ?></td>
93
- </tr>
94
-
95
- <?php
96
- $count++;
97
- }
98
- ?>
99
-
100
- <?php } else { ?>
101
- <tr>
102
- <td colspan="2">No Logs yet</td>
103
- </tr>
104
- <?php } ?>
105
- </tbody>
106
- </table>
107
-
108
- <?php
109
- $total = $wpdb->get_var( "SELECT COUNT('id') FROM {$wpdb->prefix}logger_ginger" );
110
- $num_of_pages = ceil( $total / $limit );
111
- $page_links = paginate_links( array(
112
- 'base' => add_query_arg( 'pagenum', '%#%' ),
113
- 'format' => '',
114
- 'prev_text' => __( '&laquo;', 'aag' ),
115
- 'next_text' => __( '&raquo;', 'aag' ),
116
- 'total' => $num_of_pages,
117
- 'current' => $pagenum
118
- ) );
119
-
120
- if ( $page_links ) {
121
- echo '<div class="tablenav"><div class="tablenav-pages" style="margin: 1em 0">' . $page_links . '</div></div>';
122
- }
123
-
124
- echo '</div>';
125
- ?>
126
- <form method="post" action="admin.php?page=<?php echo $_GET["page"]; ?>" >
127
- <?php wp_nonce_field('save_ginger_logger', 'ginger_options'); ?>
128
- <p><input type="submit" name="submit" value="<?php _e("Delete all logs", "ginger"); ?>" class="button button-primary delete-cookies"></p>
129
- <input type="hidden" name="action" value="deleteall">
130
- </form>
131
- <script type="text/javascript">
132
- jQuery(document).ready(function(){
133
- jQuery(".delete-cookies").click(function() {
134
- if (!confirm("<?php _e("Are you sure? This process cannot be undone.", "ginger"); ?>")){
135
- return false;
136
- }
137
- });
138
- });
139
- </script>
140
- </div>
141
- <?php else: //La licenza sembra non essere valida; ?>
142
- <?php $option = get_option('gingerlogger');
143
- $option['activated'] = 0; update_option('gingerlogger', $option); ?>
144
- <div class="wrap">
145
- <h2>Ginger - Logger Add On</h2>
146
- <p><?php _e("Licence key look inactive. Addon disabled", "ginger"); ?></p>
147
- <p><?php _e("If you think is an error contact us here:", "ginger"); ?> <a href="http://www.ginger-cookielaw.com/">www.ginger-cookielaw.com/</a></p>
148
- </div>
149
- <?php endif; ?>
150
-
151
-
152
- <?php }
153
-
154
- add_action("wp_head", "ginger_add_log_variable");
155
- function ginger_add_log_variable(){
156
- ?>
157
- <script type="text/javascript">
158
- var ginger_logger = "Y";
159
- var ginger_logger_url = "<?php bloginfo("url"); ?>";
160
- var current_url = "<?php echo (isset($_SERVER['HTTPS']) ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; ?>";
161
-
162
- function gingerAjaxLogTime(status) {
163
- var xmlHttp = new XMLHttpRequest();
164
- var parameters = "ginger_action=time";
165
- var url= ginger_logger_url + "?" + parameters;
166
- xmlHttp.open("GET", url, true);
167
-
168
- //Black magic paragraph
169
- xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
170
-
171
- xmlHttp.onreadystatechange = function() {
172
- if(xmlHttp.readyState == 4 && xmlHttp.status == 200) {
173
- var time = xmlHttp.responseText;
174
- gingerAjaxLogger(time, status);
175
- }
176
- }
177
-
178
- xmlHttp.send(parameters);
179
- }
180
-
181
- function gingerAjaxLogger(ginger_logtime, status) {
182
- console.log(ginger_logtime);
183
- var xmlHttp = new XMLHttpRequest();
184
- var parameters = "ginger_action=log&time=" + ginger_logtime + "&url=" + current_url + "&status=" + status;
185
- var url= ginger_logger_url + "?" + parameters;
186
- console.log(url);
187
- xmlHttp.open("GET", url, true);
188
-
189
- //Black magic paragraph
190
- xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
191
-
192
- xmlHttp.send(parameters);
193
- }
194
-
195
- </script>
196
- <?php
197
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
addon/logger/index.php DELETED
@@ -1,230 +0,0 @@
1
- <?php
2
- //Logger
3
- $option_logger = get_option('gingerlogger');
4
- if($option_logger && $option_logger['activated'] == 1):
5
- require_once('ginger.logger.php');
6
- endif;
7
-
8
- add_action("ginger_addon_activation_page", "ginger_logger_activation_page");
9
-
10
- function ginger_logger_activation_page()
11
- {
12
- $appname = "logger";
13
- $app_data = ginger_app_data($appname);
14
- $option_ginger_analitics = get_option('gingerlogger');
15
- ?>
16
-
17
- <div class="ginger-addon">
18
- <table class="form-table striped">
19
- <thead>
20
- <tr>
21
- <td colspan="2">
22
- <img class="ginger-thumb" src="<?php echo $app_data["thumb"]; ?>" />
23
- <h3><?php _e("Acceptance Logger", "ginger"); ?>
24
- <?php
25
- ginger_app_price($appname, $app_data);
26
- ?></h3>
27
- <small><?php _e("This add-on log user's acceptance and show reports on admin page. Very useful in case of disputes", "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_analitics && $option_ginger_analitics['activated'] == 1){ echo "disabled='disabled' "; } ?>><?php _e("Get Activation Code", "ginger"); ?></a>
31
- </p>
32
- </td>
33
- </tr>
34
- </thead>
35
- <tbody>
36
- <tr>
37
-
38
- <td>
39
- <fieldset>
40
- <legend class="screen-reader-text"><span><?php _e("Acceptance Logger", "ginger"); ?></span></legend>
41
- <p>
42
- <label>
43
- <?php _e("Active add-on", "ginger");?>:&nbsp;
44
- </label>
45
- <?php if ($option_ginger_analitics && $option_ginger_analitics['activated'] == 1): ?>
46
- <img id="img_google_logger"
47
- src="<?php echo plugins_url('/ginger/img/ok.png'); ?>"
48
- style="max-width: 20px; max-height: 20px; vertical-align: middle">
49
-
50
- <form method="get" action="<?php echo admin_url('admin.php?page=ginger-add-on'); ?>">
51
- <input type="hidden" name="page" value="ginger-add-on">
52
- <input id="activationcode" type="text" name="activationcode"
53
- value="<?php echo $option_ginger_analitics['licence_key']; ?>" placeholder=""
54
- size="30px">
55
- <input id="activationmail" type="text" name="activationmail"
56
- value="<?php echo $option_ginger_analitics['email']; ?>" placeholder="" size="30px">
57
- <input type="hidden" name="product_id" value="gingerlogger">
58
- <input type="hidden" name="request" value="deactivation">
59
- <input type="submit" class="button" value="<?php _e('Deactivate', 'ginger') ?>">
60
- </form>
61
- <?php else: ?>
62
- <img id="img_google_logger"
63
- src="<?php echo plugins_url('/ginger/img/xx.png'); ?>"
64
- style="max-width: 20px; max-height: 20px; vertical-align: middle">
65
- <form method="get" action="<?php echo admin_url('admin.php?page=ginger-add-on'); ?>">
66
- <input type="hidden" name="page" value="ginger-add-on">
67
- <input id="activationcode" type="text" name="activationcode" value=""
68
- placeholder="<?php _e('Insert here the add-on activation code.', 'ginger') ?>"
69
- size="30px">
70
- <input id="activationmail" type="text" name="activationmail" value=""
71
- placeholder="<?php _e('Insert here your activation mail.', 'ginger') ?>" size="30px">
72
- <input type="hidden" name="product_id" value="gingerlogger">
73
- <input type="hidden" name="request" value="activation">
74
- <input type="submit" class="button" value="<?php _e('Activate', 'ginger') ?>">
75
- </form>
76
- <?php endif; ?>
77
- </p>
78
- </fieldset>
79
- </td>
80
- </tr>
81
-
82
- </tbody>
83
- </table>
84
- </div>
85
- <?php
86
-
87
- }
88
-
89
-
90
- function ginger_do_log($url = "", $status = "Y"){
91
- global $wpdb;
92
- if($url == "")
93
- $url = (isset($_SERVER['HTTPS']) ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
94
- $table_name = $wpdb->prefix . 'logger_ginger';
95
- $ipuser = ginger_get_ip_address();
96
- $now = current_time( 'mysql' );
97
- $wpdb->insert(
98
- $table_name,
99
- array(
100
- 'time' => $now,
101
- 'ipaddress' => $ipuser,
102
- 'url' => $url,
103
- 'status' => $status
104
- ),
105
- array(
106
- '%s',
107
- '%s',
108
- '%s',
109
- '%s'
110
- )
111
- );
112
- }
113
-
114
-
115
- function ginger_get_ip_address() {
116
- // check for shared internet/ISP IP
117
- if (!empty($_SERVER['HTTP_CLIENT_IP']) && ginger_validate_ip($_SERVER['HTTP_CLIENT_IP'])) {
118
- return $_SERVER['HTTP_CLIENT_IP'];
119
- }
120
-
121
- // check for IPs passing through proxies
122
- if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
123
- // check if multiple ips exist in var
124
- if (strpos($_SERVER['HTTP_X_FORWARDED_FOR'], ',') !== false) {
125
- $iplist = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']);
126
- foreach ($iplist as $ip) {
127
- if (ginger_validate_ip($ip))
128
- return $ip;
129
- }
130
- } else {
131
- if (ginger_validate_ip($_SERVER['HTTP_X_FORWARDED_FOR']))
132
- return $_SERVER['HTTP_X_FORWARDED_FOR'];
133
- }
134
- }
135
- if (!empty($_SERVER['HTTP_X_FORWARDED']) && ginger_validate_ip($_SERVER['HTTP_X_FORWARDED']))
136
- return $_SERVER['HTTP_X_FORWARDED'];
137
- if (!empty($_SERVER['HTTP_X_CLUSTER_CLIENT_IP']) && ginger_validate_ip($_SERVER['HTTP_X_CLUSTER_CLIENT_IP']))
138
- return $_SERVER['HTTP_X_CLUSTER_CLIENT_IP'];
139
- if (!empty($_SERVER['HTTP_FORWARDED_FOR']) && ginger_validate_ip($_SERVER['HTTP_FORWARDED_FOR']))
140
- return $_SERVER['HTTP_FORWARDED_FOR'];
141
- if (!empty($_SERVER['HTTP_FORWARDED']) && ginger_validate_ip($_SERVER['HTTP_FORWARDED']))
142
- return $_SERVER['HTTP_FORWARDED'];
143
-
144
- // return unreliable ip since all else failed
145
- return $_SERVER['REMOTE_ADDR'];
146
- }
147
-
148
- /**
149
- * Ensures an ip address is both a valid IP and does not fall within
150
- * a private network range.
151
- */
152
- function ginger_validate_ip($ip) {
153
- if (strtolower($ip) === 'unknown')
154
- return false;
155
-
156
- // generate ipv4 network address
157
- $ip = ip2long($ip);
158
-
159
- // if the ip is set and not equivalent to 255.255.255.255
160
- if ($ip !== false && $ip !== -1) {
161
- // make sure to get unsigned long representation of ip
162
- // due to discrepancies between 32 and 64 bit OSes and
163
- // signed numbers (ints default to signed in PHP)
164
- $ip = sprintf('%u', $ip);
165
- // do private network range checking
166
- if ($ip >= 0 && $ip <= 50331647) return false;
167
- if ($ip >= 167772160 && $ip <= 184549375) return false;
168
- if ($ip >= 2130706432 && $ip <= 2147483647) return false;
169
- if ($ip >= 2851995648 && $ip <= 2852061183) return false;
170
- if ($ip >= 2886729728 && $ip <= 2887778303) return false;
171
- if ($ip >= 3221225984 && $ip <= 3221226239) return false;
172
- if ($ip >= 3232235520 && $ip <= 3232301055) return false;
173
- if ($ip >= 4294967040) return false;
174
- }
175
- return true;
176
- }
177
-
178
-
179
-
180
- function ginger_logger_create_table($product_id){
181
- if($product_id == "gingerlogger"){
182
- global $wpdb;
183
- $table_name = $wpdb->prefix . 'logger_ginger';
184
- $charset_collate = $wpdb->get_charset_collate();
185
- $sql = "CREATE TABLE $table_name (
186
- id int(10) NOT NULL AUTO_INCREMENT,
187
- time datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
188
- ipaddress varchar(45),
189
- url text NOT NULL,
190
- status varchar(1) DEFAULT 'Y' NOT NULL,
191
- UNIQUE KEY id (id)
192
- ) $charset_collate;";
193
- require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
194
- dbDelta( $sql );
195
- }
196
- }
197
-
198
- add_action("ginger_activated_addon", "ginger_logger_create_table");
199
-
200
- // init to check date and save log
201
- add_action("init", "ginger_activity_log");
202
- function ginger_activity_log(){
203
- if(!((isset($_GET["ginger_action"]) && $_GET["ginger_action"] == "time") || (isset($_GET["ginger_action"]) && $_GET["ginger_action"] == "log"))) {
204
- return;
205
- }
206
- if($_GET["ginger_action"] == "time"){
207
-
208
- header("Cache-Control: no-cache, no-store, must-revalidate"); // HTTP 1.1.
209
- header("Pragma: no-cache"); // HTTP 1.0.
210
- header("Expires: 0"); // Proxies.
211
- echo time();
212
- exit;
213
- }
214
- if($_GET["ginger_action"] == "log"){
215
- if(!isset($_GET["url"]) || $_GET["url"] == "") exit;
216
- if(!isset($_GET["time"]) || $_GET["time"] == "") exit;
217
- if(!isset($_GET["status"]) || $_GET["status"] == "") exit;
218
-
219
- if(($_GET["time"] + 10) < time()) exit;
220
- header("Cache-Control: no-cache, no-store, must-revalidate"); // HTTP 1.1.
221
- header("Pragma: no-cache"); // HTTP 1.0.
222
- header("Expires: 0"); // Proxies.
223
- // echo time();
224
- if(function_exists("ginger_do_log")){
225
- ginger_do_log($_GET["url"], $_GET["status"]);
226
- }
227
- exit;
228
- }
229
-
230
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
addon/polylang/ginger.polylang.php DELETED
@@ -1,348 +0,0 @@
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 DELETED
@@ -1,90 +0,0 @@
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 DELETED
@@ -1,339 +0,0 @@
1
- <?php
2
- add_action("ginger_add_menu", "ginger_wpml_menu");
3
-
4
- function ginger_wpml_menu(){
5
-
6
- add_submenu_page( 'ginger-setup', "WPML", __("WPML", "ginger"), 'manage_options', 'ginger-wpml', 'ginger_wpml_menu_page');
7
-
8
-
9
- }
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')){
22
- return;
23
- }
24
-
25
- if(isset($_POST["submit"])){
26
-
27
- $params = $_POST;
28
- unset($params["submit"]);
29
- unset($params["ginger_options"]);
30
- unset($params["_wp_http_referer"]);
31
-
32
-
33
- // print_r($params);
34
- update_option($key, $params);
35
-
36
- echo '<div class="updated"><p>'.__( 'Updated!', 'ginger' ).'</p></div>';
37
- }
38
- $options = get_option($key);
39
-
40
- // print_r($options);
41
- ?>
42
- <div class="wrap">
43
- <h2>WPML - Ginger setup</h2>
44
- <hr>
45
-
46
- <?php
47
- if (!function_exists('icl_get_languages')) {
48
- echo "<h3>";
49
- _e("WPML is disabled!", "ginger");
50
- echo "</h3>";
51
-
52
- _e("Enable here:", "ginger");
53
- echo " <a href='".get_bloginfo("url")."/wp-admin/plugins.php'>"._("Plugins")."</a>";
54
- }else{
55
- ?>
56
- <form method="post" action="admin.php?page=<?php echo $_GET["page"]; ?>">
57
-
58
- <table class="form-table striped">
59
- <thead>
60
- <tr>
61
- <td colspan="2">
62
- <h2><?php _e("Banner Multilanguage Setup", "ginger"); ?></h2>
63
- <?php _e("Overwrite default banner rules", "ginger"); ?>
64
- </td>
65
- </tr>
66
- </thead>
67
- <tbody>
68
-
69
- <?php wp_nonce_field('save_ginger_wpml_options', 'ginger_options'); ?>
70
- <?php
71
- $languages = icl_get_languages('skip_missing=0');
72
- //print_r($languages);
73
- $c=0;
74
- foreach ($languages as $langcode=>$langval ) {
75
- ?>
76
- <tr style="background-color:#F99A30; ">
77
- <th scope="row" style="padding-left:20px;"></th>
78
- <td>
79
- <h2><?php echo $langval["native_name"]; ?></h2>
80
- </td>
81
- </tr>
82
-
83
- <tr>
84
- <th scope="row" style="padding-left:20px;"><?php _e("Banner Text", "ginger"); ?> - <?php echo $langval["native_name"]; ?></th>
85
- <td>
86
- <fieldset>
87
- <legend class="screen-reader-text"><span><?php _e("Banner Text", "ginger"); ?></span></legend>
88
- <p><label><?php
89
- if (function_exists("wp_editor"))
90
- 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));
91
- else
92
- echo '<textarea name = "ginger_banner_text['.$langcode.']" >' . $options["ginger_banner_text"][$langcode] . '</textarea>';
93
- ?>
94
- <br>
95
- <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>
96
- </label>
97
- </p>
98
- </fieldset>
99
- </td>
100
- </tr>
101
-
102
- <tr>
103
- <th scope="row" style="padding-left:20px;"><?php _e('Privacy Policy page', 'ginger'); ?> - <?php echo $langval["native_name"]; ?></th>
104
- <td>
105
- <fieldset>
106
- <p><label>
107
- <?php
108
- $sitepress->switch_lang($langcode);
109
- $args = array(
110
- 'sort_order' => 'asc',
111
- 'sort_column' => 'post_title',
112
- 'hierarchical' => 1,
113
- 'number' => '',
114
- 'offset' => 0,
115
- 'post_type' => 'page',
116
- 'post_status' => 'publish',
117
- );
118
-
119
- $p = new WP_Query( $args );
120
- ?>
121
- <select name="ginger_privacy_page[<?php echo $langcode; ?>]" id="privacy_page_select_<?php echo $langcode; ?>" >
122
- <option value=""><?php _e('Select page', 'ginger'); ?></option>
123
- <?php
124
- while ( $p->have_posts() ) :
125
- $p->next_post();
126
- ?>
127
- <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>
128
- <?php
129
- endwhile;
130
- ?>
131
- </select>
132
- <?php
133
- $sitepress->switch_lang($current_lang); //restore previous language
134
- ?>
135
-
136
- </label></p>
137
- </fieldset>
138
- </td>
139
- </tr>
140
-
141
-
142
-
143
- <tr>
144
- <th scope="row" style="padding-left:20px;"><?php _e("Iframe Text", "ginger"); ?> - <?php echo $langval["native_name"]; ?></th>
145
- <td>
146
- <fieldset>
147
- <legend class="screen-reader-text"><span><?php _e("Iframe Text", "ginger"); ?></span></legend>
148
- <p><label><?php
149
- if (function_exists("wp_editor"))
150
- 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));
151
- else
152
- echo '<textarea name = "ginger_Iframe_text['.$langcode.']" >' . $options["ginger_Iframe_text"][$langcode] . '</textarea>';
153
-
154
- ?></label></p>
155
- </fieldset>
156
- </td>
157
- </tr>
158
-
159
- <tr>
160
- <th scope="row" style="padding-left:20px;"><?php _e("Customize your banner buttons", "ginger"); ?> - <?php echo $langval["native_name"]; ?></th>
161
- <td>
162
- <fieldset>
163
- <legend class="screen-reader-text"><span><?php _e("Iframe Text", "ginger"); ?></span></legend>
164
- <p>
165
- <label><b><?php _e("Accept cookie Button", "ginger"); ?></b></label>
166
- </p>
167
-
168
- <p>
169
- <label><?php _e("Text", "ginger"); ?></label>
170
- <input name="accept_cookie_button_text[<?php echo $langcode; ?>]" id="accept_cookie_button_text_<?php echo $langcode; ?>" type="text"
171
- value="<?php if ($options['accept_cookie_button_text'][$langcode] != "") {
172
- echo $options['accept_cookie_button_text'][$langcode];
173
- } else {
174
- echo _e('Accept Cookie', 'ginger');
175
- } ?>">
176
- </p>
177
-
178
- <p>
179
- <label><b><?php _e("Disable cookie Button", "ginger"); ?></b></label>
180
- </p>
181
-
182
- <p>
183
- <label><?php _e("Text", "ginger"); ?></label>
184
- <input name="disable_cookie_button_text[<?php echo $langcode; ?>]" id="disable_cookie_button_text_<?php echo $langcode; ?>" type="text"
185
- value="<?php if (isset($options['disable_cookie_button_text'][$langcode]) && $options['disable_cookie_button_text'][$langcode] != "") {
186
- echo $options['disable_cookie_button_text'][$langcode];
187
- } else {
188
- echo _e('Disable Cookie', 'ginger');
189
- } ?>" <?php if (!(isset($options['disable_cookie_button_status'][$langcode]) && $options['disable_cookie_button_status'][$langcode] == "1")) {
190
- echo 'disabled=true';
191
- } ?>>
192
- <?php echo _e('Enable:', 'ginger') ?>&nbsp;
193
- <input type="checkbox" id="disable_cookie_button_status_<?php echo $langcode; ?>" name="disable_cookie_button_status[<?php echo $langcode; ?>]"
194
- value="1" <?php if (isset($options['disable_cookie_button_status'][$langcode]) && $options['disable_cookie_button_status'][$langcode] == "1") {
195
- echo 'checked';
196
- } ?>
197
- 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; ?>');">
198
-
199
-
200
- <img id="img_disable_cookie_button_status_<?php echo $langcode; ?>"
201
- src="<?php if (isset($options['disable_cookie_button_status'][$langcode]) && $options['disable_cookie_button_status'][$langcode] == "1") {
202
- echo plugins_url("ginger/img/ok.png");
203
- } else {
204
- echo plugins_url("ginger/img/xx.png");
205
- } ?>" style="max-width: 20px; max-height: 20px; vertical-align: middle">
206
-
207
-
208
- </p>
209
- </fieldset>
210
- </td>
211
- </tr>
212
-
213
-
214
-
215
-
216
- <?php
217
-
218
- }
219
- ?>
220
- </tbody>
221
- </table>
222
- <p class="submit"><input type="submit" name="submit" id="submit" class="button button-primary" value="<?php _e("Save Changes", "ginger"); ?>"></p>
223
- </form>
224
- <?php
225
-
226
- }// check wpml active
227
- ?>
228
-
229
-
230
-
231
- </div>
232
-
233
- <?php
234
-
235
- }
236
-
237
-
238
- add_filter("ginger_text_iframe", "ginger_wpml_text_iframe");
239
- function ginger_wpml_text_iframe($text){
240
- $key = "ginger_wpml_options";
241
- $options = get_option($key);
242
- if($options == "") return $text;
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];
253
- $ginger_iframe_text = str_replace('</', '<\/', $ginger_iframe_text);
254
- $ginger_iframe_text = str_replace( array("\n", "\r"), "<br \/>", $ginger_iframe_text );
255
- return $ginger_iframe_text;
256
- endif;
257
-
258
- return $text;
259
- }
260
-
261
-
262
- add_filter("ginger_text_banner", "ginger_wpml_text_banner");
263
- function ginger_wpml_text_banner($text)
264
- {
265
- $key = "ginger_wpml_options";
266
- $options = get_option($key);
267
- if ($options == "") return $text;
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);
278
- $ginger_text = str_replace(array("\n", "\r"), "<br \/>", $ginger_text);
279
-
280
- //Recupero privacy policy se presente
281
- if (strpos($ginger_text, '{{privacy_page}}') !== false):
282
- $privacy_policy = $options['ginger_privacy_page'][$current_lang];
283
- if ($privacy_policy) {
284
-
285
- $privacy_policy = get_post($privacy_policy);
286
- $privacy_policy = ' <a href="' . get_permalink($privacy_policy->ID) . '">' . addslashes($privacy_policy->post_title) . '<\/a>';
287
- $ginger_text = str_replace('{{privacy_page}}', $privacy_policy, $ginger_text);
288
- }
289
- endif;
290
- return $ginger_text;
291
- endif;
292
-
293
- return $text;
294
- }
295
-
296
- add_filter("ginger_label_accept_cookie", "ginger_wpml_label_accept_cookie");
297
- function ginger_wpml_label_accept_cookie($text){
298
- $key = "ginger_wpml_options";
299
- $options = get_option($key);
300
- if($options == "") return $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];
311
- return $label_accept_cookie;
312
- endif;
313
-
314
- return $text;
315
- }
316
-
317
- add_filter("ginger_label_disable_cookie", "ginger_wpml_label_disable_cookie");
318
- function ginger_wpml_label_disable_cookie($text){
319
- $key = "ginger_wpml_options";
320
- $options = get_option($key);
321
- if($options == "") return $text;
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];
332
- return $label_disable_cookie;
333
- endif;
334
- endif;
335
-
336
- return $text;
337
- }
338
-
339
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
addon/wpml/index.php DELETED
@@ -1,90 +0,0 @@
1
- <?php
2
- //WPML
3
- $option_wpml = get_option('gingerwpml');
4
- if($option_wpml && $option_wpml['activated'] == 1):
5
- require_once('ginger.wpml.php');
6
- endif;
7
-
8
- add_action("ginger_addon_activation_page", "ginger_wpml_activation_page");
9
-
10
- function ginger_wpml_activation_page()
11
- {
12
- $appname = "wpml";
13
- $app_data = ginger_app_data($appname);
14
- $option_ginger_wpml = get_option('gingerwpml');
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("WPML", "ginger"); ?>
24
- <?php
25
- ginger_app_price($appname, $app_data);
26
- ?></h3>
27
- <small><?php _e("WPML add-on will adapt Ginger for WPML 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_wpml && $option_ginger_wpml['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("WPML", "ginger"); ?></span></legend>
42
- <p>
43
- <label>
44
- <?php _e("Active add-on", "ginger");?>:&nbsp;
45
- </label>
46
-
47
- <?php if ($option_ginger_wpml && $option_ginger_wpml['activated'] == 1): ?>
48
- <img id="img_google_wpml"
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_wpml['licence_key']; ?>" placeholder=""
56
- size="30px">
57
- <input id="activationmail" type="text" name="activationmail"
58
- value="<?php echo $option_ginger_wpml['email']; ?>" placeholder="" size="30px">
59
- <input type="hidden" name="product_id" value="gingerwpml">
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_wpml"
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="gingerwpml">
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
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/ginger.about.php CHANGED
@@ -1,5 +1,21 @@
 
1
  <div class="wrap">
2
- <h2>About EU Cookie Law</h2>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
 
4
 
5
  </div>
1
+
2
  <div class="wrap">
3
+ <div style="background-color: #F99A30; padding:10px;">
4
+
5
+ <a href="http://www.ginger-cookielaw.com/download/" target="_blank" ><img src="http://www.ginger-cookielaw.com/wp-content/uploads/2015/07/logo-head.png" style="float: left;"></a>
6
+ <p style="color: #FFFFFF; font-size: 30px; ">Need more?<br> Import-Export tools, Dinamic Google Analytics, Custom JS configurator, Logger, Multilanguage Tools, and more </p>
7
+
8
+ </div>
9
+
10
+
11
+ <div style="text-align: center; margin:60px 0px;"><h1 style="font-size: 40px; "><a href="http://www.ginger-cookielaw.com/download/" target="_blank" style="border-bottom: solid 6px #F99A30; color:#F99A30;text-decoration: none;">GET GINGER TOOLS INSTALLER!</h1></div>
12
+
13
+
14
+ <br style="clear:both;">
15
+
16
+ <br style="clear:both;">
17
+
18
+
19
 
20
 
21
  </div>
admin/ginger.utils.php CHANGED
@@ -14,6 +14,8 @@ function register_ginger_menu_page(){
14
  $ginger_menu_hook = add_menu_page( 'ginger', 'Ginger Cookie', 'manage_options', 'ginger-setup', 'ginger_menu_page', plugins_url( 'ginger/img/ginger-color.png' ));
15
  do_action("ginger_add_menu");
16
 
 
 
17
  if ($ginger_menu_hook) {
18
  if(function_exists("get_current_screen"))
19
  add_action( 'load-' . $ginger_menu_hook, 'ginger_add_help' );
@@ -21,6 +23,7 @@ function register_ginger_menu_page(){
21
 
22
  }
23
 
 
24
  function ginger_menu_page(){
25
  require_once(plugin_dir_path( __FILE__ )."/ginger.admin.php");
26
  }
@@ -98,55 +101,9 @@ function save_privacy_page($title,$content){
98
  }
99
 
100
 
101
- //Attivazione plugin abilito le impostazioni di base se non inserite.
102
- function ginger_plugin_activate() {
103
- $options = get_option('ginger_general');
104
- if (!is_array($options)){
105
- $options = array('enable_ginger' => '0', 'ginger_cache' => 'yes', 'ginger_opt' => 'in', 'ginger_scroll' => '1', 'ginger_click_out' => '0' , 'ginger_force_reload' => '0' , 'ginger_keep_banner' => '0' );
106
- update_option('ginger_general', $options);
107
-
108
- $options = array (
109
- 'ginger_banner_type' => 'bar',
110
- 'ginger_banner_position' => 'top',
111
- 'ginger_banner_text' => addslashes(__("This website uses cookies. By continuing to use the site you are agreeing to its use of cookies.", "ginger")),
112
- 'ginger_Iframe_text' => addslashes(__("This content has been disabled because you have not accepted cookies.", "ginger")),
113
- 'accept_cookie_button_text' => 'Accept',
114
- 'theme_ginger' => 'light',
115
- 'background_color' => '',
116
- 'text_color' => '',
117
- 'button_color' => '',
118
- 'link_color' => '',
119
- 'disable_cookie_button_status' => '0',
120
- 'read_more_button_status' => '0',
121
- );
122
- update_option('ginger_banner', $options);
123
- }
124
- }
125
-
126
- function ginger_app_price($appname, $appdata = false){
127
- if(!$appdata)
128
- $appdata = ginger_app_data($appname);
129
- $price = $appdata["price"];
130
- if($price == "0"){
131
- echo '<small style="color: green">(';
132
- _e("Free", "ginger");
133
- echo ')</small>';
134
- }else{
135
- echo '<small style="color: green">(';
136
- _e("price: ", "ginger");
137
- echo $price;
138
- echo '&euro;)</small>';
139
- }
140
-
141
- }
142
-
143
-
144
- function ginger_app_data($appname){
145
-
146
- $url = "http://www.ginger-cookielaw.com/api/?pname=".$appname;
147
- $response = wp_remote_get($url);
148
- if($response) {
149
- $array = json_decode($response["body"], true);
150
- return $array[$appname];
151
- }
152
  }
14
  $ginger_menu_hook = add_menu_page( 'ginger', 'Ginger Cookie', 'manage_options', 'ginger-setup', 'ginger_menu_page', plugins_url( 'ginger/img/ginger-color.png' ));
15
  do_action("ginger_add_menu");
16
 
17
+ add_submenu_page( 'ginger-setup', "Premium", __("Premium", "ginger"), 'manage_options', 'ginger-about', 'ginger_about_menu_page');
18
+
19
  if ($ginger_menu_hook) {
20
  if(function_exists("get_current_screen"))
21
  add_action( 'load-' . $ginger_menu_hook, 'ginger_add_help' );
23
 
24
  }
25
 
26
+
27
  function ginger_menu_page(){
28
  require_once(plugin_dir_path( __FILE__ )."/ginger.admin.php");
29
  }
101
  }
102
 
103
 
104
+ function render_ginger_action_links($actions)
105
+ {
106
+ $url = "http://www.ginger-cookielaw.com/download/";
107
+ $actions[] = '<a href="' . $url . '" style="color:#3db634;" target="_blank">' . _x( 'Get Tools Installer & Upgrade', 'ginger' ) . '</a>';
108
+ return $actions;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
109
  }
ginger-eu-cookie-law.php CHANGED
@@ -1,9 +1,9 @@
1
  <?php
2
  /*
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.3.6
7
  Author: Manafactory
8
  Author URI: http://manafactory.it/
9
  License: GPLv2 or later
@@ -14,9 +14,6 @@ if ( !defined('ABSPATH')) exit;
14
 
15
  load_plugin_textdomain( 'ginger', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
16
 
17
- // check existing addon
18
- require_once('addon/ginger.addon.utils.php');
19
-
20
  //Gestione Backend
21
  if(is_admin()){
22
  require_once("admin/ginger.utils.php");
@@ -28,3 +25,5 @@ if(!is_admin()){
28
  require_once("front/gingerfront.utils.php");
29
  require_once("front/gingerfront.core.php");
30
  }
 
 
1
  <?php
2
  /*
3
  Plugin Name: Ginger - EU Cookie Law
4
+ Plugin URI: http://www.ginger-cookielaw.com/
5
+ Description: Make your website compliant with EU Cookie Policy! For more features get <a href="">Ginger Plus - Tools Installer</a>
6
+ Version: 3.0
7
  Author: Manafactory
8
  Author URI: http://manafactory.it/
9
  License: GPLv2 or later
14
 
15
  load_plugin_textdomain( 'ginger', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
16
 
 
 
 
17
  //Gestione Backend
18
  if(is_admin()){
19
  require_once("admin/ginger.utils.php");
25
  require_once("front/gingerfront.utils.php");
26
  require_once("front/gingerfront.core.php");
27
  }
28
+
29
+ add_filter('plugin_action_links_' . plugin_basename(__FILE__), 'render_ginger_action_links');
readme.txt CHANGED
@@ -4,7 +4,7 @@ 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.3
7
- Stable tag: 2.3.6
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -93,6 +93,10 @@ Yes, actually you we have 2 addons for multilanguages: wpml and polylang. Ask to
93
 
94
  == Changelog ==
95
 
 
 
 
 
96
  = 2.3.6 =
97
  * Fixed 3.0 compatibility
98
 
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.3
7
+ Stable tag: 3.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
93
 
94
  == Changelog ==
95
 
96
+
97
+ = 3.0 =
98
+ * Removed policy violation
99
+
100
  = 2.3.6 =
101
  * Fixed 3.0 compatibility
102
 
uninstall.php CHANGED
@@ -10,20 +10,3 @@ if ( ! current_user_can( 'activate_plugins' ) )
10
  delete_option('ginger_general');
11
  delete_option('ginger_banner');
12
  delete_option('ginger_policy');
13
-
14
- delete_option('gingerjscustom');
15
- delete_option('ginger_jscustom_options');
16
-
17
- delete_option('gingeradsense');
18
-
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');
27
-
28
- global $wpdb;
29
- $wpdb->query( "DROP TABLE IF EXISTS {$wpdb->prefix}logger_ginger" );
10
  delete_option('ginger_general');
11
  delete_option('ginger_banner');
12
  delete_option('ginger_policy');