WP Maintenance - Version 5.0.4

Version Description

  • Add separete for countdown
  • Fixed bug authorize pages ID
  • Change font size of countdown : vw instead px
Download this release

Release Info

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

Code changes from version 5.0.3 to 5.0.4

classes/countdown.php CHANGED
@@ -35,9 +35,9 @@ class WPM_Countdown extends WP_maintenance {
35
  CountStepper = -1;
36
  LeadingZero = true;
37
  ';
38
- $Counter .= " DisplayFormat = '<div id=\"wpm-cpt-day\">%%D%%<br /><span id=\"wpm-cpt-days-span\">".__('Days', 'wp-maintenance')."</span></div><div id=\"wpm-cpt-hours\">%%H%%<br /><span id=\"wpm-cpt-hours-span\">".__('Hours', 'wp-maintenance')."</span></div><div id=\"wpm-cpt-minutes\">%%M%%<br /><span id=\"wpm-cpt-minutes-span\">".__('Minutes', 'wp-maintenance')."</span></div>";
39
  if( isset($paramMMode['active_cpt_s']) && $paramMMode['active_cpt_s']==1 ) {
40
- $Counter .= '<div id="wpm-cpt-seconds">%%S%%<br /><span id="wpm-cpt-seconds-span">'.__('Seconds', 'wp-maintenance').'</span></div>';
41
  }
42
  $Counter .= "';";
43
  if( isset($paramMMode['message_cpt_fin']) && $paramMMode['message_cpt_fin']!='' ) {
35
  CountStepper = -1;
36
  LeadingZero = true;
37
  ';
38
+ $Counter .= " DisplayFormat = '<div id=\"wpm-cpt-day\">%%D%%<br /><span id=\"wpm-cpt-days-span\">".__('Days', 'wp-maintenance')."</span></div><div class=\"wpm_ctp_sep\" style=\"float:left;\">:</div><div id=\"wpm-cpt-hours\">%%H%%<br /><span id=\"wpm-cpt-hours-span\">".__('Hours', 'wp-maintenance')."</span></div><div class=\"wpm_ctp_sep\" style=\"float:left;\">:</div><div id=\"wpm-cpt-minutes\">%%M%%<br /><span id=\"wpm-cpt-minutes-span\">".__('Minutes', 'wp-maintenance')."</span></div>";
39
  if( isset($paramMMode['active_cpt_s']) && $paramMMode['active_cpt_s']==1 ) {
40
+ $Counter .= '<div class="wpm_ctp_sep" style="float:left;">:</div><div id="wpm-cpt-seconds">%%S%%<br /><span id="wpm-cpt-seconds-span">'.__('Seconds', 'wp-maintenance').'</span></div>';
41
  }
42
  $Counter .= "';";
43
  if( isset($paramMMode['message_cpt_fin']) && $paramMMode['message_cpt_fin']!='' ) {
classes/wp-maintenance.php CHANGED
@@ -596,14 +596,14 @@ a.wpmadashicons:hover { text-decoration:none;color: '.$colors[2].'!important; }
596
  }
597
 
598
  /* Désactive le mode maintenance pour les PAGE ID définies */
599
- if( isset($paramMMode['id_pages']) && !empty($paramMMode['id_pages']) ) {
600
  $listPageId = explode(',', $paramMMode['id_pages']);
601
  foreach($listPageId as $keyPageId => $valPageId) {
602
  if( $valPageId == get_the_ID() ) {
603
  $statusActive = 0;
604
  }
605
  }
606
- }
607
 
608
  /* On désactive le mode maintenance pour les admins */
609
  if( current_user_can('administrator') == true ) {
@@ -620,6 +620,8 @@ a.wpmadashicons:hover { text-decoration:none;color: '.$colors[2].'!important; }
620
  /* Mode Maintenance */
621
  function wpm_maintenance_mode() {
622
 
 
 
623
  if(get_option('wp_maintenance_settings')) { extract(get_option('wp_maintenance_settings')); }
624
  $paramMMode = get_option('wp_maintenance_settings');
625
 
@@ -665,6 +667,17 @@ a.wpmadashicons:hover { text-decoration:none;color: '.$colors[2].'!important; }
665
  }
666
  }
667
 
 
 
 
 
 
 
 
 
 
 
 
668
  // Prevetn Plugins from caching
669
  // Disable caching plugins. This should take care of:
670
  // - W3 Total Cache
@@ -686,46 +699,47 @@ a.wpmadashicons:hover { text-decoration:none;color: '.$colors[2].'!important; }
686
  define('DONOTCACHEOBJECT', true);
687
  }
688
  nocache_headers();
689
-
690
- if( isset($paramMMode['error_503']) && $paramMMode['error_503']=='Yes' ) {
691
- header('HTTP/1.1 503 Service Temporarily Unavailable');
692
- header('Status: 503 Service Temporarily Unavailable');
693
- header('Retry-After: 86400'); // retry in a day
694
- }
695
-
696
- $template = $this->wpm_get_default_template();
697
- require_once( WPM_DIR.'/themes/default/functions.php' );
698
-
699
- $template_tags = array (
700
- "{TitleSEO}" => wpm_title_seo(),
701
- "{MetaDescription}" => wpm_metadescription(),
702
- "{HeaderCode}" => wpm_headercode(),
703
- "{Head}" => wpm_head(),
704
- "{Logo}" => wpm_logo(),
705
- "{Version}" => WPM_VERSION,
706
- "{Title}" => wpm_title(),
707
- "{Text}" => wpm_text(),
708
- "{Favicon}" => wpm_favicon(),
709
- "{CustomCSS}" => wpm_customcss(),
710
- "{Analytics}" => wpm_analytics(),
711
- "{TopSocialIcon}" => wpm_social_position("top"),
712
- "{BottomSocialIcon}" => wpm_social_position("bottom"),
713
- "{Copyrights}" => wpm_copyrights(),
714
- "{AddStyleWysija}" => wpm_stylenewsletter(),
715
- "{Newsletter}" => wpm_newsletter(),
716
- "{SliderCSS}" => WPM_Slider::slider_css(),
717
- "{ScriptSlider}" => WPM_Slider::slider_scripts(),
718
- "{ScriptSlideshow}" => WPM_Slider::slider_functions(),
719
- "{Counter}" => WPM_Countdown::display($dateCpt),
720
- "{SlideshowAL}" => WPM_Slider::slidershow('abovelogo'),
721
- "{SlideshowBL}" => WPM_Slider::slidershow('belowlogo'),
722
- "{SlideshowBT}" => WPM_Slider::slidershow('belowtext'),
723
 
724
 
725
- );
726
-
727
- echo strtr($template, $template_tags);
728
- exit();
 
729
  }
