PluginProbe
Templately – Elementor & Gutenberg Template Library: 6500+ Free & Pro Ready Templates And Cloud! / 2.2.0
Templately – Elementor & Gutenberg Template Library: 6500+ Free & Pro Ready Templates And Cloud! v2.2.0
3.7.5 3.7.4 3.7.3 3.7.2 1-final 3.7.1 3.7.0 3.6.8 3.6.7 3.6.6 3.6.5 3.6.4 3.6.3 3.6.2 3.6.1 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.10 All 111 releases
← All changes | includes/Plugin.php +56 -77 3.1.102.2.0 View file →
@@ -6,15 +6,10 @@
6 6 * class registers and all the components required to run the plugin.
7 7 *
8 8 * @package Templately
9 9 */
10 -
11 10 namespace Templately;
12 11
13 -use Templately\API\Conditions;
14 -use Templately\API\ThemeBuilderApi;
15 -use Templately\Builder\ThemeBuilder;
16 -use Templately\Core\Importer\FullSiteImport;
17 12 use Templately\Utils\Base;
18 13 use Templately\Utils\Enqueue;
19 14
20 15 use Templately\Core\Admin;
@@ -37,47 +32,39 @@
37 32 use Templately\Core\Platform\Gutenberg;
38 33 use Templately\Core\Platform\Elementor;
39 34
40 35 final class Plugin extends Base {
41 - public $version = '3.1.10';
36 + public $version = '2.2.0';
42 37
43 38 public $admin;
44 - /**
45 - * Enqueue class responsible for assets
46 - * @var Enqueue
47 - */
48 - public $assets;
39 + /**
40 + * Enqueue class responsible for assets
41 + * @var Enqueue
42 + */
43 + public $assets;
44 + /**
45 + * Plugin constructor.
46 + * Initializing Templately plugin.
47 + *
48 + * @access private
49 + */
50 + public function __construct() {
51 + $this->define_constants();
52 + $this->set_locale();
49 53
50 - /**
51 - * @var ThemeBuilder
52 - */
53 - public $theme_builder;
54 -
55 - /**
56 - * Plugin constructor.
57 - * Initializing Templately plugin.
58 - *
59 - * @access private
60 - */
61 - public function __construct() {
62 - $this->define_constants();
63 - $this->set_locale();
64 -
65 54 Maintenance::init();
66 55
67 - $this->assets = Enqueue::get_instance( TEMPLATELY_URL, TEMPLATELY_PATH, $this->version );
68 - $this->admin = Admin::get_instance();
69 - $this->theme_builder = ThemeBuilder::get_instance();
56 + $this->assets = Enqueue::get_instance( TEMPLATELY_URL, TEMPLATELY_PATH, $this->version );
57 + $this->admin = Admin::get_instance();
70 58
71 - add_action( 'plugins_loaded', [ $this, 'plugins_loaded' ] );
72 - add_action( 'rest_api_init', [ $this, 'register_routes' ] );
59 + add_action( 'plugins_loaded', [$this, 'plugins_loaded'] );
60 + add_action( 'rest_api_init', [$this, 'register_routes'] );
73 61 /**
74 62 * Initialize.
75 63 */
76 - do_action( 'templately_init' );
64 + do_action( 'templately_init' );
65 + }
77 66
78 - }
79 -
80 67 /**
81 68 * Cloning is forbidden.
82 69 *
83 70 * @since 2.0
@@ -86,14 +73,14 @@
86 73 _doing_it_wrong( __FUNCTION__, __( 'Cloning is forbidden.', 'templately' ), '2.0' );
87 74 }
88 75
89 76 /**
90 - * Un-serializing instances of this class is forbidden.
77 + * Unserializing instances of this class is forbidden.
91 78 *
92 79 * @since 2.0
93 80 */
94 81 public function __wakeup() {
95 - _doing_it_wrong( __FUNCTION__, __( 'Un-serializing instances of this class is forbidden.', 'templately' ), '2.0' );
82 + _doing_it_wrong( __FUNCTION__, __( 'Unserializing instances of this class is forbidden.', 'templately' ), '2.0' );
96 83 }
97 84
98 85 /**
99 86 * Initializing Things on Plugins Loaded
@@ -98,9 +85,9 @@
98 85 /**
99 86 * Initializing Things on Plugins Loaded
100 87 * @return void
101 88 */
102 - public function plugins_loaded() {
89 + public function plugins_loaded(){
103 90 $this->platforms(); // PLATFORMS LOADED
104 91 $this->apis(); // APIs LOADED
105 92
106 93 /**
@@ -106,13 +93,8 @@
106 93 /**
107 94 * Migrator for Templately
108 95 */
109 96 Migrator::get_instance();
110 -
111 - /**
112 - * Full Site Import
113 - */
114 - FullSiteImport::get_instance();
115 97 }
116 98
117 99 /**
118 100 * Initialize all platforms
@@ -117,12 +99,12 @@
117 99 /**
118 100 * Initialize all platforms
119 101 * @return void
120 102 */
121 - public function platforms() {
122 - Gutenberg::get_instance();
123 - Elementor::get_instance();
124 - }
103 + public function platforms(){
104 + Gutenberg::get_instance();
105 + Elementor::get_instance();
106 + }
125 107
126 108 /**
127 109 * All the API instantiated
128 110 *
@@ -127,25 +109,23 @@
127 109 * All the API instantiated
128 110 *
129 111 * @return void
130 112 */
131 - private function apis() {
132 - Conditions::get_instance();
113 + private function apis(){
133 114 Categories::get_instance();
134 - TemplateTypes::get_instance();
135 - Dependencies::get_instance();
136 - Tags::get_instance();
137 - ThemeBuilderApi::get_instance();
115 + TemplateTypes::get_instance();
116 + Dependencies::get_instance();
117 + Tags::get_instance();
138 118
139 - Items::get_instance();
140 - SavedTemplates::get_instance();
119 + Items::get_instance();
120 + SavedTemplates::get_instance();
141 121
142 - Login::get_instance();
143 - SignUp::get_instance();
144 - Import::get_instance();
145 - Profile::get_instance();
146 - MyClouds::get_instance();
147 - WorkSpaces::get_instance();
122 + Login::get_instance();
123 + SignUp::get_instance();
124 + Import::get_instance();
125 + Profile::get_instance();
126 + MyClouds::get_instance();
127 + WorkSpaces::get_instance();
148 128 }
149 129
150 130 /**
151 131 * Register all REST API endpoints
@@ -150,40 +130,39 @@
150 130 /**
151 131 * Register all REST API endpoints
152 132 * @return void
153 133 */
154 - public function register_routes() {
155 - if ( ! empty( $modules = Module::get_instance()->get( 'API' ) ) ) {
156 - foreach ( $modules as $module ) {
134 + public function register_routes(){
135 + if( ! empty( $modules = Module::get_instance()->get( 'API' ) ) ) {
136 + foreach( $modules as $module ) {
157 137 $module->object->register_routes();
158 138 }
159 139 }
160 - }
140 + }
161 141
162 142 /**
163 143 * Define CONSTANTS
164 144 *
145 + * @since 2.0.0
165 146 * @return void
166 - * @since 2.0.0
167 147 */
168 - public function define_constants() {
169 - $this->define( 'TEMPLATELY_URL', plugin_dir_url( TEMPLATELY_FILE ) );
170 - $this->define( 'TEMPLATELY_ASSETS', TEMPLATELY_URL . 'assets/' );
148 + public function define_constants() {
149 + $this->define( 'TEMPLATELY_URL', plugin_dir_url( TEMPLATELY_FILE ) );
150 + $this->define( 'TEMPLATELY_ASSETS', TEMPLATELY_URL . 'assets/' );
171 151 $this->define( 'TEMPLATELY_PLUGIN_BASENAME', plugin_basename( TEMPLATELY_FILE ) );
172 152 $this->define( 'TEMPLATELY_VERSION', $this->version );
173 - $this->define( 'TEMPLATELY_API_NAMESPACE', 'templately/v1' );
174 - $this->define( 'TEMPLATELY_VIEWS_ABSPATH', TEMPLATELY_PATH . 'views/' );
175 - }
153 + $this->define( 'TEMPLATELY_API_NAMESPACE', 'templately/v1' );
154 + }
176 155
177 156 /**
178 157 * Define constant if not already set.
179 158 *
180 - * @param string $name Constant name.
159 + * @param string $name Constant name.
181 160 * @param mixed $value Constant value.
182 161 *
183 162 * @return void
184 163 */
185 - private function define( string $name, $value ) {
164 + private function define( $name, $value ) {
186 165 if ( ! defined( $name ) ) {
187 166 define( $name, $value );
188 167 }
189 168 }
@@ -189,21 +168,21 @@
189 168 }
190 169
191 170 /**
192 171 * Setting the locale for translation availability
172 + * @since 1.0.0
193 173 * @return void
194 - * @since 1.0.0
195 174 */
196 - public function set_locale() {
175 + public function set_locale(){
197 176 add_action( 'init', [ $this, 'load_textdomain' ] );
198 177 }
199 178
200 179 /**
201 180 * Loading Text Domain on init HOOK
202 - * @return void
203 181 * @since 1.0.0
204 182 *
183 + * @return void
205 184 */
206 - public function load_textdomain() {
185 + public function load_textdomain(){
207 186 load_plugin_textdomain( 'templately', false, dirname( TEMPLATELY_PLUGIN_BASENAME ) . '/languages' );
208 187 }
209 188 }