1 change: 0 additions & 1 deletion assets/css/style-admin.min.css

This file was deleted.

91 changes: 71 additions & 20 deletions assets/css/style-wizard.css
Expand Up @@ -10,6 +10,7 @@

.wp-toolbar .wpmm-wizard-fullscreen {
margin-top: -32px;
height: 100vh;
}

#wpwrap {
Expand Down Expand Up @@ -42,14 +43,18 @@
}

h2.wpmm-title {
position: relative;

margin: 0 !important;
padding: 8px 48px 8px 188px !important;
padding: 8px 80px !important;
font-size: 15px !important;

background-color: #fff;
background-position: 130px;
position: relative;
background-position: 25px;
}

h2.wpmm-title span {
display: flex;
position: absolute;
right: 75px;
top: 50%;
Expand Down Expand Up @@ -94,8 +99,7 @@ h2.wpmm-title span img {
}

.step.import-step {
margin-left: 130px;
margin-top: 100px;
margin: min(10%, 10vh) min(12%, 12vh);
}

.import-step .header {
Expand All @@ -110,46 +114,58 @@ h2.wpmm-title span img {
font-size: 18px;
font-weight: 400;
color: currentColor;
max-width: 600px;
}

.templates-radio form {
.templates-radio {
max-width: calc( 340px * 3 + 35px * 2 );
}

.templates-radio__item {
display: flex;
flex-direction: column;
width: 100%;
}

.wpmm-templates-radio form {
display: flex;
flex-wrap: wrap;
margin-top: 65px;
width: 100%;
gap: 35px;
}

.templates-radio [type=radio], .bullets-wrap [type=radio] {
.wpmm-templates-radio [type=radio], .bullets-wrap [type=radio] {
position: absolute;
opacity: 0;
}

.templates-radio [type=radio] + .template {
.wpmm-templates-radio [type=radio] + .wpmm-template {
cursor: pointer;
background-color: #fff;
width: 240px;
height: 250px;
display: block;
}

.templates-radio [type=radio]:checked + .template {
.wpmm-templates-radio [type=radio]:checked + .wpmm-template {
outline: 2px solid #0065A6;
}

.templates-radio .template {
.wpmm-templates-radio .wpmm-template {
position: relative;
border: 1px solid rgba(0, 0, 0, 0.2);
padding-bottom: 106.57%;
width: 100%;
height: 0;
}

.templates-radio .template img {
.wpmm-templates-radio .wpmm-template img {
width: 100%;
height: 100%;
object-fit: cover;

position: absolute;
}

.templates-radio .template p {
.wpmm-templates-radio .wpmm-template p {
position: absolute;
bottom: 15px;
transform: translateX(-50%);
Expand All @@ -161,30 +177,49 @@ h2.wpmm-title span img {
margin-top: 45px;
}

#wizard-buttons {
display: flex;
flex-wrap: wrap;
gap: 15px;
}

#wizard-buttons .button-import {
max-width: 200px;
width: 100%;
}

#wizard-buttons .button-skip {
color: #555D66;
border-color: #555D66;
white-space: break-spaces;
}

.dashicons-update {
position: absolute;
top: 50%;
left: 50%;
animation: abs-spin 2s linear infinite;
}

.templates-radio .template.loading img {
.wpmm-templates-radio .wpmm-template.loading img {
opacity: .2;
}

.import-text {
color: #717A84;
}

.templates-radio [type=radio] + .template {
width: 340px;
height: 357px;
.wpmm-templates-radio [type=radio] + .wpmm-template {
max-width: 320px;
width: 100%;
height: auto;
}

.templates-radio .tag {
.wpmm-templates-radio .tag {
font-size: 15px;
margin: 0 0 12px 0;
color: #7a7979;
white-space: nowrap;
}

.finish-step, .subscribe-step {
Expand Down Expand Up @@ -280,3 +315,19 @@ input.invalid:focus {
}
}

@media screen and (max-width: 600px) {
#wpbody {
padding-top: 0;
}

.templates-radio form {
flex-wrap: wrap;
}
}

@media screen and (max-width: 782px) {
html.wp-toolbar {
padding-top: 32px;
}
}

1 change: 0 additions & 1 deletion assets/css/style-wizard.min.css

This file was deleted.

1 change: 0 additions & 1 deletion assets/css/style.bot.min.css

This file was deleted.

1 change: 0 additions & 1 deletion assets/css/style.min.css

This file was deleted.

29 changes: 29 additions & 0 deletions assets/images/otter-logo.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion assets/js/bot.min.js

This file was deleted.

1 change: 0 additions & 1 deletion assets/js/chosen.jquery.min.js

This file was deleted.

1 change: 0 additions & 1 deletion assets/js/jquery-ui-timepicker-addon.min.js

This file was deleted.

1 change: 0 additions & 1 deletion assets/js/jquery.countdown.min.js

This file was deleted.

1 change: 0 additions & 1 deletion assets/js/jquery.fitvids.min.js

This file was deleted.

1 change: 0 additions & 1 deletion assets/js/jquery.plugin.min.js

This file was deleted.

1 change: 0 additions & 1 deletion assets/js/jquery.validate.min.js

This file was deleted.

1 change: 0 additions & 1 deletion assets/js/scripts-admin-global.min.js

This file was deleted.

69 changes: 56 additions & 13 deletions assets/js/scripts-admin.js
Expand Up @@ -217,7 +217,8 @@ jQuery( function( $ ) {
* TEMPLATES
*/
let pageEditURL = '#';
const templateWrap = $( '.template-image-wrap' );
const templateWrap = $( '.wpmm-template-image-wrap' );
const wizardButtons = $( '#wizard-buttons' );

templateWrap.on( 'click', '.button-import', function() {
/* If the page has some content inside, show a confirmation prompt to let the use know the
Expand All @@ -230,6 +231,9 @@ jQuery( function( $ ) {
second_button: `<button class="button button-secondary button-big go-back">${ wpmmVars.confirmModalTexts.buttonGoBack }</button>`,
} );

$( this ).parent().addClass( 'importing' );
$( this ).hide();

const importButton = this;
$( 'button.confirm' ).on( 'click', function() {
$( this ).html( '<span class="dashicons dashicons-update"></span>' + wpmmVars.importingText + '...' );
Expand All @@ -239,6 +243,9 @@ jQuery( function( $ ) {

$( 'button.go-back' ).on( 'click', function() {
$( '.modal-overlay' ).remove();
$( 'body' ).removeClass( 'has-modal' );
$( importButton ).show();
$( importButton ).parent().removeClass( 'importing' );
} );
} else {
fireImport( this );
Expand Down Expand Up @@ -338,20 +345,26 @@ jQuery( function( $ ) {
/**
* WIZARD
*/
let skipWizard = false;
const wizardTemplateSelect = $( 'input[name="wizard-template"]' );
const wizardImportButton = $( '#wpmm-wizard-wrapper .button-import' );

$( 'h2.wpmm-title span' ).on( 'click', function() {
window.location.href = wpmmVars.adminURL;
} );

if ( $( 'input[name="wizard-template"]:checked' ).val() ) {
$( '#wpmm-wizard-wrapper .button-import' ).removeClass( 'disabled' );
} else {
$( 'input[name="wizard-template"]' ).on( 'change', function() {
$( '#wpmm-wizard-wrapper .button-import' ).removeClass( 'disabled' );
$( 'input[name="wizard-template"]' ).off( 'change' );
} );
}

$( '#wizard-import-button' ).on( 'click', '.button-import:not(.disabled)', function() {
wizardTemplateSelect.on( 'change', function() {
wizardImportButton.removeClass( 'disabled' );

const selected = $( 'input[name="wizard-template"]:checked' ).data( 'category' );
$( '#wizard-buttons .button-skip' ).attr( 'value', selected ? wpmmVars.skipImportStrings[ selected ] : wpmmVars.skipImportDefault );
} );

wizardButtons.on( 'click', '.button-import:not(.disabled)', function() {
const templateSelect = $( 'input[name="wizard-template"]:checked' );
const templateSlug = templateSelect.val();
const category = templateSelect[ 0 ].dataset.category;
Expand All @@ -364,11 +377,28 @@ jQuery( function( $ ) {
};

importInProgress( data.template_slug );
$( '#wpmm-wizard-wrapper .button-skip' ).addClass( 'disabled' );
importTemplate( data, function( response ) {
moveToStep( 'import', 'subscribe' );
pageEditURL = response.pageEditURL.replace( /&amp;/g, '&' );

$( '#wpmm-wizard-wrapper .finish-step .heading' ).text( wpmmVars.finishWizardStrings[ category ] );
$( '#wpmm-wizard-wrapper .button-skip' ).removeClass( 'disabled' );
} );
} );

wizardButtons.on( 'click', '.button-skip', function() {
$.post( wpmmVars.ajaxURL, {
action: 'wpmm_skip_wizard',
_wpnonce: wpmmVars.wizardNonce,
}, function( response ) {
if ( ! response.success ) {
// eslint-disable-next-line no-console
console.error( response.data );
return;
}
skipWizard = true;
moveToStep( 'import', 'subscribe' );
} );
} );

Expand All @@ -384,6 +414,7 @@ jQuery( function( $ ) {

const emailInput = $( '#email-input-wrap input[type="text"]' );
const email = emailInput.val();
const subscribeButton = $( this );

if ( ! isEmailValid( email ) ) {
$( '#email-input-wrap' ).append( `<p class="subscribe-message email-error"><i>${ wpmmVars.invalidEmailString }</i></p>` );
Expand All @@ -397,6 +428,7 @@ jQuery( function( $ ) {
}

emailInput.removeClass( 'invalid' );
subscribeButton.addClass( 'is-busy' );

$.post( wpmmVars.ajaxURL, {
action: 'wpmm_subscribe',
Expand All @@ -407,14 +439,25 @@ jQuery( function( $ ) {
alert( response.data );
}

moveToStep( 'subscribe', 'finish' );
subscribeButton.removeClass( 'is-busy' );
if ( ! skipWizard ) {
moveToStep( 'subscribe', 'finish' );
return;
}

window.location.reload();
} );

return false;
} );

$( '#skip-subscribe' ).on( 'click', function() {
moveToStep( 'subscribe', 'finish' );
if ( ! skipWizard ) {
moveToStep( 'subscribe', 'finish' );
return;
}

window.location.reload();
} );

$( '#view-page-button' ).on( 'click', function() {
Expand All @@ -431,13 +474,13 @@ jQuery( function( $ ) {
* @param {string} slug The template that will be imported
*/
function importInProgress( slug ) {
const template = $( 'input[value=' + slug + '] + .template' );
const template = $( 'input[value=' + slug + '] + .wpmm-template' );

template.addClass( 'loading' );
template.append( '<span class="dashicons dashicons-update"></span><p><i>' + wpmmVars.loadingString + '</i></p>' );

$( '.button-import' ).attr( 'disabled', 'disabled' );
$( '#wpmm-wizard-wrapper .templates-radio label' ).css( 'pointer-events', 'none' );
$( '#wpmm-wizard-wrapper .wpmm-templates-radio label' ).css( 'pointer-events', 'none' );
}

/**
Expand Down Expand Up @@ -480,7 +523,7 @@ jQuery( function( $ ) {
if ( ! response.success ) {
alert( response.data );
$( '.dashicons-update' ).remove();
$( '<p class="error import-error">' + wpmmVars.errorString + '</p>' ).insertAfter( '#wizard-import-button' );
$( '<p class="error import-error">' + wpmmVars.errorString + '</p>' ).insertAfter( '#wizard-buttons' );
return false;
}

Expand All @@ -502,7 +545,7 @@ jQuery( function( $ ) {
if ( ! response.success ) {
alert( response.data.errorMessage );
$( '.dashicons-update' ).remove();
$( '<p class="error import-error">' + wpmmVars.errorString + '</p>' ).insertAfter( '#wizard-import-button' );
$( '<p class="error import-error">' + wpmmVars.errorString + '</p>' ).insertAfter( '#wizard-buttons' );

window.location.reload();
return false;
Expand Down
1 change: 0 additions & 1 deletion assets/js/scripts-admin.min.js

This file was deleted.

1 change: 0 additions & 1 deletion assets/js/scripts.min.js

This file was deleted.

Binary file modified assets/templates/coming-soon/coming-soon-1/screenshot.png 100755 → 100644
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/templates/coming-soon/coming-soon-2/screenshot.png 100755 → 100644
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/templates/coming-soon/coming-soon-3/screenshot.png 100755 → 100644
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/templates/coming-soon/coming-soon-4/screenshot.png 100755 → 100644
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/templates/landing-page/landing-page-1/screenshot.png 100755 → 100644
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/templates/landing-page/landing-page-2/screenshot.png 100755 → 100644
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/templates/landing-page/landing-page-3/screenshot.png 100755 → 100644
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/templates/landing-page/landing-page-4/screenshot.png 100755 → 100644
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/templates/landing-page/landing-page-5/screenshot.png 100755 → 100644
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/templates/landing-page/landing-page-6/screenshot.png 100755 → 100644
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/templates/landing-page/landing-page-7/screenshot.png 100755 → 100644
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/templates/maintenance/maintenance-1/screenshot.png 100755 → 100644
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/templates/maintenance/maintenance-2/screenshot.png 100755 → 100644
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/templates/maintenance/maintenance-3/screenshot.png 100755 → 100644
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/templates/maintenance/maintenance-4/screenshot.png 100755 → 100644
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -2,7 +2,7 @@
"name": "codeinwp/wp-maintenance-mode",
"description": "Adds a splash page to your site that lets visitors know your site is down for maintenance. Full access to the back- & front-end is optional.",
"type": "wordpress-plugin",
"version": "2.6.1",
"version": "2.6.2",
"license": "GPL-2.0+",
"homepage": "https://themeisle.com",
"support": {
Expand Down
48 changes: 48 additions & 0 deletions includes/classes/wp-maintenance-mode-admin.php
Expand Up @@ -55,6 +55,7 @@ private function __construct() {
add_action( 'wp_ajax_wpmm_reset_settings', array( $this, 'reset_plugin_settings' ) );
add_action( 'wp_ajax_wpmm_select_page', array( $this, 'select_page' ) );
add_action( 'wp_ajax_wpmm_insert_template', array( $this, 'insert_template' ) );
add_action( 'wp_ajax_wpmm_skip_wizard', array( $this, 'skip_wizard' ) );
add_action( 'wp_ajax_wpmm_subscribe', array( $this, 'subscribe_newsletter' ) );
add_action( 'wp_ajax_wpmm_change_template_category', array( $this, 'change_template_category' ) );
add_action( 'wp_ajax_wpmm_toggle_gutenberg', array( $this, 'toggle_gutenberg' ) );
Expand Down Expand Up @@ -182,6 +183,12 @@ public function enqueue_admin_scripts() {
'title' => _x( 'Upload Image', 'image_uploader default title', 'wp-maintenance-mode' ),
'buttonText' => _x( 'Choose Image', 'image_uploader default button_text', 'wp-maintenance-mode' ),
),
'skipImportStrings' => array(
'maintenance' => __( 'I don’t want to use a Maintenance Template', 'wp-maintenance-mode' ),
'coming-soon' => __( 'I don’t want to use a Coming Soon Template', 'wp-maintenance-mode' ),
'landing-page' => __( 'I don’t want to use a Landing Page Template', 'wp-maintenance-mode' ),
),
'skipImportDefault' => __( 'I don’t want to use a template', 'wp-maintenance-mode' ),
)
);

Expand Down Expand Up @@ -668,6 +675,26 @@ public function insert_template() {
wp_send_json_success( array( 'pageEditURL' => get_edit_post_link( $page_id ) ) );
}

/**
* Skip importing a template (and installing Otter) from the wizard
*
* @return void
*/
public function skip_wizard() {
// check nonce existence
if ( empty( $_POST['_wpnonce'] ) ) {
die( esc_html__( 'The nonce field must not be empty.', 'wp-maintenance-mode' ) );
}

// check nonce validation
if ( ! wp_verify_nonce( $_POST['_wpnonce'], 'wizard' ) ) {
die( esc_html__( 'Security check.', 'wp-maintenance-mode' ) );
}

update_option( 'wpmm_fresh_install', false );
wp_send_json_success();
}

/**
* Subscribe user to plugin newsletter
*
Expand Down Expand Up @@ -1130,5 +1157,26 @@ public function get_policy_link_message() {
return __( 'No privacy features detected for your WordPress version. Update WordPress to get this field automatically filled in or type in the URL that points to your privacy policy page.', 'wp-maintenance-mode' );
}
}

/**
* Returns the HTML of the Otter notice
*
* @return string
*/
public function get_otter_notice( $location = null ) {
return sprintf(
'<div class="wpmm_otter-notice">
<div class="wpmm_otter-notice__logo">
<img src="%s"/>
</div>
<div class="wpmm_otter-notice__text">%s&nbsp;<a href="%s" target="_blank">%s</a></div>
</div>',
esc_url( WPMM_URL . 'assets/images/otter-logo.svg' ),
/* translators: %1$s %2$s bold text tags */
sprintf( __( 'These templates make use of %1$s Otter Blocks %2$s powerful features, which will be installed and activated.', 'wp-maintenance-mode' ), '<b>', '</b>' ),
tsdk_utmify( 'https://themeisle.com/plugins/otter-blocks/', $this->plugin_slug, $location ),
__( 'Learn more about Otter.', 'wp-maintenance-mode' )
);
}
}
}
3 changes: 2 additions & 1 deletion includes/classes/wp-maintenance-mode.php
Expand Up @@ -8,7 +8,7 @@

class WP_Maintenance_Mode {

const VERSION = '2.6.1';
const VERSION = '2.6.2';

const MAINTENANCE = 'maintenance';
const COMING_SOON = 'coming-soon';
Expand Down Expand Up @@ -686,6 +686,7 @@ public function init() {
! ( defined( 'WP_CLI' ) && WP_CLI )
) {
if ( isset( $this->plugin_settings['design']['page_id'] ) && get_option( 'wpmm_new_look' ) ) {
define( 'IS_MAINTENANCE', true );
include_once wpmm_get_template_path( 'maintenance.php', true );
return;
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "wp-maintenance-mode",
"version": "2.6.1",
"version": "2.6.2",
"author": "Themeisle",
"homepage": "https://themeisle.com/",
"license": "GPL-3.0+",
Expand Down
11 changes: 10 additions & 1 deletion readme.txt
Expand Up @@ -7,7 +7,7 @@ Author URI: https://themeisle.com/
Tags: maintenance mode, admin, administration, unavailable, coming soon, multisite, landing page, under construction, contact form, subscribe, countdown
Requires at least: 3.5
Tested up to: 6.1
Stable tag: 2.6.1
Stable tag: 2.6.2
Requires PHP: 5.6
License: GPL-2.0+

Expand Down Expand Up @@ -92,6 +92,15 @@ Notice: `wp-cron.php` is excluded by default.

== Changelog ==

##### [Version 2.6.2](https://github.com/Codeinwp/wp-maintenance-mode/compare/v2.6.1...v2.6.2) (2022-12-16)

* Add the option in the wizard to skip importing a template and installing Otter
* Improve the quality of the template screenshots
* Fix the template overriding issue




##### [Version 2.6.1](https://github.com/Codeinwp/wp-maintenance-mode/compare/v2.6.0...v2.6.1) (2022-11-03)

* Add a notice to announce the rebrand of the plugin
Expand Down
46 changes: 32 additions & 14 deletions views/settings.php
Expand Up @@ -11,6 +11,8 @@
if ( ! isset( $this->plugin_settings['design']['page_id'] ) ) {
$this->plugin_settings['design']['page_id'] = 0;
}

$is_otter_active = is_plugin_active( 'otter-blocks/otter-blocks.php' ) || defined( 'OTTER_BLOCKS_VERSION' );
?>
<div class="wrap">
<h2 class="wpmm-title"><?php echo esc_html( get_admin_page_title() ); ?>
Expand Down Expand Up @@ -44,19 +46,24 @@
<div class="step-wrap">
<div class="step import-step">
<h4 class="header"><?php esc_html_e( 'Get started with a free template.', 'wp-maintenance-mode' ); ?></h4>
<p class="description"><?php esc_html_e( 'Just click on one of the pre-designed templates below to get started. You can always edit and customize later, so these are a perfect starting point!', 'wp-maintenance-mode' ); ?></p>
<div class="templates-radio">
<p class="description"><?php esc_html_e( 'Choose the type of template you want, powered by Otter Blocks. You can always customise your layout.', 'wp-maintenance-mode' ); ?></p>
<?php
if ( ! $is_otter_active ) {
echo $this->get_otter_notice( 'wizard' );
}
?>
<div class="wpmm-templates-radio">
<form>
<?php
$categories = WP_Maintenance_Mode::get_page_categories();
foreach ( $categories as $category => $label ) {
$slug = $default_templates[ $category ]['slug'];
$thumbnail_url = $default_templates[ $category ]['thumbnail'];
?>
<div>
<div class="templates-radio__item" >
<h6 class="tag"><?php echo $label; ?></h6>
<input id="<?php echo esc_attr( $slug ); ?>" type="radio" name="wizard-template" value="<?php echo esc_attr( $slug ); ?>" data-category="<?php echo esc_attr( $category ); ?>" <?php checked( $category, 'maintenance' ); ?>>
<label for="<?php echo esc_attr( $slug ); ?>" class="template">
<label for="<?php echo esc_attr( $slug ); ?>" class="wpmm-template">
<img src="<?php echo esc_url( $thumbnail_url ); ?>" alt="<?php echo esc_attr( $slug ); ?>"/>
</label>
</div>
Expand All @@ -65,10 +72,10 @@
?>
</form>
</div>
<div id="wizard-import-button" class="import-button">
<div id="wizard-buttons" class="import-button">
<input type="button" class="button button-big button-primary disabled button-import" value="<?php esc_html_e( 'Continue', 'wp-maintenance-mode' ); ?>"/>
<input type="button" class="button button-big button-secondary button-skip" value="<?php esc_html_e( 'I don’t want to use a Maintenance Template', 'wp-maintenance-mode' ); ?>"/>
</div>
<p class="import-text"><i><?php esc_html_e( 'This template uses Otter Blocks plugin which will be installed on import.', 'wp-maintenance-mode' ); ?></i></p>
</div>
</div>
<div class="step-wrap">
Expand Down Expand Up @@ -285,16 +292,20 @@
if ( $page_status && $page_status !== 'trash' ) {
?>
<a href="<?php echo get_edit_post_link( $this->plugin_settings['design']['page_id'] ); ?>"><?php esc_html_e( 'Edit page', 'wp-maintenance-mode' ); ?></a> <?php } ?>
<p class="description"><?php esc_html_e( 'Select the page that will be used as the Maintenance, Coming Soon or Landing page.', 'wp-maintenance-mode' ); ?></p>
</td>
</tr>
</tbody>
</table>
<table>
<tbody><tr valign="top">
<p class="description"><?php esc_html_e( 'Select the page that will be used as the Maintenance, Coming Soon or Landing page.', 'wp-maintenance-mode' ); ?></p>
</tr></tbody>
</table>
<table class="form-table">
<tbody>
<tr valign="top">
<th scope="row">
<label for="dashboard-template"><?php esc_html_e( 'Pick a template', 'wp-maintenance-mode' ); ?></label>
<label for="dashboard-template" class="wpmm-templates-gallery__label"><?php esc_html_e( 'Pick a template', 'wp-maintenance-mode' ); ?></label>
</th>
<td class="category-select-wrap">
<select name="options[design][template_category]" id="template-category">
Expand All @@ -315,11 +326,18 @@
<?php if ( $is_old_version ) { ?>
<p class="description"><i><?php echo __( '<b>Note</b>: You need at least WP 5.8 to use new generation maintenance pages.', 'wp-maintenance-mode' ); ?></i></p>
<?php } else { ?>
<p class="description"><?php esc_html_e( 'Pick one of our starter templates for your maintenance or coming soon page. You can always customize them based on your needs. Stay in the loop for more templates!', 'wp-maintenance-mode' ); ?></p>
<br/>
<p class="description"><i><?php esc_html_e( 'This templates use Otter Blocks plugin which will be installed on import.', 'wp-maintenance-mode' ); ?></i></p>
<p class="wpmm-templates-gallery__description">
<?php esc_html_e( 'Pick one of our starter templates for your maintenance or coming soon page. You can always customize them based on your needs.', 'wp-maintenance-mode' ); ?>
<br/>
<?php esc_html_e( 'Stay in the loop for more templates!', 'wp-maintenance-mode' ); ?>
</p>
<?php
if ( ! $is_otter_active ) {
echo $this->get_otter_notice( 'settings' );
}
?>
<?php } ?>
<div class="templates">
<div class="wpmm-templates">
<?php
if ( ! isset( $this->plugin_settings['design']['template_category'] ) ) {
$this->plugin_settings['design']['template_category'] = 'all';
Expand Down Expand Up @@ -349,8 +367,8 @@

$template_label = json_decode( file_get_contents( $content ) )->label;
?>
<div class="template-wrap">
<div class="template-image-wrap <?php echo $is_old_version ? '' : 'can-import'; ?>">
<div class="wpmm-template-wrap">
<div class="wpmm-template-image-wrap <?php echo $is_old_version ? '' : 'can-import'; ?>">
<img src="<?php echo $thumbnail; ?>" alt="<?php echo $name; ?>"/>
<?php if ( ! $is_old_version ) { ?>
<button type="button" class="button button-primary button-import" data-tab="design" data-slug="<?php echo esc_attr( $name ); ?>" data-category="<?php echo esc_attr( $category ); ?>" data-replace="<?php echo (int) $will_replace; ?>"><?php esc_html_e( 'Import template', 'wp-maintenance-mode' ); ?></button>
Expand Down
14 changes: 12 additions & 2 deletions views/wpmm-page-template.php
Expand Up @@ -3,7 +3,15 @@
* Template Name: Full Width for Maintenance Page
*/

?><!DOCTYPE html>
defined( 'ABSPATH' ) || exit;

$overrideable_template = wpmm_get_template_path( 'maintenance.php', true );
if ( ( defined( 'IS_MAINTENANCE' ) && IS_MAINTENANCE ) && WPMM_VIEWS_PATH . 'maintenance.php' !== $overrideable_template ) {
exit();
} else {
$settings = WP_Maintenance_Mode::get_instance()->get_plugin_settings();
?>
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
Expand All @@ -19,7 +27,6 @@
the_post();
the_content();

$settings = WP_Maintenance_Mode::get_instance()->get_plugin_settings();
if ( isset( $settings['bot']['status'] ) && $settings['bot']['status'] === 1 ) {
?>
<div class="bot-container">
Expand All @@ -46,3 +53,6 @@
?>
</body>
</html>
<?php
exit();
}
2 changes: 1 addition & 1 deletion wp-maintenance-mode.php
Expand Up @@ -4,7 +4,7 @@
*
* Plugin Name: LightStart - Maintenance Mode, Coming Soon and Landing Page Builder
* Description: Adds a splash page to your site that lets visitors know your site is down for maintenance. It's perfect for a coming soon or landing page.
* Version: 2.6.1
* Version: 2.6.2
* Author: Themeisle
* Author URI: https://themeisle.com/
* Twitter: themeisle
Expand Down