730
 
731
  }
596
  }
597
 
598
  /* Désactive le mode maintenance pour les PAGE ID définies */
599
+ /*if( isset($paramMMode['id_pages']) && !empty($paramMMode['id_pages']) ) {
600
  $listPageId = explode(',', $paramMMode['id_pages']);
601
  foreach($listPageId as $keyPageId => $valPageId) {
602
  if( $valPageId == get_the_ID() ) {
603
  $statusActive = 0;
604
  }
605
  }
606
+ }*/
607
 
608
  /* On désactive le mode maintenance pour les admins */
609
  if( current_user_can('administrator') == true ) {
620
  /* Mode Maintenance */
621
  function wpm_maintenance_mode() {
622
 
623
+ global $post;
624
+
625
  if(get_option('wp_maintenance_settings')) { extract(get_option('wp_maintenance_settings')); }
626
  $paramMMode = get_option('wp_maintenance_settings');
627
 
667
  }
668
  }
669
 
670
+ $statusPageActive = 1;
671
+ /*Désactive le mode maintenance pour les PAGE ID définies */
672
+ if( isset($paramMMode['id_pages']) && !empty($paramMMode['id_pages']) ) {
673
+ $listPageId = explode(',', $paramMMode['id_pages']);
674
+ foreach($listPageId as $keyPageId => $valPageId) {
675
+ if( trim($valPageId) == $post->ID ) {
676
+ $statusPageActive = 0;
677
+ }
678
+ }
679
+ }
680
+
681
  // Prevetn Plugins from caching
