PluginProbe ʕ •ᴥ•ʔ
Prime Slider Addons for Elementor / 3.6.6
Prime Slider Addons for Elementor v3.6.6
4.4.2 4.4.1 4.4.0 4.3.1 4.3.0 4.2.2 4.2.1 trunk 1.11.0 1.12.0 1.9.0 2.10.0 2.2.0 2.3.0 2.4.0 2.5.1 2.6.2 2.7.1 2.8.0 2.8.1 2.9.4 2.9.5 3.0.0 3.1.0 3.1.3 3.10.0 3.10.2 3.10.3 3.10.4 3.10.5 3.10.6 3.11.10 3.11.11 3.11.12 3.11.13 3.11.2 3.11.5 3.11.6 3.11.7 3.11.9 3.12.0 3.13.4 3.13.7 3.14.0 3.14.1 3.14.10 3.14.11 3.14.12 3.14.13 3.14.14 3.14.15 3.14.2 3.14.5 3.14.6 3.14.7 3.14.8 3.14.9 3.15.0 3.15.1 3.15.10 3.15.11 3.15.12 3.15.13 3.15.14 3.15.15 3.15.16 3.15.17 3.15.18 3.15.19 3.15.2 3.15.20 3.15.21 3.15.22 3.15.23 3.15.3 3.15.4 3.15.5 3.15.6 3.15.7 3.15.8 3.15.9 3.16.0 3.16.1 3.16.2 3.16.3 3.16.4 3.16.5 3.16.6 3.17.0 3.17.1 3.17.10 3.17.11 3.17.12 3.17.13 3.17.14 3.17.15 3.17.16 3.17.17 3.17.2 3.17.3 3.17.4 3.17.5 3.17.6 3.17.7 3.17.8 3.17.9 3.18.0 3.18.1 3.18.2 3.18.3 3.18.4 3.18.5 3.18.6 3.18.7 3.2.0 3.4.0 3.4.1 3.5.3 3.5.6 3.6.1 3.6.2 3.6.5 3.6.6 3.7.1 3.8.3 3.9.1 4.0.0 4.0.1 4.0.10 4.0.2 4.0.3 4.0.4 4.0.5 4.0.6 4.0.7 4.0.8 4.0.9 4.1.0 4.1.1 4.1.10 4.1.11 4.1.12 4.1.13 4.1.2 4.1.3 4.1.4 4.1.5 4.1.6 4.1.7 4.1.9 4.2.0
bdthemes-prime-slider-lite / loader.php
bdthemes-prime-slider-lite Last commit date
admin 3 years ago assets 3 years ago base 3 years ago freemius 3 years ago includes 3 years ago languages 3 years ago modules 3 years ago traits 3 years ago bdthemes-prime-slider.php 3 years ago changelog.txt 3 years ago loader.php 3 years ago readme.txt 3 years ago
loader.php
444 lines
1 <?php
2
3 namespace PrimeSlider;
4
5 use Elementor\Plugin ;
6 if ( !defined( 'ABSPATH' ) ) {
7 exit;
8 }
9 // Exit if accessed directly
10 /**
11 * Main class for element pack
12 */
13 class Prime_Slider_Loader
14 {
15 /**
16 * @var Prime_Slider_Loader
17 */
18 private static $_instance ;
19 /**
20 * @var Manager
21 */
22 private $_modules_manager ;
23 private $classes_aliases = array(
24 'PrimeSlider\\Modules\\PanelPostsControl\\Module' => 'PrimeSlider\\Modules\\QueryControl\\Module',
25 'PrimeSlider\\Modules\\PanelPostsControl\\Controls\\Group_Control_Posts' => 'PrimeSlider\\Modules\\QueryControl\\Controls\\Group_Control_Posts',
26 'PrimeSlider\\Modules\\PanelPostsControl\\Controls\\Query' => 'PrimeSlider\\Modules\\QueryControl\\Controls\\Query',
27 ) ;
28 public $elements_data = array(
29 'sections' => array(),
30 'columns' => array(),
31 'widgets' => array(),
32 ) ;
33 /**
34 * @deprecated
35 *
36 * @return string
37 */
38 public function get_version()
39 {
40 return BDTPS_VER;
41 }
42
43 /**
44 * Throw error on object clone
45 *
46 * The whole idea of the singleton design pattern is that there is a single
47 * object therefore, we don't want the object to be cloned.
48 *
49 * @since 1.0.0
50 * @return void
51 */
52 public function __clone()
53 {
54 // Cloning instances of the class is forbidden
55 _doing_it_wrong( __FUNCTION__, esc_html__( 'Cheatin&#8217; huh?', 'bdthemes-prime-slider' ), '1.6.0' );
56 }
57
58 /**
59 * Disable unserializing of the class
60 *
61 * @since 1.0.0
62 * @return void
63 */
64 public function __wakeup()
65 {
66 // Unserializing instances of the class is forbidden
67 _doing_it_wrong( __FUNCTION__, esc_html__( 'Cheatin&#8217; huh?', 'bdthemes-prime-slider' ), '1.6.0' );
68 }
69
70 /**
71 * @return Plugin
72 */
73 public static function elementor()
74 {
75 return Plugin::$instance;
76 }
77
78 /**
79 * @return Prime_Slider_Loader
80 */
81 public static function instance()
82 {
83 if ( is_null( self::$_instance ) ) {
84 self::$_instance = new self();
85 }
86 return self::$_instance;
87 }
88
89 /**
90 * we loaded module manager + admin php from here
91 * @return [type] [description]
92 */
93 private function _includes()
94 {
95 $duplicator = prime_slider_option( 'duplicator', 'prime_slider_other_settings', 'off' );
96 $live_copy = prime_slider_option( 'live-copy', 'prime_slider_other_settings', 'off' );
97 // Admin settings controller
98 require_once BDTPS_ADMIN_PATH . 'module-settings.php';
99 //Assets Manager
100 // require_once 'admin/optimizer/asset-minifier-manager.php';
101 // Dynamic Select control
102 require BDTPS_PATH . 'traits/query-controls/select-input/dynamic-select-input-module.php';
103 require BDTPS_PATH . 'traits/query-controls/select-input/dynamic-select.php';
104 // Global Controls
105 require_once BDTPS_PATH . 'traits/global-widget-controls.php';
106 //require_once BDTPS_PATH . 'traits/global-swiper-controls.php';
107 //require_once BDTPS_PATH . 'traits/global-mask-controls.php';
108 require BDTPS_PATH . 'includes/modules-manager.php';
109 if ( !class_exists( 'BdThemes_Duplicator' ) ) {
110 if ( $duplicator == 'on' ) {
111 require BDTPS_PATH . 'includes/class-duplicator.php';
112 }
113 }
114 if ( !class_exists( 'BdThemes_Live_Copy' ) ) {
115 if ( $live_copy == 'on' && !is_plugin_active( 'live-copy-paste/live-copy-paste.php' ) ) {
116 require_once BDTPS_PATH . 'includes/live-copy/class-live-copy.php';
117 }
118 }
119 if ( ps_is_dashboard_enabled() ) {
120
121 if ( is_admin() ) {
122 // Load admin class for admin related content process
123 require_once BDTPS_ADMIN_PATH . 'admin.php';
124 // require BDTPS_PATH . 'includes/admin-feeds.php';
125 new Admin();
126 }
127
128 }
129 }
130
131 /**
132 * Autoloader function for all classes files
133 * @param [type] $class [description]
134 * @return [type] [description]
135 */
136 public function autoload( $class )
137 {
138 if ( 0 !== strpos( $class, __NAMESPACE__ ) ) {
139 return;
140 }
141 $has_class_alias = isset( $this->classes_aliases[$class] );
142 // Backward Compatibility: Save old class name for set an alias after the new class is loaded
143
144 if ( $has_class_alias ) {
145 $class_alias_name = $this->classes_aliases[$class];
146 $class_to_load = $class_alias_name;
147 } else {
148 $class_to_load = $class;
149 }
150
151
152 if ( !class_exists( $class_to_load ) ) {
153 $filename = strtolower( preg_replace( [
154 '/^' . __NAMESPACE__ . '\\\\/',
155 '/([a-z])([A-Z])/',
156 '/_/',
157 '/\\\\/'
158 ], [
159 '',
160 '$1-$2',
161 '-',
162 DIRECTORY_SEPARATOR
163 ], $class_to_load ) );
164 $filename = BDTPS_PATH . $filename . '.php';
165 if ( is_readable( $filename ) ) {
166 include $filename;
167 }
168 }
169
170 if ( $has_class_alias ) {
171 class_alias( $class_alias_name, $class );
172 }
173 }
174
175 /**
176 * Register all script that need for any specific widget on call basis.
177 * @return [type] [description]
178 */
179 public function register_site_scripts()
180 {
181 $reveal_effects = prime_slider_option( 'reveal-effects', 'prime_slider_other_settings', 'off' );
182 $suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min' );
183 //TODO more attractive animation
184 //Thirdparty widgets
185
186 if ( prime_slider_is_widget_enabled( 'multiscroll' ) ) {
187 wp_register_script(
188 'jquery-multiscroll',
189 BDTPS_ASSETS_URL . 'vendor/js/jquery.multiscroll.min.js',
190 [ 'jquery', 'elementor-frontend' ],
191 BDTPS_VER,
192 true
193 );
194 wp_register_script(
195 'easings',
196 BDTPS_ASSETS_URL . 'vendor/js/jquery.easings.min.js',
197 [ 'jquery', 'elementor-frontend' ],
198 BDTPS_VER,
199 true
200 );
201 }
202
203 if ( prime_slider_is_widget_enabled( 'pagepiling' ) ) {
204 wp_register_script(
205 'jquery-pagepiling',
206 BDTPS_ASSETS_URL . 'vendor/js/jquery.pagepiling.min.js',
207 [ 'jquery', 'elementor-frontend' ],
208 BDTPS_VER,
209 true
210 );
211 }
212 if ( prime_slider_is_widget_enabled( 'knily' ) or prime_slider_is_third_party_enabled( 'woolamp' ) ) {
213 wp_register_script(
214 'goodshare',
215 BDTPS_ASSETS_URL . 'vendor/js/goodshare.min.js',
216 [ 'jquery', 'elementor-frontend' ],
217 BDTPS_VER,
218 true
219 );
220 }
221
222 if ( prime_slider_is_third_party_enabled( 'woocircle' ) ) {
223 wp_register_script(
224 'classie',
225 BDTPS_ASSETS_URL . 'vendor/js/classie.min.js',
226 [ 'jquery', 'elementor-frontend' ],
227 BDTPS_VER,
228 true
229 );
230 wp_register_script(
231 'dynamics',
232 BDTPS_ASSETS_URL . 'vendor/js/dynamics.min.js',
233 [ 'jquery', 'elementor-frontend' ],
234 BDTPS_VER,
235 true
236 );
237 }
238
239 if ( prime_slider_is_widget_enabled( 'pieces' ) ) {
240 wp_register_script(
241 'pieces',
242 BDTPS_ASSETS_URL . 'vendor/js/pieces.min.js',
243 [ 'jquery', 'elementor-frontend' ],
244 BDTPS_VER,
245 true
246 );
247 }
248 wp_register_script(
249 'bdt-parallax',
250 BDTPS_ASSETS_URL . 'vendor/js/parallax.min.js',
251 [ 'jquery' ],
252 null,
253 true
254 );
255
256 if ( 'on' === $reveal_effects ) {
257 wp_register_script(
258 'anime',
259 BDTPS_ASSETS_URL . 'vendor/js/anime.min.js',
260 [ 'jquery', 'elementor-frontend' ],
261 BDTPS_VER,
262 true
263 );
264 wp_register_script(
265 'revealFx',
266 BDTPS_ASSETS_URL . 'vendor/js/RevealFx.min.js',
267 [ 'jquery', 'elementor-frontend' ],
268 BDTPS_VER,
269 true
270 );
271 }
272
273 }
274
275 public function register_site_styles()
276 {
277 $direction_suffix = ( is_rtl() ? '.rtl' : '' );
278 wp_register_style(
279 'prime-slider-font',
280 BDTPS_ASSETS_URL . 'css/prime-slider-font' . $direction_suffix . '.css',
281 [],
282 BDTPS_VER
283 );
284 }
285
286 /**
287 * Loading site related style from here.
288 * @return [type] [description]
289 */
290 public function enqueue_site_styles()
291 {
292 $direction_suffix = ( is_rtl() ? '.rtl' : '' );
293 wp_enqueue_style(
294 'bdt-uikit',
295 BDTPS_ASSETS_URL . 'css/bdt-uikit' . $direction_suffix . '.css',
296 [],
297 '3.15.1'
298 );
299 wp_enqueue_style(
300 'prime-slider-site',
301 BDTPS_ASSETS_URL . 'css/prime-slider-site' . $direction_suffix . '.css',
302 [],
303 BDTPS_VER
304 );
305 wp_register_style(
306 'splitting',
307 BDTPS_ASSETS_URL . 'vendor/css/splitting' . $direction_suffix . '.css',
308 [],
309 BDTPS_VER
310 );
311 }
312
313 /**
314 * Loading site related script that needs all time such as uikit.
315 * @return [type] [description]
316 */
317 public function enqueue_site_scripts()
318 {
319 $suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min' );
320 wp_enqueue_script(
321 'bdt-uikit',
322 BDTPS_ASSETS_URL . 'js/bdt-uikit.min.js',
323 [ 'jquery' ],
324 '3.15.1'
325 );
326 wp_enqueue_script(
327 'prime-slider-site',
328 BDTPS_ASSETS_URL . 'js/prime-slider-site' . $suffix . '.js',
329 [ 'jquery', 'elementor-frontend' ],
330 BDTPS_VER
331 );
332 }
333
334 public function enqueue_editor_scripts()
335 {
336 $suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min' );
337 wp_enqueue_script(
338 'prime-slider',
339 BDTPS_ASSETS_URL . 'js/prime-slider-editor' . $suffix . '.js',
340 [ 'backbone-marionette', 'elementor-common-modules', 'elementor-editor-modules' ],
341 BDTPS_VER,
342 true
343 );
344 }
345
346 /**
347 * Load editor editor related style from here
348 * @return [type] [description]
349 */
350 public function enqueue_preview_styles()
351 {
352 $direction_suffix = ( is_rtl() ? '.rtl' : '' );
353 wp_enqueue_style(
354 'prime-slider-preview',
355 BDTPS_ASSETS_URL . 'css/prime-slider-preview' . $direction_suffix . '.css',
356 '',
357 BDTPS_VER
358 );
359 }
360
361 public function enqueue_editor_styles()
362 {
363 $direction_suffix = ( is_rtl() ? '-rtl' : '' );
364 wp_enqueue_style(
365 'prime-slider-editor',
366 BDTPS_ASSETS_URL . 'css/prime-slider-editor' . $direction_suffix . '.css',
367 '',
368 BDTPS_VER
369 );
370 wp_enqueue_style(
371 'prime-slider-font',
372 BDTPS_ASSETS_URL . 'css/prime-slider-font' . $direction_suffix . '.css',
373 [],
374 BDTPS_VER
375 );
376 }
377
378 public function enqueue_admin_scripts()
379 {
380 wp_enqueue_script(
381 'ps-notice-js',
382 BDTPS_ADMIN_URL . 'assets/js/ps-notice.js',
383 [ 'jquery' ],
384 BDTPS_VER,
385 true
386 );
387 }
388
389 /**
390 * initialize the category
391 * @return [type] [description]
392 */
393 public function prime_slider_init()
394 {
395 $this->_modules_manager = new Manager();
396 $elementor = Plugin::$instance;
397 // Add element category in panel
398 $elementor->elements_manager->add_category( BDTPS_SLUG, [
399 'title' => BDTPS_TITLE,
400 'icon' => 'font',
401 ] );
402 do_action( 'bdthemes_prime_slider/init' );
403 }
404
405 private function setup_hooks()
406 {
407 add_action( 'elementor/init', [ $this, 'prime_slider_init' ] );
408 add_action( 'elementor/editor/after_enqueue_styles', [ $this, 'enqueue_editor_styles' ] );
409 add_action( 'elementor/frontend/before_register_styles', [ $this, 'register_site_styles' ] );
410 add_action( 'elementor/frontend/before_register_scripts', [ $this, 'register_site_scripts' ] );
411 add_action( 'elementor/preview/enqueue_styles', [ $this, 'enqueue_preview_styles' ] );
412 //add_action( 'elementor/editor/before_enqueue_scripts', [ $this, 'enqueue_editor_scripts' ] ); // TODO
413 add_action( 'elementor/frontend/after_register_styles', [ $this, 'enqueue_site_styles' ] );
414 add_action( 'elementor/editor/before_enqueue_scripts', [ $this, 'enqueue_editor_scripts' ] );
415 add_action( 'elementor/frontend/before_enqueue_scripts', [ $this, 'enqueue_site_scripts' ] );
416 // load WordPress dashboard scripts
417 add_action( 'admin_init', [ $this, 'enqueue_admin_scripts' ] );
418 }
419
420 /**
421 * Prime_Slider_Loader constructor.
422 * @throws \Exception
423 */
424 private function __construct()
425 {
426 // Register class automatically
427 spl_autoload_register( [ $this, 'autoload' ] );
428 // Include some backend files
429 $this->_includes();
430 // Finally hooked up all things here
431 $this->setup_hooks();
432 }
433
434 }
435 if ( !defined( 'BDTPS_TESTS' ) ) {
436 // In tests we run the instance manually.
437 Prime_Slider_Loader::instance();
438 }
439 // handy function for push data
440 function prime_slider_config()
441 {
442 return Prime_Slider_Loader::instance();
443 }
444