WP Maintenance - Version 6.0.9

Version Description

  • Bug IP autorized fixed
Download this release

Release Info

Developer Florent73
Plugin Icon 128x128 WP Maintenance
Version 6.0.9
Comparing to
See all releases

Code changes from version 6.0.8 to 6.0.9

classes/wp-maintenance.php CHANGED
@@ -616,15 +616,16 @@ class WP_maintenance {
616
  $paramIpAddress = get_option('wp_maintenance_ipaddresses');
617
 
618
  /* Désactive le mode maintenance pour les IP définies */
619
- if( isset($paramIpAddress) ) {
620
  $lienIpAddress = explode("\r\n", $paramIpAddress);
621
  $ip_autorized = array();
622
  foreach($lienIpAddress as $ipAutorized) {
623
- if( $ipAutorized!='' ) {
624
- array_push( $ip_autorized, $ipAutorized);
625
  }
626
- }
627
- if ( array_search(wpm_get_ip(), $ip_autorized) !== FALSE ) {
 
628
  $statusActive = 0;
629
  }
630
 
616
  $paramIpAddress = get_option('wp_maintenance_ipaddresses');
617
 
618
  /* Désactive le mode maintenance pour les IP définies */
619
+ if(isset($paramIpAddress)) {
620
  $lienIpAddress = explode("\r\n", $paramIpAddress);
621
  $ip_autorized = array();
622
  foreach($lienIpAddress as $ipAutorized) {
623
+ if($ipAutorized!='') {
624
+ array_push($ip_autorized, $ipAutorized);
625
  }
626
+ }
627
+ //error_log(wpm_get_ip().' --> '.print_r($ip_autorized));
628
+ if(array_search(wpm_get_ip(), $ip_autorized)!== FALSE) {
629
  $statusActive = 0;
630
  }
631
 
includes/functions.php CHANGED
@@ -139,15 +139,15 @@ function wpm_get_ip() {
139
 
140
  // IP si internet partagé
141
  if (isset($_SERVER['HTTP_CLIENT_IP'])) {
142
- return esc_url($_SERVER['HTTP_CLIENT_IP']);
143
  }
144
  // IP derrière un proxy
145
  elseif (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
146
- return esc_url($_SERVER['HTTP_X_FORWARDED_FOR']);
147
  }
148
  // Sinon : IP normale
149
  else {
150
- return (isset($_SERVER['REMOTE_ADDR']) ? esc_url($_SERVER['REMOTE_ADDR']) : '');
151
  }
152
 
153
  }
139
 
140
  // IP si internet partagé
141
  if (isset($_SERVER['HTTP_CLIENT_IP'])) {
142
+ return esc_html($_SERVER['HTTP_CLIENT_IP']);
143
  }
144
  // IP derrière un proxy
145
  elseif (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
146
+ return esc_html($_SERVER['HTTP_X_FORWARDED_FOR']);
147
  }
148
  // Sinon : IP normale
149
  else {
150
+ return (isset($_SERVER['REMOTE_ADDR']) ? esc_html($_SERVER['REMOTE_ADDR']) : '');
151
  }
152
 
153
  }
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://paypal.me/restezconnectes/20/
4
  Tags: Maintenance, Construction, Launch, Coming soon
5
  Requires at least: 3.0
6
  Tested up to: 6.0
7
- Stable tag: 6.0.8
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -70,6 +70,9 @@ You can translate WP Maintenance on [__translate.wordpress.org__](https://transl
70
 
71
  == Changelog ==
72
 
 
 
 
73
  = 6.0.8 =
74
  * Several security patches brought
75
  * WARNING : somes parameters will be reinitilized, please check all
4
  Tags: Maintenance, Construction, Launch, Coming soon
5
  Requires at least: 3.0
6
  Tested up to: 6.0
7
+ Stable tag: 6.0.9
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
70
 
71
  == Changelog ==
72
 
73
+ = 6.0.9 =
74
+ * Bug IP autorized fixed
75
+
76
  = 6.0.8 =
77
  * Several security patches brought
78
  * WARNING : somes parameters will be reinitilized, please check all
socialicons/style1/128/google_plus.png DELETED
Binary file
socialicons/style1/256/google_plus.png DELETED
Binary file
socialicons/style1/32/google_plus.png DELETED
Binary file
socialicons/style1/512/google_plus.png DELETED
Binary file
socialicons/style1/64/google_plus.png DELETED
Binary file
socialicons/style6/32/google_plus.png DELETED
Binary file
socialicons/style6/64/google_plus.png DELETED
Binary file
themes/default/functions.php CHANGED
@@ -3,391 +3,391 @@
3
  // Template Tags
4
  function wpm_title_seo() {
5
 
6
- // Récupère les paramètres sauvegardés
7
- if(get_option('wp_maintenance_settings_seo')) { extract(get_option('wp_maintenance_settings_seo')); }
8
- $o = get_option('wp_maintenance_settings_seo');
9
 
10
- $output = get_bloginfo( 'name', 'display' );
11
 
12
- if ( (isset($o['enable_seo']) && $o['enable_seo']==1) && $o['seo_title']!='' ) {
13
- $output = esc_html( $o['seo_title'] );
14
- }
15
 
16
- return $output;
17
  }
18
 
19
  function wpm_title() {
20
-
21
- // Récupère les paramètres sauvegardés
22
- if(get_option('wp_maintenance_settings')) { extract(get_option('wp_maintenance_settings')); }
23
- $o = get_option('wp_maintenance_settings');
24
 
25
- $output = '';
26
 
27
- if( !empty($o['titre_maintenance']) ) {
28
- $output = esc_html( stripslashes($o['titre_maintenance']) );
29
- }
30
- return $output;
31
  }
32
 
33
  function wpm_metadescription() {
34
- // Récupère les paramètres sauvegardés
35
- if(get_option('wp_maintenance_settings_seo')) { extract(get_option('wp_maintenance_settings_seo')); }
36
- $o = get_option('wp_maintenance_settings_seo');
37
 
38
- $output = '<meta name="description" content="'.get_bloginfo( 'description', 'display' ).'">';
39
 
40
- if ( (isset($o['enable_seo']) && $o['enable_seo']==1) && $o['seo_description']!='' ) {
41
- $output = '<meta name="description" content="'.esc_attr( $o['seo_description'] ).'">';
42
- }
43
 
44
- return $output;
45
  }
46
 
47
  function wpm_footer_text() {
48
 
49
- // Récupère les paramètres sauvegardés
50
- if(get_option('wp_maintenance_settings_footer')) { extract(get_option('wp_maintenance_settings_footer')); }
51
- $o = get_option('wp_maintenance_settings_footer');
52
 
53
- $output = '';
54
 
55
- if( isset($o['enable_footer']) && $o['enable_footer'] == 1 ) {
56
 
57
- $output .= '<div class="footer-basic">
58
- <footer>
59
- <p class="copyright">';
60
 
61
- if( isset($o['text_bt_maintenance']) && $o['text_bt_maintenance']!='' ) {
62
- $output .= nl2br(stripslashes($o['text_bt_maintenance']));
63
- }
64
- if( (isset($o['add_wplogin']) && $o['add_wplogin']==1) && (isset($o['add_wplogin_title']) && $o['add_wplogin_title']!='') ) {
65
- $output .= '<br /><br /><a href="'.get_admin_url().'">'.str_replace('#DASHBOARD', ' '.__('Dashboard', 'wp-maintenance'), esc_html($o['add_wplogin_title'])).'</a>';
66
 
67
- }
68
 
69
- $output .= '</p>
70
- </footer>
71
- </div>';
72
 
73
- }
74
 
75
- return $output;
76
  }
77
 
78
  function wpm_favicon() {
79
- // Récupère les paramètres sauvegardés
80
- if(get_option('wp_maintenance_settings_seo')) { extract(get_option('wp_maintenance_settings_seo')); }
81
- $o = get_option('wp_maintenance_settings_seo');
82
 
83
- $output = '';
84
 
85
- if ( !empty( $o['favicon'] ) ) {
86
- $output .= "<!-- Favicon -->\n";
87
- $output .= '<link href="'.esc_attr( $o['favicon'] ).'" rel="shortcut icon" type="image/x-icon" />';
88
- }
89
 
90
- return $output;
91
  }
92
 
93
  function wpm_head() {
94
 
95
- // Récupère les paramètres sauvegardés
96
- if(get_option('wp_maintenance_settings_colors')) { extract(get_option('wp_maintenance_settings_colors')); }
97
- $o = get_option('wp_maintenance_settings_colors');
98
-
99
-
100
- $output = "<!-- Add Google Fonts -->\n";
101
- $output .= '<link rel="stylesheet" href="https://fonts.googleapis.com/css?family='.str_replace(' ', '+', $o['font_title']).'|'.str_replace(' ', '+',$o['font_text']).'|'.str_replace(' ', '+',$o['font_text_bottom']).'|'.str_replace(' ', '+',$o['font_cpt']);
102
- if( isset($o['newletter_font_text']) && $o['newletter_font_text'] != '') {
103
- $output .= '|'.str_replace(' ', '+',$o['newletter_font_text']);
104
- }
105
- $output .= '">';
106
- return $output;
107
  }
108
 
109
  function wpm_text() {
110
-
111
- // Récupère les paramètres sauvegardés
112
- if(get_option('wp_maintenance_settings')) { extract(get_option('wp_maintenance_settings')); }
113
- $o = get_option('wp_maintenance_settings');
114
 
115
- $output = '';
116
 
117
- if( !empty($o['text_maintenance']) ) {
118
- $output = nl2br(stripslashes($o['text_maintenance']));
119
- }
120
- return $output;
121
  }
122
 
123
  function wpm_logo() {
124
 
125
- // Récupère les paramètres sauvegardés
126
- if(get_option('wp_maintenance_settings_picture')) { extract(get_option('wp_maintenance_settings_picture')); }
127
- $o = get_option('wp_maintenance_settings_picture');
128
 
129
- $output = '';
130
 
131
- if ( !empty( $o['image'] ) ) {
132
- if( empty($o['image_width']) ) { $o['image_width'] = 450; }
133
- if( empty($o['image_height']) ) { $o['image_height'] = 450; }
134
- $output .= "<div id='logo'><img id='wpm-image' src='".esc_url($o['image'])."' width='".$o['image_width']."px' height='".$o['image_height']."px' alt='".get_bloginfo( 'name', 'display' )." ".get_bloginfo( 'description', 'display' )."' title='".get_bloginfo( 'name', 'display' )." ".get_bloginfo( 'description', 'display' )."' style='width:".$o['image_width']."px!important;height:".$o['image_height']."px!important;'></div>";
135
- }
136
 
137
- return $output;
138
  }
139
 
140
  function wpm_customcss() {
141
 
142
- // Récupère les paramètres sauvegardés
143
- if(get_option('wp_maintenance_settings')) { extract(get_option('wp_maintenance_settings')); }
144
- $o = get_option('wp_maintenance_settings');
145
-
146
- // Récupère les paramètres sauvegardés des couleurs
147
- if(get_option('wp_maintenance_settings_colors')) { extract(get_option('wp_maintenance_settings_colors')); }
148
- $colors = get_option('wp_maintenance_settings_colors');
149
-
150
- // Récupère les paramètres sauvegardés des images
151
- if(get_option('wp_maintenance_settings_picture')) { extract(get_option('wp_maintenance_settings_picture')); }
152
- $picture = get_option('wp_maintenance_settings_picture');
153
-
154
- $oo = get_option('wp_maintenance_settings_socialnetworks');
155
-
156
- // CSS
157
- $output = '<style type="text/css">';
158
- ob_start();
159
-
160
- $addStyleGeneral = '';
161
-
162
- /* Définition des couleurs par défault */
163
- if( !isset($colors['color_bg']) || $colors['color_bg']=="") { $colors['color_bg'] = "#f1f1f1"; }
164
- if( !isset($colors['color_txt']) || $colors['color_txt']=="") { $colors['color_txt'] = "#888888"; }
165
-
166
- /* Traitement de la feuille de style */
167
- $styleRemplacements = array (
168
- "#_COLORTXT" => $colors['color_txt'],
169
- "#_COLORBG" => $colors['color_bg'],
170
- "#_COLORCPTBG" => $colors['color_cpt_bg'],
171
- "#_DATESIZE" => $colors['date_cpt_size'],
172
- "#_COLORCPT" => $colors['color_cpt'],
173
- "#_COLOR_BG_BT" => $colors['color_bg_bottom'],
174
- "#_COLOR_TXT_BT" => $colors['color_text_bottom'],
175
- "#_COLORHEAD" => $colors['color_bg_header'],
176
- );
177
- $remplaceStyle = str_replace(array_keys($styleRemplacements), array_values($styleRemplacements), get_option('wp_maintenance_settings_css'));
178
- $output .= wpm_compress($remplaceStyle);
179
-
180
- /* Si on a activé un motif */
181
- if( isset($picture['b_enable_image']) && $picture['b_enable_image'] == 2 ) {
182
-
183
- $addStyleGeneral .= 'body {
184
- background-image: url('.esc_url(WP_PLUGIN_URL.'/wp-maintenance/images/pattern'.$picture['b_pattern'].'.png').');
185
- background-repeat: repeat;
186
- background-color: '.$colors['color_bg'].';}';
187
-
188
- }
189
-
190
- /* Si on a une image de fond */
191
- if( isset($picture['b_enable_image']) && $picture['b_enable_image'] == 1 ) {
192
-
193
- if( isset($picture['b_image']) && $picture['b_image'] ) {
194
-
195
- if( empty($picture['b_repeat_image']) ) { $picture['b_repeat_image'] = 'repeat'; }
196
- if( isset($picture['b_fixed_image']) && $picture['b_fixed_image']==1 ) {
197
- $picture['b_fixed_image'] = 'fixed;';
198
- } else {
199
- $picture['b_fixed_image'] = '';
200
- }
201
- $addStyleGeneral .= 'body {display: grid!important;background:url('.esc_url($picture['b_image']).') '.$picture['b_repeat_image'].' '.$picture['b_fixed_image'].'top center;background-size: cover;
202
- -webkit-background-size: cover;-moz-background-size: cover;-o-background-size: cover;background-color: '.$colors['color_bg'].';background-position: center;}';
203
-
204
- if( isset($picture['b_opacity_image']) ) {
205
- $addStyleGeneral .= '#main { background-color: rgba(0,0,0,'.esc_html($picture['b_opacity_image']).'); }';
206
- }
207
- }
208
-
209
- }
210
-
211
- if( isset($picture['b_enable_image']) && $picture['b_enable_image']==0 ) {
212
- $addStyleGeneral .= 'body {background-color: '.$colors['color_bg'].';}';
213
- }
214
-
215
- if( isset($colors['color_bg_header']) && $colors['color_bg_header']!='') {
216
- $addStyleGeneral .= 'header { background-color:'.$colors['color_bg_header'].';}';
217
- }
218
- $addStyleGeneral .= '.wpm_social_icon {float:left;width:'.esc_html($oo['size']).'px;margin:0px 5px auto;}.wpm_social ul {margin: 10px 0;max-width: 100%;padding: 0;text-align: '.esc_html($oo['align']).';}';
219
-
220
- /* Si container activé */
221
- if( isset($colors['container_active']) && $colors['container_active'] == 1 ) {
222
-
223
- if( empty($colors['container_opacity']) ) { $colors['container_opacity'] = 0.5; }
224
- if( empty($colors['container_width']) ) { $colors['container_width'] = 80; }
225
- if( empty($colors['container_color']) ) { $colors['container_color'] = '#ffffff'; }
226
- if( isset($colors['container_color']) ) { $paramRGBColor = wpm_hex2rgb($colors['container_color']); }
227
- $addStyleGeneral .= '#sscontent {background-color: rgba('.esc_html($paramRGBColor['rouge']).','.esc_html($paramRGBColor['vert']).','.esc_html($paramRGBColor['bleu']).', '.esc_html($colors['container_opacity']).');padding:0.8em;margin-left:auto;margin-right:auto;width:'.esc_html($colors['container_width']).'%;}';
228
-
229
- }
230
-
231
- $addStyleGeneral .= '.wpm_newletter {';
232
- if( isset($colors['newletter_size']) ) { $addStyleGeneral .= 'font-size:'.esc_html($colors['newletter_size']).'px;'; }
233
- if( isset($colors['newletter_font_style']) ) { $addStyleGeneral .= 'font-style:'.esc_html($colors['newletter_font_style']).';'; }
234
- if( isset($colors['newletter_font_weigth']) ) { $addStyleGeneral .= 'font-weight:'.esc_html($colors['newletter_font_weigth']).';'; }
235
- if( isset($colors['newletter_font_text']) ) { $addStyleGeneral .= 'font-family:'.wpm_format_font($colors['newletter_font_text']).', serif;'; }
236
- $addStyleGeneral .= '}
237
- h3 {';
238
- if( isset($colors['font_title']) ) { $addStyleGeneral .= 'font-family: '.wpm_format_font($colors['font_title']).', serif;'; }
239
- if( isset($colors['font_title_size']) ) { $addStyleGeneral .= 'font-size: '.esc_html($colors['font_title_size']).'px;'; }
240
- if( isset($colors['font_title_style']) ) { $addStyleGeneral .= 'font-style: '.esc_html($colors['font_title_style']).';'; }
241
- if( isset($colors['font_title_weigth']) ) { $addStyleGeneral .= 'font-weight: '.esc_html($colors['font_title_weigth']).';'; }
242
- if( isset($colors['color_title']) ) { $addStyleGeneral .= 'color:'.esc_html($colors['color_title']).';'; }
243
- $addStyleGeneral .= 'line-height: 100%;text-align:center;margin:0.5em auto;
244
- }
245
- p {';
246
- if( isset($colors['font_text']) ) { $addStyleGeneral .= 'font-family: '.wpm_format_font($colors['font_text']).', serif;'; }
247
- if( isset($colors['font_text_size']) ) { $addStyleGeneral .= 'font-size: '.esc_html($colors['font_text_size']).'px;'; }
248
- if( isset($colors['font_text_style']) ) { $addStyleGeneral .= 'font-style: '.esc_html($colors['font_text_style']).';'; }
249
- if( isset($colors['font_text_weigth']) ) { $addStyleGeneral .= 'font-weight: '.esc_html($colors['font_text_weigth']).';'; }
250
- if( isset($colors['color_txt']) ) { $addStyleGeneral .= 'color:'.esc_html($colors['color_txt']).';'; }
251
  $addStyleGeneral .= 'line-height: 100%;text-align:center;margin:0.5em auto;padding-left:2%;padding-right:2%;
252
- }
253
- footer {';
254
- if( isset($colors['font_text_bottom']) ) { $addStyleGeneral .= 'font-family: '.wpm_format_font($colors['font_text_bottom']).', serif;'; }
255
- if( isset($colors['font_bottom_style']) ) { $addStyleGeneral .= 'font-style: '.esc_html($colors['font_bottom_style']).';'; }
256
- if( isset($colors['font_bottom_size']) ) { $addStyleGeneral .= 'font-size: '.esc_html($colors['font_bottom_size']).'px;'; }
257
- if( isset($colors['font_bottom_weigth']) ) { $addStyleGeneral .= 'font-weight: '.esc_html($colors['font_bottom_weigth']).';'; }
258
- if( isset($colors['color_text_bottom']) ) { $addStyleGeneral .= 'color: '.esc_html($colors['color_text_bottom']).';'; }
259
- if( isset($colors['color_bg_bottom']) ) { $addStyleGeneral .= 'background:'.esc_html($colors['color_bg_bottom']).';'; }
260
  $addStyleGeneral .= 'text-decoration:none;
261
- }
262
- footer a:link {';
263
- if( isset($colors['color_text_bottom']) ) { $addStyleGeneral .= 'color:'.esc_html($colors['color_text_bottom']).';'; }
264
- if( isset($colors['font_bottom_size']) ) { $addStyleGeneral .= 'font-size: '.esc_html($colors['font_bottom_size']).'px;'; }
265
  $addStyleGeneral .= 'text-decoration:none;
266
- }
267
- footer a:visited {';
268
- if( isset($colors['color_text_bottom']) ) { $addStyleGeneral .= 'color:'.esc_html($colors['color_text_bottom']).';'; }
269
- if( isset($colors['font_bottom_size']) ) { $addStyleGeneral .= 'font-size: '.esc_html($colors['font_bottom_size']).'px;'; }
270
  $addStyleGeneral .= 'text-decoration:none;
271
- }
272
- footer a:hover {
273
  text-decoration:underline;';
274
- if( isset($colors['font_bottom_size']) ) { $addStyleGeneral .= 'font-size: '.esc_html($colors['font_bottom_size']).'px;'; }
275
- $addStyleGeneral .= '
276
- }';
277
 
278
- $output .= wpm_compress($addStyleGeneral);
279
- $output .= ob_get_clean();
280
 
281
- $output .= '</style>'."\n";
282
 
283
- return $output;
284
  }
285
 
286
  function wpm_headercode() {
287
 
288
- // Récupère les paramètres sauvegardés
289
- if(get_option('wp_maintenance_settings_options')) { extract(get_option('wp_maintenance_settings_options')); }
290
- $o = get_option('wp_maintenance_settings_options');
291
 
292
- $output = '';
293
 
294
- if( isset($o['headercode']) && $o['headercode']!='') {
295
- $output = stripslashes($o['headercode']);
296
- }
297
 
298
- return $output;
299
  }
300
 
301
  function wpm_social_position($position = '') {
302
 
303
- // Récupère les paramètres sauvegardés
304
- $o = get_option('wp_maintenance_settings_socialnetworks');
305
 
306
- $output = '';
307
- if( isset($o['enable']) && $o['enable'] == 1 ) {
308
 
309
- if( isset($o['position']) && $o['position']=='top' && isset($position) && $position=='top' ) {
310
- $output = '<header id="header" role="banner" class="pam">'.do_shortcode('[wpm_social]').'</header>';
311
- }
312
- if( isset($o['position']) && $o['position']=='bottom' && isset($position) && $position=='bottom') {
313
- $output = do_shortcode('[wpm_social]');
314
- }
315
- }
316
 
317
- return $output;
318
  }
319
 
320
 
321
  function wpm_stylenewsletter() {
322
 
323
- // Récupère les paramètres sauvegardés
324
- if(get_option('wp_maintenance_settings')) { extract(get_option('wp_maintenance_settings')); }
325
- $o = get_option('wp_maintenance_settings');
326
 
327
- // Récupère les paramètres sauvegardés des couleurs
328
- if(get_option('wp_maintenance_settings_colors')) { extract(get_option('wp_maintenance_settings_colors')); }
329
- $colors = get_option('wp_maintenance_settings_colors');
330
 
331
 
332
- $output = '';
333
 
334
- if( empty($colors['color_field_text']) ) { $colors['color_field_text'] = '#333333'; }
335
- if( empty($colors['color_text_button']) ) { $colors['color_text_button']= '#ffffff'; }
336
- if( empty($colors['color_field_background']) ) { $colors['color_field_background']= '#F1F1F1'; }
337
- if( empty($colors['color_field_border']) ) { $colors['color_field_border']= '#333333'; }
338
- if( empty($colors['color_button_onclick']) ) { $colors['color_button_onclick']= '#333333'; }
339
- if( empty($colors['color_button_hover']) ) { $colors['color_button_hover']= '#cccccc'; }
340
- if( empty($colors['color_button']) ) { $colors['color_button']= '#1e73be'; }
341
 
342
- $wysijaRemplacements = array (
343
- "#_COLORTXT" => esc_html($colors['color_field_text']),
344
- "#_COLORBG" => esc_html($colors['color_field_background']),
345
- "#_COLORBORDER" => esc_html($colors['color_field_border']),
346
- "#_COLORBUTTON" => esc_html($colors['color_button']),
347
- "#_COLORTEXTBUTTON" => esc_html($colors['color_text_button']),
348
- "#_COLOR_BTN_HOVER" => esc_html($colors['color_button_hover']),
349
- "#_COLOR_BTN_CLICK" => esc_html($colors['color_button_onclick'])
350
- );
351
 
352
- if( isset($o['code_newletter']) && $o['code_newletter']!='' && strpos($o['code_newletter'], 'wysija_form') == 1 ) {
353
 
354
- $output = str_replace(array_keys($wysijaRemplacements), array_values($wysijaRemplacements), wpm_wysija_style() );
355
 
356
- } else if( isset($o['code_newletter']) && strpos($o['code_newletter'], 'mc4wp_form') == 1 ) {
357
 
358
- $output = str_replace(array_keys($wysijaRemplacements), array_values($wysijaRemplacements), wpm_mc4wp_style() );
359
 
360
- }
361
 
362
- if( isset($output) && $output!='' ) {
363
- return '<style type="text/css">'.wpm_compress(sanitize_text_field($output)).'</style>';
364
- } else {
365
- return;
366
- }
367
  }
368
 
369
  function wpm_newsletter() {
370
 
371
- // Récupère les paramètres sauvegardés
372
- if(get_option('wp_maintenance_settings')) { extract(get_option('wp_maintenance_settings')); }
373
- $o = get_option('wp_maintenance_settings');
374
-
375
- $output = '';
376
-
377
- if( isset($o['newletter']) && $o['newletter']==1 ) {
378
-
379
- $output = '<div class="wpm_newletter">';
380
- if( isset($o['title_newletter']) && $o['title_newletter']!='') {
381
- $output .= '<div>'.sanitize_text_field(stripslashes($o['title_newletter'])).'</div>';
382
- }
383
- if( isset($o['type_newletter']) && isset($o['iframe_newletter']) && $o['iframe_newletter']!='' && $o['type_newletter']=='iframe' ) {
384
- $output .= stripslashes($o['iframe_newletter']);
385
- }
386
- if( isset($o['type_newletter']) && isset($o['code_newletter']) && $o['code_newletter']!='' && $o['type_newletter']=='shortcode' ) {
387
- $output .= do_shortcode(stripslashes($o['code_newletter']));
388
- }
389
- $output .= '</div>';
390
- }
391
-
392
- return $output;
393
  }
3
  // Template Tags
4
  function wpm_title_seo() {
5
 
6
+ // Récupère les paramètres sauvegardés
7
+ if(get_option('wp_maintenance_settings_seo')) { extract(get_option('wp_maintenance_settings_seo')); }
8
+ $o = get_option('wp_maintenance_settings_seo');
9
 
10
+ $output = get_bloginfo( 'name', 'display' );
11
 
12
+ if ( (isset($o['enable_seo']) && $o['enable_seo']==1) && $o['seo_title']!='' ) {
13
+ $output = esc_html( $o['seo_title'] );
14
+ }
15
 
16
+ return $output;
17
  }
18
 
19
  function wpm_title() {
20
+
21
+ // Récupère les paramètres sauvegardés
22
+ if(get_option('wp_maintenance_settings')) { extract(get_option('wp_maintenance_settings')); }
23
+ $o = get_option('wp_maintenance_settings');
24
 
25
+ $output = '';
26
 
27
+ if(!empty($o['titre_maintenance']) ) {
28
+ $output = esc_html( stripslashes($o['titre_maintenance']) );
29
+ }
30
+ return $output;
31
  }
32
 
33
  function wpm_metadescription() {
34
+ // Récupère les paramètres sauvegardés
35
+ if(get_option('wp_maintenance_settings_seo')) { extract(get_option('wp_maintenance_settings_seo')); }
36
+ $o = get_option('wp_maintenance_settings_seo');
37
 
38
+ $output = '<meta name="description" content="'.get_bloginfo( 'description', 'display' ).'">';
39
 
40
+ if ( (isset($o['enable_seo']) && $o['enable_seo']==1) && $o['seo_description']!='' ) {
41
+ $output = '<meta name="description" content="'.esc_attr( $o['seo_description'] ).'">';
42
+ }
43
 
44
+ return $output;
45
  }
46
 
47
  function wpm_footer_text() {
48
 
49
+ // Récupère les paramètres sauvegardés
50
+ if(get_option('wp_maintenance_settings_footer')) { extract(get_option('wp_maintenance_settings_footer')); }
51
+ $o = get_option('wp_maintenance_settings_footer');
52
 
53
+ $output = '';
54
 
55
+ if(isset($o['enable_footer']) && $o['enable_footer'] == 1) {
56
 
57
+ $output .= '<div class="footer-basic">
58
+ <footer>
59
+ <p class="copyright">';
60
 
61
+ if(isset($o['text_bt_maintenance']) && $o['text_bt_maintenance']!='') {
62
+ $output .= nl2br(stripslashes($o['text_bt_maintenance']));
63
+ }
64
+ if((isset($o['add_wplogin']) && $o['add_wplogin']==1) && (isset($o['add_wplogin_title']) && $o['add_wplogin_title']!='') ) {
65
+ $output .= '<br /><br /><a href="'.get_admin_url().'">'.str_replace('#DASHBOARD', ' '.__('Dashboard', 'wp-maintenance'), esc_html($o['add_wplogin_title'])).'</a>';
66
 
67
+ }
68
 
69
+ $output .= '</p>
70
+ </footer>
71
+ </div>';
72
 
73
+ }
74
 
75
+ return $output;
76
  }
77
 
78
  function wpm_favicon() {
79
+ // Récupère les paramètres sauvegardés
80
+ if(get_option('wp_maintenance_settings_seo')) { extract(get_option('wp_maintenance_settings_seo')); }
81
+ $o = get_option('wp_maintenance_settings_seo');
82
 
83
+ $output = '';
84
 
85
+ if (!empty( $o['favicon']) ) {
86
+ $output .= "<!-- Favicon -->\n";
87
+ $output .= '<link href="'.esc_attr($o['favicon']).'" rel="shortcut icon" type="image/x-icon" />';
88
+ }
89
 
90
+ return $output;
91
  }
92
 
93
  function wpm_head() {
94
 
95
+ // Récupère les paramètres sauvegardés
96
+ if(get_option('wp_maintenance_settings_colors')) { extract(get_option('wp_maintenance_settings_colors')); }
97
+ $o = get_option('wp_maintenance_settings_colors');
98
+
99
+
100
+ $output = "<!-- Add Google Fonts -->\n";
101
+ $output .= '<link rel="stylesheet" href="https://fonts.googleapis.com/css?family='.str_replace(' ', '+', $o['font_title']).'|'.str_replace(' ', '+', $o['font_text']).'|'.str_replace(' ', '+', $o['font_text_bottom']).'|'.str_replace(' ', '+', $o['font_cpt']);
102
+ if(isset($o['newletter_font_text']) && $o['newletter_font_text'] != '') {
103
+ $output .= '|'.str_replace(' ', '+', $o['newletter_font_text']);
104
+ }
105
+ $output .= '">';
106
+ return $output;
107
  }
108
 
109
  function wpm_text() {
110
+
111
+ // Récupère les paramètres sauvegardés
112
+ if(get_option('wp_maintenance_settings')) { extract(get_option('wp_maintenance_settings')); }
113
+ $o = get_option('wp_maintenance_settings');
114
 
115
+ $output = '';
116
 
117
+ if(!empty($o['text_maintenance']) ) {
118
+ $output = nl2br(stripslashes($o['text_maintenance']));
119
+ }
120
+ return $output;
121
  }
122
 
123
  function wpm_logo() {
124
 
125
+ // Récupère les paramètres sauvegardés
126
+ if(get_option('wp_maintenance_settings_picture')) { extract(get_option('wp_maintenance_settings_picture')); }
127
+ $o = get_option('wp_maintenance_settings_picture');
128
 
129
+ $output = '';
130
 
131
+ if ( !empty( $o['image'] ) ) {
132
+ if(empty($o['image_width']) ) { $o['image_width'] = 450; }
133
+ if(empty($o['image_height']) ) { $o['image_height'] = 450; }
134
+ $output .= "<div id='logo'><img id='wpm-image' src='".esc_url($o['image'])."' width='".$o['image_width']."px' height='".$o['image_height']."px' alt='".get_bloginfo( 'name', 'display' )." ".get_bloginfo( 'description', 'display' )."' title='".get_bloginfo( 'name', 'display' )." ".get_bloginfo( 'description', 'display' )."' style='width:".$o['image_width']."px!important;height:".$o['image_height']."px!important;'></div>";
135
+ }
136
 
137
+ return $output;
138
  }
139
 
140
  function wpm_customcss() {
141
 
142
+ // Récupère les paramètres sauvegardés
143
+ if(get_option('wp_maintenance_settings')) { extract(get_option('wp_maintenance_settings')); }
144
+ $o = get_option('wp_maintenance_settings');
145
+
146
+ // Récupère les paramètres sauvegardés des couleurs
147
+ if(get_option('wp_maintenance_settings_colors')) { extract(get_option('wp_maintenance_settings_colors')); }
148
+ $colors = get_option('wp_maintenance_settings_colors');
149
+
150
+ // Récupère les paramètres sauvegardés des images
151
+ if(get_option('wp_maintenance_settings_picture')) { extract(get_option('wp_maintenance_settings_picture')); }
152
+ $picture = get_option('wp_maintenance_settings_picture');
153
+
154
+ $oo = get_option('wp_maintenance_settings_socialnetworks');
155
+
156
+ // CSS
157
+ $output = '<style type="text/css">';
158
+ ob_start();
159
+
160
+ $addStyleGeneral = '';
161
+
162
+ /* Définition des couleurs par défault */
163
+ if(!isset($colors['color_bg']) || $colors['color_bg']=="") { $colors['color_bg'] = "#f1f1f1"; }
164
+ if(!isset($colors['color_txt']) || $colors['color_txt']=="") { $colors['color_txt'] = "#888888"; }
165
+
166
+ /* Traitement de la feuille de style */
167
+ $styleRemplacements = array (
168
+ "#_COLORTXT" => $colors['color_txt'],
169
+ "#_COLORBG" => $colors['color_bg'],
170
+ "#_COLORCPTBG" => $colors['color_cpt_bg'],
171
+ "#_DATESIZE" => $colors['date_cpt_size'],
172
+ "#_COLORCPT" => $colors['color_cpt'],
173
+ "#_COLOR_BG_BT" => $colors['color_bg_bottom'],
174
+ "#_COLOR_TXT_BT" => $colors['color_text_bottom'],
175
+ "#_COLORHEAD" => $colors['color_bg_header'],
176
+ );
177
+ $remplaceStyle = str_replace(array_keys($styleRemplacements), array_values($styleRemplacements), get_option('wp_maintenance_settings_css'));
178
+ $output .= wpm_compress($remplaceStyle);
179
+
180
+ /* Si on a activé un motif */
181
+ if(isset($picture['b_enable_image']) && $picture['b_enable_image'] == 2 ) {
182
+
183
+ $addStyleGeneral .= 'body {
184
+ background-image: url('.esc_url(WP_PLUGIN_URL.'/wp-maintenance/images/pattern'.$picture['b_pattern'].'.png').');
185
+ background-repeat: repeat;
186
+ background-color: '.$colors['color_bg'].';}';
187
+
188
+ }
189
+
190
+ /* Si on a une image de fond */
191
+ if(isset($picture['b_enable_image']) && $picture['b_enable_image'] == 1 ) {
192
+
193
+ if(isset($picture['b_image']) && $picture['b_image'] ) {
194
+
195
+ if(empty($picture['b_repeat_image']) ) { $picture['b_repeat_image'] = 'repeat'; }
196
+ if(isset($picture['b_fixed_image']) && $picture['b_fixed_image']==1 ) {
197
+ $picture['b_fixed_image'] = 'fixed;';
198
+ } else {
199
+ $picture['b_fixed_image'] = '';
200
+ }
201
+ $addStyleGeneral .= 'body {display: grid!important;background:url('.esc_url($picture['b_image']).') '.$picture['b_repeat_image'].' '.$picture['b_fixed_image'].'top center;background-size: cover;
202
+ -webkit-background-size: cover;-moz-background-size: cover;-o-background-size: cover;background-color: '.$colors['color_bg'].';background-position: center;}';
203
+
204
+ if(isset($picture['b_opacity_image']) ) {
205
+ $addStyleGeneral .= '#main { background-color: rgba(0,0,0,'.esc_html($picture['b_opacity_image']).'); }';
206
+ }
207
+ }
208
+
209
+ }
210
+
211
+ if(isset($picture['b_enable_image']) && $picture['b_enable_image']==0 ) {
212
+ $addStyleGeneral .= 'body {background-color: '.$colors['color_bg'].';}';
213
+ }
214
+
215
+ if(isset($colors['color_bg_header']) && $colors['color_bg_header']!='') {
216
+ $addStyleGeneral .= 'header { background-color:'.$colors['color_bg_header'].';}';
217
+ }
218
+ $addStyleGeneral .= '.wpm_social_icon {float:left;width:'.esc_html($oo['size']).'px;margin:0px 5px auto;}.wpm_social ul {margin: 10px 0;max-width: 100%;padding: 0;text-align: '.esc_html($oo['align']).';}';
219
+
220
+ /* Si container activé */
221
+ if(isset($colors['container_active']) && $colors['container_active'] == 1 ) {
222
+
223
+ if(empty($colors['container_opacity']) ) { $colors['container_opacity'] = 0.5; }
224
+ if(empty($colors['container_width']) ) { $colors['container_width'] = 80; }
225
+ if(empty($colors['container_color']) ) { $colors['container_color'] = '#ffffff'; }
226
+ if(isset($colors['container_color']) ) { $paramRGBColor = wpm_hex2rgb($colors['container_color']); }
227
+ $addStyleGeneral .= '#sscontent {background-color: rgba('.esc_html($paramRGBColor['rouge']).','.esc_html($paramRGBColor['vert']).','.esc_html($paramRGBColor['bleu']).', '.esc_html($colors['container_opacity']).');padding:0.8em;margin-left:auto;margin-right:auto;width:'.esc_html($colors['container_width']).'%;}';
228
+
229
+ }
230
+
231
+ $addStyleGeneral .= '.wpm_newletter {';
232
+ if(isset($colors['newletter_size']) ) { $addStyleGeneral .= 'font-size:'.esc_html($colors['newletter_size']).'px;'; }
233
+ if(isset($colors['newletter_font_style']) ) { $addStyleGeneral .= 'font-style:'.esc_html($colors['newletter_font_style']).';'; }
234
+ if(isset($colors['newletter_font_weigth']) ) { $addStyleGeneral .= 'font-weight:'.esc_html($colors['newletter_font_weigth']).';'; }
235
+ if(isset($colors['newletter_font_text']) ) { $addStyleGeneral .= 'font-family:'.wpm_format_font($colors['newletter_font_text']).', serif;'; }
236
+ $addStyleGeneral .= '}
237
+ h3 {';
238
+ if(isset($colors['font_title']) ) { $addStyleGeneral .= 'font-family: '.wpm_format_font($colors['font_title']).', serif;'; }
239
+ if(isset($colors['font_title_size']) ) { $addStyleGeneral .= 'font-size: '.esc_html($colors['font_title_size']).'px;'; }
240
+ if(isset($colors['font_title_style']) ) { $addStyleGeneral .= 'font-style: '.esc_html($colors['font_title_style']).';'; }
241
+ if(isset($colors['font_title_weigth']) ) { $addStyleGeneral .= 'font-weight: '.esc_html($colors['font_title_weigth']).';'; }
242
+ if(isset($colors['color_title']) ) { $addStyleGeneral .= 'color:'.esc_html($colors['color_title']).';'; }
243
+ $addStyleGeneral .= 'line-height: 100%;text-align:center;margin:0.5em auto;
244
+ }
245
+ p {';
246
+ if(isset($colors['font_text']) ) { $addStyleGeneral .= 'font-family: '.wpm_format_font($colors['font_text']).', serif;'; }
247
+ if(isset($colors['font_text_size']) ) { $addStyleGeneral .= 'font-size: '.esc_html($colors['font_text_size']).'px;'; }
248
+ if(isset($colors['font_text_style']) ) { $addStyleGeneral .= 'font-style: '.esc_html($colors['font_text_style']).';'; }
249
+ if(isset($colors['font_text_weigth']) ) { $addStyleGeneral .= 'font-weight: '.esc_html($colors['font_text_weigth']).';'; }
250
+ if(isset($colors['color_txt']) ) { $addStyleGeneral .= 'color:'.esc_html($colors['color_txt']).';'; }
251
  $addStyleGeneral .= 'line-height: 100%;text-align:center;margin:0.5em auto;padding-left:2%;padding-right:2%;
252
+ }
253
+ footer {';
254
+ if(isset($colors['font_text_bottom']) ) { $addStyleGeneral .= 'font-family: '.wpm_format_font($colors['font_text_bottom']).', serif;'; }
255
+ if(isset($colors['font_bottom_style']) ) { $addStyleGeneral .= 'font-style: '.esc_html($colors['font_bottom_style']).';'; }
256
+ if(isset($colors['font_bottom_size']) ) { $addStyleGeneral .= 'font-size: '.esc_html($colors['font_bottom_size']).'px;'; }
257
+ if(isset($colors['font_bottom_weigth']) ) { $addStyleGeneral .= 'font-weight: '.esc_html($colors['font_bottom_weigth']).';'; }
258
+ if(isset($colors['color_text_bottom']) ) { $addStyleGeneral .= 'color: '.esc_html($colors['color_text_bottom']).';'; }
259
+ if(isset($colors['color_bg_bottom']) ) { $addStyleGeneral .= 'background:'.esc_html($colors['color_bg_bottom']).';'; }
260
  $addStyleGeneral .= 'text-decoration:none;
261
+ }
262
+ footer a:link {';
263
+ if(isset($colors['color_text_bottom']) ) { $addStyleGeneral .= 'color:'.esc_html($colors['color_text_bottom']).';'; }
264
+ if(isset($colors['font_bottom_size']) ) { $addStyleGeneral .= 'font-size: '.esc_html($colors['font_bottom_size']).'px;'; }
265
  $addStyleGeneral .= 'text-decoration:none;
266
+ }
267
+ footer a:visited {';
268
+ if(isset($colors['color_text_bottom']) ) { $addStyleGeneral .= 'color:'.esc_html($colors['color_text_bottom']).';'; }
269
+ if(isset($colors['font_bottom_size']) ) { $addStyleGeneral .= 'font-size: '.esc_html($colors['font_bottom_size']).'px;'; }
270
  $addStyleGeneral .= 'text-decoration:none;
271
+ }
272
+ footer a:hover {
273
  text-decoration:underline;';
274
+ if(isset($colors['font_bottom_size']) ) { $addStyleGeneral .= 'font-size: '.esc_html($colors['font_bottom_size']).'px;'; }
275
+ $addStyleGeneral .= '
276
+ }';
277
 
