-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
64 lines (55 loc) · 1.66 KB
/
index.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
56
57
58
59
60
61
62
63
64
<?php
/**
* @author [email protected]
* @copyright 2023 Goodmotion
* @license GPL-2.0-or-later
*
* @wordpress-plugin
* Plugin Name: Deaktiver
* Plugin URI: false
* Description: Disable native features of WordPress that you don't need.
* Version: 0.0.1
* Requires at least: 6.0
* Requires PHP: 8.0
* Author: Faramaz patrick
* Author URI: https://goodmotion.fr
* Text Domain: deaktiver
* Domain Path: /languages
* License: GPL v2 or later
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
* Update URI: false
*/
use Deaktiver\Dependencies\PressWind\PWVite;
use Deaktiver\Options\OptionsPage;
use Deaktiver\Options\OptionsServices;
require_once __DIR__ . '/vendor/autoload.php';
if (! defined('WP_ENV')) {
define('WP_ENV', 'development');
}
define('WPPERFORMANCE_DEAKTIVER', 'deaktiver');
define('WPPERFORMANCE_DEAKTIVER_URI', plugin_dir_url(__DIR__) . WPPERFORMANCE_DEAKTIVER);
/**
* admin options page
*/
new OptionsPage;
new OptionsServices;
/**
* init all deaktive activated
*/
Deaktiver\Deaktive\Deaktiver::init();
// if page is deaktiver load assets
if (isset($_GET['page']) && $_GET['page'] === WPPERFORMANCE_DEAKTIVER) {
PWVite::init(port: 9980, path: '/admin-app', position: 'admin',
plugin_path: __FILE__, slug: WPPERFORMANCE_DEAKTIVER);
}
/**
* Load the plugin text domain for translation.
*/ function deaktiver_load_textdomain()
{
load_plugin_textdomain(
WPPERFORMANCE_DEAKTIVER,
false,
basename(dirname(__FILE__)) . '/languages'
);
}
add_action('init', 'deaktiver_load_textdomain');