682
  // Disable caching plugins. This should take care of:
683
  // - W3 Total Cache
699
  define('DONOTCACHEOBJECT', true);
700
  }
701
  nocache_headers();
702
+ if ($statusPageActive == 1) {
703
+ if( isset($paramMMode['error_503']) && $paramMMode['error_503']=='Yes' ) {
704
+ header('HTTP/1.1 503 Service Temporarily Unavailable');
705
+ header('Status: 503 Service Temporarily Unavailable');
706
+ header('Retry-After: 86400'); // retry in a day
707
+ }
708
+
709
+ $template = $this->wpm_get_default_template();
710
+ require_once( WPM_DIR.'/themes/default/functions.php' );
711
+
712
+ $template_tags = array (
713
+ "{TitleSEO}" => wpm_title_seo(),
714
+ "{MetaDescription}" => wpm_metadescription(),
715
+ "{HeaderCode}" => wpm_headercode(),
716
+ "{Head}" => wpm_head(),
717
+ "{Logo}" => wpm_logo(),
718
+ "{Version}" => WPM_VERSION,
719
+ "{Title}" => wpm_title(),
720
+ "{Text}" => wpm_text(),
721
+ "{Favicon}" => wpm_favicon(),
722
+ "{CustomCSS}" => wpm_customcss(),
723
+ "{Analytics}" => wpm_analytics(),
724
+ "{TopSocialIcon}" => wpm_social_position("top"),
725
+ "{BottomSocialIcon}" => wpm_social_position("bottom"),
726
+ "{Copyrights}" => wpm_copyrights(),
727
+ "{AddStyleWysija}" => wpm_stylenewsletter(),
728
+ "{Newsletter}" => wpm_newsletter(),
729
+ "{SliderCSS}" => WPM_Slider::slider_css(),
730
+ "{ScriptSlider}" => WPM_Slider::slider_scripts(),
731
+ "{ScriptSlideshow}" => WPM_Slider::slider_functions(),
732
+ "{Counter}" => WPM_Countdown::display($dateCpt),
733
+ "{SlideshowAL}" => WPM_Slider::slidershow('abovelogo'),
734
+ "{SlideshowBL}" => WPM_Slider::slidershow('belowlogo'),
735
+ "{SlideshowBT}" => WPM_Slider::slidershow('belowtext'),
736
 
737
 
738
+ );
739
+
740
+ echo strtr($template, $template_tags);
741
+ exit();
742
+ }
743
  }
744
 
745
  }
includes/functions.php CHANGED
@@ -368,6 +368,7 @@ a:hover, a:focus, a:active {color: #_COLORTXT;text-decoration: none;}
368
  text-align:center;
369
  margin: 0.5em auto;
370
  }
 
371
  #header {
372
  background: #_COLORHEAD;
373
  }
368
  text-align:center;
369
  margin: 0.5em auto;
370
  }
371
+ .wpm_ctp_sep { margin-top:1vw; }
372
  #header {
373
  background: #_COLORHEAD;
374
  }