278
+ $output .= wpm_compress($addStyleGeneral);
279
+ $output .= ob_get_clean();
280
 
281
+ $output .= '</style>'."\n";
282
 
283
+ return $output;
284
  }
285
 
286
  function wpm_headercode() {
287
 
288
+ // Récupère les paramètres sauvegardés
289
+ if(get_option('wp_maintenance_settings_options')) { extract(get_option('wp_maintenance_settings_options')); }
290
+ $o = get_option('wp_maintenance_settings_options');
291
 
292
+ $output = '';
293
 
294
+ if(isset($o['headercode']) && $o['headercode']!='') {
295
+ $output = stripslashes($o['headercode']);
296
+ }
297
 
298
+ return $output;
299
  }
300
 
301
  function wpm_social_position($position = '') {
302
 
303
+ // Récupère les paramètres sauvegardés
304
+ $o = get_option('wp_maintenance_settings_socialnetworks');
305
 
306
+ $output = '';
307
+ if(isset($o['enable']) && $o['enable'] == 1 ) {
308
 
309
+ if(isset($o['position']) && $o['position']=='top' && isset($position) && $position=='top' ) {
310
+ $output = '<header id="header" role="banner" class="pam">'.do_shortcode('[wpm_social]').'</header>';
311
+ }
312
+ if(isset($o['position']) && $o['position']=='bottom' && isset($position) && $position=='bottom') {
313
+ $output = do_shortcode('[wpm_social]');
314
+ }
315
+ }
316
 
317
+ return $output;
318
  }
