PluginProbe
Hostinger Tools / 1.9.6
Hostinger Tools v1.9.6
3.0.77 3.0.76 3.0.75 3.0.74 3.0.73 3.0.72 3.0.71 3.0.70 3.0.69 3.0.68 3.0.67 3.0.66 1.8.1 1.8.2 1.8.3 1.9.1 1.9.4 1.9.5 1.9.6 1.9.7 1.9.8 1.9.9 2.0.0 2.0.1 2.0.4 All 108 releases
hostinger / includes / class-hostinger-bootstrap.php

class-hostinger-bootstrap.php in Hostinger Tools 1.9.6, at includes/class-hostinger-bootstrap.php

76 lines 2.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 defined( 'ABSPATH' ) || exit;
4
5 class Hostinger_Bootstrap {
6 protected Hostinger_Loader $loader;
7
8 public function __construct() {
9 require_once HOSTINGER_ABSPATH . 'includes/class-hostinger-loader.php';
10 $this->loader = new Hostinger_Loader();
11 }
12
13 public function run(): void {
14 $this->load_dependencies();
15 $this->set_locale();
16 $this->loader->run();
17 }
18
19 private function load_dependencies(): void {
20 require_once HOSTINGER_ABSPATH . 'includes/class-hostinger-config.php';
21 require_once HOSTINGER_ABSPATH . 'includes/class-hostinger-helper.php';
22 require_once HOSTINGER_ABSPATH . 'includes/class-hostinger-errors.php';
23 require_once HOSTINGER_ABSPATH . 'includes/class-hostinger-settings.php';
24 require_once HOSTINGER_ABSPATH . 'includes/requests/class-hostinger-requests-client.php';
25
26 if ( ! empty( Hostinger_Helper::get_api_token() ) ) {
27 require_once HOSTINGER_ABSPATH . 'includes/amplitude/class-hostinger-amplitude-actions.php';
28 require_once HOSTINGER_ABSPATH . 'includes/amplitude/class-hostinger-amplitude.php';
29 }
30
31 $this->load_onboarding_dependencies();
32 $this->load_public_dependencies();
33
34 if ( is_admin() ) {
35 $this->load_admin_dependencies();
36 }
37
38 if ( defined( 'WP_CLI' ) && WP_CLI ) {
39 require_once HOSTINGER_ABSPATH . 'includes/class-hostinger-cli.php';
40 }
41
42 require_once HOSTINGER_ABSPATH . 'includes/class-hostinger-i18n.php';
43
44 if ( get_option( 'hostinger_maintenance_mode', 0 ) ) {
45 require_once HOSTINGER_ABSPATH . 'includes/class-hostinger-coming-soon.php';
46 }
47 }
48
49 private function set_locale() {
50
51 $plugin_i18n = new Hostinger_i18n();
52 $this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );
53
54 }
55
56 private function load_admin_dependencies(): void {
57 require_once HOSTINGER_ABSPATH . 'includes/admin/class-hostinger-admin-assets.php';
58 require_once HOSTINGER_ABSPATH . 'includes/admin/class-hostinger-admin-menu.php';
59 require_once HOSTINGER_ABSPATH . 'includes/admin/class-hostinger-admin-ajax.php';
60 require_once HOSTINGER_ABSPATH . 'includes/admin/class-hostinger-admin-redirect.php';
61 }
62
63 private function load_public_dependencies(): void {
64 require_once HOSTINGER_ABSPATH . 'includes/public/class-hostinger-public-assets.php';
65 }
66
67 private function load_onboarding_dependencies(): void {
68 require_once HOSTINGER_ABSPATH . 'includes/admin/class-hostinger-admin-actions.php';
69 require_once HOSTINGER_ABSPATH . 'includes/admin/onboarding/class-hostinger-onboarding-settings.php';
70
71 if ( ! Hostinger_Onboarding_Settings::all_steps_completed() ) {
72 require_once HOSTINGER_ABSPATH . 'includes/admin/onboarding/class-hostinger-autocomplete-steps.php';
73 }
74 }
75 }
76