-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathsimplerstatic.php
executable file
·40 lines (36 loc) · 1.24 KB
/
simplerstatic.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* Plugin Name: Simpler Static
* Plugin URI: http://simplerstatic.com
* Description: Simple WordPress static site generator
* Version: 0.2
* Author: Leon Stafford
* Author URI: https://ljs.dev
* License: The Unlicense
* License URI: https://unlicense.org
* Text Domain: simplerstatic
*/
/**
* Check that we're using at least version 7.3 of PHP
*/
if ( version_compare( PHP_VERSION, '7.3', '<' ) ) {
if ( is_admin() && ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) ) {
if ( ! is_plugin_active( plugin_basename( __FILE__ ) ) ) {
echo( "<p>'<b>Simpler Static</b> requires PHP 7.3 or higher</p>" );
exit();
}
deactivate_plugins( __FILE__ );
}
} else {
define( 'SIMPLERSTATIC_PATH', plugin_dir_path( __FILE__ ) );
if ( file_exists( SIMPLERSTATIC_PATH . 'vendor/autoload.php' ) ) {
require_once SIMPLERSTATIC_PATH . 'vendor/autoload.php';
}
// Loading up Simpler Static in a separate file so that there's nothing to
// trigger a PHP error in this file (e.g. by using namespacing)
SimplerStatic\Plugin::instance();
}