319
 
320
 
321
  function wpm_stylenewsletter() {
322
 
323
+ // Récupère les paramètres sauvegardés
324
+ if(get_option('wp_maintenance_settings')) { extract(get_option('wp_maintenance_settings')); }
325
+ $o = get_option('wp_maintenance_settings');
326
 
327
+ // Récupère les paramètres sauvegardés des couleurs
328
+ if(get_option('wp_maintenance_settings_colors')) { extract(get_option('wp_maintenance_settings_colors')); }
329
+ $colors = get_option('wp_maintenance_settings_colors');
330
 
331
 
332
+ $output = '';
333
 
334
+ if(empty($colors['color_field_text']) ) { $colors['color_field_text'] = '#333333'; }
335
+ if(empty($colors['color_text_button']) ) { $colors['color_text_button']= '#ffffff'; }
336
+ if(empty($colors['color_field_background']) ) { $colors['color_field_background']= '#F1F1F1'; }
337
+ if(empty($colors['color_field_border']) ) { $colors['color_field_border']= '#333333'; }
338
+ if(empty($colors['color_button_onclick']) ) { $colors['color_button_onclick']= '#333333'; }
339
+ if(empty($colors['color_button_hover']) ) { $colors['color_button_hover']= '#cccccc'; }
340
+ if(empty($colors['color_button']) ) { $colors['color_button']= '#1e73be'; }
341
 
342
+ $wysijaRemplacements = array (
343
+ "#_COLORTXT" => esc_html($colors['color_field_text']),
344
+ "#_COLORBG" => esc_html($colors['color_field_background']),
345
+ "#_COLORBORDER" => esc_html($colors['color_field_border']),
346
+ "#_COLORBUTTON" => esc_html($colors['color_button']),
347
+ "#_COLORTEXTBUTTON" => esc_html($colors['color_text_button']),
348
+ "#_COLOR_BTN_HOVER" => esc_html($colors['color_button_hover']),
349
+ "#_COLOR_BTN_CLICK" => esc_html($colors['color_button_onclick'])
350
+ );
351
 
352
+ if(isset($o['code_newletter']) && $o['code_newletter']!='' && strpos($o['code_newletter'], 'wysija_form') == 1 ) {
353
 
354
+ $output = str_replace(array_keys($wysijaRemplacements), array_values($wysijaRemplacements), wpm_wysija_style() );
355
 
356
+ } elseif(isset($o['code_newletter']) && strpos($o['code_newletter'], 'mc4wp_form') == 1 ) {
357
 
358
+ $output = str_replace(array_keys($wysijaRemplacements), array_values($wysijaRemplacements), wpm_mc4wp_style() );
359
 
360
+ }
361
 
362
+ if(isset($output) && $output!='' ) {
363
+ return '<style type="text/css">'.wpm_compress(sanitize_text_field($output)).'</style>';
364
+ } else {
365
+ return;
366
+ }
367
  }
