Initial commit

This commit is contained in:
Cooper Dalrymple
2025-10-29 11:52:55 -05:00
parent 4acaaf406e
commit e3bb6e6039
17 changed files with 5761 additions and 3 deletions

3
.gitignore vendored Normal file
View File

@@ -0,0 +1,3 @@
vendor
node_modules
*.zip

21
Makefile Normal file
View File

@@ -0,0 +1,21 @@
all: install
reinstall: clean install
clean: clean-composer clean-npm
clean-composer:
rm -rf vendor/* || true
rm composer.lock || true
composer clearcache
clean-npm:
rm -rf node_modules/* || true
rm package-lock.json || true
install:
composer install
npm install
package: install
gulp package

View File

@@ -1,3 +0,0 @@
# ogre-suspension
OgreSuspension will lock down a WordPress instance with a custom suspension page and prevent access to the admin dashboard. Use with caution!

BIN
assets/bg.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 542 KiB

29
assets/logo.svg Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 83 KiB

239
assets/style.css Normal file
View File

@@ -0,0 +1,239 @@
/**
* @package ogre-suspension
* @author cleverogre
* @version 1.0.0
* @since 1.0.0
*/
:root {
--color--orange: #f89a31;
--color--green: #c2e3e1;
--color--yellow: #f7ec76;
--font-family--sans-serif: 'Passion One', 'Open Sans', Arial, Helvetica, sans-serif;
--font-family--serif: 'Roboto Slab', Georgia, Times, "Time New Roman", serif;
}
* {
outline: none;
}
html {
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
scroll-behavior: smooth;
min-height: 100%;
font-family: var(--font-family--serif);
font-size: 24px;
line-height: 2;
font-weight: 500;
font-style: normal;
text-align: left;
}
.screen-reader-text {
clip: rect(1px, 1px, 1px, 1px);
position: absolute !important;
height: 1px;
width: 1px;
overflow: hidden;
}
.screen-reader-text:focus {
border-radius: 3px;
box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
clip: auto !important;
display: block;
font-weight: bold;
height: auto;
left: 5px;
line-height: normal;
padding: 1rem;
text-decoration: none;
top: 5px;
width: auto;
z-index: 100000;
}
body {
margin: 0;
min-height: 100%;
padding: 4rem 2rem;
background-color: #000;
background-repeat: no-repeat;
background-position: top center;
background-size: 100% auto;
background-image: url(bg.jpg);
color: #fff;
display: flex;
align-items: center;
justify-content: center;
}
body:before,
body:after {
content: '';
display: block;
width: 100%;
height: auto;
margin: 0;
padding: 0;
aspect-ratio: 1284 / 1920;
position: absolute;
top: 0;
right: 0;
bottom: auto;
left: 0;
}
body:before {
z-index: 10;
background-image: linear-gradient(to bottom, transparent 0%, #000 100%), url(bg.jpg);
}
body:after {
z-index: 20;
background-color: transparent;
background-repeat: no-repeat;
background-position: center;
background-size: 100% auto;
background-image: url(texture.png);
}
main {
width: 1140px;
max-width: 100%;
margin: auto;
padding: 4rem 2rem 2rem;
position: relative;
z-index: 30;
background: rgba(0, 0, 0, .75);
}
main > *:first-child {
margin-block-start: 0;
}
main > *:last-child {
margin-block-end: 0;
}
:where(h1, h2, h3, h4, h5, h6) {
margin: 1em auto;
width: 100%;
font-weight: bold;
font-style: normal;
line-height: 1.5;
font-family: var(--font-family--serif);
}
:where(h1, h2) {
max-width: 940px;
}
h1 {
font-size: 2em;
margin-bottom: .5em;
}
h2 {
font-size: 1.5em;
}
:where(h3, h4, h5) {
font-weight: normal;
}
h3 {
font-family: var(--font-family--sans-serif);
font-size: 1.25em;
line-height: 1;
font-weight: normal;
color: var(--color--orange);
}
h4 {
font-size: 1em;
line-height: 1.25;
}
h5 {
font-size: .9em;
color: var(--color--orange);
}
p {
display: block;
width: 100%;
height: auto;
margin: .6em auto;
padding: 0;
color: inherit;
}
img {
display: block;
width: auto;
height: auto;
float: none;
max-width: 100%;
margin-inline: auto;
}
figure {
width: 100%;
max-width: 940px;
margin: 0 auto .5em;
border-bottom: 10px solid rgba(248, 154, 49, .7);
}
a {
display: inline;
background: transparent;
text-decoration: none;
font-weight: inherit;
color: var(--color--orange);
}
a:hover {
color: var(--color--green);
}
a:active {
color: var(--color--yellow);
}
a:hover,
a:active {
box-shadow: 0px 2px 0px currentColor;
outline: 0;
}
@media (min-width: 1921px) {
body:before,
body:after {
height: 100%;
padding: 0;
position: fixed;
bottom: 0;
background-attachment: fixed;
}
body:before {
background-size: cover;
}
}
@media (max-width: 768px) {
body {
padding-top: 0;
padding-bottom: 0;
background-image: none;
}
body:before,
body:after {
content: none;
display: none;
visibility: hidden;
}
main {
padding-inline: 1rem;
padding-bottom: 4rem;
}
}

BIN
assets/texture.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 93 KiB

36
composer.json Normal file
View File

@@ -0,0 +1,36 @@
{
"$schema": "https://getcomposer.org/schema.json",
"name": "cleverogre/ogre-suspension",
"version": "1.0.0",
"title": "OgreSuspension",
"description": "OgreSuspension will lock down a WordPress instance with a custom suspension page and prevent access to the admin dashboard. Use with caution!",
"author": "CleverOgre",
"license": "GPL-3.0+",
"keywords": [
"WordPress",
"Plugin",
"suspension",
"lockdown",
"shutdown",
"suspend"
],
"homepage": "https://cleverogre.com",
"repositories": {
"cleverogre/plugin-framework": {
"type": "vcs",
"url": "git@git.cleverogre.com:cleverogre/plugin-framework.git"
}
},
"require": {
"cleverogre/plugin-framework": "dev-main"
},
"replace": {
"yahnis-elsts/plugin-update-checker": "*",
"froger-me/wp-package-updater": "*",
"magicoli/wp-package-updater-lib": "*",
"wpengine/advanced-custom-fields-pro": "*"
},
"config": {
"optimize-autoloader": true
}
}

70
composer.lock generated Normal file
View File

@@ -0,0 +1,70 @@
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "7e20dd4d5ed03d04d9ecb241e18fece9",
"packages": [
{
"name": "cleverogre/plugin-framework",
"version": "dev-main",
"source": {
"type": "git",
"url": "git@git.cleverogre.com:cleverogre/plugin-framework.git",
"reference": "3fd0d5689801b2e7ca9f457f2082ccec283ed86e"
},
"require": {
"froger-me/wp-package-updater": "^1.4.0",
"magicoli/wp-package-updater-lib": "^0.1.9",
"wpengine/advanced-custom-fields-pro": "^6.4.2",
"yahnis-elsts/plugin-update-checker": "^5.0"
},
"default-branch": true,
"type": "library",
"extra": {
"installer-paths": {
"acf/": [
"wpengine/advanced-custom-fields-pro"
]
}
},
"autoload": {
"files": [
"plugin-framework.php",
"inc/package-updater.php",
"inc/acf.php",
"inc/trait-singleton.php",
"inc/abstract-plugin.php"
]
},
"scripts": {
"post-update-cmd": [
"php vendor/magicoli/wp-package-updater-lib/install.php"
]
},
"license": [
"GPL-3.0+"
],
"description": "Framework for WordPress plugins created by CleverOgre",
"homepage": "https://cleverogre.com",
"keywords": [
"Framework",
"Plugin",
"WordPress"
],
"time": "2025-10-29T15:56:48+00:00"
}
],
"packages-dev": [],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": {
"cleverogre/plugin-framework": 20
},
"prefer-stable": false,
"prefer-lowest": false,
"platform": {},
"platform-dev": {},
"plugin-api-version": "2.6.0"
}

