forked from Simply-Static/simply-static
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsimply-static.php
executable file
·52 lines (44 loc) · 1.6 KB
/
simply-static.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
41
42
43
44
45
46
47
48
49
50
51
52
<?php
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* Plugin Name: Simply Static
* Plugin URI: https://patrickposner.dev
* Description: A static site generator to create fast and secure static versions of your WordPress website.
* Version: 2.2.1.1
* Author: Patrick Posner
* Author URI: https://patrickposner.dev
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
* Text Domain: simply-static
* Domain Path: /languages
*/
define( 'SIMPLY_STATIC_PATH', plugin_dir_path( __FILE__ ) );
define( 'SIMPLY_STATIC_URL', untrailingslashit( plugin_dir_url( __FILE__ ) ) );
// Check PHP version.
if ( version_compare( PHP_VERSION, '7.2.5', '<' ) ) {
deactivate_plugins( plugin_basename( __FILE__ ) );
wp_die( esc_html__( 'Simply Static requires PHP 7.2.5 or higher.', 'simply-static' ), 'Plugin dependency check', array( 'back_link' => true ) );
}
// localize.
$textdomain_dir = plugin_basename( dirname( __FILE__ ) ) . '/languages';
load_plugin_textdomain( 'simply-static', false, $textdomain_dir );
// run autoloader.
if ( file_exists( __DIR__ . '/vendor/autoload.php' ) && ! class_exists( 'Simply_Static\Plugin' ) ) {
require __DIR__ . '/vendor/autoload.php';
}
// boot Simply Static.
if ( ! function_exists( 'simply_static_run_plugin' ) ) {
add_action( 'plugins_loaded', 'simply_static_run_plugin' );
/**
* Run plugin
*
* @return void
*/
function simply_static_run_plugin() {
require_once SIMPLY_STATIC_PATH . 'src/class-ss-plugin.php';
Simply_Static\Plugin::instance();
}
}