368
 
369
  function wpm_newsletter() {
370
 
371
+ // Récupère les paramètres sauvegardés
372
+ if(get_option('wp_maintenance_settings')) { extract(get_option('wp_maintenance_settings')); }
373
+ $o = get_option('wp_maintenance_settings');
374
+
375
+ $output = '';
376
+
377
+ if(isset($o['newletter']) && $o['newletter']==1 ) {
378
+
379
+ $output = '<div class="wpm_newletter">';
380
+ if(isset($o['title_newletter']) && $o['title_newletter']!='') {
381
+ $output .= '<div>'.sanitize_text_field(stripslashes($o['title_newletter'])).'</div>';
382
+ }
383
+ if(isset($o['type_newletter']) && isset($o['iframe_newletter']) && $o['iframe_newletter']!='' && $o['type_newletter']=='iframe' ) {
384
+ $output .= stripslashes($o['iframe_newletter']);
385
+ }
386
+ if(isset($o['type_newletter']) && isset($o['code_newletter']) && $o['code_newletter']!='' && $o['type_newletter']=='shortcode' ) {
387
+ $output .= do_shortcode(stripslashes($o['code_newletter']));
388
+ }
389
+ $output .= '</div>';
390
+ }
391
+
392
+ return $output;
393
  }
themes/default/index2.php CHANGED
@@ -1,36 +1,36 @@
1
  <!DOCTYPE html>