56
gulpfile.js Normal file
View File

@@ -0,0 +1,56 @@
const gulp = require('gulp'),
clean = require('gulp-clean'),
concatCss = require('gulp-concat-css'),
postcss = require('gulp-postcss'),
cssnano = require('cssnano'),
sass = require('gulp-sass')(require('sass'));
// Clean Tasks
gulp.task('clean-style', function () {
return gulp.src('style.css', {
read: false,
allowEmpty: true,
}).pipe(clean());
});
gulp.task(
'clean',
gulp.series(
'clean-style'
)
);
// Compile Tasks
gulp.task('compile-style', function () {
return gulp.src('assets/sass/style.scss', { base: './' })
.pipe(sass().on('error', sass.logError))
.pipe(concatCss('style.css'))
.pipe(postcss(cssnano()))
.pipe(gulp.dest('assets/css'));
});
gulp.task(
'compile',
gulp.series(
'compile-style'
)
);
// Default Tasks
gulp.task(
'default',
gulp.series(
'clean',
'compile'
)
);
gulp.task('watch', function () {
gulp.watch(['assets/sass/**/*.scss']).on(
'change',
'default'
);
});

47
inc/class-admin.php Normal file
View File

@@ -0,0 +1,47 @@
<?php
/**
* @package ogre-suspension
* @author cleverogre
* @version 1.0.0
* @since 1.0.0
*/
namespace Ogre\Suspension;
use Ogre\Singleton;
defined('ABSPATH') || exit;
final class Admin {
use Singleton;
protected function __construct() {
add_action('init', [$this, 'logout'], 1);
add_action('init', [$this, 'frontend_redirect'], 2);
add_action('admin_init', [$this, 'logout'], 1);
add_action('admin_init', [$this, 'admin_redirect'], 2);
}
public function logout():void {
if (!is_user_logged_in()) return;
wp_logout();
$this->do_redirect();
}
public function frontend_redirect():void {
if (is_front_page()) return;
$this->do_redirect();
}
public function admin_redirect():void {
$this->do_redirect();
}
private function do_redirect():void {
wp_redirect(get_site_url());
exit;
}
}
Admin::instance();