js/wpm-cpt-script.js CHANGED
@@ -1 +1 @@
1
- function calcage(e,t,n){return s=(Math.floor(e/t)%n).toString(),LeadingZero&&s.length<2&&(s="0"+s),"<b>"+s+"</b>"}function CountBack(e){return 0>e?void(1==Disable?document.location.replace(UrlDisable):document.getElementById("cntdwn").innerHTML=FinishMessage):(DisplayStr=DisplayFormat.replace(/%%D%%/g,calcage(e,86400,1e5)),DisplayStr=DisplayStr.replace(/%%H%%/g,calcage(e,3600,24)),DisplayStr=DisplayStr.replace(/%%M%%/g,calcage(e,60,60)),DisplayStr=DisplayStr.replace(/%%S%%/g,calcage(e,1,60)),document.getElementById("cntdwn").innerHTML=DisplayStr,void(CountActive&&setTimeout("CountBack("+(e+CountStepper)+")",SetTimeOutPeriod)))}function putspan(e,t){document.write("<div class='cptR-rec_countdown'><span id='cntdwn' style='font-family:"+FontFamily+";background-color:"+e+"; color:"+t+"; font-size:"+FontSize+"px;'></span></div>")}"undefined"==typeof BackColor&&(BackColor=""),"undefined"==typeof ForeColor&&(ForeColor="black"),"undefined"==typeof FontSize&&(FontSize="78"),"undefined"==typeof TargetDate&&(TargetDate="12/31/2020 5:00 AM"),"undefined"==typeof DisplayFormat&&(DisplayFormat="%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds."),"undefined"==typeof CountActive&&(CountActive=!0),"undefined"==typeof FinishMessage&&(FinishMessage=""),"number"!=typeof CountStepper&&(CountStepper=-1),"undefined"==typeof LeadingZero&&(LeadingZero=!0),"undefined"==typeof Disable&&(Disable=""),"undefined"==typeof FontFamily&&(FontFamily="Pacifico"),CountStepper=Math.ceil(CountStepper),0==CountStepper&&(CountActive=!1);var SetTimeOutPeriod=1e3*(Math.abs(CountStepper)-1)+990;putspan(BackColor,ForeColor,FontSize);var dthen=new Date(TargetDate),dnow=new Date;CountStepper>0?ddiff=new Date(dnow-dthen):ddiff=new Date(dthen-dnow),gsecs=Math.floor(ddiff.valueOf()/1e3),CountBack(gsecs);
1
+ function calcage(e,t,n){return s=(Math.floor(e/t)%n).toString(),LeadingZero&&s.length<2&&(s="0"+s),"<b>"+s+"</b>"}function CountBack(e){return 0>e?void(1==Disable?document.location.replace(UrlDisable):document.getElementById("cntdwn").innerHTML=FinishMessage):(DisplayStr=DisplayFormat.replace(/%%D%%/g,calcage(e,86400,1e5)),DisplayStr=DisplayStr.replace(/%%H%%/g,calcage(e,3600,24)),DisplayStr=DisplayStr.replace(/%%M%%/g,calcage(e,60,60)),DisplayStr=DisplayStr.replace(/%%S%%/g,calcage(e,1,60)),document.getElementById("cntdwn").innerHTML=DisplayStr,void(CountActive&&setTimeout("CountBack("+(e+CountStepper)+")",SetTimeOutPeriod)))}function putspan(e,t){document.write("<div class='cptR-rec_countdown'><span id='cntdwn' style='font-family:"+FontFamily+";background-color:"+e+"; color:"+t+"; font-size:"+FontSize+"vw;'></span></div>")}"undefined"==typeof BackColor&&(BackColor=""),"undefined"==typeof ForeColor&&(ForeColor="black"),"undefined"==typeof FontSize&&(FontSize="10"),"undefined"==typeof TargetDate&&(TargetDate="12/31/2020 5:00 AM"),"undefined"==typeof DisplayFormat&&(DisplayFormat="%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds."),"undefined"==typeof CountActive&&(CountActive=!0),"undefined"==typeof FinishMessage&&(FinishMessage=""),"number"!=typeof CountStepper&&(CountStepper=-1),"undefined"==typeof LeadingZero&&(LeadingZero=!0),"undefined"==typeof Disable&&(Disable=""),"undefined"==typeof FontFamily&&(FontFamily="Pacifico"),CountStepper=Math.ceil(CountStepper),0==CountStepper&&(CountActive=!1);var SetTimeOutPeriod=1e3*(Math.abs(CountStepper)-1)+990;putspan(BackColor,ForeColor,FontSize);var dthen=new Date(TargetDate),dnow=new Date;CountStepper>0?ddiff=new Date(dnow-dthen):ddiff=new Date(dthen-dnow),gsecs=Math.floor(ddiff.valueOf()/1e3),CountBack(gsecs);
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://wpmaintenance.info/a-propos/
4
  Tags: Maintenance, Construction, Launch, Coming soon
5
  Requires at least: 3.0
6
  Tested up to: 5.0