2
  <html>
3
- <head>
4
- <meta charset="UTF-8">
5
- <!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge"><![endif]-->
6
- <meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
7
- <title>{TitleSEO}</title>
8
- {MetaDescription}
9
- {Favicon}
10
- {Head}
11
- <link rel="stylesheet" href="{Url}themes/default/css/knacss.css" media="all">
12
- <link rel="stylesheet" href="{Url}themes/default/css/styles.css" media="all">
13
- {CustomCSS}
14
- {AddStyleWysija}
15
- {HeaderCode}
16
- </head>
17
- <body>
18
- {TopSocialIcon}
19
- <main id="main" role="main">
20
- <p style="text-align:center;">
21
- {Logo}
22
- </p>
23
- <div id="sscontent">
24
- <p style="text-align:center;padding:1.5em;"><h3>{Title}</h3>
25
- <p>{Text}</p>
26
- {Counter}
27
- {Newsletter}
28
- </p>
29
- </div>
30
- <p>{BottomSocialIcon}</p>
31
- </main>
32
-
33
- {FooterText}
34
- </body>
35
  </html>
36
  <?php die(); ?>
1
  <!DOCTYPE html>
2
  <html>
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge"><![endif]-->
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
7
+ <title>{TitleSEO}</title>
8
+ {MetaDescription}
9
+ {Favicon}
10
+ {Head}
11
+ <link rel="stylesheet" href="{Url}themes/default/css/knacss.css" media="all">
12
+ <link rel="stylesheet" href="{Url}themes/default/css/styles.css" media="all">
13
+ {CustomCSS}
14
+ {AddStyleWysija}
15
+ {HeaderCode}
16
+ </head>
17
+ <body>
18
+ {TopSocialIcon}
19
+ <main id="main" role="main">
20
+ <p style="text-align:center;">
21
+ {Logo}
22
+ </p>
23
+ <div id="sscontent">
24
+ <p style="text-align:center;padding:1.5em;"><h3>{Title}</h3>
25
+ <p>{Text}</p>
26
+ {Counter}
27
+ {Newsletter}
28
+ </p>
29
+ </div>
30
+ <p>{BottomSocialIcon}</p>
31
+ </main>
32
+
33
+ {FooterText}
34
+ </body>
35
  </html>