67
inc/class-template.php Normal file
View File

@@ -0,0 +1,67 @@
<?php
/**
* @package ogre-suspension
* @author cleverogre
* @version 1.0.0
* @since 1.0.0
*/
namespace Ogre\Suspension;
use Ogre\Singleton;
use Ogre\Suspension;
defined('ABSPATH') || exit;
final class Template {
use Singleton;
protected function __construct() {
add_action('template_redirect', [$this, 'template_redirect']);
}
public function template_redirect():void {
$path = self::get_path();
if (file_exists($path)) {
include($path);
exit;
} else {
wp_die(Suspension::__('Site unavailable.'));
}
}
public static function get_path():string {
return Suspension::get_dir('templates/suspended.php');
}
public static function get_title():string {
return sprintf(
'%s - %s',
get_bloginfo('title'),
Suspension::__('Site Unavailable')
);
}
public static function the_title():void {
echo esc_html(self::get_title());
}
public static function get_image_url():string {
return Suspension::get_url('assets/logo.svg');
}
public static function get_image():string {
return sprintf(
'<img src="%s" alt="%s" width="206" height="150" />',
esc_url(self::get_image_url()),
Suspension::esc_attr__('CleverOgre Logo')
);
}
public static function the_image():void {
echo self::get_image();
}
}
Template::instance();

33
ogre-suspension.php Normal file
View File

@@ -0,0 +1,33 @@
<?php
/*
Plugin Name: OgreSuspension
Plugin URI: https://git.cleverogre.com/cleverogre/ogre-suspension
Description: OgreSuspension will lock down a WordPress instance with a custom suspension page and prevent access to the admin dashboard. Use with caution!
Version: 1.0.0
Author: CleverOgre
Author URI: https://cleverogre.com/
Text Domain: ogre-suspension
License: GPLv3 or later
License URI: http://www.gnu.org/licenses/gpl-3.0.html
Copyright: © 2025 CleverOgre, Inc. All rights reserved.
*/
namespace Ogre;
defined('ABSPATH') || exit;
require_once 'vendor/autoload.php';
final class Suspension extends Plugin {
protected function __construct() {
parent::__construct();
$this->add_files([
'inc/class-template.php',
'inc/class-admin.php',
]);
}
}
Suspension::instance();

5040
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

