CMP – Coming Soon & Maintenance Plugin by NiteoThemes - Version 3.7.9

Version Description

Download this release

Release Info

Developer niteo
Plugin Icon 128x128 CMP – Coming Soon & Maintenance Plugin by NiteoThemes
Version 3.7.9
Comparing to
See all releases

Code changes from version 3.7.8 to 3.7.9

cmp-settings.php CHANGED
@@ -685,7 +685,7 @@ add_thickbox();
685
  }
686
 
687
  // Language Switcher
688
- if ( function_exists('icl_register_string') && file_exists(dirname(__FILE__) . '/inc/settings/settings-lang-switcher.php' ) ) {
689
  require ( dirname(__FILE__) . '/inc/settings/settings-lang-switcher.php' );
690
  } else if ( file_exists(dirname(__FILE__) . '/inc/settings/settings-lang-switcher-disabled.php' ) ) {
691
  require ( dirname(__FILE__) . '/inc/settings/settings-lang-switcher-disabled.php' );
685
  }
686
 
687
  // Language Switcher
688
+ if ( $this->translation_active() && file_exists(dirname(__FILE__) . '/inc/settings/settings-lang-switcher.php' ) ) {
689
  require ( dirname(__FILE__) . '/inc/settings/settings-lang-switcher.php' );
690
  } else if ( file_exists(dirname(__FILE__) . '/inc/settings/settings-lang-switcher-disabled.php' ) ) {
691
  require ( dirname(__FILE__) . '/inc/settings/settings-lang-switcher-disabled.php' );
inc/class-cmp-render_html.php CHANGED
@@ -239,7 +239,7 @@ class CMP_Coming_Soon_and_Maintenance_Render_HTML extends CMP_Coming_Soon_and_Ma
239
  **/
240
  public function cmp_render_lang_switcher() {
241
  $html = false;
242
- if ( get_option('niteoCS_lang_switcher', '1') == '1' && function_exists('icl_register_string') ) {
243
  include dirname( __FILE__) . '/render/language-switcher.php';
244
  }
245
  return $html;
239
  **/
240
  public function cmp_render_lang_switcher() {
241
  $html = false;
242
+ if ( get_option('niteoCS_lang_switcher', '1') == '1' && function_exists('icl_register_string') || defined( 'ICL_SITEPRESS_VERSION' )) {
243
  include dirname( __FILE__) . '/render/language-switcher.php';
244
  }
245
  return $html;
inc/render/enqueue-styles.php CHANGED
@@ -21,6 +21,6 @@ if ( $fa === true ) {
21
  echo '<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" >' . PHP_EOL;
22
  }
23
 
24
- if ( get_option('niteoCS_lang_switcher', '1') == '1' && function_exists('icl_register_string') ) {
25
  echo '<link href="' . esc_url( CMP_PLUGIN_URL . 'css/lang-switcher.css' ). '" rel="stylesheet">' . PHP_EOL;
26
  }
21
  echo '<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" >' . PHP_EOL;
22
  }
23
 
24
+ if ( get_option('niteoCS_lang_switcher', '1') == '1' && $this->translation_active() ) {
25
  echo '<link href="' . esc_url( CMP_PLUGIN_URL . 'css/lang-switcher.css' ). '" rel="stylesheet">' . PHP_EOL;
26
  }
inc/render/language-switcher.php CHANGED
@@ -6,7 +6,7 @@ $display_text = get_option('niteoCS_lang_switcher[text]', '1');
6
  $current_lang_slug = $this->cmp_get_current_lang( 'slug' );
7
  $current_lang_name = $this->cmp_get_current_lang( 'name' );
8
  $class = !$display_flag || !$display_text ? ' no-padding-left' : '';
9
-
10
  if ( function_exists('pll_the_languages') ) {
11
  $translations = pll_the_languages( array( 'raw' => 1 ) );
12
  $flag = pathinfo($translations[$current_lang_slug]['flag']);
6
  $current_lang_slug = $this->cmp_get_current_lang( 'slug' );
7
  $current_lang_name = $this->cmp_get_current_lang( 'name' );
8
  $class = !$display_flag || !$display_text ? ' no-padding-left' : '';
9
+ // var_dump($current_lang_slug);
10
  if ( function_exists('pll_the_languages') ) {
11
  $translations = pll_the_languages( array( 'raw' => 1 ) );
12
  $flag = pathinfo($translations[$current_lang_slug]['flag']);
inc/render/seo.php CHANGED
@@ -2,8 +2,9 @@
2
 
3
  ob_start();
4
 
5
- $title = stripslashes( get_option('niteoCS_title', get_bloginfo('name').' Coming soon!') );
6
- $descr = stripslashes( get_option('niteoCS_descr', 'Just another Coming Soon Page') );
 
7
  $seo_visibility = get_option('niteoCS_seo_visibility', get_option( 'blog_public', '1' ));
8
  $seo_img_id = get_option('niteoCS_seo_img_id');
9
  $seo_img_url = wp_get_attachment_image_src($seo_img_id, 'large');
2
 
3
  ob_start();
4
 
5
+ $title = $this->cmp_wpml_translate_string( stripslashes( get_option('niteoCS_title', get_bloginfo('name').' Coming soon!') ), 'SEO Title' );
6
+ $descr = $this->cmp_wpml_translate_string( stripslashes( get_option('niteoCS_descr', 'Just Another Coming Soon Page') ), 'SEO Description' );
7
+
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');
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.8
7
  Author: NiteoThemes
8
  Author URI: https://www.niteothemes.com
9
  Text Domain: cmp-coming-soon-maintenance
@@ -63,7 +63,7 @@ if ( ! class_exists( 'CMP_Coming_Soon_and_Maintenance' ) ) :
63
 
64
  // define constants
65
  private function constants() {
66
- $this->define( 'CMP_VERSION', '3.7.8' );
67
  $this->define( 'CMP_DEBUG', FALSE );
68
  $this->define( 'CMP_AUTHOR', 'NiteoThemes' );
69
  $this->define( 'CMP_AUTHOR_HOMEPAGE', 'https://niteothemes.com' );
@@ -207,28 +207,31 @@ if ( ! class_exists( 'CMP_Coming_Soon_and_Maintenance' ) ) :
207
  */
208
  public function cmp_register_wpml_strings() {
209
 
210
- if ( function_exists('icl_register_string') ) {
 
211
  $themeslug = $this->cmp_selectedTheme();
212
  $translation = json_decode( get_option('niteoCS_translation'), true );
213
  $overlay_status = get_option('niteoCS_overlay_text[status]', '0');
214
 
215
- icl_register_string( 'CMP - Coming Soon & Maintenance', 'Title', stripslashes( get_option('niteoCS_body_title', 'SOMETHING IS HAPPENING!') ) );
216
- icl_register_string( 'CMP - Coming Soon & Maintenance', 'Copyright', stripslashes( get_option('niteoCS_copyright', 'Made by <a href="https://niteothemes.com">NiteoThemes</a> with love.') ) );
217
- icl_register_string( 'CMP - Coming Soon & Maintenance', 'Subscribe GDPR Message', stripslashes( get_option('niteoCS_subscribe_label', '') ) );
218
- icl_register_string( 'CMP - Coming Soon & Maintenance', 'Social Icons Title', stripslashes( get_option('niteoCS_soc_title', 'GET SOCIAL WITH US') ) );
219
- icl_register_string( 'CMP - Coming Soon & Maintenance', 'Counter Title', stripslashes( get_option('niteoCS_counter_heading', 'STAY TUNED, WE ARE LAUNCHING SOON...') ) );
220
- icl_register_string( 'CMP - Coming Soon & Maintenance', 'Extended Footer Title', stripslashes( get_option('niteoCS_contact_title', 'Quick Contacts') ) );
221
- icl_register_string( 'CMP - Coming Soon & Maintenance', 'Extended Footer Content', stripslashes( get_option('niteoCS_contact_content', 'Lorem Ipsum is simply dummy text of the printing and typesetting industry.') ) );
222
- icl_register_string( 'CMP - Coming Soon & Maintenance', 'Contact Form Title', stripslashes( get_option('niteoCS_contact_form_label', 'Get in Touch') ) );
 
 
223
 
224
  foreach ( $translation as $translate ) {
225
- icl_register_string( 'CMP - Coming Soon & Maintenance', $translate['name'], stripslashes( $translate['translation'] ) );
226
  }
227
 
228
  if ( $overlay_status == '1' && in_array( $themeslug, $this->cmp_overlay_text_themes() ) ) {
229
- icl_register_string( 'CMP - Coming Soon & Maintenance', 'Overlay Title', stripslashes( get_option('niteoCS_overlay_text[heading]', 'NEW WEBSITE ON THE WAY!') ) );
230
- icl_register_string( 'CMP - Coming Soon & Maintenance', 'Overlay Content', stripslashes( get_option('niteoCS_overlay_text[paragraph]', '') ) );
231
- icl_register_string( 'CMP - Coming Soon & Maintenance', 'Overlay Button Text', stripslashes( get_option('niteoCS_overlay_text[button_text]', 'Call to Action!') ) );
232
  }
233
 
234
  // register strings from themes
@@ -238,6 +241,16 @@ if ( ! class_exists( 'CMP_Coming_Soon_and_Maintenance' ) ) :
238
  }
239
  }
240
 
 
 
 
 
 
 
 
 
 
 
241
  /**
242
  * Translates given string
243
  *
@@ -311,9 +324,9 @@ if ( ! class_exists( 'CMP_Coming_Soon_and_Maintenance' ) ) :
311
  if ( function_exists('pll_languages_list') ) {
312
  $langs = pll_languages_list();
313
 
314
- } else if ( function_exists('icl_get_languages') ) {
315
- global $sitepress;
316
- $langs = array_keys( icl_get_languages() );
317
  }
318
 
319
  return $langs;
@@ -328,7 +341,7 @@ if ( ! class_exists( 'CMP_Coming_Soon_and_Maintenance' ) ) :
328
  public function cmp_get_default_language() {
329
  $default = null;
330
 
331
- if ( function_exists('pll_languages_list') ) {
332
  $default = pll_default_language();
333
 
334
  } else if ( defined( 'ICL_SITEPRESS_VERSION' ) ) {
@@ -338,6 +351,7 @@ if ( ! class_exists( 'CMP_Coming_Soon_and_Maintenance' ) ) :
338
 
339
  return $default;
340
  }
 
341
  /**
342
  * get translated object by id
343
  *
@@ -349,8 +363,8 @@ if ( ! class_exists( 'CMP_Coming_Soon_and_Maintenance' ) ) :
349
  if ( function_exists('pll_get_post') ) {
350
  $id = pll_get_post( $id );
351
 
352
- } else if ( function_exists( 'icl_object_id' ) ) {
353
- $id = icl_object_id( $id );
354
  }
355
 
356
  return $id;
@@ -421,6 +435,16 @@ if ( ! class_exists( 'CMP_Coming_Soon_and_Maintenance' ) ) :
421
  public function cmp_builder_themes() {
422
  return array( 'divi', 'elementor' );
423
  }
 
 
 
 
 
 
 
 
 
 
424
 
425
  /**
426
  * returns array list of premium themes => manually defined
@@ -611,7 +635,7 @@ if ( ! class_exists( 'CMP_Coming_Soon_and_Maintenance' ) ) :
611
  wp_enqueue_script( 'webfont' );
612
  wp_enqueue_script( 'cmp-select2-js' );
613
 
614
- if ( function_exists('pll_languages_list') || defined('ICL_SITEPRESS_VERSION') ) {
615
  $langs = $this->cmp_get_language_list();
616
  $default_lang = $this->cmp_get_default_language();
617
  wp_localize_script( 'cmp-editor-translation', 'translation', array( 'langs' => $langs, 'default' => $default_lang ) );
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.9
7
  Author: NiteoThemes
8
  Author URI: https://www.niteothemes.com
9
  Text Domain: cmp-coming-soon-maintenance
63
 
64
  // define constants
65
  private function constants() {
66
+ $this->define( 'CMP_VERSION', '3.7.9' );
67
  $this->define( 'CMP_DEBUG', FALSE );
68
  $this->define( 'CMP_AUTHOR', 'NiteoThemes' );
69
  $this->define( 'CMP_AUTHOR_HOMEPAGE', 'https://niteothemes.com' );
207
  */
208
  public function cmp_register_wpml_strings() {
209
 
210
+ if ( $this->translation_active() ) {
211
+
212
  $themeslug = $this->cmp_selectedTheme();
213
  $translation = json_decode( get_option('niteoCS_translation'), true );
214
  $overlay_status = get_option('niteoCS_overlay_text[status]', '0');
215
 
216
+ $this->cmp_register_string( 'CMP - Coming Soon & Maintenance', 'Title', stripslashes( get_option('niteoCS_body_title', 'SOMETHING IS HAPPENING!') ) );
217
+ $this->cmp_register_string( 'CMP - Coming Soon & Maintenance', 'Copyright', stripslashes( get_option('niteoCS_copyright', 'Made by <a href="https://niteothemes.com">NiteoThemes</a> with love.') ) );
218
+ $this->cmp_register_string( 'CMP - Coming Soon & Maintenance', 'Subscribe GDPR Message', stripslashes( get_option('niteoCS_subscribe_label', '') ) );
219
+ $this->cmp_register_string( 'CMP - Coming Soon & Maintenance', 'Social Icons Title', stripslashes( get_option('niteoCS_soc_title', 'GET SOCIAL WITH US') ) );
220
+ $this->cmp_register_string( 'CMP - Coming Soon & Maintenance', 'Counter Title', stripslashes( get_option('niteoCS_counter_heading', 'STAY TUNED, WE ARE LAUNCHING SOON...') ) );
221
+ $this->cmp_register_string( 'CMP - Coming Soon & Maintenance', 'Extended Footer Title', stripslashes( get_option('niteoCS_contact_title', 'Quick Contacts') ) );
222
+ $this->cmp_register_string( 'CMP - Coming Soon & Maintenance', 'Extended Footer Content', stripslashes( get_option('niteoCS_contact_content', 'Lorem Ipsum is simply dummy text of the printing and typesetting industry.') ) );
223
+ $this->cmp_register_string( 'CMP - Coming Soon & Maintenance', 'Contact Form Title', stripslashes( get_option('niteoCS_contact_form_label', 'Get in Touch') ) );
224
+ $this->cmp_register_string( 'CMP - Coming Soon & Maintenance', 'SEO Title', stripslashes( get_option('niteoCS_title', get_bloginfo('name').' Coming soon!') ) );
225
+ $this->cmp_register_string( 'CMP - Coming Soon & Maintenance', 'SEO Description', stripslashes( get_option('niteoCS_descr', 'Just Another Coming Soon Page') ) );
226
 
227
  foreach ( $translation as $translate ) {
228
+ $this->cmp_register_string( 'CMP - Coming Soon & Maintenance', $translate['name'], stripslashes( $translate['translation'] ) );
229
  }
230
 
231
  if ( $overlay_status == '1' && in_array( $themeslug, $this->cmp_overlay_text_themes() ) ) {
232
+ $this->cmp_register_string( 'CMP - Coming Soon & Maintenance', 'Overlay Title', stripslashes( get_option('niteoCS_overlay_text[heading]', 'NEW WEBSITE ON THE WAY!') ) );
233
+ $this->cmp_register_string( 'CMP - Coming Soon & Maintenance', 'Overlay Content', stripslashes( get_option('niteoCS_overlay_text[paragraph]', '') ) );
234
+ $this->cmp_register_string( 'CMP - Coming Soon & Maintenance', 'Overlay Button Text', stripslashes( get_option('niteoCS_overlay_text[button_text]', 'Call to Action!') ) );
235
  }
236
 
237
  // register strings from themes
241
  }
242
  }
243
 
244
+ public function cmp_register_string( $name, $group, $string, $multiline = false ) {
245
+
246
+ if ( function_exists('pll_register_string') ) {
247
+ pll_register_string( $name, $string, $group, $multiline );
248
+
249
+ } else if ( defined( 'ICL_SITEPRESS_VERSION' ) ) {
250
+ do_action( 'wpml_register_single_string', $name, $group, $string );
251
+ }
252
+ }
253
+
254
  /**
255
  * Translates given string
256
  *
324
  if ( function_exists('pll_languages_list') ) {
325
  $langs = pll_languages_list();
326
 
327
+ } else if ( defined( 'ICL_SITEPRESS_VERSION' ) ) {
328
+ $langs = apply_filters( 'wpml_active_languages', NULL, array( 'skip_missing' => 0 ) );
329
+ $langs = array_keys( $langs );
330
  }
331
 
332
  return $langs;
341
  public function cmp_get_default_language() {
342
  $default = null;
343
 
344
+ if ( function_exists('pll_default_language') ) {
345
  $default = pll_default_language();
346
 
347
  } else if ( defined( 'ICL_SITEPRESS_VERSION' ) ) {
351
 
352
  return $default;
353
  }
354
+
355
  /**
356
  * get translated object by id
357
  *
363
  if ( function_exists('pll_get_post') ) {
364
  $id = pll_get_post( $id );
365
 
366
+ } else if ( defined( 'ICL_SITEPRESS_VERSION' ) ) {
367
+ $id = apply_filters( 'wpml_object_id', $id );
368
  }
369
 
370
  return $id;
435
  public function cmp_builder_themes() {
436
  return array( 'divi', 'elementor' );
437
  }
438
+
439
+ /**
440
+ * Check if WPML or Polylang is activated
441
+ *
442
+ * @since 3.7.9
443
+ * @return array
444
+ */
445
+ public function translation_active() {
446
+ return function_exists('pll_languages_list') || defined('ICL_SITEPRESS_VERSION');
447
+ }
448
 
449
  /**
450
  * returns array list of premium themes => manually defined
635
  wp_enqueue_script( 'webfont' );
636
  wp_enqueue_script( 'cmp-select2-js' );
637
 
638
+ if ( $this->translation_active() ) {
639
  $langs = $this->cmp_get_language_list();
640
  $default_lang = $this->cmp_get_default_language();
641
  wp_localize_script( 'cmp-editor-translation', 'translation', array( 'langs' => $langs, 'default' => $default_lang ) );
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: coming soon, coming soon page, launch page, maintenance mode, under constr
5
  Requires at least: 3.0
6
  Requires PHP: 5.6
7
  Tested up to: 5.4
8
- Stable tag: 3.7.8
9
  License: GPLv2 or later
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -154,6 +154,11 @@ https://www.youtube.com/watch?v=uxuJfHzwdtE
154
  <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>
155
 
156
  == Changelog ==
 
 
 
 
 
157
  <h4>CMP 3.7.8 - 27-Jun-20</h4>
158
  <ul>
159
  <li>Security update resolving few small security issues.</li>
5
  Requires at least: 3.0
6
  Requires PHP: 5.6
7
  Tested up to: 5.4
8
+ Stable tag: 3.7.9
9
  License: GPLv2 or later
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
11
 
154
  <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>
155
 
156
  == Changelog ==
157
+ <h4>CMP 3.7.9 - 30-Jun-20</h4>
158
+ <ul>
159
+ <li>Updated WPML compatibility - replaced deprecated WPML functions with new equivalents.</li>
160
+ </ul>
161
+
162
  <h4>CMP 3.7.8 - 27-Jun-20</h4>
163
  <ul>
164
  <li>Security update resolving few small security issues.</li>