36
  <?php die(); ?>
views/wp-maintenance-colors.php CHANGED
@@ -329,11 +329,11 @@ $paramsColors = get_option('wp_maintenance_settings_colors');
329
  <td>
330
  <td style="vertical-align:top;">
331
  <label for="wpmcolors[color_button]" class="wp-maintenance-setting-row-title"><?php _e('Button color', 'wp-maintenance'); ?></label>
332
- <input type="text" value="<?php if( isset($paramsColors['color_button']) && $paramsColors['color_button']!='' ) { echo esc_html($paramsColors['color_button']); } else { echo '#1e73be'; } ?>" name="wpmcolors[color_button]" class="wpm-color-field" data-default-color="#1e73be" />
333
  <label for="wpmcolors[color_button_hover]" class="wp-maintenance-setting-row-title"><?php _e('Button color hover', 'wp-maintenance'); ?></label>
334
- <input type="text" value="<?php if( isset($paramsColors['color_button_hover']) && $paramsColors['color_button_hover']!='' ) { echo esc_html($paramsColors['color_button_hover']); } else { echo '#ffffff'; } ?>" name="wpmcolors[color_button_hover]" class="wpm-color-field" data-default-color="#ffffff" /><br />
335
  <label for="wpmcolors[color_button_onclick]" class="wp-maintenance-setting-row-title"><?php _e('Button color onclick', 'wp-maintenance'); ?></label>
336
- <input type="text" value="<?php if( isset($paramsColors['color_button_onclick']) && $paramsColors['color_button_onclick']!='' ) { echo esc_html($paramsColors['color_button_onclick']); } else { echo '#ffffff'; } ?>" name="wpmcolors[color_button_onclick]" class="wpm-color-field" data-default-color="#ffffff" />
337
  </td>
338
  </tr>
339
  </table>
@@ -343,7 +343,7 @@ $paramsColors = get_option('wp_maintenance_settings_colors');
343
 
344
  <?php