28
package.json Normal file
View File

@@ -0,0 +1,28 @@
{
"$schema": "https://www.schemastore.org/package.json",
"name": "cleverogre/ogre-suspension",
"version": "1.0.0",
"title": "OgreSuspension",
"description": "OgreSuspension will lock down a WordPress instance with a custom suspension page and prevent access to the admin dashboard. Use with caution!",
"author": "CleverOgre",
"license": "GPL-3.0+",
"keywords": [
"WordPress",
"Plugin",
"suspension",
"lockdown",
"shutdown",
"suspend"
],
"homepage": "https://cleverogre.com",
"engines": {
"node": ">=21.1.0",
"npm": ">=10.2.3"
},
"devDependencies": {
"gulp": "^5.0.0",
"gulp-clean": "^0.4.0",
"gulp-cli": "^2.3.0",
"gulp-zip": "^6.1.0"
}
}

32
readme.txt Normal file
View File

@@ -0,0 +1,32 @@
=== OgreSuspension ===
Contributors: ogrecooper, cleverogre
Tested up to: 6.8.3
Requires at least: 5.0
Requires PHP: 8.0
Version: 1.0.0
License: GPLv3 or later
License URI: https://www.gnu.org/licenses/gpl-3.0.html
Copyright: CleverOgre
Donate link: https://cleverogre.com/
Tags: wordpress, plugin, suspension, lockdown, shutdown, suspend
OgreSuspension will lock down a WordPress instance with a custom suspension page and prevent access to the admin dashboard. Use with caution!
== Installation ==
The required libraries can be installed using the following command:
`composer install`
You can install the optional development tools using the following command:
`npm install`
== FAQ ==
= What is this plugin? =
If you don't know what plugin you have downloaded, please contact [CleverOgre](team@cleverogre.com) for more information.
== Changelog ==
= 1.0.0 - 2025-10-29 =
* Initial release

60
templates/suspended.php Normal file
View File

@@ -0,0 +1,60 @@
<?php
/**
* @package ogre-suspension
* @author cleverogre
* @version 1.0.0
* @since 1.0.0
*/
use Ogre\Suspension;
use Ogre\Suspension\Template;
?><!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<meta http-equiv="Cache-control" content="no-cache">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="0">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title><?php Template::the_title(); ?></title>
</head>
<body>
<main>
<figure>
<a href="https://cleverogre.com/"><?php Template::the_image(); ?></a>
</figure>
<h1 class="screen-reader-text"><?php Suspension::esc_html_e('CleverOgre'); ?></h1>
<p><?php Suspension::esc_html_e('Purveyors of Fine Pensacola Websites Since 2007'); ?></p>
<h3><?php Suspension::esc_html_e('Well hey there, fancy meeting you here!'); ?></h3>
<p><?php Suspension::esc_html_e('Looks like you found one of our sites that\'s not quite ready yet for public viewing. That\'s okay, happens to the best of us.'); ?></p>
<p><?php printf(
Suspension::esc_html__('May we suggest heading on over to our website, %s, to learn more about our company. You can see %s, %s and %s.'),
'<a href="https://cleverogre.com/">cleverogre.com</a>',
sprintf(
'<a href="https://cleverogre.com/you/">%s</a>',
Suspension::esc_html__('what we do')
),
sprintf(
'<a href="https://cleverogre.com/us/">%s</a>',
Suspension::esc_html__('who we are')
),
sprintf(
'<a href="https://cleverogre.com/them/">%s</a>',
Suspension::esc_html__('how we help our clients be awesome')
)
); ?></p>
<p><?php printf(
Suspension::esc_html__('Of course, if you have any questions for the Ogres you can always use any of the methods listed on our %s.'),
sprintf(
'<a href="https://cleverogre.com/contact/">%s</a>',
Suspension::esc_html__('contact page')
)
); ?></p>
<p><?php Suspension::esc_html_e('Thanks for stopping by!'); ?></p>
</main>
<link rel="stylesheet" href="<?php echo esc_url(Suspension::get_url('assets/style.css')); ?>" type="text/css" media="all">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Passion+One:400,700,900" type="text/css" media="all">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto+Slab:400,700" type="text/css" media="all">
</body>
</html>