-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplugin-name.php
More file actions
43 lines (36 loc) · 1.58 KB
/
Copy pathplugin-name.php
File metadata and controls
43 lines (36 loc) · 1.58 KB
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
<?php
/**
* Plugin Name: WordPress MVC Starter
* Description: A WordPress-native MVC application starter kit.
* Version: 1.0.0
* Requires at least: 6.5
* Requires PHP: 8.2
* Author: Shahin Ilderemi
* Author URI: https://ildrm.com
* License: GPL-2.0-or-later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: wordpress-mvc-starter
* Domain Path: /languages
*/
defined('ABSPATH') || exit;
define('STARTERKIT_MVC_FILE', __FILE__);
define('STARTERKIT_MVC_VERSION', '1.0.0');
if (PHP_VERSION_ID < 80200 || version_compare($GLOBALS['wp_version'] ?? '0', '6.5', '<')) {
add_action('admin_notices', static function (): void {
echo '<div class="notice notice-error"><p>' . esc_html__('WordPress MVC Starter requires PHP 8.2 and WordPress 6.5 or newer.', 'wordpress-mvc-starter') . '</p></div>';
});
return;
}
if (!is_file(__DIR__ . '/vendor/autoload.php')) {
add_action('admin_notices', static function (): void {
echo '<div class="notice notice-error"><p>'
. esc_html__('WordPress MVC Starter is missing its Composer autoloader. Install the release ZIP or run composer install.', 'wordpress-mvc-starter')
. '</p></div>';
});
return;
}
require __DIR__ . '/vendor/autoload.php';
$starterkit_app = require __DIR__ . '/bootstrap/app.php';
register_activation_hook(__FILE__, [$starterkit_app->make(\StarterKit\Mvc\WordPress\Lifecycle\Activator::class), 'activate']);
register_deactivation_hook(__FILE__, [$starterkit_app->make(\StarterKit\Mvc\WordPress\Lifecycle\Deactivator::class), 'deactivate']);
$starterkit_app->boot();