345
  } else {
346
- printf( __('Enable %s to customize the forms', 'wp-maintenance'), '<a href="'.admin_url().'?page=wp-maintenance#newsletter">'.__('newsletter option', 'wp-maintenance').'</a>' );
347
  }
348
 
349
  } else {
329
  <td>
330
  <td style="vertical-align:top;">
331
  <label for="wpmcolors[color_button]" class="wp-maintenance-setting-row-title"><?php _e('Button color', 'wp-maintenance'); ?></label>
332
+ <input type="text" value="<?php if(isset($paramsColors['color_button']) && $paramsColors['color_button']!='') { echo esc_html($paramsColors['color_button']); } else { echo '#1e73be'; } ?>" name="wpmcolors[color_button]" class="wpm-color-field" data-default-color="#1e73be" />
333
  <label for="wpmcolors[color_button_hover]" class="wp-maintenance-setting-row-title"><?php _e('Button color hover', 'wp-maintenance'); ?></label>
334
+ <input type="text" value="<?php if(isset($paramsColors['color_button_hover']) && $paramsColors['color_button_hover']!='') { echo esc_html($paramsColors['color_button_hover']); } else { echo '#ffffff'; } ?>" name="wpmcolors[color_button_hover]" class="wpm-color-field" data-default-color="#ffffff" /><br />
335
  <label for="wpmcolors[color_button_onclick]" class="wp-maintenance-setting-row-title"><?php _e('Button color onclick', 'wp-maintenance'); ?></label>
336
+ <input type="text" value="<?php if(isset($paramsColors['color_button_onclick']) && $paramsColors['color_button_onclick']!='' ) { echo esc_html($paramsColors['color_button_onclick']); } else { echo '#ffffff'; } ?>" name="wpmcolors[color_button_onclick]" class="wpm-color-field" data-default-color="#ffffff" />
337
  </td>
338
  </tr>
339
  </table>
343
 
344
  <?php
345
  } else {
346
+ printf(__('Enable %s to customize the forms', 'wp-maintenance'), '<a href="'.admin_url().'?page=wp-maintenance#newsletter">'.__('newsletter option', 'wp-maintenance').'</a>');
347
  }
348
 