7
- Stable tag: 5.0.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -65,15 +65,18 @@ Yes. Thank you for submitting your changes to update the plugin.
65
 
66
  You can translate WP Maintenance on [__translate.wordpress.org__](https://translate.wordpress.org/projects/wp-plugins/wp-maintenance).
67
 
68
- == Upgrade Notice ==
 
 
 
 
 
69
 
70
  = 5.0.3 =
71
  * Fixed bug : Warning in count function for 7.2 php version
72
  * Fixed bug : Background color
73
  * Design : Changing position of WP Maintenance menu
74
 
75
- == Changelog ==
76
-
77
  = 5.0.2 =
78
  * Fixed bug : conflict mode preview with others previews
79
 
4
  Tags: Maintenance, Construction, Launch, Coming soon
5
  Requires at least: 3.0
6
  Tested up to: 5.0
7
+ Stable tag: 5.0.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
65
 
66
  You can translate WP Maintenance on [__translate.wordpress.org__](https://translate.wordpress.org/projects/wp-plugins/wp-maintenance).
67
 
68
+ == Changelog ==
69
+
70
+ = 5.0.4 =
71
+ * Add separete for countdown
72
+ * Fixed bug authorize pages ID
73
+ * Change font size of countdown : vw instead px
74
 
75
  = 5.0.3 =
76
  * Fixed bug : Warning in count function for 7.2 php version
77
  * Fixed bug : Background color
78
  * Design : Changing position of WP Maintenance menu
79
 
 
 
80
  = 5.0.2 =
81
  * Fixed bug : conflict mode preview with others previews
82
 
views/wp-maintenance-colors.php CHANGED
@@ -172,7 +172,7 @@ $paramMMode = get_option('wp_maintenance_settings');
172
  </td>
173
  <td>
174
  <?php _e('Size:', 'wp-maintenance'); ?>
175
- <input type="text" size="3" class="wpm-form-field" id="date_cpt_size" name="wp_maintenance_settings[date_cpt_size]" value="<?php if( isset($paramMMode['date_cpt_size']) && $paramMMode['date_cpt_size']!='' ) { echo trim($paramMMode['date_cpt_size']); } else { echo '16'; } ?>" />px
176
 
177
  </td>
178
  </tr>
172
  </td>
173
  <td>
174
  <?php _e('Size:', 'wp-maintenance'); ?>
175
+ <input type="text" size="3" class="wpm-form-field" id="date_cpt_size" name="wp_maintenance_settings[date_cpt_size]" value="<?php if( isset($paramMMode['date_cpt_size']) && $paramMMode['date_cpt_size']!='' ) { echo trim($paramMMode['date_cpt_size']); } else { echo '10'; } ?>" />vw
176
 
177
  </td>
178
  </tr>
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://wpmaintenance.info
8
- * Version: 5.0.3
9
  * Text Domain: wp-maintenance
10
  * Domain Path: /languages/
11
  */
@@ -36,7 +36,7 @@ define( 'WPM_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
36
  define( 'WPM_PLUGIN_URL', plugins_url().'/'.strtolower('wp-maintenance').'/');
37
  define( 'WPM_ICONS_URL', plugins_url().'/'.strtolower('wp-maintenance').'/socialicons/');
38
 
39
- if( !defined( 'WPM_VERSION' )) { define( 'WPM_VERSION', '5.0.3' ); }
40
 
41
  require WPM_DIR . 'classes/wp-maintenance.php';
42
  require WPM_DIR . 'classes/slider.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://wpmaintenance.info
8
+ * Version: 5.0.4
9
  * Text Domain: wp-maintenance
10
  * Domain Path: /languages/
11
  */
36
  define( 'WPM_PLUGIN_URL', plugins_url().'/'.strtolower('wp-maintenance').'/');
37
  define( 'WPM_ICONS_URL', plugins_url().'/'.strtolower('wp-maintenance').'/socialicons/');
38
 
39
+ if( !defined( 'WPM_VERSION' )) { define( 'WPM_VERSION', '5.0.4' ); }
40
 
41
  require WPM_DIR . 'classes/wp-maintenance.php';
42
  require WPM_DIR . 'classes/slider.php';