PluginProbe
Elementor Website Builder – more than just a page builder / 4.3.3
Elementor Website Builder – more than just a page builder v4.3.3
4.3.3 4.3.2 4.3.1 4.3.0 4.3.0-beta3 4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 All 456 releases
elementor / vendor / elementor / wp-one-package / src / Loader.php

Loader.php in Elementor Website Builder – more than just a page builder 4.3.3, at vendor/elementor/wp-one-package/src/Loader.php

114 lines 3.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace ElementorOne;
4
5 use ElementorOne\Admin\Config;
6 use ElementorOne\Connect\Facade;
7
8 if ( ! defined( 'ABSPATH' ) ) {
9 exit; // Exit if accessed directly.
10 }
11
12 /**
13 * Class \ElementorOne\Loader
14 */
15 class Loader {
16
17 /**
18 * Initialize the loader.
19 * @return void
20 */
21 public static function init(): void {
22 /**
23 * Fires in the early stages of Elementor One init hook.
24 */
25 do_action( 'elementor_one/pre_init' );
26
27 self::define_constants();
28 self::initialize_connect();
29 self::initialize_services();
30 self::initialize_components();
31 self::initialize_controllers();
32 }
33
34 /**
35 * Initialize the Connect facade with configuration.
36 *
37 * @return void
38 */
39 private static function initialize_connect(): void {
40 Facade::make( [
41 'app_name' => Config::APP_NAME,
42 'app_prefix' => Config::APP_PREFIX,
43 'app_rest_namespace' => Config::APP_REST_NAMESPACE,
44 'admin_page' => Config::ADMIN_PAGE,
45 'base_url' => Config::BASE_URL,
46 'app_type' => Config::APP_TYPE,
47 'plugin_slug' => Config::PLUGIN_SLUG,
48 'scopes' => Config::SCOPES,
49 'connect_mode' => Config::CONNECT_MODE,
50 'state_nonce' => Config::STATE_NONCE,
51 ] );
52 }
53
54 /**
55 * Initialize all services.
56 *
57 * @return void
58 */
59 private static function initialize_services(): void {
60 \ElementorOne\Admin\Services\Editor::instance();
61 \ElementorOne\Admin\Services\Licenses::instance();
62 \ElementorOne\Admin\Services\Migration::instance();
63 }
64
65 /**
66 * Initialize all components.
67 *
68 * @return void
69 */
70 private static function initialize_components(): void {
71 \ElementorOne\Admin\Components\Page::instance();
72 \ElementorOne\Admin\Components\Assets::instance();
73 \ElementorOne\Admin\Components\Fields::instance();
74 \ElementorOne\Admin\Components\Onboarding::instance();
75 \ElementorOne\Admin\Components\ManageDashboardWidget::instance();
76 }
77
78 /**
79 * Initialize all REST controllers.
80 *
81 * @return void
82 */
83 private static function initialize_controllers(): void {
84 new \ElementorOne\Admin\Controllers\TopBar();
85 new \ElementorOne\Admin\Controllers\Themes();
86 new \ElementorOne\Admin\Controllers\Plugins();
87 new \ElementorOne\Admin\Controllers\Settings();
88 new \ElementorOne\Admin\Controllers\ManageDashboardWidget();
89 new \ElementorOne\Admin\Controllers\Logs();
90 }
91
92 /**
93 * Define constants
94 * @return void
95 */
96 public static function define_constants(): void {
97 if ( ! defined( 'ELEMENTOR_ONE_ASSETS_URL' ) && function_exists( 'plugin_dir_url' ) ) {
98 define( 'ELEMENTOR_ONE_ASSETS_URL', plugin_dir_url( __DIR__ ) . 'assets/build/' );
99 }
100
101 if ( ! defined( 'ELEMENTOR_ONE_ASSETS_PATH' ) && function_exists( 'plugin_dir_path' ) ) {
102 define( 'ELEMENTOR_ONE_ASSETS_PATH', plugin_dir_path( __DIR__ ) . 'assets/build/' );
103 }
104
105 if ( ! defined( 'ELEMENTOR_ONE_UI_ASSETS_ROOT_URL' ) && function_exists( 'plugin_dir_url' ) ) {
106 define( 'ELEMENTOR_ONE_UI_ASSETS_ROOT_URL', plugin_dir_url( __DIR__ ) . 'assets/elementor-home/' );
107 }
108
109 if ( ! defined( 'ELEMENTOR_ONE_CLIENT_APP_URL' ) ) {
110 define( 'ELEMENTOR_ONE_CLIENT_APP_URL', ELEMENTOR_ONE_UI_ASSETS_ROOT_URL . 'client.js' );
111 }
112 }
113 }
114