349
  } else {
views/wp-maintenance-settings.php CHANGED
@@ -4,17 +4,17 @@ defined( 'ABSPATH' ) or die( 'Not allowed' );
4
 
5
  $messageUpdate = 0;
6
  /* Update des paramètres */
7
- if( isset($_POST['action']) && $_POST['action'] == 'update_settings' && wp_verify_nonce($_POST['security-settings'], 'valid-settings') ) {
8
 
9
- if( empty($_POST["wpoptions"]["pageperso"]) ) { $_POST["wpoptions"]["pageperso"] = 0; }
10
- if( empty($_POST["wpoptions"]["dashboard_delete_db"]) ) { $_POST["wpoptions"]["dashboard_delete_db"] = 0; }
11
- if( empty($_POST["wpoptions"]["error_503"]) ) { $_POST["wpoptions"]["error_503"] = 0; }
12
 
13
  update_option('wp_maintenance_limit', sanitize_text_field($_POST["wp_maintenance_limit"]));
14
  update_option('wp_maintenance_ipaddresses', sanitize_textarea_field($_POST["wp_maintenance_ipaddresses"]));
15
 
16
- $updateSetting = wpm_update_settings( $_POST["wpoptions"], 'wp_maintenance_settings_options' );
17
- if( $updateSetting == true ) { $messageUpdate = 1; }
18
 
19
  }
20
 
@@ -57,7 +57,7 @@ jQuery(document).ready(function() {
57
 
58
  <!-- HEADER -->
59
  <h2 class="headerpage"><?php _e('WP Maintenance - Settings', 'wp-maintenance'); ?> <sup>v.<?php _e(WPM_VERSION); ?></sup></h2>
60
- <?php if( isset($messageUpdate) && $messageUpdate == 1 ) { ?>
61
  <div id="message" class="updated fade"><p><strong><?php _e('Options saved.', 'wp-maintenance'); ?></strong></p></div>
62
  <?php } ?>
63
  <!-- END HEADER -->
@@ -77,7 +77,7 @@ jQuery(document).ready(function() {
77
  <h3><?php _e('Theme maintenance page', 'wp-maintenance'); ?></h3>
78
  <p>
79
  <label class="wp-maintenance-container"><span class="wp-maintenance-label-text"><?php _e('Yes, I use a theme maintenance page', 'wp-maintenance'); ?></span>
80
- <input type="checkbox" name="wpoptions[pageperso]" value="1" <?php if( isset($wpoptions['pageperso']) && $wpoptions['pageperso']==1) { echo ' checked'; } ?>>
81
  <span class="wp-maintenance-checkmark"></span>
82
  </label>
83
 
@@ -90,7 +90,7 @@ jQuery(document).ready(function() {
90
  <h3><?php _e('Delete custom settings upon plugin deactivation?', 'wp-maintenance'); ?></h3>
91
  <p>
92
  <label class="wp-maintenance-container"><span class="wp-maintenance-label-text"><?php _e('Yes, all custom settings will be deleted from database upon plugin deactivation', 'wp-maintenance'); ?></span>
93
- <input type="checkbox" name="wpoptions[dashboard_delete_db]" value="1" <?php if( isset($wpoptions['dashboard_delete_db']) && $wpoptions['dashboard_delete_db']==1) { echo ' checked'; } ?>>
94
  <span class="wp-maintenance-checkmark"></span>
95
  </label>
96
  </p>
@@ -99,7 +99,7 @@ jQuery(document).ready(function() {
99
  <h3><?php _e('Display code HTTP Error 503?', 'wp-maintenance'); ?></h3>
100
  <p>
101
  <label class="wp-maintenance-container"><span class="wp-maintenance-label-text"><?php _e('Yes, inform visitors and search engines that my site is temporarily unavailable.', 'wp-maintenance'); ?></span>
102
- <input type="checkbox" name="wpoptions[error_503]" value="1" <?php if( isset($wpoptions['error_503']) && $wpoptions['error_503']==1) { echo ' checked'; } ?>>
103
  <span class="wp-maintenance-checkmark"></span>
104
  </label>
105
  </p>
@@ -119,8 +119,8 @@ jQuery(document).ready(function() {
119
  $roles = wpm_get_roles();
120
  foreach($roles as $role=>$name) {
121
  $limitCheck = '';
122
- if( isset($paramLimit[$role]) && $paramLimit[$role]==$role) { $limitCheck = ' checked'; }
123
- if( $role !='administrator') {
124
 
125
  ?>
126
  <label class="wp-maintenance-container"><span class="wp-maintenance-label-text"><?php echo esc_html($name); ?></span>
@@ -141,7 +141,7 @@ jQuery(document).ready(function() {
141
  </div>
142
  <div class="wp-maintenance-setting-row">
143
  <label for="wp_maintenance_ipaddresses" class="wp-maintenance-setting-row-title"><?php _e('Allow the site to display these IP addresses. Please, enter one IP address by line', 'wp-maintenance'); ?></label>
144
- <textarea name="wp_maintenance_ipaddresses" class="wp-maintenance-input" ROWS="5" style="width:80%;"><?php if( isset($paramIpAddress) && $paramIpAddress!='' ) { echo esc_textarea($paramIpAddress); } ?></textarea>
145
  </div>
146
 
147
  <p class="submit"><button type="submit" name="footer_submit" id="footer_submit" class="wp-maintenance-button wp-maintenance-button-primary"><?php _e('Save', 'wp-maintenance'); ?></button></p>
@@ -155,7 +155,7 @@ jQuery(document).ready(function() {
155
  </div>
156
  <div class="wp-maintenance-setting-row">
157
  <label for="wpoptions[id_pages]" class="wp-maintenance-setting-row-title"><?php _e('Allow the site to display these ID pages. Please, enter the ID pages separate with comma', 'wp-maintenance'); ?></label>
158
- <input name="wpoptions[id_pages]" size="80%" class="wp-maintenance-input" value="<?php if( isset($wpoptions['id_pages']) && $wpoptions['id_pages']!='' ) { echo esc_html($wpoptions['id_pages']); } ?>" />
159
  </div>
160
 
161
  <p class="submit"><button type="submit" name="footer_submit" id="footer_submit" class="wp-maintenance-button wp-maintenance-button-primary"><?php _e('Save', 'wp-maintenance'); ?></button></p>
@@ -169,7 +169,7 @@ jQuery(document).ready(function() {
169
  </div>
170
  <div class="wp-maintenance-setting-row">
171
  <label for="wpoptions[headercode]" class="wp-maintenance-setting-row-title"><?php _e('The following code will add to the <head> tag. Useful if you need to add additional scripts such as CSS or JS', 'wp-maintenance'); ?></label>
172
- <textarea id="headercode" name="wpoptions[headercode]" class="wp-maintenance-input" COLS=50 ROWS=2><?php if( isset($wpoptions['headercode']) && $wpoptions['headercode']!='' ) { echo esc_textarea(stripslashes($wpoptions['headercode'])); } ?></textarea>
173
  </div>
174
 
175
  <p class="submit"><button type="submit" name="footer_submit" id="footer_submit" class="wp-maintenance-button wp-maintenance-button-primary"><?php _e('Save', 'wp-maintenance'); ?></button></p>
4
 
5
  $messageUpdate = 0;
6
  /* Update des paramètres */
7
+ if(isset($_POST['action']) && $_POST['action'] == 'update_settings' && wp_verify_nonce($_POST['security-settings'], 'valid-settings') ) {
8
 
9
+ if(empty($_POST["wpoptions"]["pageperso"]) ) { $_POST["wpoptions"]["pageperso"] = 0; }
10
+ if(empty($_POST["wpoptions"]["dashboard_delete_db"]) ) { $_POST["wpoptions"]["dashboard_delete_db"] = 0; }
11
+ if(empty($_POST["wpoptions"]["error_503"]) ) { $_POST["wpoptions"]["error_503"] = 0; }
12
 
13
  update_option('wp_maintenance_limit', sanitize_text_field($_POST["wp_maintenance_limit"]));
14
  update_option('wp_maintenance_ipaddresses', sanitize_textarea_field($_POST["wp_maintenance_ipaddresses"]));
15
 
16
+ $updateSetting = wpm_update_settings($_POST["wpoptions"], 'wp_maintenance_settings_options');
17
+ if($updateSetting == true ) { $messageUpdate = 1; }
18
 
19
  }
20
 
57
 
58
  <!-- HEADER -->
59
  <h2 class="headerpage"><?php _e('WP Maintenance - Settings', 'wp-maintenance'); ?> <sup>v.<?php _e(WPM_VERSION); ?></sup></h2>
60
+ <?php if(isset($messageUpdate) && $messageUpdate == 1 ) { ?>
61
  <div id="message" class="updated fade"><p><strong><?php _e('Options saved.', 'wp-maintenance'); ?></strong></p></div>
62
  <?php } ?>
63
  <!-- END HEADER -->
77
  <h3><?php _e('Theme maintenance page', 'wp-maintenance'); ?></h3>
78
  <p>
79
  <label class="wp-maintenance-container"><span class="wp-maintenance-label-text"><?php _e('Yes, I use a theme maintenance page', 'wp-maintenance'); ?></span>
80
+ <input type="checkbox" name="wpoptions[pageperso]" value="1" <?php if(isset($wpoptions['pageperso']) && $wpoptions['pageperso']==1) { echo ' checked'; } ?>>
81
  <span class="wp-maintenance-checkmark"></span>
82
  </label>
83
 
90
  <h3><?php _e('Delete custom settings upon plugin deactivation?', 'wp-maintenance'); ?></h3>
91
  <p>
92
  <label class="wp-maintenance-container"><span class="wp-maintenance-label-text"><?php _e('Yes, all custom settings will be deleted from database upon plugin deactivation', 'wp-maintenance'); ?></span>
93
+ <input type="checkbox" name="wpoptions[dashboard_delete_db]" value="1" <?php if(isset($wpoptions['dashboard_delete_db']) && $wpoptions['dashboard_delete_db']==1) { echo ' checked'; } ?>>
94
  <span class="wp-maintenance-checkmark"></span>
95
  </label>
96
  </p>
99
  <h3><?php _e('Display code HTTP Error 503?', 'wp-maintenance'); ?></h3>
100
  <p>
101
  <label class="wp-maintenance-container"><span class="wp-maintenance-label-text"><?php _e('Yes, inform visitors and search engines that my site is temporarily unavailable.', 'wp-maintenance'); ?></span>
102
+ <input type="checkbox" name="wpoptions[error_503]" value="1" <?php if(isset($wpoptions['error_503']) && $wpoptions['error_503']==1) { echo ' checked'; } ?>>
103
  <span class="wp-maintenance-checkmark"></span>
104
  </label>
105
  </p>
119
  $roles = wpm_get_roles();
120
  foreach($roles as $role=>$name) {
121
  $limitCheck = '';
122
+ if(isset($paramLimit[$role]) && $paramLimit[$role]==$role) { $limitCheck = ' checked'; }
123
+ if($role !='administrator') {
124
 
125
  ?>
126
  <label class="wp-maintenance-container"><span class="wp-maintenance-label-text"><?php echo esc_html($name); ?></span>
141
  </div>
142
  <div class="wp-maintenance-setting-row">
143
  <label for="wp_maintenance_ipaddresses" class="wp-maintenance-setting-row-title"><?php _e('Allow the site to display these IP addresses. Please, enter one IP address by line', 'wp-maintenance'); ?></label>
144
+ <textarea name="wp_maintenance_ipaddresses" class="wp-maintenance-input" ROWS="5" style="width:80%;"><?php if(isset($paramIpAddress) && $paramIpAddress!='' ) { echo esc_textarea($paramIpAddress); } ?></textarea>
145
  </div>
146
 
147
  <p class="submit"><button type="submit" name="footer_submit" id="footer_submit" class="wp-maintenance-button wp-maintenance-button-primary"><?php _e('Save', 'wp-maintenance'); ?></button></p>
155
  </div>
156
  <div class="wp-maintenance-setting-row">
157
  <label for="wpoptions[id_pages]" class="wp-maintenance-setting-row-title"><?php _e('Allow the site to display these ID pages. Please, enter the ID pages separate with comma', 'wp-maintenance'); ?></label>
158
+ <input name="wpoptions[id_pages]" size="80%" class="wp-maintenance-input" value="<?php if(isset($wpoptions['id_pages']) && $wpoptions['id_pages']!='' ) { echo esc_html($wpoptions['id_pages']); } ?>" />
159
  </div>
160
 
161
  <p class="submit"><button type="submit" name="footer_submit" id="footer_submit" class="wp-maintenance-button wp-maintenance-button-primary"><?php _e('Save', 'wp-maintenance'); ?></button></p>
169
  </div>
170
  <div class="wp-maintenance-setting-row">
171
  <label for="wpoptions[headercode]" class="wp-maintenance-setting-row-title"><?php _e('The following code will add to the <head> tag. Useful if you need to add additional scripts such as CSS or JS', 'wp-maintenance'); ?></label>
172
+ <textarea id="headercode" name="wpoptions[headercode]" class="wp-maintenance-input" COLS=50 ROWS=2><?php if(isset($wpoptions['headercode']) && $wpoptions['headercode']!='' ) { echo esc_textarea(stripslashes($wpoptions['headercode'])); } ?></textarea>
173
  </div>
174
 
175
  <p class="submit"><button type="submit" name="footer_submit" id="footer_submit" class="wp-maintenance-button wp-maintenance-button-primary"><?php _e('Save', 'wp-maintenance'); ?></button></p>
wp-maintenance.php CHANGED
@@ -5,7 +5,7 @@
5
  * Description: The WP Maintenance plugin allows you to put your website on the waiting time for you to do maintenance or launch your website. Personalize this page with picture, countdown...
6
  * Author: Florent Maillefaud
7
  * Author URI: https://madeby.restezconnectes.fr
8
- * Version: 6.0.8
9
  * Text Domain: wp-maintenance
10
  * Domain Path: /languages/
11
  */
@@ -37,7 +37,7 @@ define( 'WPM_PLUGIN_URL', plugins_url().'/'.strtolower('wp-maintenance').'/');
37
  define( 'WPM_ICONS_URL', plugins_url().'/'.strtolower('wp-maintenance').'/socialicons/');
38
  define( 'WPM_ADMIN_URL', admin_url().'admin.php?page=wp-maintenance'); //we assume the admin url is absolute with at least one querystring
39
 
40
- if( !defined( 'WPM_VERSION' )) { define( 'WPM_VERSION', '6.0.8' ); }
41
 
42
  require WPM_DIR . 'classes/wp-maintenance.php';
43
  require WPM_DIR . 'classes/countdown.php';
5
  * Description: The WP Maintenance plugin allows you to put your website on the waiting time for you to do maintenance or launch your website. Personalize this page with picture, countdown...
6
  * Author: Florent Maillefaud
7
  * Author URI: https://madeby.restezconnectes.fr
8
+ * Version: 6.0.9
9
  * Text Domain: wp-maintenance
10
  * Domain Path: /languages/
11
  */
37
  define( 'WPM_ICONS_URL', plugins_url().'/'.strtolower('wp-maintenance').'/socialicons/');
38
  define( 'WPM_ADMIN_URL', admin_url().'admin.php?page=wp-maintenance'); //we assume the admin url is absolute with at least one querystring
39
 
40
+ if( !defined( 'WPM_VERSION' )) { define( 'WPM_VERSION', '6.0.9' ); }
41
 
42
  require WPM_DIR . 'classes/wp-maintenance.php';
43
  require WPM_DIR . 'classes/countdown.php';