41 changes: 38 additions & 3 deletions Gruntfile.js
Expand Up @@ -116,7 +116,41 @@ module.exports = function(grunt) {
debounceDelay: 150
}
}
}
},
version: {
project: {
src: [
'package.json'
]
},
composer: {
src: [
'composer.json'
]
},
mainClass: {
options: {
prefix: '\\.*\\VERSION\.*\\s=\.*\\s\''
},
src: [
'includes/classes/wp-maintenance-mode.php'
]
},
metatag: {
options: {
prefix: 'Version:\\s*',
flags: ''
},
src: [ 'wp-maintenance-mode.php' ]
},
},
wp_readme_to_markdown: {
plugin: {
files: {
'README.md': 'readme.txt'
},
},
},
});


Expand All @@ -127,13 +161,14 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-uglify-es');
grunt.loadNpmTasks('grunt-postcss');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-version');
grunt.loadNpmTasks('grunt-wp-readme-to-markdown');

/**
* Register tasks
*/
grunt.registerTask('default', [
'jshint',
'uglify',
'postcss',
]);
};
};
143 changes: 143 additions & 0 deletions README.md
@@ -0,0 +1,143 @@
# WP Maintenance Mode #
**Contributors:** [themeisle](https://profiles.wordpress.org/themeisle/)
**Plugin Name:** WP Maintenance Mode
**Plugin URI:** https://themeisle.com/
**Author:** Themeisle
**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:** 5.9
**Stable tag:** trunk
**Requires PHP:** 5.6
**License:** GPL-2.0+

Adds a splash page to your site that lets visitors know your site is down for maintenance. It's perfect for a coming soon page. The new Bot functionality is here!

## Description ##

Add a maintenance page to your blog that lets visitors know your blog is down for maintenance, or add a coming soon page for a new website. User with admin rights gets full access to the blog including the front end.

Activate the plugin and your blog is in maintenance-mode, works and only registered users with enough rights can see the front end. You can use a date with a countdown timer for visitor information or set a value and unit for information.

Also works with WordPress Multisite installs (each blog from the network has its own maintenance settings).

### Features ###

* Fully customizable (change colors, texts and backgrounds);
* Subscription form (export emails to .csv file);
* Countdown timer (remaining time);
* Contact form (receive emails from visitors);
* Coming soon page;
* Landing page templates;
* WordPress multisite;
* Responsive design;
* Social media icons;
* Works with any WordPress theme;
* SEO options;
* Exclude URLs from maintenance;
* Bot functionality to collect the emails in a friendly and efficient way;
* GDPR Ready;

### Bugs, technical hints or contribute ###

Please give us feedback, contribute and file technical bugs on [GitHub Repo](https://github.com/andrianvaleanu/WP-Maintenance-Mode).

### Credits ###

Developed by [Themeisle](https://themeisle.com)

## Installation ##

1. Unpack the download package
2. Upload all files to the `/wp-content/plugins/` directory, include folders
3. Activate the plugin through the 'Plugins' menu in WordPress
4. Go to `Settings` page, where you can change what settings you need (pay attention to **Exclude** option!)

## Screenshots ##

1. Maintenance Mode Example
2. Maintenance Mode Example #2
3. Bot Example
4. Dashboard General Settings
5. Dashboard Design Settings
6. Dashboard Modules Settings
7. Dashboard Bot Settings
8. Contact Form

## Frequently Asked Questions ##

### How to use plugin filters ###
Check out our [Snippet Library](https://github.com/codeinwp/Snippet-Library/).

### Cache Plugin Support ###
WP Maintenance Mode can be unstable due to the cache plugins; we recommend deactivating any cache plugin when maintenance mode is active. If you **really** want to use a cache plugin, make sure you delete the entire cache after each change.

### Exclude list ###
If you change your login url, please add the new slug (url: http://domain.com/newlogin, then you should add: newlogin) to Exclude list from plugin settings -> General Tab.

Notice: `wp-cron.php` is excluded by default.

## Changelog ##

##### [Version 2.4.3](https://github.com/Codeinwp/wp-maintenance-mode/compare/v2.4.2...v2.4.3) (2022-01-27)

- Change ownership to Themeisle




### 2.4.2 (18/01/2022) ###
* Misc: 900 000 Active Installs Celebrations!
* Misc: WordPress 5.9 compatibility
* Fix: jQuery UI CSS theme reference from jQuery CDN
* Misc: Text fixes in the dashboard

### 2.4.1 (20/07/2021) ###
* Misc: WordPress 5.8 compatibility

### 2.4.0 (13/05/2021) ###
* Design: add "Custom CSS" setting; Finally! :)
* Design: add "Footer links" color setting
* Design: add a list of available shortcodes under the "Text" editor
* Bot: make {visitor_name} placeholder work in all messages after the visitor types his name
* Misc: add [embed] shortcode for responsive video embeds; Compatible with YouTube, Vimeo, DailyMotion.
* Misc: make the exclude mechanism work with Cyrillic characters
* Misc: add `wpmm_maintenance_template` filter; It works the same way as the `wpmm_contact_template` filter, but for the maintenance template.
* Misc: now you can override the `contact` email template too; Check `/views/contact.php` for more details.
* Misc: better compatibility with translation plugins like Loco Translate
* Misc: the image uploaders (from the dashboard) are now translatable
* Misc: improve uninstall routine
* Misc: add `wpmm_delete_cache` action; It is called after each setting change.
* Misc: add support for cache plugins like WP Rocket, WP Fastest Cache, Endurance Page Cache, Swift Performance Lite, Cache Enabler, SG Optimizer, LiteSpeed Cache, Nginx Helper;
* Misc: remove `wpmm_count_where` helper function
* Misc: code improvements

### 2.3.0 (07/12/2020) ###
* Modules: add support for Google Analytics 4 measurement ID
* Design: enable media buttons on wp_editor (now you can add images from the editor)
* Bot: fix translation issue
* Misc: add filters for capabilities `wpmm_settings_capability`, `wpmm_subscribers_capability`, and `wpmm_all_actions_capability` (the last one can be used to override all capabilities)
* Misc: fix [loginform] shortcode redirect attribute
* Misc: a few CSS & Javascript improvements
* Misc: bump "Tested up to" version to 5.6

### 2.2.4 (20/05/2019) ###
* bump "Tested up to" to 5.2.0
* fix typo in Italian translation (it_IT)
* Bot: add a note about how you can export the list of subscribers [#195](https://github.com/andrianvaleanu/WP-Maintenance-Mode/issues/195)
* Bot: add client-side sanitization to the input fields [#176](https://github.com/andrianvaleanu/WP-Maintenance-Mode/issues/176)

### 2.2.3 (20/02/2019) ###
* bump "Tested up to" version to 5.1.0
* replace "wpmu_new_blog" action with "wp_initialize_site" action for WP 5.1.0 users because the first one is deprecated in the new version
* small improvement to "check_exclude" method from "WP_Maintenance_Mode" class

### 2.2.2 (27/11/2018) ###
* Google Analytics module: migrate from analytics.js to gtag.js + add ip anonymization [#178](https://github.com/andrianvaleanu/WP-Maintenance-Mode/issues/178)
* GDPR module: accept links inside texareas + add policy link target [#188](https://github.com/andrianvaleanu/WP-Maintenance-Mode/issues/188)
* add charset meta tag [#200](https://github.com/andrianvaleanu/WP-Maintenance-Mode/issues/200)
* fix PHP Notice: Undefined index: HTTP_USER_AGENT
* add plural and single form translation for subscribers number (settings page)

### Earlier versions ###
For the changelog of earlier versions, please refer to the [full changelog](http://plugins.svn.wordpress.org/wp-maintenance-mode/trunk/changelog.txt).
Binary file modified assets/images/backgrounds/bg10_thumb.jpg
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/images/backgrounds/bg11_thumb.jpg
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/images/backgrounds/bg1_thumb.jpg
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/images/backgrounds/bg2_thumb.jpg
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/images/backgrounds/bg3_thumb.jpg
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/images/backgrounds/bg4_thumb.jpg
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/images/backgrounds/bg5_thumb.jpg
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/images/backgrounds/bg6_thumb.jpg
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/images/backgrounds/bg7_thumb.jpg
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/images/backgrounds/bg8_thumb.jpg
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/images/backgrounds/bg9_thumb.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/images/recommended/blocksy.jpg
Binary file not shown.
Binary file added assets/images/recommended/neve.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/recommended/optimole.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/recommended/otter.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/images/recommended/postcards.jpg
Binary file not shown.
Binary file removed assets/images/recommended/pulsetic.jpeg
Binary file not shown.
Binary file removed assets/images/recommended/static-pages.png
Binary file not shown.
20 changes: 20 additions & 0 deletions bin/dist.sh
@@ -0,0 +1,20 @@
#!/usr/bin/env bash

BUILD_VERSION=$(node -pe "require('./package.json').version")
export BUILD_VERSION
BUILD_NAME=$(node -pe "require('./package.json').name")
export BUILD_NAME

if [ ! -d "dist" ]; then
mkdir "dist"
fi

if [ ! -d "artifact" ]; then
mkdir "artifact"
fi

rsync -rc --exclude-from ".distignore" "./" "dist/$BUILD_NAME"

cd dist
zip -r "../artifact/$BUILD_NAME" "./$BUILD_NAME/"
cd -
152 changes: 152 additions & 0 deletions bin/install-wp-tests.sh
@@ -0,0 +1,152 @@
#!/usr/bin/env bash

if [ $# -lt 3 ]; then
echo "usage: $0 <db-name> <db-user> <db-pass> [db-host] [wp-version] [skip-database-creation]"
exit 1
fi

DB_NAME=$1
DB_USER=$2
DB_PASS=$3
DB_HOST=${4-localhost}
WP_VERSION=${5-latest}
SKIP_DB_CREATE=${6-false}

TMPDIR=${TMPDIR-/tmp}
TMPDIR=$(echo $TMPDIR | sed -e "s/\/$//")
WP_TESTS_DIR=${WP_TESTS_DIR-$TMPDIR/wordpress-tests-lib}
WP_CORE_DIR=${WP_CORE_DIR-$TMPDIR/wordpress/}

download() {
if [ `which curl` ]; then
curl -s "$1" > "$2";
elif [ `which wget` ]; then
wget -nv -O "$2" "$1"
fi
}

if [[ $WP_VERSION =~ ^[0-9]+\.[0-9]+$ ]]; then
WP_TESTS_TAG="branches/$WP_VERSION"
elif [[ $WP_VERSION =~ [0-9]+\.[0-9]+\.[0-9]+ ]]; then
if [[ $WP_VERSION =~ [0-9]+\.[0-9]+\.[0] ]]; then
# version x.x.0 means the first release of the major version, so strip off the .0 and download version x.x
WP_TESTS_TAG="tags/${WP_VERSION%??}"
else
WP_TESTS_TAG="tags/$WP_VERSION"
fi
elif [[ $WP_VERSION == 'nightly' || $WP_VERSION == 'trunk' ]]; then
WP_TESTS_TAG="trunk"
else
# http serves a single offer, whereas https serves multiple. we only want one
download http://api.wordpress.org/core/version-check/1.7/ /tmp/wp-latest.json
grep '[0-9]+\.[0-9]+(\.[0-9]+)?' /tmp/wp-latest.json
LATEST_VERSION=$(grep -o '"version":"[^"]*' /tmp/wp-latest.json | sed 's/"version":"//')
if [[ -z "$LATEST_VERSION" ]]; then
echo "Latest WordPress version could not be found"
exit 1
fi
WP_TESTS_TAG="tags/$LATEST_VERSION"
fi

set -ex

install_wp() {

if [ -d $WP_CORE_DIR ]; then
return;
fi

mkdir -p $WP_CORE_DIR

if [[ $WP_VERSION == 'nightly' || $WP_VERSION == 'trunk' ]]; then
mkdir -p $TMPDIR/wordpress-nightly
download https://wordpress.org/nightly-builds/wordpress-latest.zip $TMPDIR/wordpress-nightly/wordpress-nightly.zip
unzip -q $TMPDIR/wordpress-nightly/wordpress-nightly.zip -d $TMPDIR/wordpress-nightly/
mv $TMPDIR/wordpress-nightly/wordpress/* $WP_CORE_DIR
else
if [ $WP_VERSION == 'latest' ]; then
local ARCHIVE_NAME='latest'
elif [[ $WP_VERSION =~ [0-9]+\.[0-9]+ ]]; then
# https serves multiple offers, whereas http serves single.
download https://api.wordpress.org/core/version-check/1.7/ $TMPDIR/wp-latest.json
if [[ $WP_VERSION =~ [0-9]+\.[0-9]+\.[0] ]]; then
# version x.x.0 means the first release of the major version, so strip off the .0 and download version x.x
LATEST_VERSION=${WP_VERSION%??}
else
# otherwise, scan the releases and get the most up to date minor version of the major release
local VERSION_ESCAPED=`echo $WP_VERSION | sed 's/\./\\\\./g'`
LATEST_VERSION=$(grep -o '"version":"'$VERSION_ESCAPED'[^"]*' $TMPDIR/wp-latest.json | sed 's/"version":"//' | head -1)
fi
if [[ -z "$LATEST_VERSION" ]]; then
local ARCHIVE_NAME="wordpress-$WP_VERSION"
else
local ARCHIVE_NAME="wordpress-$LATEST_VERSION"
fi
else
local ARCHIVE_NAME="wordpress-$WP_VERSION"
fi
download https://wordpress.org/${ARCHIVE_NAME}.tar.gz $TMPDIR/wordpress.tar.gz
tar --strip-components=1 -zxmf $TMPDIR/wordpress.tar.gz -C $WP_CORE_DIR
fi

download https://raw.github.com/markoheijnen/wp-mysqli/master/db.php $WP_CORE_DIR/wp-content/db.php
}

install_test_suite() {
# portable in-place argument for both GNU sed and Mac OSX sed
if [[ $(uname -s) == 'Darwin' ]]; then
local ioption='-i.bak'
else
local ioption='-i'
fi

# set up testing suite if it doesn't yet exist
if [ ! -d $WP_TESTS_DIR ]; then
# set up testing suite
mkdir -p $WP_TESTS_DIR
svn co --quiet https://develop.svn.wordpress.org/${WP_TESTS_TAG}/tests/phpunit/includes/ $WP_TESTS_DIR/includes
svn co --quiet https://develop.svn.wordpress.org/${WP_TESTS_TAG}/tests/phpunit/data/ $WP_TESTS_DIR/data
fi

if [ ! -f wp-tests-config.php ]; then
download https://develop.svn.wordpress.org/${WP_TESTS_TAG}/wp-tests-config-sample.php "$WP_TESTS_DIR"/wp-tests-config.php
# remove all forward slashes in the end
WP_CORE_DIR=$(echo $WP_CORE_DIR | sed "s:/\+$::")
sed $ioption "s:dirname( __FILE__ ) . '/src/':'$WP_CORE_DIR/':" "$WP_TESTS_DIR"/wp-tests-config.php
sed $ioption "s/youremptytestdbnamehere/$DB_NAME/" "$WP_TESTS_DIR"/wp-tests-config.php
sed $ioption "s/yourusernamehere/$DB_USER/" "$WP_TESTS_DIR"/wp-tests-config.php
sed $ioption "s/yourpasswordhere/$DB_PASS/" "$WP_TESTS_DIR"/wp-tests-config.php
sed $ioption "s|localhost|${DB_HOST}|" "$WP_TESTS_DIR"/wp-tests-config.php
fi

}

install_db() {

if [ ${SKIP_DB_CREATE} = "true" ]; then
return 0
fi

# parse DB_HOST for port or socket references
local PARTS=(${DB_HOST//\:/ })
local DB_HOSTNAME=${PARTS[0]};
local DB_SOCK_OR_PORT=${PARTS[1]};
local EXTRA=""

if ! [ -z $DB_HOSTNAME ] ; then
if [ $(echo $DB_SOCK_OR_PORT | grep -e '^[0-9]\{1,\}$') ]; then
EXTRA=" --host=$DB_HOSTNAME --port=$DB_SOCK_OR_PORT --protocol=tcp"
elif ! [ -z $DB_SOCK_OR_PORT ] ; then
EXTRA=" --socket=$DB_SOCK_OR_PORT"
elif ! [ -z $DB_HOSTNAME ] ; then
EXTRA=" --host=$DB_HOSTNAME --protocol=tcp"
fi
fi

# create database
mysqladmin create $DB_NAME --user="$DB_USER" --password="$DB_PASS"$EXTRA
}

install_wp
install_test_suite
install_db
36 changes: 26 additions & 10 deletions composer.json
@@ -1,37 +1,53 @@
{
"name": "andrianvaleanu/wp-maintenance-mode",
"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",
"homepage": "https://designmodo.com",
"version": "2.4.3",
"license": "GPL-2.0+",
"homepage": "https://themeisle.com",
"support": {
"source": "https://github.com/andrianvaleanu/WP-Maintenance-Mode",
"source": "https://github.com/codeinwp/WP-Maintenance-Mode",
"forum": "https://wordpress.org/support/plugin/wp-maintenance-mode/",
"issues": "https://github.com/andrianvaleanu/WP-Maintenance-Mode/issues"
"issues": "https://github.com/codeinwp/WP-Maintenance-Mode/issues"
},
"authors": [
{
"name": "Designmodo",
"homepage": "https://designmodo.com/"
"name": "Themeisle",
"homepage": "https://themeisle.com/"
}
],
"require": {
"php": "^5.6 || ^7.0"
"codeinwp/themeisle-sdk": "^3.2"
},
"require-dev": {
"codeinwp/phpcs-ruleset": "dev-main",
"squizlabs/php_codesniffer": "^3.5",
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.1",
"phpcompatibility/php-compatibility": "^9.3",
"phpcompatibility/phpcompatibility-wp": "^2.1",
"wp-coding-standards/wpcs": "*"
},
"autoload": {
"files": [
"vendor/codeinwp/themeisle-sdk/load.php"
]
},
"config": {
"optimize-autoloader": true,
"platform": {
"php": "5.6"
}
},
"keywords": [
"maintenance",
"WordPress",
"plugin"
],
"scripts": {
"lint": "./vendor/bin/phpcs -p -s",
"fix": "./vendor/bin/phpcbf -p"
"format": "./vendor/bin/phpcbf --standard=phpcs.xml --report-summary --report-source -s --runtime-set testVersion 7.0- ",
"format-fix-exit": "./vendor/bin/phpcbf-fix-exit-0 --standard=phpcs.xml --report-summary --report-source -s --runtime-set testVersion 7.0- ",
"phpcs": "phpcs --standard=phpcs.xml -s --runtime-set testVersion 7.0-",
"lint": "composer run-script phpcs",
"phpcs-i": "phpcs -i"
}
}
}
318 changes: 301 additions & 17 deletions composer.lock

Large diffs are not rendered by default.

9 changes: 0 additions & 9 deletions includes/classes/wp-maintenance-mode-admin.php
Expand Up @@ -79,7 +79,6 @@ public function enqueue_admin_styles() {
return;
}


$screen = get_current_screen();
if ( $this->plugin_screen_hook_suffix === $screen->id ) {
$wp_scripts = wp_scripts();
Expand Down Expand Up @@ -606,14 +605,6 @@ public function add_notices() {
} else {
// delete wpmm_notice
delete_option( 'wpmm_notice' );

// notice for pulsetic
ob_start();
include_once wpmm_get_template_path( 'promo-pulsetic.php' );
$notices['promo-pulsetic'] = array(
'class' => 'wpmm_notices updated notice is-dismissible',
'msg' => ob_get_clean(),
);
}

// get dismissed notices
Expand Down
2 changes: 1 addition & 1 deletion includes/classes/wp-maintenance-mode.php
Expand Up @@ -6,7 +6,7 @@

class WP_Maintenance_Mode {

const VERSION = '2.4.2';
const VERSION = '2.4.3';

protected $plugin_slug = 'wp-maintenance-mode';
protected $plugin_settings;
Expand Down
24 changes: 9 additions & 15 deletions includes/functions/helpers.php
Expand Up @@ -109,27 +109,21 @@ function wpmm_get_banner_url( $filename ) {
function wpmm_get_banners() {
return array(
array(
'title' => 'Pulsetic',
'link' => 'https://pulsetic.com/',
'image' => 'pulsetic.jpeg',
'title' => 'Neve',
'link' => 'https://themeisle.com/themes/neve/',
'image' => 'neve.jpg',
'utm' => true,
),
array(
'title' => 'Blocksy',
'link' => 'https://creativethemes.com/blocksy/',
'image' => 'blocksy.jpg',
'title' => 'Optimole',
'link' => 'https://optimole.com/wordpress/',
'image' => 'optimole.jpg',
'utm' => true,
),
array(
'title' => 'Postcards',
'link' => 'https://designmodo.com/postcards/',
'image' => 'postcards.jpg',
'utm' => true,
),
array(
'title' => 'Static Pages',
'link' => 'https://designmodo.com/static-pages/',
'image' => 'static-pages.png',
'title' => 'Otter Blocks',
'link' => 'https://themeisle.com/plugins/otter-blocks/',
'image' => 'otter.jpg',
'utm' => true,
),
);
Expand Down
4,800 changes: 0 additions & 4,800 deletions package-lock.json

This file was deleted.

22 changes: 18 additions & 4 deletions package.json
@@ -1,20 +1,34 @@
{
"name": "wp-maintenance-mode",
"version": "2.4.2",
"author": "Designmodo",
"homepage": "https://designmodo.com/",
"version": "2.4.3",
"author": "Themeisle",
"homepage": "https://themeisle.com/",
"license": "GPL-3.0+",
"bugs": {
"url": "https://github.com/andrianvaleanu/WP-Maintenance-Mode/issues"
"url": "https://github.com/codeinwp/WP-Maintenance-Mode/issues"
},
"scripts": {
"build": "grunt",
"dist": "bash ./bin/dist.sh",
"release": "npx semantic-release"
},
"main": "Gruntfile.js",
"devDependencies": {
"@semantic-release/changelog": "^5.0.1",
"@semantic-release/exec": "^5.0.0",
"@semantic-release/git": "^9.0.0",
"autoprefixer": "^9.8.6",
"conventional-changelog-simple-preset": "^1.0.14",
"cssnano": "^4.1.11",
"grunt": "^1.4.0",
"grunt-contrib-jshint": "^2.1.0",
"grunt-contrib-uglify-es": "git://github.com/gruntjs/grunt-contrib-uglify.git#harmony",
"grunt-contrib-watch": "^1.1.0",
"grunt-postcss": "^0.9.0",
"grunt-version": "^3.0.0",
"grunt-wp-readme-to-markdown": "^2.1.0",
"replace-in-file": "^6.1.0",
"semantic-release": "^17.3.7",
"time-grunt": "^2.0.0"
}
}
50 changes: 50 additions & 0 deletions phpcs.xml
@@ -0,0 +1,50 @@
<?xml version="1.0"?>
<ruleset name="Themeisle">
<description>Themeisle rules for PHP_CodeSnifferr</description>

<file>./</file>

<arg value="ps"/>
<arg name="extensions" value="php"/>

<exclude-pattern type="relative">vendor</exclude-pattern>
<exclude-pattern type="relative">node_modules</exclude-pattern>
<exclude-pattern type="relative">**/build</exclude-pattern>
<exclude-pattern type="relative">tests</exclude-pattern>

<rule ref="WordPress-Core">
<exclude name="WordPress.PHP.YodaConditions.NotYoda"/>
<exclude name="Squiz.Commenting.InlineComment.InvalidEndChar"/>
<exclude name="WordPress.DB.PreparedSQL.NotPrepared"/>
<exclude name="WordPress.NamingConventions.ValidVariableName.NotSnakeCaseMemberVar"/>
<exclude name="WordPress.NamingConventions.ValidHookName.UseUnderscores"/>
<exclude name="Squiz.Commenting.FunctionComment.ParamCommentFullStop"/>
<exclude name="Squiz.Commenting.FunctionComment.MissingParamTag"/>
<exclude name="Squiz.Commenting.FileComment.SpacingAfterComment"/>
<exclude name="WordPress.WP.I18n.MissingTranslatorsComment"/>
<exclude name="Squiz.Commenting.FunctionComment.MissingParamName"/>
<exclude name="Squiz.Commenting.VariableComment.EmptyVar"/>
<exclude name="Generic.Commenting.DocComment.MissingShort"/>
<exclude name="Squiz.Commenting.FunctionComment.MissingParamComment"/>
<exclude name="WordPress.Files.FileName.NotHyphenatedLowercase"/>
<exclude name="WordPress.Files.FileName.InvalidClassFileName"/>
<exclude name="WordPress.PHP.StrictComparisons.LooseComparison"/>
<exclude name="WordPress.PHP.StrictInArray.MissingTrueStrict"/>
<exclude name="WordPress.PHP.RestrictedPHPFunctions.date_date"/>
<exclude name="Squiz.PHP.DisallowMultipleAssignments.Found"/>
<exclude name="Generic.Files.LineEndings.InvalidEOLChar"/>
<exclude name="WordPress.DateTime.RestrictedFunctions.date_date"/>
</rule>

<rule ref="WordPress.WP.I18n">
<properties>
<property name="text_domain" type="array">
<element value="wp-maintenance-mode"/>
<element value="default"/>
</property>
</properties>
</rule>
<arg value="sp"/>
<arg name="basepath" value="./" />
<arg name="parallel" value="20"/>
</ruleset>
68 changes: 0 additions & 68 deletions phpcs.xml.dist

This file was deleted.

18 changes: 18 additions & 0 deletions phpunit.xml
@@ -0,0 +1,18 @@
<phpunit
bootstrap="tests/bootstrap.php"
backupGlobals="false"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
>
<php>
<const name="FS_METHOD" value="direct"/>
</php>
<testsuites>
<testsuite name="default">
<directory phpVersion="5.4.0" phpVersionOperator=">=" suffix="-test.php">./tests/</directory>
<exclude>./tests/old/</exclude>
</testsuite>
</testsuites>
</phpunit>
46 changes: 0 additions & 46 deletions readme.md

This file was deleted.

27 changes: 17 additions & 10 deletions readme.txt
@@ -1,13 +1,13 @@
=== WP Maintenance Mode ===
Contributors: Designmodo
Contributors: Themeisle
Plugin Name: WP Maintenance Mode
Plugin URI: https://designmodo.com/
Author: Designmodo
Author URI: https://designmodo.com/
Plugin URI: https://themeisle.com/
Author: Themeisle
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: 5.9
Stable tag: 2.4.2
Stable tag: trunk
Requires PHP: 5.6
License: GPL-2.0+

Expand All @@ -17,9 +17,9 @@ Adds a splash page to your site that lets visitors know your site is down for ma

Add a maintenance page to your blog that lets visitors know your blog is down for maintenance, or add a coming soon page for a new website. User with admin rights gets full access to the blog including the front end.

Activate the plugin and your blog is in maintenance-mode, works and only registered users with enough rights can see the front end. You can use a date with a countdown timer for visitor information or set a value and unit for information.
Activate the plugin and your blog is in maintenance-mode, works and only registered users with enough rights can see the front end. You can use a date with a countdown timer for visitor information or set a value and unit for information.

Also works with WordPress Multisite installs (each blog from the network has it's own maintenance settings).
Also works with WordPress Multisite installs (each blog from the network has its own maintenance settings).

= Features =

Expand All @@ -44,7 +44,7 @@ Please give us feedback, contribute and file technical bugs on [GitHub Repo](htt

= Credits =

Developed by [Designmodo](https://designmodo.com)
Developed by [Themeisle](https://themeisle.com)

== Installation ==

Expand All @@ -66,8 +66,8 @@ Developed by [Designmodo](https://designmodo.com)

== Frequently Asked Questions ==

= How to use plugin filters =
Check out our [Snippet Library](https://github.com/WP-Maintenance-Mode/Snippet-Library/).
= How to use plugin filters =
Check out our [Snippet Library](https://github.com/codeinwp/Snippet-Library/).

= Cache Plugin Support =
WP Maintenance Mode can be unstable due to the cache plugins; we recommend deactivating any cache plugin when maintenance mode is active. If you **really** want to use a cache plugin, make sure you delete the entire cache after each change.
Expand All @@ -79,6 +79,13 @@ Notice: `wp-cron.php` is excluded by default.

== Changelog ==

##### [Version 2.4.3](https://github.com/Codeinwp/wp-maintenance-mode/compare/v2.4.2...v2.4.3) (2022-01-27)

- Change ownership to Themeisle




= 2.4.2 (18/01/2022) =
* Misc: 900 000 Active Installs Celebrations!
* Misc: WordPress 5.9 compatibility
Expand Down
34 changes: 34 additions & 0 deletions tests/bootstrap.php
@@ -0,0 +1,34 @@
<?php
/**
* PHPUnit bootstrap file
*
* @package Sample_Theme
*/

$_tests_dir = getenv( 'WP_TESTS_DIR' );

error_log( var_export ( $_tests_dir, true) );

if ( ! $_tests_dir ) {
$_tests_dir = rtrim( sys_get_temp_dir(), '/\\' ) . '/wordpress-tests-lib';
}

if ( ! file_exists( $_tests_dir . '/includes/functions.php' ) ) {
echo "Could not find $_tests_dir/includes/functions.php, have you run bin/install-wp-tests.sh ?" . PHP_EOL;
exit( 1 );
}

// Give access to tests_add_filter() function.
require_once $_tests_dir . '/includes/functions.php';

/**
* Registers theme
*/
function _register_module() {
require_once dirname( dirname( __FILE__ ) ) . '/wp-maintenance-mode.php';
}

tests_add_filter( 'muplugins_loaded', '_register_module' );

// Start up the WP testing environment.
require $_tests_dir . '/includes/bootstrap.php';
39 changes: 39 additions & 0 deletions tests/generic-test.php
@@ -0,0 +1,39 @@
<?php
/**
* Generic test.
*/

/**
* Test_Generic.
*/
class Test_Generic extends WP_UnitTestCase {
public function test_constants() {
$this->assertTrue( defined('WPMM_PATH') );
$this->assertTrue( defined('WPMM_CLASSES_PATH') );
$this->assertTrue( defined('WPMM_FUNCTIONS_PATH') );
$this->assertTrue( defined('WPMM_LANGUAGES_PATH') );
$this->assertTrue( defined('WPMM_VIEWS_PATH') );
$this->assertTrue( defined('WPMM_CSS_PATH') );
$this->assertTrue( defined('WPMM_URL') );
$this->assertTrue( defined('WPMM_JS_URL') );
$this->assertTrue( defined('WPMM_CSS_URL') );
$this->assertTrue( defined('WPMM_IMAGES_URL') );
$this->assertTrue( defined('WPMM_ASSETS_SUFFIX') && WPMM_ASSETS_SUFFIX === '.min' );
}

public function test_wpmm_maybe_define_constant() {

wpmm_maybe_define_constant( 'SOMECONSTANT', 'exists' );
wpmm_maybe_define_constant( 'SOMECONSTANT', 'again' );
$this->assertTrue( defined('SOMECONSTANT') && SOMECONSTANT === 'exists' );
}

public function test_class_loading() {
$this->assertTrue( class_exists('WP_Maintenance_Mode') );
}

public function test_wpmm_get_banners() {
$banners = wpmm_get_banners();
$this->assertNonEmptyMultidimensionalArray( $banners );
}
}
18 changes: 0 additions & 18 deletions views/promo-blocksy.php

This file was deleted.

19 changes: 0 additions & 19 deletions views/promo-pulsetic.php

This file was deleted.

28 changes: 14 additions & 14 deletions views/settings.php
Expand Up @@ -215,7 +215,7 @@
$hide_shortcodes_text = __( 'Hide available shortcodes', 'wp-maintenance-mode' );
$show_shortcodes_text = __( 'See available shortcodes', 'wp-maintenance-mode' );
?>
<a href="javascript:void(0);" class="button button-small toggle-shortcodes-list" data-hide="<?php echo esc_attr( $hide_shortcodes_text ); ?>" data-show="<?php echo esc_attr( $show_shortcodes_text ); ?>" ><?php echo esc_html( $show_shortcodes_text ); ?></a>
<a href="javascript:void(0);" class="button button-small toggle-shortcodes-list" data-hide="<?php echo esc_attr( $hide_shortcodes_text ); ?>" data-show="<?php echo esc_attr( $show_shortcodes_text ); ?>" ><?php echo esc_html( $show_shortcodes_text ); ?></a>

<ul class="shortcodes-list">
<li>
Expand Down Expand Up @@ -280,11 +280,11 @@
<td>
<input type="text" value="<?php echo esc_url( $this->plugin_settings['design']['bg_custom'] ); ?>" name="options[design][bg_custom]" class="background_url" />
<input
type="button"
value="<?php echo esc_attr_x( 'Upload', 'upload background button', 'wp-maintenance-mode' ); ?>"
class="button image_uploader_trigger"
data-name="background"
data-title="<?php esc_attr_e( 'Upload Background', 'wp-maintenance-mode' ); ?>"
type="button"
value="<?php echo esc_attr_x( 'Upload', 'upload background button', 'wp-maintenance-mode' ); ?>"
class="button image_uploader_trigger"
data-name="background"
data-title="<?php esc_attr_e( 'Upload Background', 'wp-maintenance-mode' ); ?>"
data-button-text="<?php esc_attr_e( 'Choose Background', 'wp-maintenance-mode' ); ?>"
data-to-selector=".background_url"
/>
Expand All @@ -295,15 +295,15 @@ class="button image_uploader_trigger"
<th scope="row">
<label for="options[design][bg_predefined]"><?php esc_html_e( 'Choose background', 'wp-maintenance-mode' ); ?></label>

<p class="description">
<p class="description">
<?php
printf(
wp_kses(
/* translators: free photos url */
__( '* source <a href="%s" target="_blank">Free Photos</a>', 'wp-maintenance-mode' ),
wpmm_translated_string_allowed_html()
),
esc_url( wpmm_get_utmized_url( 'http://designmodo.com/free-photos/', array( 'source' => 'settings' ) ) )
esc_url( wpmm_get_utmized_url( 'https://themeisle.com/blog/wordpress-stock-photos/', array( 'source' => 'settings' ) ) )
);
?>
</p>
Expand Down Expand Up @@ -512,7 +512,7 @@ class="button image_uploader_trigger"
<th scope="row">
<label for="options[modules][social_instagram]">Instagram</label>
</th>
<td>
<td>
<input type="text" value="<?php echo esc_attr( $this->plugin_settings['modules']['social_instagram'] ); ?>" name="options[modules][social_instagram]" />
</td>
</tr>
Expand Down Expand Up @@ -673,11 +673,11 @@ class="button image_uploader_trigger"
<td>
<input type="text" value="<?php echo esc_url( $this->plugin_settings['bot']['avatar'] ); ?>" name="options[bot][avatar]" id="options[bot][avatar]" class="avatar_url" />
<input
type="button"
value="<?php echo esc_attr_x( 'Upload', 'upload avatar button', 'wp-maintenance-mode' ); ?>"
class="button image_uploader_trigger"
data-name="avatar"
data-title="<?php esc_attr_e( 'Upload Avatar', 'wp-maintenance-mode' ); ?>"
type="button"
value="<?php echo esc_attr_x( 'Upload', 'upload avatar button', 'wp-maintenance-mode' ); ?>"
class="button image_uploader_trigger"
data-name="avatar"
data-title="<?php esc_attr_e( 'Upload Avatar', 'wp-maintenance-mode' ); ?>"
data-button-text="<?php esc_attr_e( 'Choose picture', 'wp-maintenance-mode' ); ?>"
data-to-selector=".avatar_url"
/>
Expand Down
38 changes: 29 additions & 9 deletions wp-maintenance-mode.php
Expand Up @@ -2,19 +2,19 @@
/**
* WP Maintenance Mode
*
* Plugin Name: WP Maintenance Mode
* Plugin URI: https://designmodo.com/
* Plugin Name: WP Maintenance Mode & Coming Soon
* 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 page.
* Version: 2.4.2
* Author: Designmodo
* Author URI: https://designmodo.com/
* Twitter: designmodo
* GitHub Plugin URI: https://github.com/andrianvaleanu/WP-Maintenance-Mode
* GitHub Branch: master
* Text Domain: wp-maintenance-mode
* Version: 2.4.3
* Author: Themeisle
* Author URI: https://themeisle.com/
* Twitter: themeisle
* GitHub Plugin URI: https://github.com/codeinwp/wp-maintenance-mode
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
* Text Domain: wp-maintenance-mode
* Domain Path: /languages
* WordPress Available: yes
* Requires License: no
*/

defined( 'ABSPATH' ) || exit;
Expand Down Expand Up @@ -68,3 +68,23 @@
require_once WPMM_CLASSES_PATH . 'wp-maintenance-mode-admin.php';
add_action( 'plugins_loaded', array( 'WP_Maintenance_Mode_Admin', 'get_instance' ) );
}

add_filter( 'themeisle_sdk_products', 'wpmm_load_sdk' );


/**
* Filter products array.
*
* @param array $products products array.
*
* @return array
*/
function wpmm_load_sdk( $products ) {
$products[] = __FILE__;
return $products;
}

$autoload_path = __DIR__ . '/vendor/autoload.php';
if ( is_file( $autoload_path ) ) {
require_once $autoload_path;
}
5,524 changes: 5,524 additions & 0 deletions yarn.lock

Large diffs are not rendered by default.