-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathymodules.php
55 lines (49 loc) · 1.66 KB
/
ymodules.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
53
54
55
<?php
/**
* YModules - Modular Extension System for WordPress
*
* A lightweight, performance-focused modular system that follows the Y Modules Manifesto principles
* of Zero Redundancy, Minimal Requests, and Maximal Performance.
*
* @package YModules
* @version 1.0.0
*
* Plugin Name: YModules
* Plugin URI: https://example.com/ymodules
* Description: Lightweight modular extension system for WordPress
* Version: 1.0.0
* Author: YModules Team
* Author URI: https://example.com
* Text Domain: ymodules
* Domain Path: /languages
* Requires at least: 5.0
* Requires PHP: 7.2
*/
// If this file is called directly, abort
if (!defined('ABSPATH')) {
exit;
}
// Define plugin constants
define('YMODULES_VERSION', '1.0.0');
define('YMODULES_PLUGIN_FILE', __FILE__);
define('YMODULES_PLUGIN_DIR', plugin_dir_path(__FILE__));
define('YMODULES_PLUGIN_URL', plugin_dir_url(__FILE__));
define('YMODULES_MODULES_DIR', YMODULES_PLUGIN_DIR . 'modules/');
// Define new structure constants
define('YMODULES_SRC_DIR', YMODULES_PLUGIN_DIR . 'src/');
define('YMODULES_SRC_URL', YMODULES_PLUGIN_URL . 'src/');
define('YMODULES_ASSETS_DIR', YMODULES_PLUGIN_DIR . 'assets/');
define('YMODULES_ASSETS_URL', YMODULES_PLUGIN_URL . 'assets/');
define('YMODULES_SRC_ASSETS_DIR', YMODULES_SRC_DIR . 'assets/');
define('YMODULES_SRC_ASSETS_URL', YMODULES_SRC_URL . 'assets/');
// Include the autoloader
require_once YMODULES_PLUGIN_DIR . 'autoload.php';
// Initialize plugin
function ymodules_init() {
// Create and initialize YModules with WordPress adapter
return \YModules\YModules::getInstance([
'plugin_file' => YMODULES_PLUGIN_FILE
]);
}
// Start the plugin
ymodules_init();