Diff: STRATO-apps/wordpress_03/app/wp-content/plugins/tutor-pro/addons/google-meet/google-meet.php
Keine Baseline-Datei – Diff nur gegen leer.
1
-
1
+
<?php
2
+
/**
3
+
* Tutor Google Meet Addon
4
+
*
5
+
* @package TutorPro\Addons
6
+
* @subpackage GoogleMeet
7
+
* @author Themeum <support@themeum.com>
8
+
* @link https://themeum.com
9
+
* @since 2.1.0
10
+
*/
11
+
12
+
namespace TutorPro\GoogleMeet;
13
+
14
+
use TUTOR\Permalink;
15
+
use TutorPro\GoogleMeet\Admin\Admin;
16
+
use TutorPro\GoogleMeet\Assets\Enqueue;
17
+
use TutorPro\GoogleMeet\CustomPosts\InitPostTypes;
18
+
use TutorPro\GoogleMeet\Frontend\Frontend;
19
+
use TutorPro\GoogleMeet\GoogleEvent\Events;
20
+
use TutorPro\GoogleMeet\GoogleEvent\GoogleEvent;
21
+
use TutorPro\GoogleMeet\MetaBox\MetaBox;
22
+
use TutorPro\GoogleMeet\Settings\Settings;
23
+
use TutorPro\GoogleMeet\TopicsEvent\TopicsEvent;
24
+
use TutorPro\GoogleMeet\Validator\Validator;
25
+
26
+
if ( ! class_exists( 'GoogleMeet' ) ) {
27
+
28
+
/**
29
+
* PluginStarter main class that trigger the plugin
30
+
*/
31
+
final class GoogleMeet {
32
+
33
+
/**
34
+
* Plugin meta data
35
+
*
36
+
* @since v1.0.0
37
+
*
38
+
* @var array addon meta data.
39
+
*/
40
+
private static $meta_data = array();
41
+
42
+
/**
43
+
* Plugin instance
44
+
*
45
+
* @since v1.0.0
46
+
*
47
+
* @var $instance
48
+
*/
49
+
public static $instance = null;
50
+
51
+
/**
52
+
* Register hooks and load dependent files
53
+
*
54
+
* @since v1.0.0
55
+
*
56
+
* @return void
57
+
*/
58
+
public function __construct() {
59
+
require_once tutor_pro()->path . '/vendor/autoload.php';
60
+
61
+
add_action( 'tutor_addon_before_enable_tutor-pro/addons/google-meet/google-meet.php', array( $this, 'update_permalink' ) );
62
+
63
+
$this->load_packages();
64
+
}
65
+
66
+
/**
67
+
* Update permalink during addon enable.
68
+
*
69
+
* @since 2.6.0
70
+
*
71
+
* @return void
72
+
*/
73
+
public function update_permalink() {
74
+
Permalink::set_permalink_flag();
75
+
}
76
+
77
+
/**
78
+
* Plugin meta data
79
+
*
80
+
* @since v1.0.0
81
+
*
82
+
* @return array contains plugin meta data
83
+
*/
84
+
public static function meta_data(): array {
85
+
self::$meta_data['url'] = plugin_dir_url( __FILE__ );
86
+
self::$meta_data['path'] = plugin_dir_path( __FILE__ );
87
+
self::$meta_data['basename'] = plugin_basename( __FILE__ );
88
+
self::$meta_data['templates'] = trailingslashit( plugin_dir_path( __FILE__ ) . 'templates' );
89
+
self::$meta_data['views'] = trailingslashit( plugin_dir_path( __FILE__ ) . 'views' );
90
+
self::$meta_data['assets'] = trailingslashit( plugin_dir_url( __FILE__ ) . 'assets' );
91
+
92
+
// set ENV DEV | PROD.
93
+
self::$meta_data['env'] = 'DEV';
94
+
return self::$meta_data;
95
+
}
96
+
97
+
/**
98
+
* Create and return instance of this plugin
99
+
*
100
+
* @return self instance of plugin
101
+
*/
102
+
public static function instance() {
103
+
// If tutor is not active then return.
104
+
if ( ! function_exists( 'tutor' ) ) {
105
+
return;
106
+
}
107
+
108
+
if ( null === self::$instance ) {
109
+
self::$instance = new self();
110
+
}
111
+
return self::$instance;
112
+
}
113
+
114
+
/**
115
+
* Load packages
116
+
*
117
+
* @return void
118
+
*/
119
+
public function load_packages() {
120
+
new Init();
121
+
if ( Validator::is_addon_enabled() ) {
122
+
new Settings();
123
+
new Admin();
124
+
new InitPostTypes();
125
+
new GoogleEvent();
126
+
new Enqueue();
127
+
new Events();
128
+
new TopicsEvent();
129
+
new Frontend();
130
+
}
131
+
}
132
+
}
133
+
134
+
// trigger.
135
+
GoogleMeet::instance();
136
+
}
137
+