Version Description
Download this release
Release Info
Developer | niteo |
Plugin | CMP – Coming Soon & Maintenance Plugin by NiteoThemes |
Version | 3.7.3 |
Comparing to | |
See all releases |
Code changes from version 3.7.2.1 to 3.7.3
- cmp-advanced.php +1 -1
- cmp-settings.php +19 -12
- css/cmp-admin-head.css +0 -2
- css/cmp-menu-logo.css +0 -4
- img/thumbnails/elementor/screenshot1.jpg +0 -0
- img/thumbnails/elementor/screenshot2.jpg +0 -0
- img/thumbnails/elementor/screenshot3.jpg +0 -0
- img/thumbnails/elementor_thumbnail.jpg +0 -0
- inc/class-cmp-render_html.php +2 -1
- inc/render/custom-css.php +18 -42
- inc/render/javascripts.php +341 -199
- inc/render/niteothemes-info.php +1 -1
- inc/render/seo.php +10 -5
- inc/settings/settings-counter.php +1 -0
- niteo-cmp.php +51 -19
- readme.txt +6 -1
- themes/countdown/countdown-defaults.php +1 -0
- themes/countdown/countdown-theme.php +1 -58
- themes/divi.txt +1 -1
- themes/elementor.txt +3 -0
cmp-advanced.php
CHANGED
@@ -11,7 +11,7 @@ if ( $_SERVER['REQUEST_METHOD'] == 'POST' ) {
|
|
11 |
$ajax_nonce = wp_create_nonce( 'cmp-coming-soon-ajax-secret' );
|
12 |
|
13 |
// get all wp pages to array(id->name);
|
14 |
-
$pages = $this->cmp_get_pages();
|
15 |
|
16 |
if ( isset( $_POST['niteoCS_bypass_id'] ) ) {
|
17 |
if ( $_POST['niteoCS_bypass_id'] == '' ) {
|
11 |
$ajax_nonce = wp_create_nonce( 'cmp-coming-soon-ajax-secret' );
|
12 |
|
13 |
// get all wp pages to array(id->name);
|
14 |
+
$pages = $this->cmp_get_pages('publish');
|
15 |
|
16 |
if ( isset( $_POST['niteoCS_bypass_id'] ) ) {
|
17 |
if ( $_POST['niteoCS_bypass_id'] == '' ) {
|
cmp-settings.php
CHANGED
@@ -365,6 +365,7 @@ if ( $_SERVER['REQUEST_METHOD'] == 'POST' ) {
|
|
365 |
if ( isset($_POST['niteoCS_overlay_button_url']) ) {
|
366 |
update_option('niteoCS_overlay_text[button_url]', sanitize_text_field($_POST['niteoCS_overlay_button_url']));
|
367 |
}
|
|
|
368 |
}
|
369 |
|
370 |
|
@@ -510,13 +511,16 @@ if ( !get_option('niteoCS_socialmedia') ) {
|
|
510 |
$socialmedia = json_decode( $niteoCS_socialmedia, true );
|
511 |
}
|
512 |
|
|
|
|
|
|
|
513 |
//include theme defaults
|
514 |
-
if (file_exists($this->cmp_theme_dir($themeslug).$themeslug.'/'.$themeslug.'-defaults.php')) {
|
515 |
include ( $this->cmp_theme_dir($themeslug).$themeslug.'/'.$themeslug.'-defaults.php' );
|
516 |
}
|
517 |
|
518 |
// set banner type again, if the themes are not upgraded after 2.9.5 release where this settings got theme settings independent
|
519 |
-
$banner_type
|
520 |
|
521 |
// get logo url from id
|
522 |
if ( $niteoCS_logo_id != '' ) {
|
@@ -585,7 +589,7 @@ add_thickbox();
|
|
585 |
<h2 class="nav-tab-wrapper">
|
586 |
<a class="nav-tab nav-tab-active general" href="<?php echo admin_url(); ?>admin.php?page=cmp-settings#general" data-tab="general"><i class="fa fa-cog" aria-hidden="true"></i><?php _e('Settings', 'cmp-coming-soon-maintenance');?></a>
|
587 |
|
588 |
-
<?php if (
|
589 |
<a class="nav-tab content" href="<?php echo admin_url(); ?>admin.php?page=cmp-settings#content" data-tab="content"><i class="fa fa-pencil-square-o" aria-hidden="true"></i><?php _e('Content', 'cmp-coming-soon-maintenance');?></a>
|
590 |
<?php endif; ?>
|
591 |
<a class="nav-tab theme-setup" href="<?php echo admin_url(); ?>admin.php?page=cmp-settings#theme-setup" data-tab="theme-setup"><i class="fa fa-wrench" aria-hidden="true"></i><?php _e('Customize', 'cmp-coming-soon-maintenance');?></a>
|
@@ -613,7 +617,7 @@ add_thickbox();
|
|
613 |
}
|
614 |
|
615 |
// include banner
|
616 |
-
if ( !class_exists('
|
617 |
<a class="cmp-bundle-banner table-wrapper general" href="https://niteothemes.com/bundles/" target="_blank"><img src="<?php echo plugins_url('img/banner_bundle.jpg', __FILE__);?>" alt="CMP Bundle Banner"></a>
|
618 |
<?php
|
619 |
}
|
@@ -623,7 +627,7 @@ add_thickbox();
|
|
623 |
require ( dirname(__FILE__) . '/inc/settings/settings-theme-selector.php' );
|
624 |
}
|
625 |
|
626 |
-
if (
|
627 |
|
628 |
// get logo settings
|
629 |
if ( isset( $theme_supports['logo'] ) && $theme_supports['logo'] ) {
|
@@ -719,9 +723,9 @@ add_thickbox();
|
|
719 |
}
|
720 |
}
|
721 |
|
722 |
-
// include
|
723 |
-
if ( $
|
724 |
-
require ( $this->cmp_theme_dir(
|
725 |
}
|
726 |
|
727 |
// special effects for premium themes
|
@@ -750,20 +754,23 @@ add_thickbox();
|
|
750 |
}
|
751 |
|
752 |
// font selector settings
|
753 |
-
if ( file_exists(dirname(__FILE__) . '/inc/settings/settings-typography.php' ) &&
|
754 |
require ( dirname(__FILE__) . '/inc/settings/settings-typography.php' );
|
755 |
}
|
756 |
|
757 |
// SEO settings
|
758 |
if ( file_exists(dirname(__FILE__) . '/inc/settings/settings-seo.php' ) ) {
|
759 |
require ( dirname(__FILE__) . '/inc/settings/settings-seo.php' );
|
760 |
-
}
|
|
|
761 |
// CSS settings
|
762 |
if ( file_exists(dirname(__FILE__) . '/inc/settings/settings-css.php' ) ) {
|
763 |
require ( dirname(__FILE__) . '/inc/settings/settings-css.php' );
|
764 |
-
}
|
765 |
-
?>
|
766 |
|
|
|
|
|
|
|
767 |
|
768 |
</div> <!-- <div class="cmp-settings-wrapper"> -->
|
769 |
|
365 |
if ( isset($_POST['niteoCS_overlay_button_url']) ) {
|
366 |
update_option('niteoCS_overlay_text[button_url]', sanitize_text_field($_POST['niteoCS_overlay_button_url']));
|
367 |
}
|
368 |
+
|
369 |
}
|
370 |
|
371 |
|
511 |
$socialmedia = json_decode( $niteoCS_socialmedia, true );
|
512 |
}
|
513 |
|
514 |
+
|
515 |
+
$builder_theme = in_array( $themeslug, $this->cmp_builder_themes() );
|
516 |
+
|
517 |
//include theme defaults
|
518 |
+
if ( file_exists( $this->cmp_theme_dir($themeslug).$themeslug.'/'.$themeslug.'-defaults.php' ) ) {
|
519 |
include ( $this->cmp_theme_dir($themeslug).$themeslug.'/'.$themeslug.'-defaults.php' );
|
520 |
}
|
521 |
|
522 |
// set banner type again, if the themes are not upgraded after 2.9.5 release where this settings got theme settings independent
|
523 |
+
$banner_type = get_option('niteoCS_banner', '2');
|
524 |
|
525 |
// get logo url from id
|
526 |
if ( $niteoCS_logo_id != '' ) {
|
589 |
<h2 class="nav-tab-wrapper">
|
590 |
<a class="nav-tab nav-tab-active general" href="<?php echo admin_url(); ?>admin.php?page=cmp-settings#general" data-tab="general"><i class="fa fa-cog" aria-hidden="true"></i><?php _e('Settings', 'cmp-coming-soon-maintenance');?></a>
|
591 |
|
592 |
+
<?php if ( !$builder_theme ) : ?>
|
593 |
<a class="nav-tab content" href="<?php echo admin_url(); ?>admin.php?page=cmp-settings#content" data-tab="content"><i class="fa fa-pencil-square-o" aria-hidden="true"></i><?php _e('Content', 'cmp-coming-soon-maintenance');?></a>
|
594 |
<?php endif; ?>
|
595 |
<a class="nav-tab theme-setup" href="<?php echo admin_url(); ?>admin.php?page=cmp-settings#theme-setup" data-tab="theme-setup"><i class="fa fa-wrench" aria-hidden="true"></i><?php _e('Customize', 'cmp-coming-soon-maintenance');?></a>
|
617 |
}
|
618 |
|
619 |
// include banner
|
620 |
+
if ( !class_exists('CMP_Addons') ) { ?>
|
621 |
<a class="cmp-bundle-banner table-wrapper general" href="https://niteothemes.com/bundles/" target="_blank"><img src="<?php echo plugins_url('img/banner_bundle.jpg', __FILE__);?>" alt="CMP Bundle Banner"></a>
|
622 |
<?php
|
623 |
}
|
627 |
require ( dirname(__FILE__) . '/inc/settings/settings-theme-selector.php' );
|
628 |
}
|
629 |
|
630 |
+
if ( !$builder_theme ) {
|
631 |
|
632 |
// get logo settings
|
633 |
if ( isset( $theme_supports['logo'] ) && $theme_supports['logo'] ) {
|
723 |
}
|
724 |
}
|
725 |
|
726 |
+
// include builders related settings
|
727 |
+
if ( $builder_theme && file_exists( $this->cmp_theme_dir( $themeslug ).$themeslug .'/'.$themeslug.'-admin-settings.php' ) ) {
|
728 |
+
require ( $this->cmp_theme_dir( $themeslug ).$themeslug .'/'.$themeslug.'-admin-settings.php' );
|
729 |
}
|
730 |
|
731 |
// special effects for premium themes
|
754 |
}
|
755 |
|
756 |
// font selector settings
|
757 |
+
if ( file_exists(dirname(__FILE__) . '/inc/settings/settings-typography.php' ) && !$builder_theme ) {
|
758 |
require ( dirname(__FILE__) . '/inc/settings/settings-typography.php' );
|
759 |
}
|
760 |
|
761 |
// SEO settings
|
762 |
if ( file_exists(dirname(__FILE__) . '/inc/settings/settings-seo.php' ) ) {
|
763 |
require ( dirname(__FILE__) . '/inc/settings/settings-seo.php' );
|
764 |
+
}
|
765 |
+
|
766 |
// CSS settings
|
767 |
if ( file_exists(dirname(__FILE__) . '/inc/settings/settings-css.php' ) ) {
|
768 |
require ( dirname(__FILE__) . '/inc/settings/settings-css.php' );
|
769 |
+
}
|
|
|
770 |
|
771 |
+
if ( $_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['niteoCS_builder_page_id'])) {
|
772 |
+
do_action('cmp_save_settings', sanitize_text_field($_POST['niteoCS_builder_page_id']), $themeslug);
|
773 |
+
} ?>
|
774 |
|
775 |
</div> <!-- <div class="cmp-settings-wrapper"> -->
|
776 |
|
css/cmp-admin-head.css
CHANGED
@@ -1,5 +1,3 @@
|
|
1 |
-
/* #wpadminbar ul li#wp-admin-bar-cmp-admin-notice{background:#2c3e50;} */
|
2 |
-
|
3 |
#wpadminbar .cmp-logo {
|
4 |
position: absolute;
|
5 |
display: inline-block;
|
|
|
|
|
1 |
#wpadminbar .cmp-logo {
|
2 |
position: absolute;
|
3 |
display: inline-block;
|
css/cmp-menu-logo.css
DELETED
@@ -1,4 +0,0 @@
|
|
1 |
-
#toplevel_page_cmp-settings img {
|
2 |
-
max-width: 20px!important;
|
3 |
-
padding-top: 6px!important;
|
4 |
-
}
|
|
|
|
|
|
|
|
img/thumbnails/elementor/screenshot1.jpg
ADDED
Binary file
|
img/thumbnails/elementor/screenshot2.jpg
ADDED
Binary file
|
img/thumbnails/elementor/screenshot3.jpg
ADDED
Binary file
|
img/thumbnails/elementor_thumbnail.jpg
ADDED
Binary file
|
inc/class-cmp-render_html.php
CHANGED
@@ -127,7 +127,7 @@ class CMP_Coming_Soon_and_Maintenance_Render_HTML extends CMP_Coming_Soon_and_Ma
|
|
127 |
|
128 |
|
129 |
/**
|
130 |
-
*
|
131 |
*
|
132 |
* @since 2.4
|
133 |
* @return HTML
|
@@ -139,6 +139,7 @@ class CMP_Coming_Soon_and_Maintenance_Render_HTML extends CMP_Coming_Soon_and_Ma
|
|
139 |
return $html;
|
140 |
}
|
141 |
|
|
|
142 |
/**
|
143 |
* render custom CSS.
|
144 |
*
|
127 |
|
128 |
|
129 |
/**
|
130 |
+
* return theme head SEO.
|
131 |
*
|
132 |
* @since 2.4
|
133 |
* @return HTML
|
139 |
return $html;
|
140 |
}
|
141 |
|
142 |
+
|
143 |
/**
|
144 |
* render custom CSS.
|
145 |
*
|
inc/render/custom-css.php
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
|
2 |
<?php
|
3 |
$css = '';
|
4 |
-
$themeslug
|
5 |
-
|
6 |
if ( isset($_GET['theme']) && !empty($_GET['theme']) ) {
|
7 |
$themeslug = esc_attr($_GET['theme']);
|
8 |
}
|
@@ -96,46 +96,11 @@ if ( in_array( $themeslug, $this->cmp_premium_themes_installed() ) ) {
|
|
96 |
$effect = $_GET['effect'];
|
97 |
}
|
98 |
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
<!-- constellation effect -->
|
105 |
-
<style>
|
106 |
-
.particles-js-canvas-el {position: absolute; top:0; left:0;}
|
107 |
-
<?php
|
108 |
-
switch ( $themeslug ) {
|
109 |
-
case 'frame': ?>
|
110 |
-
.particles-js-canvas-el {z-index: -1;}
|
111 |
-
#background-image, .video-banner {z-index: -3;}
|
112 |
-
.background-overlay {z-index: -2;}
|
113 |
-
<?php
|
114 |
-
break;
|
115 |
-
|
116 |
-
case 'stylo':
|
117 |
-
case 'eclipse': ?>
|
118 |
-
.particles-js-canvas-el {z-index: 1;}
|
119 |
-
<?php
|
120 |
-
break;
|
121 |
-
default:
|
122 |
-
break;
|
123 |
-
} ?>
|
124 |
-
</style>
|
125 |
-
<?php
|
126 |
-
break;
|
127 |
-
|
128 |
-
case 'bubbles':
|
129 |
-
case '2': ?>
|
130 |
-
<!-- constellation effect -->
|
131 |
-
<style>
|
132 |
-
canvas {position: absolute; top:0; left:0;}
|
133 |
-
</style>
|
134 |
-
<?php
|
135 |
-
break;
|
136 |
-
|
137 |
-
default:
|
138 |
-
break;
|
139 |
}
|
140 |
}
|
141 |
|
@@ -174,6 +139,17 @@ if ( get_option('niteoCS_login_icon', '0') !== '0' ) {
|
|
174 |
|
175 |
}
|
176 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
177 |
$css = ob_get_clean();
|
178 |
|
179 |
$custom_css = ( get_option('niteoCS_custom_css', '') != '' ) ? '<style>'.stripslashes( wp_filter_nohtml_kses( get_option('niteoCS_custom_css') ) ).'</style>' : '';
|
1 |
|
2 |
<?php
|
3 |
$css = '';
|
4 |
+
$themeslug = $this->cmp_selectedTheme();
|
5 |
+
$countdown_action = get_option('niteoCS_countdown_action', 'no-action');
|
6 |
if ( isset($_GET['theme']) && !empty($_GET['theme']) ) {
|
7 |
$themeslug = esc_attr($_GET['theme']);
|
8 |
}
|
96 |
$effect = $_GET['effect'];
|
97 |
}
|
98 |
|
99 |
+
if ( $effect !== 'disabled' ) { ?>
|
100 |
+
<style>
|
101 |
+
.particles-js-canvas-el {position:absolute; top:0; left:0; bottom:0; pointer-events:none;}
|
102 |
+
</style>
|
103 |
+
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
104 |
}
|
105 |
}
|
106 |
|
139 |
|
140 |
}
|
141 |
|
142 |
+
if ( get_option('niteoCS_counter_date' ) < time() && $countdown_action === 'hide' ) { ?>
|
143 |
+
<style>
|
144 |
+
#counter {
|
145 |
+
display: none;
|
146 |
+
}
|
147 |
+
</style>
|
148 |
+
<?php
|
149 |
+
|
150 |
+
}
|
151 |
+
|
152 |
+
|
153 |
$css = ob_get_clean();
|
154 |
|
155 |
$custom_css = ( get_option('niteoCS_custom_css', '') != '' ) ? '<style>'.stripslashes( wp_filter_nohtml_kses( get_option('niteoCS_custom_css') ) ).'</style>' : '';
|
inc/render/javascripts.php
CHANGED
@@ -3,216 +3,227 @@
|
|
3 |
|
4 |
do_action('cmp-before-footer-scripts');
|
5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
if ( isset($_GET['background']) && is_numeric($_GET['background']) ) {
|
7 |
$background = esc_attr($_GET['background']);
|
8 |
-
}
|
9 |
-
|
10 |
-
<!-- Fade in background image after load -->
|
11 |
-
<script>
|
12 |
-
window.addEventListener("load",function(event) {
|
13 |
-
init();
|
14 |
-
});
|
15 |
|
16 |
-
|
|
|
|
|
|
|
|
|
|
|
17 |
|
18 |
-
|
19 |
-
var body = document.getElementById('body');
|
20 |
-
if ( image === null ) {
|
21 |
-
image = document.getElementById('body');
|
22 |
-
}
|
23 |
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
|
|
28 |
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
var contentWrapper = document.getElementsByClassName('content-wrapper')[0];
|
34 |
-
setTimeout(function(){ contentWrapper.className += " overflow"; }, 1500);
|
35 |
-
|
36 |
-
<?php
|
37 |
-
break;
|
38 |
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
|
|
46 |
break;
|
47 |
-
} ?>
|
48 |
-
}
|
49 |
-
</script>
|
50 |
-
|
51 |
-
<?php
|
52 |
-
// include background scripts
|
53 |
-
switch ( $background ) {
|
54 |
-
// VIDIM script for background video
|
55 |
-
case '5':
|
56 |
-
$video_autoloop = get_option('niteoCS_video_autoloop', '1'); ?>
|
57 |
-
<script src='<?php echo plugins_url('cmp-coming-soon-maintenance/js/external/vidim.min.js?v=1.0.2"');?>'></script>
|
58 |
-
<script>
|
59 |
-
<?php
|
60 |
-
$video_poster = wp_get_attachment_image_src( get_option('niteoCS_video_thumb'), 'large' );
|
61 |
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
// sanitize source
|
69 |
-
switch ( $source ) {
|
70 |
-
case 'youtube':
|
71 |
-
$source = 'YouTube';
|
72 |
-
break;
|
73 |
-
case 'local':
|
74 |
-
$source = 'video/mp4';
|
75 |
-
break;
|
76 |
default:
|
77 |
break;
|
78 |
-
}
|
|
|
|
|
79 |
|
80 |
-
|
81 |
-
case 'YouTube': ?>
|
82 |
-
var src = '<?php echo esc_url(get_option('niteoCS_youtube_url')); ?>'.split('?t=');
|
83 |
-
var myBackground = new vidim( '#player', {
|
84 |
-
src: src[0],
|
85 |
-
type: 'YouTube',
|
86 |
-
poster: '<?php echo esc_url( $video_poster ); ?>',
|
87 |
-
quality: 'hd1080',
|
88 |
-
muted: true,
|
89 |
-
loop: <?php echo $video_autoloop ? 'true' : 'false' ; ?>,
|
90 |
-
startAt: src.length > 1 ? src[1] : '0'
|
91 |
-
});
|
92 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
93 |
<?php
|
94 |
-
|
95 |
-
|
96 |
-
case 'vimeo': ?>
|
97 |
-
var src = <?php esc_url(get_option('niteoCS_vimeo_url')); ?>
|
98 |
-
var myBackground = new vidim( '#player', {
|
99 |
-
src: src,
|
100 |
-
type: 'vimeo',
|
101 |
-
poster: '<?php echo esc_url( $video_poster ); ?>',
|
102 |
-
loop: <?php echo $video_autoloop ? 'true' : 'false' ; ?>
|
103 |
-
});
|
104 |
-
<?php
|
105 |
-
break;
|
106 |
|
107 |
-
|
108 |
-
$
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
} ?>
|
125 |
-
</script>
|
126 |
-
<?php
|
127 |
-
break;
|
128 |
-
|
129 |
-
// SLIDER SCRIPTS FOR UNSPLASH or Custom IMAGES
|
130 |
-
case '0':
|
131 |
-
case '1':
|
132 |
-
$slider = get_option('niteoCS_slider', '0');
|
133 |
-
|
134 |
-
if ( $slider == '1' ) {
|
135 |
-
$slider_effect = get_option('niteoCS_slider_effect', 'true');
|
136 |
-
$slider_autoplay = get_option('niteoCS_slider_auto', '1');
|
137 |
-
|
138 |
-
switch ( $slider_effect ) {
|
139 |
-
// slice effect scripts
|
140 |
-
case 'slice':
|
141 |
-
?>
|
142 |
-
<script src='<?php echo plugins_url('cmp-coming-soon-maintenance/js/external/imagesloaded.pkgd.min.js' );?>'></script>
|
143 |
-
<script src='<?php echo plugins_url('cmp-coming-soon-maintenance/js/external/anime.min.js' );?>'></script>
|
144 |
-
<script src='<?php echo plugins_url('cmp-coming-soon-maintenance/js/external/uncover.js' );?>'></script>
|
145 |
-
<script src='<?php echo $this->cmp_themeURL($themeslug).$themeslug.'/js/slice.js';?>'></script>
|
146 |
-
<?php
|
147 |
-
break;
|
148 |
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
|
|
|
|
|
|
158 |
|
159 |
<?php
|
160 |
-
|
161 |
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
$this->jquery = TRUE;
|
170 |
-
} ?>
|
171 |
-
<!-- slick carousel script -->
|
172 |
-
<script src='https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.6.0/slick.min.js'></script>
|
173 |
-
<script>
|
174 |
-
$('#slider').slick({
|
175 |
-
slide: '.slide',
|
176 |
-
slidesToShow: 1,
|
177 |
-
arrows: false,
|
178 |
-
fade: <?php echo esc_attr( $slider_effect );?>,
|
179 |
-
speed: 1000,
|
180 |
-
autoplay: <?php echo esc_attr( $slider_autoplay );?>,
|
181 |
-
autoplaySpeed: 7000,
|
182 |
});
|
|
|
|
|
183 |
|
184 |
-
|
185 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
186 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
187 |
|
188 |
-
|
189 |
-
|
190 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
191 |
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
197 |
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
203 |
|
204 |
-
</script>
|
205 |
-
<?php
|
206 |
-
break;
|
207 |
}
|
208 |
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
}
|
216 |
|
217 |
// render redirect script if CMP is in redirect mode
|
218 |
if ( $this->cmp_mode() == 3 ) {
|
@@ -268,12 +279,11 @@ if ( (in_array( $themeslug, $this->cmp_cf7_themes() ) && get_option('niteoCS_con
|
|
268 |
}
|
269 |
}
|
270 |
|
271 |
-
|
272 |
-
|
273 |
// special effects scripts for premium themes
|
274 |
if ( in_array( $themeslug, $this->cmp_premium_themes_installed() ) ) {
|
275 |
|
276 |
$effect = get_option('niteoCS_special_effect', 'disabled');
|
|
|
277 |
// change effect for preview
|
278 |
if ( isset($_GET['effect']) && is_numeric($_GET['effect'])) {
|
279 |
$effect = $_GET['effect'];
|
@@ -291,14 +301,22 @@ if ( in_array( $themeslug, $this->cmp_premium_themes_installed() ) ) {
|
|
291 |
<!-- INI particles -->
|
292 |
<script>
|
293 |
<?php
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
302 |
}
|
303 |
|
304 |
switch ( $effect ) {
|
@@ -329,14 +347,22 @@ if ( in_array( $themeslug, $this->cmp_premium_themes_installed() ) ) {
|
|
329 |
<!-- INI bubbles -->
|
330 |
<script>
|
331 |
<?php
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
338 |
} ?>
|
339 |
-
$wrapper.append("<canvas></canvas><canvas></canvas><canvas></canvas>"),function(a){var e=$wrapper.children("canvas"),n=e[0],r=e[1],i=e[2],o={circle:{amount:18,layer:3,color:[<?php echo $this->hex2rgba( get_option('niteoCS_special_effect[constellation][color]', '#ffffff') );?>],alpha:.3},line:{amount:12,layer:3,color:[<?php echo $this->hex2rgba( get_option('niteoCS_special_effect[constellation][color]', '#ffffff') );?>],alpha:.3},speed:.5,angle:20};if(n.getContext){n.getContext("2d");var t,l,c,d=r.getContext("2d"),m=i.getContext("2d"),w=window.Math,s=o.angle/360*w.PI*2,p=[],u=[];requestAnimationFrame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame||function(a,e){setTimeout(a,1e3/60)},cancelAnimationFrame=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||window.msCancelAnimationFrame||window.oCancelAnimationFrame||clearTimeout;var h=function(){t=a(window).width(),l=a(window).height(),e.each(function(){this.width=t,this.height=l})},v=function(){var a,e,n,r,i,h,f,y,g,A,F,C,b,x,q=w.sin(s),R=w.cos(s);if(o.circle.amount>0&&o.circle.layer>0){d.clearRect(0,0,t,l);for(var k=0,S=p.length;k<S;k++){var $=(I=p[k]).x,P=I.y,T=I.radius,z=I.speed;$>t+T?$=-T:$<-T?$=t+T:$+=q*z,P>l+T?P=-T:P<-T?P=l+T:P-=R*z,I.x=$,I.y=P,a=$,e=P,n=T,r=I.color,i=I.alpha,h=void 0,(h=d.createRadialGradient(a,e,n,a,e,0)).addColorStop(0,"rgba("+r[0]+","+r[1]+","+r[2]+","+i+")"),h.addColorStop(1,"rgba("+r[0]+","+r[1]+","+r[2]+","+(i-.1)+")"),d.beginPath(),d.arc(a,e,n,0,2*w.PI,!0),d.fillStyle=h,d.fill()}}if(o.line.amount>0&&o.line.layer>0){m.clearRect(0,0,t,l);var G=0;for(S=u.length;G<S;G++){$=(I=u[G]).x,P=I.y;var I,j=I.width;z=I.speed;$>t+j*q?$=-j*q:$<-j*q?$=t+j*q:$+=q*z,P>l+j*R?P=-j*R:P<-j*R?P=l+j*R:P-=R*z,I.x=$,I.y=P,f=$,y=P,g=j,A=I.color,F=I.alpha,void 0,void 0,x=void 0,C=f+w.sin(s)*g,b=y-w.cos(s)*g,(x=m.createLinearGradient(f,y,C,b)).addColorStop(0,"rgba("+A[0]+","+A[1]+","+A[2]+","+F+")"),x.addColorStop(1,"rgba("+A[0]+","+A[1]+","+A[2]+","+(F-.1)+")"),m.beginPath(),m.moveTo(f,y),m.lineTo(C,b),m.lineWidth=3,m.lineCap="round",m.strokeStyle=x,m.stroke()}}c=requestAnimationFrame(v)},f=function(){if(p=[],u=[],o.circle.amount>0&&o.circle.layer>0)for(var a=0;a<o.circle.amount/o.circle.layer;a++)for(var e=0;e<o.circle.layer;e++)p.push({x:w.random()*t,y:w.random()*l,radius:w.random()*(20+5*e)+(20+5*e),color:o.circle.color,alpha:.2*w.random()+(o.circle.alpha-.1*e),speed:o.speed*(1+.5*e)});if(o.line.amount>0&&o.line.layer>0)for(var n=0;n<o.line.amount/o.line.layer;n++)for(var r=0;r<o.line.layer;r++)u.push({x:w.random()*t,y:w.random()*l,width:w.random()*(20+5*r)+(20+5*r),color:o.line.color,alpha:.2*w.random()+(o.line.alpha-.1*r),speed:o.speed*(1+.5*r)});cancelAnimationFrame(c),c=requestAnimationFrame(v)};a(document).ready(function(){h(),f()}),a(window).resize(function(){h(),f()})}}(jQuery);
|
340 |
</script>
|
341 |
<?php
|
342 |
break;
|
@@ -380,6 +406,122 @@ if ( strpos( $content, 'iframe' ) !== false ) { ?>
|
|
380 |
<?php
|
381 |
}
|
382 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
383 |
$this->cmp_custom_footer_scripts();
|
384 |
|
385 |
do_action('cmp-after-footer-scripts');
|
3 |
|
4 |
do_action('cmp-before-footer-scripts');
|
5 |
|
6 |
+
//include theme defaults, to check if new counter is available
|
7 |
+
|
8 |
+
if ( file_exists( $this->cmp_theme_dir($themeslug).$themeslug.'/'.$themeslug.'-defaults.php' ) ) {
|
9 |
+
include ( $this->cmp_theme_dir($themeslug).$themeslug.'/'.$themeslug.'-defaults.php' );
|
10 |
+
}
|
11 |
+
|
12 |
+
$counter_script = false;
|
13 |
+
|
14 |
if ( isset($_GET['background']) && is_numeric($_GET['background']) ) {
|
15 |
$background = esc_attr($_GET['background']);
|
16 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
|
18 |
+
if ( $background !== false ) { ?>
|
19 |
+
<!-- Fade in background image after load -->
|
20 |
+
<script>
|
21 |
+
window.addEventListener("load",function(event) {
|
22 |
+
init();
|
23 |
+
});
|
24 |
|
25 |
+
function init(){
|
|
|
|
|
|
|
|
|
26 |
|
27 |
+
var image = document.getElementById('background-image');
|
28 |
+
var body = document.getElementById('body');
|
29 |
+
if ( image === null ) {
|
30 |
+
image = document.getElementById('body');
|
31 |
+
}
|
32 |
|
33 |
+
if ( image != null ) {
|
34 |
+
image.classList.add('loaded');
|
35 |
+
body.classList.add('loaded');
|
36 |
+
}
|
|
|
|
|
|
|
|
|
|
|
37 |
|
38 |
+
<?php
|
39 |
+
// theme specific function after init
|
40 |
+
switch ( $themeslug ) {
|
41 |
+
case 'fifty': ?>
|
42 |
+
var contentWrapper = document.getElementsByClassName('content-wrapper')[0];
|
43 |
+
setTimeout(function(){ contentWrapper.className += " overflow"; }, 1500);
|
44 |
+
|
45 |
+
<?php
|
46 |
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
|
48 |
+
case 'hardwork_premium': ?>
|
49 |
+
var contentWrapper = document.getElementsByClassName('section-body')[0];
|
50 |
+
setTimeout(function(){ contentWrapper.className += " overflow"; }, 1500);
|
51 |
+
<?php
|
52 |
+
break;
|
53 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
54 |
default:
|
55 |
break;
|
56 |
+
} ?>
|
57 |
+
}
|
58 |
+
</script>
|
59 |
|
60 |
+
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
|
62 |
+
// include background scripts
|
63 |
+
switch ( $background ) {
|
64 |
+
// VIDIM script for background video
|
65 |
+
case '5':
|
66 |
+
$video_autoloop = get_option('niteoCS_video_autoloop', '1'); ?>
|
67 |
+
<script src='<?php echo plugins_url('cmp-coming-soon-maintenance/js/external/vidim.min.js?v=1.0.2"');?>'></script>
|
68 |
+
<script>
|
69 |
<?php
|
70 |
+
$video_poster = wp_get_attachment_image_src( get_option('niteoCS_video_thumb'), 'large' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
|
72 |
+
if ( !empty( $video_poster ) ) {
|
73 |
+
$video_poster = $video_poster[0];
|
74 |
+
}
|
75 |
+
// video
|
76 |
+
$source = get_option('niteoCS_banner_video');
|
77 |
+
|
78 |
+
// sanitize source
|
79 |
+
switch ( $source ) {
|
80 |
+
case 'youtube':
|
81 |
+
$source = 'YouTube';
|
82 |
+
break;
|
83 |
+
case 'local':
|
84 |
+
$source = 'video/mp4';
|
85 |
+
break;
|
86 |
+
default:
|
87 |
+
break;
|
88 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
89 |
|
90 |
+
switch ( $source ) {
|
91 |
+
case 'YouTube': ?>
|
92 |
+
var src = '<?php echo esc_url(get_option('niteoCS_youtube_url')); ?>'.split('?t=');
|
93 |
+
var myBackground = new vidim( '#player', {
|
94 |
+
src: src[0],
|
95 |
+
type: 'YouTube',
|
96 |
+
poster: '<?php echo esc_url( $video_poster ); ?>',
|
97 |
+
quality: 'hd1080',
|
98 |
+
muted: true,
|
99 |
+
loop: <?php echo $video_autoloop ? 'true' : 'false' ; ?>,
|
100 |
+
startAt: src.length > 1 ? src[1] : '0'
|
101 |
+
});
|
102 |
|
103 |
<?php
|
104 |
+
break;
|
105 |
|
106 |
+
case 'vimeo': ?>
|
107 |
+
var src = <?php esc_url(get_option('niteoCS_vimeo_url')); ?>
|
108 |
+
var myBackground = new vidim( '#player', {
|
109 |
+
src: src,
|
110 |
+
type: 'vimeo',
|
111 |
+
poster: '<?php echo esc_url( $video_poster ); ?>',
|
112 |
+
loop: <?php echo $video_autoloop ? 'true' : 'false' ; ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
113 |
});
|
114 |
+
<?php
|
115 |
+
break;
|
116 |
|
117 |
+
case 'video/mp4':
|
118 |
+
$banner_url = get_option('niteoCS_video_file_url');
|
119 |
+
$banner_url = wp_get_attachment_url( $banner_url ); ?>
|
120 |
+
var myBackground = new vidim( '#player', {
|
121 |
+
src: [
|
122 |
+
{
|
123 |
+
type: 'video/mp4',
|
124 |
+
src: '<?php echo esc_url( $banner_url ); ?>',
|
125 |
+
},
|
126 |
+
],
|
127 |
+
poster: '<?php echo esc_url( $video_poster ); ?>',
|
128 |
+
loop: <?php echo $video_autoloop ? 'true' : 'false' ; ?>
|
129 |
});
|
130 |
+
<?php
|
131 |
+
break;
|
132 |
+
default:
|
133 |
+
break;
|
134 |
+
} ?>
|
135 |
+
</script>
|
136 |
+
<?php
|
137 |
+
break;
|
138 |
|
139 |
+
// SLIDER SCRIPTS FOR UNSPLASH or Custom IMAGES
|
140 |
+
case '0':
|
141 |
+
case '1':
|
142 |
+
$slider = get_option('niteoCS_slider', '0');
|
143 |
+
|
144 |
+
if ( $slider == '1' ) {
|
145 |
+
$slider_effect = get_option('niteoCS_slider_effect', 'true');
|
146 |
+
$slider_autoplay = get_option('niteoCS_slider_auto', '1');
|
147 |
+
|
148 |
+
switch ( $slider_effect ) {
|
149 |
+
// slice effect scripts
|
150 |
+
case 'slice':
|
151 |
+
?>
|
152 |
+
<script src='<?php echo plugins_url('cmp-coming-soon-maintenance/js/external/imagesloaded.pkgd.min.js' );?>'></script>
|
153 |
+
<script src='<?php echo plugins_url('cmp-coming-soon-maintenance/js/external/anime.min.js' );?>'></script>
|
154 |
+
<script src='<?php echo plugins_url('cmp-coming-soon-maintenance/js/external/uncover.js' );?>'></script>
|
155 |
+
<script src='<?php echo $this->cmp_themeURL($themeslug).$themeslug.'/js/slice.js';?>'></script>
|
156 |
+
<?php
|
157 |
+
break;
|
158 |
|
159 |
+
// mask transition effect scripts
|
160 |
+
case 'mask-transition':
|
161 |
+
if ( !$this->jquery ) {
|
162 |
+
echo '<script src="https://code.jquery.com/jquery-1.12.4.min.js" integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ=" Crossorigin="anonymous"></script>';
|
163 |
+
$this->jquery = TRUE;
|
164 |
+
} ?>
|
165 |
+
<script src='<?php echo $this->cmp_themeURL($themeslug).$themeslug.'/js/modernizr-custom.js';?>'></script>
|
166 |
+
<script src='<?php echo $this->cmp_themeURL($themeslug).$themeslug.'/js/imagesloaded.pkgd.min.js';?>'></script>
|
167 |
+
<script src='<?php echo $this->cmp_themeURL($themeslug).$themeslug.'/js/mask-transition.js';?>'></script>
|
168 |
+
|
169 |
+
<?php
|
170 |
+
break;
|
171 |
|
172 |
+
case 'train':
|
173 |
+
break;
|
174 |
+
|
175 |
+
// default (true, false) means slick carousel scripts
|
176 |
+
default:
|
177 |
+
if ( !$this->jquery ) {
|
178 |
+
echo '<script src="https://code.jquery.com/jquery-1.12.4.min.js" integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ=" Crossorigin="anonymous"></script>';
|
179 |
+
$this->jquery = TRUE;
|
180 |
+
} ?>
|
181 |
+
<!-- slick carousel script -->
|
182 |
+
<script src='https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.6.0/slick.min.js'></script>
|
183 |
+
<script>
|
184 |
+
$('#slider').slick({
|
185 |
+
slide: '.slide',
|
186 |
+
slidesToShow: 1,
|
187 |
+
arrows: false,
|
188 |
+
fade: <?php echo esc_attr( $slider_effect );?>,
|
189 |
+
speed: 1000,
|
190 |
+
autoplay: <?php echo esc_attr( $slider_autoplay );?>,
|
191 |
+
autoplaySpeed: 7000,
|
192 |
+
});
|
193 |
+
|
194 |
+
$('.prev').click(function() {
|
195 |
+
$('#slider').slick('slickPrev');
|
196 |
+
});
|
197 |
+
|
198 |
+
$('.next').click(function() {
|
199 |
+
$('#slider').slick('slickNext');
|
200 |
+
});
|
201 |
+
|
202 |
+
// custom dots navigation
|
203 |
+
$('.slide-number').click(function() {
|
204 |
+
$('#slider').slick('slickGoTo', parseInt($(this).data('slide')) );
|
205 |
+
|
206 |
+
});
|
207 |
+
|
208 |
+
// update custom dots on change
|
209 |
+
$('#slider').on('beforeChange', function(event, slick, currentSlide, nextSlide){
|
210 |
+
$('.slide-number').removeClass('active');
|
211 |
+
$('[data-slide="' + nextSlide + '"]').addClass('active');
|
212 |
+
});
|
213 |
+
|
214 |
+
</script>
|
215 |
+
<?php
|
216 |
+
break;
|
217 |
+
}
|
218 |
|
|
|
|
|
|
|
219 |
}
|
220 |
|
221 |
+
break;
|
222 |
+
|
223 |
+
default:
|
224 |
+
break;
|
225 |
+
}
|
226 |
+
}
|
|
|
227 |
|
228 |
// render redirect script if CMP is in redirect mode
|
229 |
if ( $this->cmp_mode() == 3 ) {
|
279 |
}
|
280 |
}
|
281 |
|
|
|
|
|
282 |
// special effects scripts for premium themes
|
283 |
if ( in_array( $themeslug, $this->cmp_premium_themes_installed() ) ) {
|
284 |
|
285 |
$effect = get_option('niteoCS_special_effect', 'disabled');
|
286 |
+
|
287 |
// change effect for preview
|
288 |
if ( isset($_GET['effect']) && is_numeric($_GET['effect'])) {
|
289 |
$effect = $_GET['effect'];
|
301 |
<!-- INI particles -->
|
302 |
<script>
|
303 |
<?php
|
304 |
+
|
305 |
+
switch ($themeslug ) {
|
306 |
+
case 'libra':
|
307 |
+
case 'elementor': ?>
|
308 |
+
var background= 'body';
|
309 |
+
<?php
|
310 |
+
break;
|
311 |
+
case 'divi': ?>
|
312 |
+
var background= 'main-content';
|
313 |
+
<?php
|
314 |
+
break;
|
315 |
+
default: ?>
|
316 |
+
var wrapper=document.getElementById("background-wrapper");
|
317 |
+
var background=(null===wrapper)?"slider-wrapper":"background-wrapper";
|
318 |
+
<?php
|
319 |
+
break;
|
320 |
}
|
321 |
|
322 |
switch ( $effect ) {
|
347 |
<!-- INI bubbles -->
|
348 |
<script>
|
349 |
<?php
|
350 |
+
switch ($themeslug ) {
|
351 |
+
case 'libra':
|
352 |
+
case 'elementor': ?>
|
353 |
+
var $wrapper = $('#body');
|
354 |
+
<?php
|
355 |
+
break;
|
356 |
+
case 'divi':?>
|
357 |
+
var $wrapper = $('main-content');
|
358 |
+
<?php
|
359 |
+
break;
|
360 |
+
default: ?>
|
361 |
+
var $wrapper=$("#background-wrapper").length?$("#background-wrapper"):$("#slider-wrapper");
|
362 |
+
<?php
|
363 |
+
break;
|
364 |
} ?>
|
365 |
+
$wrapper.append("<canvas class='particles-js-canvas-el'></canvas><canvas class='particles-js-canvas-el'></canvas><canvas class='particles-js-canvas-el'></canvas>"),function(a){var e=$wrapper.children("canvas"),n=e[0],r=e[1],i=e[2],o={circle:{amount:18,layer:3,color:[<?php echo $this->hex2rgba( get_option('niteoCS_special_effect[constellation][color]', '#ffffff') );?>],alpha:.3},line:{amount:12,layer:3,color:[<?php echo $this->hex2rgba( get_option('niteoCS_special_effect[constellation][color]', '#ffffff') );?>],alpha:.3},speed:.5,angle:20};if(n.getContext){n.getContext("2d");var t,l,c,d=r.getContext("2d"),m=i.getContext("2d"),w=window.Math,s=o.angle/360*w.PI*2,p=[],u=[];requestAnimationFrame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame||function(a,e){setTimeout(a,1e3/60)},cancelAnimationFrame=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||window.msCancelAnimationFrame||window.oCancelAnimationFrame||clearTimeout;var h=function(){t=a(window).width(),l=a(window).height(),e.each(function(){this.width=t,this.height=l})},v=function(){var a,e,n,r,i,h,f,y,g,A,F,C,b,x,q=w.sin(s),R=w.cos(s);if(o.circle.amount>0&&o.circle.layer>0){d.clearRect(0,0,t,l);for(var k=0,S=p.length;k<S;k++){var $=(I=p[k]).x,P=I.y,T=I.radius,z=I.speed;$>t+T?$=-T:$<-T?$=t+T:$+=q*z,P>l+T?P=-T:P<-T?P=l+T:P-=R*z,I.x=$,I.y=P,a=$,e=P,n=T,r=I.color,i=I.alpha,h=void 0,(h=d.createRadialGradient(a,e,n,a,e,0)).addColorStop(0,"rgba("+r[0]+","+r[1]+","+r[2]+","+i+")"),h.addColorStop(1,"rgba("+r[0]+","+r[1]+","+r[2]+","+(i-.1)+")"),d.beginPath(),d.arc(a,e,n,0,2*w.PI,!0),d.fillStyle=h,d.fill()}}if(o.line.amount>0&&o.line.layer>0){m.clearRect(0,0,t,l);var G=0;for(S=u.length;G<S;G++){$=(I=u[G]).x,P=I.y;var I,j=I.width;z=I.speed;$>t+j*q?$=-j*q:$<-j*q?$=t+j*q:$+=q*z,P>l+j*R?P=-j*R:P<-j*R?P=l+j*R:P-=R*z,I.x=$,I.y=P,f=$,y=P,g=j,A=I.color,F=I.alpha,void 0,void 0,x=void 0,C=f+w.sin(s)*g,b=y-w.cos(s)*g,(x=m.createLinearGradient(f,y,C,b)).addColorStop(0,"rgba("+A[0]+","+A[1]+","+A[2]+","+F+")"),x.addColorStop(1,"rgba("+A[0]+","+A[1]+","+A[2]+","+(F-.1)+")"),m.beginPath(),m.moveTo(f,y),m.lineTo(C,b),m.lineWidth=3,m.lineCap="round",m.strokeStyle=x,m.stroke()}}c=requestAnimationFrame(v)},f=function(){if(p=[],u=[],o.circle.amount>0&&o.circle.layer>0)for(var a=0;a<o.circle.amount/o.circle.layer;a++)for(var e=0;e<o.circle.layer;e++)p.push({x:w.random()*t,y:w.random()*l,radius:w.random()*(20+5*e)+(20+5*e),color:o.circle.color,alpha:.2*w.random()+(o.circle.alpha-.1*e),speed:o.speed*(1+.5*e)});if(o.line.amount>0&&o.line.layer>0)for(var n=0;n<o.line.amount/o.line.layer;n++)for(var r=0;r<o.line.layer;r++)u.push({x:w.random()*t,y:w.random()*l,width:w.random()*(20+5*r)+(20+5*r),color:o.line.color,alpha:.2*w.random()+(o.line.alpha-.1*r),speed:o.speed*(1+.5*r)});cancelAnimationFrame(c),c=requestAnimationFrame(v)};a(document).ready(function(){h(),f()}),a(window).resize(function(){h(),f()})}}(jQuery);
|
366 |
</script>
|
367 |
<?php
|
368 |
break;
|
406 |
<?php
|
407 |
}
|
408 |
|
409 |
+
|
410 |
+
|
411 |
+
if ( isset( $theme_supports['counter_script']) && $theme_supports['counter_script'] === TRUE ) {
|
412 |
+
$counter_script = true;
|
413 |
+
}
|
414 |
+
|
415 |
+
if ( $counter_script && get_option('niteoCS_counter', '1') == '1') {
|
416 |
+
$countdown_action = get_option('niteoCS_countdown_action', 'no-action');
|
417 |
+
|
418 |
+
// counter script for day only
|
419 |
+
if ( $themeslug === 'delta' || $themeslug === 'mercury' || $themeslug === 'libra' || $themeslug === 'thor') { ?>
|
420 |
+
<script>
|
421 |
+
var countdown = document.getElementById('counter');
|
422 |
+
var count = parseInt(document.getElementById('counter-day').textContent);
|
423 |
+
var ms = 5;
|
424 |
+
var day = countdown.dataset.date;
|
425 |
+
var counter = setTimeout(timer, 2000);
|
426 |
+
function timer() {
|
427 |
+
if ( count >= day ) {
|
428 |
+
document.getElementById('counter-day').innerHTML = count;
|
429 |
+
|
430 |
+
if ( count - day > 50 ) {
|
431 |
+
count = count - 3;
|
432 |
+
var counter = setTimeout(timer, ms);
|
433 |
+
} else if ( count - day > 10 ) {
|
434 |
+
count = count - 1;
|
435 |
+
var counter = setTimeout(timer, 20);
|
436 |
+
} else if ( count - day > 1 ){
|
437 |
+
count = count - 1;
|
438 |
+
var counter = setTimeout(timer, 100);
|
439 |
+
} else {
|
440 |
+
count = count - 1;
|
441 |
+
var counter = setTimeout(timer, 150);
|
442 |
+
}
|
443 |
+
}
|
444 |
+
|
445 |
+
<?php
|
446 |
+
if ( $countdown_action === 'redirect' || $countdown_action === 'disable-cmp') { ?>
|
447 |
+
if ( count == 0 ) {
|
448 |
+
window.location.reload();
|
449 |
+
}
|
450 |
+
<?php
|
451 |
+
} ?>
|
452 |
+
}
|
453 |
+
</script>
|
454 |
+
<?php
|
455 |
+
|
456 |
+
// full counter script
|
457 |
+
} else { ?>
|
458 |
+
<script>
|
459 |
+
document.addEventListener("DOMContentLoaded", function() {
|
460 |
+
var counter = document.getElementById("counter") ? document.getElementById("counter") : document.getElementById("cmp-counter");
|
461 |
+
|
462 |
+
|
463 |
+
if ( !counter ) {
|
464 |
+
return;
|
465 |
+
}
|
466 |
+
|
467 |
+
var unixtime = counter.getAttribute("data-date");
|
468 |
+
var date = new Date(unixtime*1000);
|
469 |
+
var countDownDate = new Date(date).getTime();
|
470 |
+
|
471 |
+
var dayElement = document.getElementById("counter-day");
|
472 |
+
var hourElement = document.getElementById("counter-hour");
|
473 |
+
var minuteElement = document.getElementById("counter-minute");
|
474 |
+
var secondElement = document.getElementById("counter-second");
|
475 |
+
|
476 |
+
// Update the count down every 1 second
|
477 |
+
var timerInt = setInterval(function() {
|
478 |
+
// Get today date
|
479 |
+
var now = new Date().getTime();
|
480 |
+
|
481 |
+
// Find the distance between now an the count down date
|
482 |
+
var distance = countDownDate - now;
|
483 |
+
// Time calculations for days, hours, minutes and seconds
|
484 |
+
var days = Math.floor(distance / (1000 * 60 * 60 * 24));
|
485 |
+
var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
|
486 |
+
var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
|
487 |
+
var seconds = Math.floor((distance % (1000 * 60)) / 1000);
|
488 |
+
|
489 |
+
if (days < 10) {
|
490 |
+
days = "0" + days;
|
491 |
+
}
|
492 |
+
if (hours < 10) {
|
493 |
+
hours = "0" + hours;
|
494 |
+
}
|
495 |
+
if (minutes < 10) {
|
496 |
+
minutes = "0" + minutes;
|
497 |
+
}
|
498 |
+
if (seconds < 10) {
|
499 |
+
seconds = "0" + seconds;
|
500 |
+
}
|
501 |
+
if (distance >= 0) {
|
502 |
+
dayElement ? dayElement.innerHTML = days : null;
|
503 |
+
hourElement ? hourElement.innerHTML = hours : null;
|
504 |
+
minuteElement ? minuteElement.innerHTML = minutes : null;
|
505 |
+
secondElement ? secondElement.innerHTML = seconds : null;
|
506 |
+
}
|
507 |
+
|
508 |
+
<?php
|
509 |
+
if ( $countdown_action === 'redirect' || $countdown_action === 'disable-cmp') { ?>
|
510 |
+
if ( distance < 0 ) {
|
511 |
+
clearInterval(timerInt);
|
512 |
+
window.location.reload();
|
513 |
+
}
|
514 |
+
<?php
|
515 |
+
} ?>
|
516 |
+
|
517 |
+
}, 1000);
|
518 |
+
|
519 |
+
});
|
520 |
+
</script>
|
521 |
+
<?php
|
522 |
+
}
|
523 |
+
}
|
524 |
+
|
525 |
$this->cmp_custom_footer_scripts();
|
526 |
|
527 |
do_action('cmp-after-footer-scripts');
|
inc/render/niteothemes-info.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
|
3 |
$html = '
|
4 |
-
<!-- Build by CMP – Coming Soon
|
5 |
<!-- Visit plugin page https://wordpress.org/plugins/cmp-coming-soon-maintenance/ -->
|
6 |
<!-- More CMP Themes on https://niteothemes.com -->';
|
1 |
<?php
|
2 |
|
3 |
$html = '
|
4 |
+
<!-- Build by CMP – Coming Soon Maintenance Plugin by NiteoThemes -->
|
5 |
<!-- Visit plugin page https://wordpress.org/plugins/cmp-coming-soon-maintenance/ -->
|
6 |
<!-- More CMP Themes on https://niteothemes.com -->';
|
inc/render/seo.php
CHANGED
@@ -5,14 +5,19 @@ ob_start();
|
|
5 |
|
6 |
$title = stripslashes( get_option('niteoCS_title', get_bloginfo('name').' Coming soon!') );
|
7 |
$descr = stripslashes( get_option('niteoCS_descr', 'Just another Coming Soon Page') );
|
8 |
-
|
9 |
$seo_img_id = get_option('niteoCS_seo_img_id');
|
10 |
$seo_img_url = wp_get_attachment_image_src($seo_img_id, 'large');
|
11 |
$seo_img_url = isset($seo_img_url[0]) ? $seo_img_url[0] : $this->cmp_get_background_img_for_seo();
|
12 |
?>
|
13 |
<!-- SEO -->
|
14 |
-
|
15 |
-
|
|
|
|
|
|
|
|
|
|
|
16 |
|
17 |
<!-- og meta for facebook, googleplus -->
|
18 |
<meta property="og:title" content="<?php echo esc_html( $title ); ?>"/>
|
@@ -22,7 +27,7 @@ $seo_img_url = isset($seo_img_url[0]) ? $seo_img_url[0] : $this->cmp_get_backgro
|
|
22 |
<meta property="og:image" content="<?php echo esc_url( $seo_img_url );?>"/>
|
23 |
|
24 |
<!-- twitter meta -->
|
25 |
-
<meta name="twitter:card" content="summary_large_image"
|
26 |
<meta name="twitter:title" content="<?php echo esc_html( $title ); ?>"/>
|
27 |
<meta name="twitter:description" content="<?php echo esc_html( $descr ); ?>"/>
|
28 |
<meta name="twitter:url" content="<?php echo get_home_url();?>"/>
|
@@ -41,7 +46,7 @@ if ( $favicon_id && $favicon_id != '' ) {
|
|
41 |
wp_site_icon();
|
42 |
}
|
43 |
|
44 |
-
if (
|
45 |
echo '<meta name="robots" content="noindex,nofollow" />' . PHP_EOL;
|
46 |
}
|
47 |
|
5 |
|
6 |
$title = stripslashes( get_option('niteoCS_title', get_bloginfo('name').' Coming soon!') );
|
7 |
$descr = stripslashes( get_option('niteoCS_descr', 'Just another Coming Soon Page') );
|
8 |
+
$seo_visibility = get_option('niteoCS_seo_visibility', get_option( 'blog_public', '1' ));
|
9 |
$seo_img_id = get_option('niteoCS_seo_img_id');
|
10 |
$seo_img_url = wp_get_attachment_image_src($seo_img_id, 'large');
|
11 |
$seo_img_url = isset($seo_img_url[0]) ? $seo_img_url[0] : $this->cmp_get_background_img_for_seo();
|
12 |
?>
|
13 |
<!-- SEO -->
|
14 |
+
<?php
|
15 |
+
if ( $title !== '' ) {
|
16 |
+
echo '<title>'.esc_html( $title ).'</title>';
|
17 |
+
}
|
18 |
+
if ( $descr !== '' ) {
|
19 |
+
echo '<meta name="description" content="'.esc_attr( $descr ).'"/>';
|
20 |
+
} ?>
|
21 |
|
22 |
<!-- og meta for facebook, googleplus -->
|
23 |
<meta property="og:title" content="<?php echo esc_html( $title ); ?>"/>
|
27 |
<meta property="og:image" content="<?php echo esc_url( $seo_img_url );?>"/>
|
28 |
|
29 |
<!-- twitter meta -->
|
30 |
+
<meta name="twitter:card" content="summary_large_image"/>
|
31 |
<meta name="twitter:title" content="<?php echo esc_html( $title ); ?>"/>
|
32 |
<meta name="twitter:description" content="<?php echo esc_html( $descr ); ?>"/>
|
33 |
<meta name="twitter:url" content="<?php echo get_home_url();?>"/>
|
46 |
wp_site_icon();
|
47 |
}
|
48 |
|
49 |
+
if ( $seo_visibility == '0' ) {
|
50 |
echo '<meta name="robots" content="noindex,nofollow" />' . PHP_EOL;
|
51 |
}
|
52 |
|
inc/settings/settings-counter.php
CHANGED
@@ -91,6 +91,7 @@ $niteoCS_counter_heading = get_option('niteoCS_counter_heading', 'STAY TUNED, W
|
|
91 |
<select name="niteoCS_countdown_action" id="niteoCS_countdown_action" class="counter-action">
|
92 |
|
93 |
<option value="no-action" <?php selected($niteoCS_countdown_action, 'no-action'); ?>><?php _e('No Action', 'cmp-coming-soon-maintenance');?></option>
|
|
|
94 |
<option value="disable-cmp" <?php selected($niteoCS_countdown_action, 'disable-cmp'); ?>><?php _e('Disable Coming Soon / Maintenance page.', 'cmp-coming-soon-maintenance');?></option>
|
95 |
<option value="redirect" <?php selected($niteoCS_countdown_action, 'redirect'); ?>><?php _e('URL Redirect', 'cmp-coming-soon-maintenance');?></option>
|
96 |
|
91 |
<select name="niteoCS_countdown_action" id="niteoCS_countdown_action" class="counter-action">
|
92 |
|
93 |
<option value="no-action" <?php selected($niteoCS_countdown_action, 'no-action'); ?>><?php _e('No Action', 'cmp-coming-soon-maintenance');?></option>
|
94 |
+
<option value="hide" <?php selected($niteoCS_countdown_action, 'hide'); ?>><?php _e('Hide Counter', 'cmp-coming-soon-maintenance');?></option>
|
95 |
<option value="disable-cmp" <?php selected($niteoCS_countdown_action, 'disable-cmp'); ?>><?php _e('Disable Coming Soon / Maintenance page.', 'cmp-coming-soon-maintenance');?></option>
|
96 |
<option value="redirect" <?php selected($niteoCS_countdown_action, 'redirect'); ?>><?php _e('URL Redirect', 'cmp-coming-soon-maintenance');?></option>
|
97 |
|
niteo-cmp.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: CMP - Coming Soon & Maintenance Plugin
|
4 |
Plugin URI: https://wordpress.org/plugins/cmp-coming-soon-maintenance/
|
5 |
Description: Display customizable landing page for Coming Soon, Maintenance & Under Construction page.
|
6 |
-
Version: 3.7.
|
7 |
Author: NiteoThemes
|
8 |
Author URI: https://www.niteothemes.com
|
9 |
Text Domain: cmp-coming-soon-maintenance
|
@@ -61,12 +61,9 @@ if ( ! class_exists( 'CMP_Coming_Soon_and_Maintenance' ) ) :
|
|
61 |
return self::$instance;
|
62 |
}
|
63 |
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
// define constants
|
68 |
private function constants() {
|
69 |
-
$this->define( 'CMP_VERSION', '3.7.
|
70 |
$this->define( 'CMP_DEBUG', FALSE );
|
71 |
$this->define( 'CMP_AUTHOR', 'NiteoThemes' );
|
72 |
$this->define( 'CMP_AUTHOR_HOMEPAGE', 'https://niteothemes.com' );
|
@@ -83,6 +80,7 @@ if ( ! class_exists( 'CMP_Coming_Soon_and_Maintenance' ) ) :
|
|
83 |
* Inits and hooks
|
84 |
*/
|
85 |
public function init() {
|
|
|
86 |
add_action( 'template_redirect', array( $this, 'cmp_displayPage' ), 1 );
|
87 |
add_action( 'admin_init', array( $this, 'cmp_adminInit' ) ) ;
|
88 |
add_action( 'admin_init', array( $this, 'cmp_update_process' ), 0 );
|
@@ -91,6 +89,7 @@ if ( ! class_exists( 'CMP_Coming_Soon_and_Maintenance' ) ) :
|
|
91 |
add_action( 'wp_before_admin_bar_render', array( $this, 'cmp_admin_bar' ) );
|
92 |
add_action( 'admin_enqueue_scripts', array( $this,'cmp_add_topbar_scripts' ) );
|
93 |
add_action( 'admin_enqueue_scripts', array( $this,'cmp_add_admin_style' ) );
|
|
|
94 |
add_action( 'wp_ajax_cmp_get_post_detail', array( $this, 'cmp_get_post_detail' ) );
|
95 |
add_action( 'wp_ajax_nopriv_cmp_get_post_detail', array( $this, 'cmp_get_post_detail' ) );
|
96 |
add_action( 'wp_ajax_cmp_check_update', array( $this, 'cmp_check_update' ) );
|
@@ -106,7 +105,7 @@ if ( ! class_exists( 'CMP_Coming_Soon_and_Maintenance' ) ) :
|
|
106 |
add_action( 'wp_ajax_cmp_ajax_upload_font', array( $this, 'cmp_ajax_upload_font' ) );
|
107 |
add_action( 'wp_ajax_cmp_ajax_export_settings', array( $this, 'cmp_ajax_export_settings' ) );
|
108 |
add_action( 'wp_ajax_cmp_ajax_import_settings', array( $this, 'cmp_ajax_import_settings' ) );
|
109 |
-
add_action( '
|
110 |
|
111 |
add_filter('upload_mimes', array( $this, 'cmp_allow_font_mimes' ));
|
112 |
add_filter( 'plugin_action_links_' . plugin_basename(__FILE__), array( $this,'add_action_links' ) );
|
@@ -145,17 +144,16 @@ if ( ! class_exists( 'CMP_Coming_Soon_and_Maintenance' ) ) :
|
|
145 |
$this->render_settings = new cmp_render_settings();
|
146 |
|
147 |
wp_register_style( 'cmp-style', plugins_url('/css/cmp-settings-style'.CMP_ASSET_SUFFIX.'.css', __FILE__),'', CMP_VERSION );
|
148 |
-
wp_register_style( 'cmp-menu-logo', plugins_url('/css/cmp-menu-logo.css', __FILE__),'', CMP_VERSION );
|
149 |
wp_register_style( 'font-awesome', plugins_url('/css/font-awesome.min.css', __FILE__) );
|
150 |
wp_register_style( 'countdown_flatpicker_css', plugins_url('/css/flatpickr.min.css', __FILE__) );
|
151 |
wp_register_style( 'animate-css', plugins_url('/css/animate'.CMP_ASSET_SUFFIX.'.css', __FILE__) );
|
152 |
-
|
153 |
wp_register_script( 'webfont', 'https://ajax.googleapis.com/ajax/libs/webfont/1.6.26/webfont.js', array(), '1.6.26', true );
|
154 |
wp_register_script( 'cmp-select2-js', plugins_url('/js/external/select2.min.js', __FILE__) );
|
155 |
wp_register_script( 'cmp-typography', plugins_url('/js/typography'.CMP_ASSET_SUFFIX.'.js', __FILE__), array('cmp-select2-js' ), CMP_VERSION );
|
156 |
wp_register_script( 'cmp_settings_js', plugins_url('/js/settings'.CMP_ASSET_SUFFIX.'.js', __FILE__), array('webfont', 'cmp-select2-js'), CMP_VERSION );
|
157 |
wp_register_script( 'cmp_advanced_js', plugins_url('/js/cmp-advanced'.CMP_ASSET_SUFFIX.'.js', __FILE__), array(), CMP_VERSION );
|
158 |
wp_register_script( 'countdown_flatpicker_js', plugins_url('/js/external/flatpickr.min.js', __FILE__) );
|
|
|
159 |
}
|
160 |
|
161 |
}
|
@@ -224,6 +222,16 @@ if ( ! class_exists( 'CMP_Coming_Soon_and_Maintenance' ) ) :
|
|
224 |
public function cmp_overlay_text_themes() {
|
225 |
return array( 'agency' );
|
226 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
227 |
|
228 |
/**
|
229 |
* returns array list of premium themes => manually defined
|
@@ -234,8 +242,10 @@ if ( ! class_exists( 'CMP_Coming_Soon_and_Maintenance' ) ) :
|
|
234 |
|
235 |
$premium_themes = array();
|
236 |
array_push( $premium_themes, array('name' => 'mercury', 'url' => 'https://niteothemes.com/downloads/cmp-mercury-theme/?utm_source=cmp&utm_medium=referral&utm_campaign=mercury', 'price' => '10') );
|
|
|
237 |
array_push( $premium_themes, array('name' => 'fifty', 'url' => 'https://niteothemes.com/downloads/cmp-fifty-theme/?utm_source=cmp&utm_medium=referral&utm_campaign=fifty', 'price' => '10') );
|
238 |
array_push( $premium_themes, array('name' => 'delta', 'url' => 'https://niteothemes.com/downloads/cmp-delta-theme/?utm_source=cmp&utm_medium=referral&utm_campaign=delta', 'price' => '10') );
|
|
|
239 |
array_push( $premium_themes, array('name' => 'libra', 'url' => 'https://niteothemes.com/downloads/cmp-libra-theme/?utm_source=cmp&utm_medium=referral&utm_campaign=libra', 'price' => '10') );
|
240 |
array_push( $premium_themes, array('name' => 'timex', 'url' => 'https://niteothemes.com/downloads/cmp-timex-theme/?utm_source=cmp&utm_medium=referral&utm_campaign=timex', 'price' => '15') );
|
241 |
array_push( $premium_themes, array('name' => 'divi', 'url' => 'https://niteothemes.com/downloads/cmp-divi-addon/?utm_source=cmp&utm_medium=referral&utm_campaign=divi', 'price' => '29') );
|
@@ -307,10 +317,10 @@ if ( ! class_exists( 'CMP_Coming_Soon_and_Maintenance' ) ) :
|
|
307 |
// push WP administrator to roles array, since it is default
|
308 |
array_push( $roles_topbar, 'administrator' );
|
309 |
|
310 |
-
// get current user
|
311 |
-
$current_user = wp_get_current_user();
|
312 |
|
313 |
|
|
|
|
|
314 |
// check for roles array length
|
315 |
if ( count( $current_user->roles ) > 0 ) {
|
316 |
// enqueue topbar script and style only, if current user is allowed to display topbar, or is admin
|
@@ -342,8 +352,6 @@ if ( ! class_exists( 'CMP_Coming_Soon_and_Maintenance' ) ) :
|
|
342 |
return;
|
343 |
}
|
344 |
|
345 |
-
wp_enqueue_style( 'cmp-menu-logo' );
|
346 |
-
|
347 |
$prefix = sanitize_title( __( 'CMP Settings', 'cmp-coming-soon-maintenance' ) );
|
348 |
|
349 |
$cmp_pages = array(
|
@@ -426,6 +434,16 @@ if ( ! class_exists( 'CMP_Coming_Soon_and_Maintenance' ) ) :
|
|
426 |
}
|
427 |
}
|
428 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
429 |
/**
|
430 |
* Render CMP Settings Page
|
431 |
*/
|
@@ -607,6 +625,9 @@ if ( ! class_exists( 'CMP_Coming_Soon_and_Maintenance' ) ) :
|
|
607 |
case 'no-action':
|
608 |
$message = __('Counter expired but it is set to make no action - you should login to your Wordpress Admin and adjust the expired timer or disable Coming Soon / Maintenance Mode.', 'cmp-coming-soon-maintenance');
|
609 |
break;
|
|
|
|
|
|
|
610 |
|
611 |
case 'disable-cmp':
|
612 |
$message = __('Counter expired and Coming soon / Maintanance mode was disabled.', 'cmp-coming-soon-maintenance');
|
@@ -616,13 +637,14 @@ if ( ! class_exists( 'CMP_Coming_Soon_and_Maintenance' ) ) :
|
|
616 |
$message = __('Counter expired and your Website is redirected to external URL per settings.', 'cmp-coming-soon-maintenance');
|
617 |
break;
|
618 |
|
619 |
-
|
|
|
620 |
break;
|
621 |
}
|
622 |
|
623 |
$to = get_option('niteoCS_countdown_email_address', get_option( 'admin_email' ));
|
624 |
$subject = 'Countdown timer just expired on your Coming Soon Page - ' . get_site_url();
|
625 |
-
$body = $message . ' This is auto generated message from CMP - Coming Soon & Maintenance Plugin.
|
626 |
$headers = array('Content-Type: text/plain; charset=UTF-8');
|
627 |
// send email
|
628 |
wp_mail( $to, $subject, $body, $headers );
|
@@ -780,7 +802,7 @@ if ( ! class_exists( 'CMP_Coming_Soon_and_Maintenance' ) ) :
|
|
780 |
|
781 |
$class = '';
|
782 |
$msg = '';
|
783 |
-
$icon = '<img src="'.plugins_url('/img/cmp.png', __FILE__).'" alt="CMP Logo" class="cmp-logo" style="max-
|
784 |
|
785 |
$topbar_version = get_option('niteoCS_topbar_version', 'cmp-topbar-full');
|
786 |
|
@@ -1640,7 +1662,7 @@ if ( ! class_exists( 'CMP_Coming_Soon_and_Maintenance' ) ) :
|
|
1640 |
if ( isset($_GET['page']) && ($_GET['page'] == 'cmp-settings' || $_GET['page'] == 'cmp-translate' || $_GET['page'] == 'cmp-advanced') ) {
|
1641 |
if (isset($_GET['status']) && $_GET['status'] == 'settings-saved') {
|
1642 |
$status = 'success';
|
1643 |
-
$message = __('CMP Settings Saved', 'cmp-coming-soon-maintenance');
|
1644 |
|
1645 |
echo '<div class="notice notice-'.$status.' is-dismissible"><p>'.$message.'.</p></div>';
|
1646 |
}
|
@@ -1797,13 +1819,12 @@ if ( ! class_exists( 'CMP_Coming_Soon_and_Maintenance' ) ) :
|
|
1797 |
}
|
1798 |
}
|
1799 |
|
1800 |
-
public function cmp_get_pages() {
|
1801 |
$page_titles = array();
|
1802 |
$pages = array();
|
1803 |
-
|
1804 |
$published = get_pages(
|
1805 |
array (
|
1806 |
-
'post_status' =>
|
1807 |
)
|
1808 |
);
|
1809 |
|
@@ -2176,6 +2197,7 @@ if ( ! class_exists( 'CMP_Coming_Soon_and_Maintenance' ) ) :
|
|
2176 |
public function cmp_get_background_img_for_seo() {
|
2177 |
|
2178 |
$themeslug = $this->cmp_selectedTheme();
|
|
|
2179 |
|
2180 |
$background_type = get_option('niteoCS_banner', '2');
|
2181 |
|
@@ -2739,6 +2761,16 @@ if ( ! class_exists( 'CMP_Coming_Soon_and_Maintenance' ) ) :
|
|
2739 |
|
2740 |
return;
|
2741 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2742 |
}
|
2743 |
|
2744 |
|
3 |
Plugin Name: CMP - Coming Soon & Maintenance Plugin
|
4 |
Plugin URI: https://wordpress.org/plugins/cmp-coming-soon-maintenance/
|
5 |
Description: Display customizable landing page for Coming Soon, Maintenance & Under Construction page.
|
6 |
+
Version: 3.7.3
|
7 |
Author: NiteoThemes
|
8 |
Author URI: https://www.niteothemes.com
|
9 |
Text Domain: cmp-coming-soon-maintenance
|
61 |
return self::$instance;
|
62 |
}
|
63 |
|
|
|
|
|
|
|
64 |
// define constants
|
65 |
private function constants() {
|
66 |
+
$this->define( 'CMP_VERSION', '3.7.3' );
|
67 |
$this->define( 'CMP_DEBUG', FALSE );
|
68 |
$this->define( 'CMP_AUTHOR', 'NiteoThemes' );
|
69 |
$this->define( 'CMP_AUTHOR_HOMEPAGE', 'https://niteothemes.com' );
|
80 |
* Inits and hooks
|
81 |
*/
|
82 |
public function init() {
|
83 |
+
do_action( 'cmp_plugin_loaded');
|
84 |
add_action( 'template_redirect', array( $this, 'cmp_displayPage' ), 1 );
|
85 |
add_action( 'admin_init', array( $this, 'cmp_adminInit' ) ) ;
|
86 |
add_action( 'admin_init', array( $this, 'cmp_update_process' ), 0 );
|
89 |
add_action( 'wp_before_admin_bar_render', array( $this, 'cmp_admin_bar' ) );
|
90 |
add_action( 'admin_enqueue_scripts', array( $this,'cmp_add_topbar_scripts' ) );
|
91 |
add_action( 'admin_enqueue_scripts', array( $this,'cmp_add_admin_style' ) );
|
92 |
+
add_action( 'wp_enqueue_scripts', array( $this,'cmp_add_topbar_scripts' ) );
|
93 |
add_action( 'wp_ajax_cmp_get_post_detail', array( $this, 'cmp_get_post_detail' ) );
|
94 |
add_action( 'wp_ajax_nopriv_cmp_get_post_detail', array( $this, 'cmp_get_post_detail' ) );
|
95 |
add_action( 'wp_ajax_cmp_check_update', array( $this, 'cmp_check_update' ) );
|
105 |
add_action( 'wp_ajax_cmp_ajax_upload_font', array( $this, 'cmp_ajax_upload_font' ) );
|
106 |
add_action( 'wp_ajax_cmp_ajax_export_settings', array( $this, 'cmp_ajax_export_settings' ) );
|
107 |
add_action( 'wp_ajax_cmp_ajax_import_settings', array( $this, 'cmp_ajax_import_settings' ) );
|
108 |
+
add_action( 'admin_head', array( $this,'cmp_admin_css') );
|
109 |
|
110 |
add_filter('upload_mimes', array( $this, 'cmp_allow_font_mimes' ));
|
111 |
add_filter( 'plugin_action_links_' . plugin_basename(__FILE__), array( $this,'add_action_links' ) );
|
144 |
$this->render_settings = new cmp_render_settings();
|
145 |
|
146 |
wp_register_style( 'cmp-style', plugins_url('/css/cmp-settings-style'.CMP_ASSET_SUFFIX.'.css', __FILE__),'', CMP_VERSION );
|
|
|
147 |
wp_register_style( 'font-awesome', plugins_url('/css/font-awesome.min.css', __FILE__) );
|
148 |
wp_register_style( 'countdown_flatpicker_css', plugins_url('/css/flatpickr.min.css', __FILE__) );
|
149 |
wp_register_style( 'animate-css', plugins_url('/css/animate'.CMP_ASSET_SUFFIX.'.css', __FILE__) );
|
|
|
150 |
wp_register_script( 'webfont', 'https://ajax.googleapis.com/ajax/libs/webfont/1.6.26/webfont.js', array(), '1.6.26', true );
|
151 |
wp_register_script( 'cmp-select2-js', plugins_url('/js/external/select2.min.js', __FILE__) );
|
152 |
wp_register_script( 'cmp-typography', plugins_url('/js/typography'.CMP_ASSET_SUFFIX.'.js', __FILE__), array('cmp-select2-js' ), CMP_VERSION );
|
153 |
wp_register_script( 'cmp_settings_js', plugins_url('/js/settings'.CMP_ASSET_SUFFIX.'.js', __FILE__), array('webfont', 'cmp-select2-js'), CMP_VERSION );
|
154 |
wp_register_script( 'cmp_advanced_js', plugins_url('/js/cmp-advanced'.CMP_ASSET_SUFFIX.'.js', __FILE__), array(), CMP_VERSION );
|
155 |
wp_register_script( 'countdown_flatpicker_js', plugins_url('/js/external/flatpickr.min.js', __FILE__) );
|
156 |
+
|
157 |
}
|
158 |
|
159 |
}
|
222 |
public function cmp_overlay_text_themes() {
|
223 |
return array( 'agency' );
|
224 |
}
|
225 |
+
|
226 |
+
/**
|
227 |
+
* Define CMP themes supporting 3rd party page builders
|
228 |
+
*
|
229 |
+
* @since 3.7.3
|
230 |
+
* @return array
|
231 |
+
*/
|
232 |
+
public function cmp_builder_themes() {
|
233 |
+
return array( 'divi', 'elementor' );
|
234 |
+
}
|
235 |
|
236 |
/**
|
237 |
* returns array list of premium themes => manually defined
|
242 |
|
243 |
$premium_themes = array();
|
244 |
array_push( $premium_themes, array('name' => 'mercury', 'url' => 'https://niteothemes.com/downloads/cmp-mercury-theme/?utm_source=cmp&utm_medium=referral&utm_campaign=mercury', 'price' => '10') );
|
245 |
+
array_push( $premium_themes, array('name' => 'divi', 'url' => 'https://niteothemes.com/downloads/cmp-divi-addon/?utm_source=cmp&utm_medium=referral&utm_campaign=divi', 'price' => '29') );
|
246 |
array_push( $premium_themes, array('name' => 'fifty', 'url' => 'https://niteothemes.com/downloads/cmp-fifty-theme/?utm_source=cmp&utm_medium=referral&utm_campaign=fifty', 'price' => '10') );
|
247 |
array_push( $premium_themes, array('name' => 'delta', 'url' => 'https://niteothemes.com/downloads/cmp-delta-theme/?utm_source=cmp&utm_medium=referral&utm_campaign=delta', 'price' => '10') );
|
248 |
+
array_push( $premium_themes, array('name' => 'elementor', 'url' => 'https://niteothemes.com/downloads/cmp-elementor-addon/?utm_source=cmp&utm_medium=referral&utm_campaign=elementor', 'price' => '29') );
|
249 |
array_push( $premium_themes, array('name' => 'libra', 'url' => 'https://niteothemes.com/downloads/cmp-libra-theme/?utm_source=cmp&utm_medium=referral&utm_campaign=libra', 'price' => '10') );
|
250 |
array_push( $premium_themes, array('name' => 'timex', 'url' => 'https://niteothemes.com/downloads/cmp-timex-theme/?utm_source=cmp&utm_medium=referral&utm_campaign=timex', 'price' => '15') );
|
251 |
array_push( $premium_themes, array('name' => 'divi', 'url' => 'https://niteothemes.com/downloads/cmp-divi-addon/?utm_source=cmp&utm_medium=referral&utm_campaign=divi', 'price' => '29') );
|
317 |
// push WP administrator to roles array, since it is default
|
318 |
array_push( $roles_topbar, 'administrator' );
|
319 |
|
|
|
|
|
320 |
|
321 |
|
322 |
+
// get current user
|
323 |
+
$current_user = wp_get_current_user();
|
324 |
// check for roles array length
|
325 |
if ( count( $current_user->roles ) > 0 ) {
|
326 |
// enqueue topbar script and style only, if current user is allowed to display topbar, or is admin
|
352 |
return;
|
353 |
}
|
354 |
|
|
|
|
|
355 |
$prefix = sanitize_title( __( 'CMP Settings', 'cmp-coming-soon-maintenance' ) );
|
356 |
|
357 |
$cmp_pages = array(
|
434 |
}
|
435 |
}
|
436 |
|
437 |
+
function cmp_admin_css() { ?>
|
438 |
+
<style type="text/css" media="screen">
|
439 |
+
#toplevel_page_cmp-settings img {
|
440 |
+
max-width: 20px!important;
|
441 |
+
padding-top: 6px!important;
|
442 |
+
}
|
443 |
+
</style>
|
444 |
+
<?php
|
445 |
+
}
|
446 |
+
|
447 |
/**
|
448 |
* Render CMP Settings Page
|
449 |
*/
|
625 |
case 'no-action':
|
626 |
$message = __('Counter expired but it is set to make no action - you should login to your Wordpress Admin and adjust the expired timer or disable Coming Soon / Maintenance Mode.', 'cmp-coming-soon-maintenance');
|
627 |
break;
|
628 |
+
case 'hide':
|
629 |
+
$message = __('Counter expired and and it is hidden on your website per settings..', 'cmp-coming-soon-maintenance');
|
630 |
+
break;
|
631 |
|
632 |
case 'disable-cmp':
|
633 |
$message = __('Counter expired and Coming soon / Maintanance mode was disabled.', 'cmp-coming-soon-maintenance');
|
637 |
$message = __('Counter expired and your Website is redirected to external URL per settings.', 'cmp-coming-soon-maintenance');
|
638 |
break;
|
639 |
|
640 |
+
default:
|
641 |
+
$message = '';
|
642 |
break;
|
643 |
}
|
644 |
|
645 |
$to = get_option('niteoCS_countdown_email_address', get_option( 'admin_email' ));
|
646 |
$subject = 'Countdown timer just expired on your Coming Soon Page - ' . get_site_url();
|
647 |
+
$body = $message . ' This is auto generated message from CMP - Coming Soon & Maintenance Plugin installed on ' . get_site_url();
|
648 |
$headers = array('Content-Type: text/plain; charset=UTF-8');
|
649 |
// send email
|
650 |
wp_mail( $to, $subject, $body, $headers );
|
802 |
|
803 |
$class = '';
|
804 |
$msg = '';
|
805 |
+
$icon = '<img src="'.plugins_url('/img/cmp.png', __FILE__).'" alt="CMP Logo" class="cmp-logo" style="max-width:20px;">';
|
806 |
|
807 |
$topbar_version = get_option('niteoCS_topbar_version', 'cmp-topbar-full');
|
808 |
|
1662 |
if ( isset($_GET['page']) && ($_GET['page'] == 'cmp-settings' || $_GET['page'] == 'cmp-translate' || $_GET['page'] == 'cmp-advanced') ) {
|
1663 |
if (isset($_GET['status']) && $_GET['status'] == 'settings-saved') {
|
1664 |
$status = 'success';
|
1665 |
+
$message = __('CMP Settings Saved', 'cmp-coming-soon-maintenance');
|
1666 |
|
1667 |
echo '<div class="notice notice-'.$status.' is-dismissible"><p>'.$message.'.</p></div>';
|
1668 |
}
|
1819 |
}
|
1820 |
}
|
1821 |
|
1822 |
+
public function cmp_get_pages( $post_status = 'publish,draft') {
|
1823 |
$page_titles = array();
|
1824 |
$pages = array();
|
|
|
1825 |
$published = get_pages(
|
1826 |
array (
|
1827 |
+
'post_status' => $post_status,
|
1828 |
)
|
1829 |
);
|
1830 |
|
2197 |
public function cmp_get_background_img_for_seo() {
|
2198 |
|
2199 |
$themeslug = $this->cmp_selectedTheme();
|
2200 |
+
$default_img = '';
|
2201 |
|
2202 |
$background_type = get_option('niteoCS_banner', '2');
|
2203 |
|
2761 |
|
2762 |
return;
|
2763 |
}
|
2764 |
+
|
2765 |
+
/**
|
2766 |
+
* Display Admin notices
|
2767 |
+
*
|
2768 |
+
* @since 3.7.3
|
2769 |
+
*/
|
2770 |
+
public function cmp_display_admin_notice( $type, $dismisable, $message ) {
|
2771 |
+
|
2772 |
+
echo '<div class="notice notice-'.$type.' '.$dismisable.'"><p class="message">'.$message.'</p></div>';
|
2773 |
+
}
|
2774 |
}
|
2775 |
|
2776 |
|
readme.txt
CHANGED
@@ -5,7 +5,7 @@ Tags: coming soon, landing page, launch page, maintenance mode, under constructi
|
|
5 |
Requires at least: 3.0
|
6 |
Requires PHP: 5.6
|
7 |
Tested up to: 5.4
|
8 |
-
Stable tag: 3.7.
|
9 |
License: GPLv2 or later
|
10 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
@@ -151,6 +151,11 @@ https://www.youtube.com/watch?v=uxuJfHzwdtE
|
|
151 |
<p>Nothing is better than a good feedback! Please go to <a href="https://wordpress.org/support/plugin/cmp-coming-soon-maintenance/reviews/">Plugin reviews</a> and rate it! Alternatively you can click on a Donate button too!:)</p>
|
152 |
|
153 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
154 |
<h4>CMP 3.7.2.1 - 29-Mar-20</h4>
|
155 |
<ul>
|
156 |
<li>Bug fix to repair niteothemes.com licensing server.</li>
|
5 |
Requires at least: 3.0
|
6 |
Requires PHP: 5.6
|
7 |
Tested up to: 5.4
|
8 |
+
Stable tag: 3.7.3
|
9 |
License: GPLv2 or later
|
10 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
151 |
<p>Nothing is better than a good feedback! Please go to <a href="https://wordpress.org/support/plugin/cmp-coming-soon-maintenance/reviews/">Plugin reviews</a> and rate it! Alternatively you can click on a Donate button too!:)</p>
|
152 |
|
153 |
== Changelog ==
|
154 |
+
<h4>CMP 3.7.3 - 08-April-20</h4>
|
155 |
+
<ul>
|
156 |
+
<li>CMP Elementor Add-on released.</li>
|
157 |
+
<li>New Countdown action: Hide Counter</li>
|
158 |
+
</ul>
|
159 |
<h4>CMP 3.7.2.1 - 29-Mar-20</h4>
|
160 |
<ul>
|
161 |
<li>Bug fix to repair niteothemes.com licensing server.</li>
|
themes/countdown/countdown-defaults.php
CHANGED
@@ -5,6 +5,7 @@ $theme_supports = array(
|
|
5 |
'logo' => true,
|
6 |
'slider' => false,
|
7 |
'counter' => true,
|
|
|
8 |
'subscribe' => true,
|
9 |
'social' => true,
|
10 |
'footer' => true,
|
5 |
'logo' => true,
|
6 |
'slider' => false,
|
7 |
'counter' => true,
|
8 |
+
'counter_script' => true,
|
9 |
'subscribe' => true,
|
10 |
'social' => true,
|
11 |
'footer' => true,
|
themes/countdown/countdown-theme.php
CHANGED
@@ -213,65 +213,8 @@
|
|
213 |
</div>
|
214 |
|
215 |
<?php
|
216 |
-
if ( $niteoCS_counter == '1') { ?>
|
217 |
-
<script>
|
218 |
-
// Set the date we're counting down to
|
219 |
-
var counter = document.getElementById('counter');
|
220 |
-
var unixtime = counter.getAttribute('data-date');
|
221 |
-
var date = new Date(unixtime*1000);
|
222 |
-
var countDownDate = new Date(date).getTime();
|
223 |
-
|
224 |
-
// Update the count down every 1 second
|
225 |
-
var x = setInterval(function() {
|
226 |
-
|
227 |
-
// Get todays date and time
|
228 |
-
var now = new Date().getTime();
|
229 |
-
|
230 |
-
// Find the distance between now an the count down date
|
231 |
-
var distance = countDownDate - now;
|
232 |
-
|
233 |
-
// Time calculations for days, hours, minutes and seconds
|
234 |
-
var days = Math.floor(distance / (1000 * 60 * 60 * 24));
|
235 |
-
var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
|
236 |
-
var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
|
237 |
-
var seconds = Math.floor((distance % (1000 * 60)) / 1000);
|
238 |
-
|
239 |
-
if (days < 10) {
|
240 |
-
days = '0' + days;
|
241 |
-
}
|
242 |
-
if (hours < 10) {
|
243 |
-
hours = '0' + hours;
|
244 |
-
}
|
245 |
-
if (minutes < 10) {
|
246 |
-
minutes = '0' + minutes;
|
247 |
-
}
|
248 |
-
if (seconds < 10) {
|
249 |
-
seconds = '0' + seconds;
|
250 |
-
}
|
251 |
-
if (distance >= 0) {
|
252 |
-
document.getElementById('counter-day').innerHTML = days;
|
253 |
-
document.getElementById('counter-hour').innerHTML = hours;
|
254 |
-
document.getElementById('counter-minute').innerHTML = minutes;
|
255 |
-
document.getElementById('counter-second').innerHTML = seconds;
|
256 |
-
}
|
257 |
-
|
258 |
-
<?php
|
259 |
-
if ( $countdown_action != 'no-action' && $countdown_action != 'display-text') { ?>
|
260 |
-
|
261 |
-
// If the count down is over, write some text
|
262 |
-
if (distance < 0) {
|
263 |
-
clearInterval(x);
|
264 |
-
window.location.reload();
|
265 |
-
}
|
266 |
-
<?php
|
267 |
-
} ?>
|
268 |
-
|
269 |
-
}, 1000);
|
270 |
-
</script>
|
271 |
-
<?php
|
272 |
-
}
|
273 |
|
274 |
-
//
|
275 |
if ( method_exists ( $html, 'cmp_javascripts' ) ) {
|
276 |
$html->cmp_javascripts( $banner_type, $themeslug );
|
277 |
} ?>
|
213 |
</div>
|
214 |
|
215 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
216 |
|
217 |
+
// rener footer javascripts
|
218 |
if ( method_exists ( $html, 'cmp_javascripts' ) ) {
|
219 |
$html->cmp_javascripts( $banner_type, $themeslug );
|
220 |
} ?>
|
themes/divi.txt
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
/*
|
2 |
-
Theme Name: Divi
|
3 |
Description: <p>CMP Divi is the integration bridge between CMP Coming Soon Plugin and Divi theme builder. You can build any page by Divi and use it as a coming soon/maintenance page in CMP plugin. We built a custom Countdown Divi Module with great features and design! Also all CMP functionality is working - get power of CMP Plugin with Divi to build your custom great Coming Soon or Maintenance pages!</p>
|
1 |
/*
|
2 |
+
Theme Name: CMP Divi
|
3 |
Description: <p>CMP Divi is the integration bridge between CMP Coming Soon Plugin and Divi theme builder. You can build any page by Divi and use it as a coming soon/maintenance page in CMP plugin. We built a custom Countdown Divi Module with great features and design! Also all CMP functionality is working - get power of CMP Plugin with Divi to build your custom great Coming Soon or Maintenance pages!</p>
|
themes/elementor.txt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
Theme Name: CMP Elementor
|
3 |
+
Description: <p>CMP Elementor Add-on seamlessly integrates CMP Coming Soon & Maintenance Plugin and Elementor plugin.</p><p>You can build any page by Elementor or Elementor Pro and use it as your Coming soon or Maintenance landing page with CMP plugin.!</p>
|