PluginProbe
ShopBuilder – WooCommerce Builder For Elementor / 3.2.1
ShopBuilder – WooCommerce Builder For Elementor v3.2.1
3.4.2 3.4.1 3.4.0 2.0.1 2.0.2 2.0.3 2.1.0 2.1.1 2.1.10 2.1.11 2.1.12 2.1.13 2.1.14 2.1.15 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 2.2.0 2.2.1 2.2.2 All 63 releases
shopbuilder / app / Controllers / AssetsController.php

AssetsController.php in ShopBuilder – WooCommerce Builder For Elementor 3.2.1, at app/Controllers/AssetsController.php

617 lines 18.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Assets Controller Class
4 *
5 * @package RadiusTheme\SB
6 */
7
8 namespace RadiusTheme\SB\Controllers;
9
10 use RadiusTheme\SB\AI\AIFns;
11 use RadiusTheme\SB\Helpers\Fns;
12 use RadiusTheme\SB\Models\Settings;
13 use RadiusTheme\SB\Helpers\BuilderFns;
14 use RadiusTheme\SB\Traits\SingletonTrait;
15
16 // Do not allow directly accessing this file.
17 if ( ! defined( 'ABSPATH' ) ) {
18 exit( 'This script cannot be accessed directly.' );
19 }
20
21 /**
22 * Assets Controller Class
23 */
24 class AssetsController {
25
26 use SingletonTrait;
27
28 /**
29 * Plugin version
30 *
31 * @var string
32 */
33 private $version;
34
35 /**
36 * Ajax URL
37 *
38 * @var string
39 */
40 private static $ajaxurl;
41
42 /**
43 * Styles.
44 *
45 * @var array
46 */
47 private $styles = [];
48
49 /**
50 * Scripts.
51 *
52 * @var array
53 */
54 private $scripts = [];
55
56 /**
57 * Cached bundled assets.
58 *
59 * @var array|null
60 */
61 private $cached_bundled_assets = null;
62
63 /**
64 * Class Constructor
65 */
66 public function __construct() {
67 $this->version = ( defined( 'WP_DEBUG' ) && WP_DEBUG ) ? time() : RTSB_VERSION;
68
69 // phpcs:ignore WordPress.PHP.StrictInArray.MissingTrueStrict
70 if ( in_array( 'sitepress-multilingual-cms/sitepress.php', get_option( 'active_plugins' ) ) ) {
71 self::$ajaxurl = admin_url( 'admin-ajax.php?lang=' . ICL_LANGUAGE_CODE );
72 } else {
73 self::$ajaxurl = admin_url( 'admin-ajax.php' );
74 }
75 add_filter( 'rtsb/optimizer/scripts/deps', [ $this, 'extend_shared_dependencies' ], 99 );
76 /**
77 * Admin scripts.
78 */
79 add_action( 'admin_enqueue_scripts', [ $this, 'register_backend_assets' ], 1 );
80 add_action( 'admin_enqueue_scripts', [ $this, 'enqueue_backend_scripts' ], 15 );
81
82 /**
83 * Public scripts.
84 */
85 add_action( 'wp_enqueue_scripts', [ $this, 'enqueue_public_scripts' ], 25 );
86 /**
87 * General scripts.
88 */
89 add_action( 'wp_enqueue_scripts', [ $this, 'enqueue_general_public_scripts' ], 30 );
90 }
91 /**
92 * Shared dependencies.
93 *
94 * @param array $deps Dependencies.
95 *
96 * @return array
97 */
98 public function extend_shared_dependencies( $deps ) {
99 if ( Fns::is_elementor_widget_active( 'products_slider' ) ) {
100 $deps[] = 'swiper';
101 }
102 return array_unique( $deps );
103 }
104 /**
105 * Get all frontend scripts.
106 *
107 * @return void
108 */
109 private function get_public_assets() {
110 $this->get_public_styles()->get_public_scripts();
111 }
112
113 /**
114 * Get public styles.
115 *
116 * @return object
117 */
118 private function get_public_styles() {
119 $rtl_suffix = is_rtl() ? '-rtl' : '';
120 $rtl_dir = is_rtl() ? trailingslashit( 'rtl' ) : trailingslashit( 'css' );
121
122 $this->styles[] = [
123 'handle' => 'rtsb-odometer',
124 'src' => rtsb()->get_assets_uri( 'vendor/odometer/css/odometer.min.css' ),
125 ];
126
127 $this->styles[] = [
128 'handle' => 'rtsb-fonts',
129 'src' => rtsb()->get_assets_uri( 'css/frontend/rtsb-fonts.css' ),
130 ];
131 if ( rtsb()->has_pro() ) {
132 $this->styles[] = [
133 'handle' => 'rtsb-noui-slider',
134 'src' => rtsbpro()->get_assets_uri( 'vendors/nouislider/nouislider.min.css' ),
135 ];
136 }
137
138 $pro_version = defined( 'RTSBPRO_VERSION' ) ? RTSBPRO_VERSION : '0';
139 $addon_condition = version_compare( $pro_version, '1.9.0', '<' );
140
141 if ( ! rtsb()->has_pro() && Fns::is_optimization_enabled() ) {
142 $this->styles[] = AssetRegistry::instance()->load_optimized_assets();
143 } else {
144 if ( $addon_condition ) {
145 $this->styles[] = [
146 'handle' => 'rtsb-general-addons',
147 'src' => rtsb()->get_assets_uri( $rtl_dir . 'frontend/general-addons' . $rtl_suffix . '.css' ),
148 ];
149 }
150 $this->styles[] = [
151 'handle' => 'rtsb-frontend',
152 'src' => rtsb()->get_assets_uri( $rtl_dir . 'frontend/frontend' . $rtl_suffix . '.css' ),
153 ];
154 }
155 if ( BuilderFns::is_builder_preview() && 'elementor' == Fns::page_edit_with( get_the_ID() ) ) {
156 $this->styles[] = [
157 'handle' => 'photoswipe',
158 'src' => plugins_url( 'assets/css/photoswipe/photoswipe.min.css', WC_PLUGIN_FILE ),
159 ];
160
161 $this->styles[] = [
162 'handle' => 'photoswipe-default-skin',
163 'src' => plugins_url( 'assets/css/photoswipe/default-skin/default-skin.min.css', WC_PLUGIN_FILE ),
164 ];
165
166 // Load only for elementor editor page and fix some issue.
167 $this->styles[] = [
168 'handle' => 'elementor-editor-style-fix',
169 'src' => rtsb()->get_assets_uri( 'css/backend/elementor-editor-style-fix.css' ),
170 ];
171 }
172
173 return $this;
174 }
175
176 /**
177 * Get public scripts.
178 *
179 * @return object
180 */
181 private function get_public_scripts() {
182 $this->scripts[] = [
183 'handle' => 'swiper',
184 'src' => esc_url( $this->get_swiper_url() ),
185 'deps' => [ 'jquery' ],
186 'footer' => true,
187 ];
188 $this->scripts[] = [
189 'handle' => 'rtsb-waypoints',
190 'src' => rtsb()->get_assets_uri( 'vendor/waypoints/js/jquery.waypoints.min.js' ),
191 'deps' => [ 'jquery' ],
192 'footer' => true,
193 ];
194 $this->scripts[] = [
195 'handle' => 'rtsb-odometer',
196 'src' => rtsb()->get_assets_uri( 'vendor/odometer/js/odometer.min.js' ),
197 'deps' => [ 'jquery' ],
198 'footer' => true,
199 ];
200
201 $this->scripts[] = [
202 'handle' => 'rtsb-tipsy',
203 'src' => rtsb()->get_assets_uri( 'vendor/tipsy/tipsy.min.js' ),
204 'deps' => [ 'jquery' ],
205 'footer' => true,
206 ];
207
208 if ( BuilderFns::is_builder_preview() && 'elementor' == Fns::page_edit_with( get_the_ID() ) ) {
209 $this->scripts[] = [
210 'handle' => 'wc-flexslider',
211 'src' => plugins_url( 'assets/js/flexslider/jquery.flexslider.js', WC_PLUGIN_FILE ),
212 'deps' => [ 'jquery' ],
213 'footer' => true,
214 ];
215
216 $this->scripts[] = [
217 'handle' => 'photoswipe',
218 'src' => plugins_url( 'assets/js/photoswipe/photoswipe.js', WC_PLUGIN_FILE ),
219 'deps' => [ 'jquery' ],
220 'footer' => true,
221 ];
222
223 $this->scripts[] = [
224 'handle' => 'wc-zoom',
225 'src' => plugins_url( 'assets/js/zoom/jquery.zoom.js', WC_PLUGIN_FILE ),
226 'deps' => [ 'jquery' ],
227 'footer' => true,
228 ];
229
230 $this->scripts[] = [
231 'handle' => 'wc-photoswipe-ui-default',
232 'src' => plugins_url( 'assets/js/photoswipe/photoswipe-ui-default.js', WC_PLUGIN_FILE ),
233 'deps' => [ 'jquery', 'photoswipe' ],
234 'footer' => true,
235 ];
236
237 $this->scripts[] = [
238 'handle' => 'wc-single-product',
239 'src' => plugins_url( 'assets/js/frontend/single-product.js', WC_PLUGIN_FILE ),
240 'deps' => [ 'jquery', 'wc-flexslider', 'photoswipe', 'wc-photoswipe-ui-default', 'wc-zoom' ],
241 'footer' => true,
242 ];
243
244 }
245
246 if ( rtsb()->has_pro() ) {
247 $this->scripts[] = [
248 'handle' => 'rtsb-noui-slider',
249 'src' => rtsbpro()->get_assets_uri( 'vendors/nouislider/nouislider.min.js' ),
250 'deps' => [ 'jquery' ],
251 'footer' => true,
252 ];
253
254 $this->scripts[] = [
255 'handle' => 'rtsb-sticky-sidebar',
256 'src' => rtsbpro()->get_assets_uri( 'vendors/sticky-sidebar/sticky-sidebar.min.js' ),
257 'deps' => [ 'jquery' ],
258 'footer' => true,
259 ];
260
261 $this->scripts[] = [
262 'handle' => 'rtsb-popper',
263 'src' => rtsbpro()->get_assets_uri( 'vendors/tippy/popper.min.js' ),
264 'deps' => [ 'jquery' ],
265 'footer' => true,
266 ];
267
268 $this->scripts[] = [
269 'handle' => 'rtsb-tippy',
270 'src' => rtsbpro()->get_assets_uri( 'vendors/tippy/tippy.min.js' ),
271 'deps' => [ 'jquery', 'rtsb-popper' ],
272 'footer' => true,
273 ];
274 }
275
276 if ( ! rtsb()->has_pro() && Fns::is_optimization_enabled() ) {
277 $this->scripts[] = AssetRegistry::instance()->load_optimized_assets( 'js' );
278 } else {
279 $this->scripts[] = [
280 'handle' => 'rtsb-public',
281 'src' => rtsb()->get_assets_uri( 'js/frontend/frontend.js' ),
282 'deps' => [ 'jquery', 'imagesloaded', 'swiper' ],
283 'footer' => true,
284 ];
285 }
286
287 return $this;
288 }
289
290 /**
291 * Register public scripts.
292 *
293 * @return void
294 */
295 public function register_public_scripts() {
296 $this->get_public_assets();
297 $this->styles = array_filter( $this->styles );
298 $this->scripts = array_filter( $this->scripts );
299
300 // Register public styles.
301 foreach ( $this->styles as $style ) {
302 wp_register_style( $style['handle'], $style['src'], '', $this->version );
303 }
304
305 // Register public scripts.
306 foreach ( $this->scripts as $script ) {
307 wp_register_script( $script['handle'], $script['src'], $script['deps'], $this->version, $script['footer'] );
308 }
309 }
310
311 /**
312 * Enqueues public scripts.
313 *
314 * @return void
315 */
316 public function enqueue_public_scripts() {
317 /**
318 * Register scripts.
319 */
320 $this->register_public_scripts();
321
322 /**
323 * Enqueue scripts.
324 */
325 if ( BuilderFns::is_builder_preview() && 'elementor' === Fns::page_edit_with( get_the_ID() ) ) {
326 /**
327 * Styles.
328 */
329 wp_enqueue_style( 'photoswipe' );
330 wp_enqueue_style( 'photoswipe-default-skin' );
331 wp_enqueue_style( 'elementor-editor-style-fix' );
332 wp_enqueue_style( 'woocommerce-general' );
333
334 /**
335 * Scripts.
336 */
337 $handle = Fns::optimized_handle( 'rtsb-public' );
338
339 wp_enqueue_script( 'wc-flexslider' );
340 wp_enqueue_script( 'wc-single-product' );
341 wp_dequeue_script( $handle );
342 wp_enqueue_script( 'swiper' );
343
344 if ( Fns::is_optimization_enabled() ) {
345 Fns::enqueue_optimized_assets();
346 } else {
347 wp_enqueue_script( $handle );
348 }
349 }
350
351 wp_enqueue_script( 'rtsb-tipsy' );
352
353 if ( Fns::is_optimization_enabled() ) {
354 Fns::enqueue_optimized_assets();
355 } else {
356 wp_enqueue_style( 'rtsb-fonts' );
357 wp_enqueue_style( 'rtsb-frontend' );
358 wp_enqueue_script( 'rtsb-public' );
359 }
360
361 /**
362 * Localize script.
363 */
364 self::localizeData();
365 }
366
367 /**
368 * Localized Data.
369 *
370 * @static
371 * @return void
372 */
373 public static function localizeData() {
374 $handle = Fns::optimized_handle( 'rtsb-public' );
375 $ai_data = AIFns::activated_ai_data();
376 wp_localize_script(
377 $handle,
378 'rtsbPublicParams',
379 [
380 'ajaxUrl' => esc_url( self::$ajaxurl ),
381 'aiActivated' => ! empty( $ai_data ),
382 'homeurl' => home_url(),
383 'wcCartUrl' => wc_get_cart_url(),
384 'addedToCartText' => esc_html__( 'Product Added', 'shopbuilder' ),
385 'singleCartToastrText' => esc_html__( 'Successfully Added', 'shopbuilder' ),
386 'singleCartBtnText' => apply_filters( 'rtsb/global/single_add_to_cart_success', esc_html__( 'Added to Cart', 'shopbuilder' ) ),
387 'browseCartText' => esc_html__( 'Browse Cart', 'shopbuilder' ),
388 'noProductsText' => apply_filters( 'rtsb/global/no_products_text', esc_html__( 'No more products to load', 'shopbuilder' ) ),
389 'isOptimizationEnabled' => Fns::is_optimization_enabled(),
390 'isLoaderEnabled' => Fns::enable_loader(),
391 'notice' => [
392 'position' => Fns::get_option( 'general', 'notification', 'notification_position', 'center-center' ),
393 ],
394 rtsb()->nonceId => wp_create_nonce( rtsb()->nonceText ),
395 ]
396 );
397 }
398
399 /**
400 * Registers Admin scripts.
401 *
402 * @return void
403 */
404 public function register_backend_assets() {
405 /**
406 * Styles.
407 */
408 wp_register_style( 'rtsb-admin-app', rtsb()->get_assets_uri( 'css/backend/admin-settings.css' ), '', $this->version );
409 wp_register_style( 'rtsb-fonts', rtsb()->get_assets_uri( 'css/frontend/rtsb-fonts.css' ), '', $this->version );
410
411 $current_screen = get_current_screen();
412
413 if ( 'edit-rtsb_builder' === $current_screen->id ) {
414 if ( ! function_exists( 'woocommerce_get_asset_url' ) ) {
415 include_once WC_ABSPATH . 'includes/wc-template-functions.php';
416 }
417
418 wp_deregister_style( 'select2' );
419 wp_register_style( 'select2', plugins_url( 'assets/css/select2.css', WC_PLUGIN_FILE ) ); // phpcs:ignore WordPress.WP.EnqueuedResourceParameters.MissingVersion
420 }
421 wp_register_style( 'rtsb-templatebuilder', rtsb()->get_assets_uri( 'css/backend/template-builder.css' ), '', $this->version );
422
423 /**
424 * Scripts.
425 */
426 wp_register_script( 'rtsb-admin-app', rtsb()->get_assets_uri( 'js/backend/admin-settings.js' ), '', $this->version, true );
427 wp_register_script( 'rtsb-templatebuilder', rtsb()->get_assets_uri( 'js/backend/template-builder.js' ), '', $this->version, true );
428 wp_localize_script(
429 'rtsb-admin-app',
430 'rtsbParams',
431 [
432 'ajaxurl' => esc_url( self::$ajaxurl ),
433 'homeurl' => home_url(),
434 'adminLogo' => rtsb()->get_assets_uri( 'images/icon/ShopBuilder-Logo.svg' ),
435 'blackFriday' => rtsb()->get_assets_uri( 'images/black-friday-ribbon.svg' ),
436 'restApiUrl' => esc_url_raw( rest_url() ),
437 'rest_nonce' => wp_create_nonce( 'wp_rest' ),
438 'nonce' => wp_create_nonce( rtsb()->nonceText ),
439 'pages' => Fns::get_pages(),
440 'hasPro' => rtsb()->has_pro() ? 'yes' : 'no',
441 'validLicence' => Fns::has_valid_license() ? 'yes' : 'no',
442 'proVersion' => defined( 'RTSBPRO_VERSION' ) ? RTSBPRO_VERSION : '0',
443 'updateRates' => esc_html__( 'Update All Rates', 'shopbuilder' ),
444 'sections' => Settings::instance()->get_sections(),
445 'userRoles' => Fns::get_all_user_roles(),
446 'hasElementor' => defined( 'ELEMENTOR_VERSION' ),
447 'loadElementor' => Fns::should_load_elementor_scripts(),
448 'isOptimizationEnabled' => Fns::is_optimization_enabled(),
449 ]
450 );
451 wp_localize_script(
452 'rtsb-admin-app',
453 'rtsbCaAbandonment',
454 [
455 'mainTitle' => esc_html__( 'Abandoned Carts Follow Up', 'shopbuilder' ),
456 'followUpColumnTitle' => [
457 'UserName' => esc_html__( 'Name', 'shopbuilder' ),
458 'EmailTo' => esc_html__( 'Email To', 'shopbuilder' ),
459 'CartTotal' => esc_html__( 'Cart Total', 'shopbuilder' ),
460 'OrderStatus' => esc_html__( 'Order Status', 'shopbuilder' ),
461 'DateTime' => esc_html__( 'Date / Time', 'shopbuilder' ),
462 'Action' => esc_html__( 'Action', 'shopbuilder' ),
463 ],
464 ]
465 );
466 }
467
468 /**
469 * Enqueues admin scripts.
470 *
471 * @return void
472 */
473 public function enqueue_backend_scripts() {
474 ob_start(); ?>
475 #adminmenu .toplevel_page_rtsb .wp-menu-image img {
476 width: auto;
477 height: 22px;
478 padding: 4px 0;
479 box-sizing: content-box;
480 }
481 .post-type-rtsb_builder li#wp-admin-bar-WPML_ALS_all,
482 .post-type-rtsb_builder li.language_all{
483 display: none;
484 }
485
486 <?php
487 $admin_global_style = ob_get_clean();
488 // Speed Optimization.
489 wp_add_inline_style( 'admin-menu', $admin_global_style );
490
491 global $pagenow;
492
493 $whitelisted_pages = [ 'rtsb-settings', 'rtsb-get-help', 'rtsb-themes' ];
494 $current_page = ! empty( $_GET['page'] ) ? sanitize_text_field( wp_unslash( $_GET['page'] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended
495
496 if ( 'admin.php' === $pagenow && ! empty( $_GET['page'] ) && in_array( $current_page, $whitelisted_pages, true ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
497 /**
498 * Styles.
499 */
500 wp_enqueue_style( 'rtsb-admin-app' );
501 wp_enqueue_style( 'rtsb-fonts' );
502 }
503
504 if ( 'admin.php' === $pagenow && ! empty( $_GET['page'] ) && 'rtsb-settings' === $_GET['page'] ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
505 // Elementor Console Error Fixed For "rtsb-settings" Page.
506 wp_dequeue_script( 'elementor-admin-top-bar' );
507 wp_dequeue_script( 'elementor-common' );
508 wp_dequeue_script( 'elementor-dev-tools' );
509 wp_dequeue_script( 'elementor-web-cli' );
510 wp_dequeue_script( 'elementor-import-export-admin' );
511 wp_dequeue_script( 'elementor-app-loader' );
512 wp_dequeue_script( 'elementor-admin-modules' );
513 wp_dequeue_script( 'elementor-ai-media-library' );
514 wp_dequeue_script( 'elementor-admin' );
515
516 wp_dequeue_style( 'elementor-admin-top-bar' );
517 wp_dequeue_style( 'elementor-admin' );
518 wp_dequeue_style( 'e-theme-ui-light' );
519 wp_dequeue_style( 'elementor-common' );
520
521 /**
522 * Scripts.
523 */
524 wp_enqueue_media();
525 wp_enqueue_script( 'updates' );
526 wp_enqueue_script( 'rtsb-admin-app' );
527 } else {
528 $current_screen = get_current_screen();
529
530 if ( 'edit-rtsb_builder' === $current_screen->id ) {
531 if ( ! function_exists( 'woocommerce_get_asset_url' ) ) {
532 include_once WC_ABSPATH . 'includes/wc-template-functions.php';
533 }
534 /**
535 * Styles.
536 */
537 wp_enqueue_style( 'rtsb-templatebuilder' );
538
539 wp_enqueue_style( 'select2', plugins_url( 'assets/css/select2.css', WC_PLUGIN_FILE ) ); // phpcs:ignore WordPress.WP.EnqueuedResourceParameters.MissingVersion
540
541 wp_enqueue_script( 'selectWoo' );
542 /**
543 * Scripts.
544 */
545 wp_enqueue_script( 'rtsb-templatebuilder' );
546
547 wp_localize_script(
548 'rtsb-templatebuilder',
549 'rtsbParams',
550 [
551 'ajaxurl' => esc_url( self::$ajaxurl ),
552 'homeurl' => home_url(),
553 rtsb()->nonceId => wp_create_nonce( rtsb()->nonceText ),
554 'hasPro' => rtsb()->has_pro() ? 'yes' : 'no',
555 ]
556 );
557 }
558 }
559 }
560
561 /**
562 * Enqueues general public scripts.
563 *
564 * @return void
565 */
566 public function enqueue_general_public_scripts() {
567 $notification_color = Fns::get_option( 'general', 'notification', 'notification_color', '#004BFF' );
568 $notification_bgcolor = Fns::get_option( 'general', 'notification', 'notification_bg', '#F5F8FF' );
569 $notification_button_color = Fns::get_option( 'general', 'notification', 'notification_btn_color', '#0039C0' );
570
571 $dynamic_css = '';
572
573 if ( ! empty( $notification_color ) ) {
574 $dynamic_css .= ".rtsb-shopbuilder-plugin #toast-container .toast-success{color:{$notification_color}}";
575 $dynamic_css .= ".rtsb-shopbuilder-plugin #toast-container .toast-success:before{background-color:{$notification_color}}";
576 $dynamic_css .= ".rtsb-shopbuilder-plugin #toast-container .toast-close-button{color:{$notification_color}}";
577 }
578
579 if ( ! empty( $notification_bgcolor ) ) {
580 $dynamic_css .= ".rtsb-shopbuilder-plugin #toast-container .toast-success{background-color:{$notification_bgcolor}}";
581 }
582
583 if ( ! empty( $notification_button_color ) ) {
584 $dynamic_css .= ".rtsb-shopbuilder-plugin #toast-container .toast-success a{color:{$notification_button_color}}";
585 }
586
587 if ( ! empty( $dynamic_css ) ) {
588 wp_add_inline_style( Fns::optimized_handle( 'rtsb-frontend' ), $dynamic_css );
589 }
590 }
591
592 /**
593 * Get the appropriate Swiper JS file URL.
594 *
595 * @return string
596 */
597 private function get_swiper_url() {
598 $default_swiper_url = rtsb()->get_assets_uri( 'vendor/swiper/js/swiper-bundle.min.js' );
599
600 if ( defined( 'ELEMENTOR_ASSETS_PATH' ) && defined( 'ELEMENTOR_ASSETS_URL' ) ) {
601 $experiment = get_option( 'elementor_experiment-e_swiper_latest' );
602
603 $el_relative_path = ( 'active' === $experiment || 'default' === $experiment )
604 ? 'lib/swiper/v8/swiper.min.js'
605 : 'lib/swiper/swiper.min.js';
606
607 $el_full_path = ELEMENTOR_ASSETS_PATH . $el_relative_path;
608
609 if ( file_exists( $el_full_path ) ) {
610 return ELEMENTOR_ASSETS_URL . $el_relative_path;
611 }
612 }
613
614 return $default_swiper_url;
615 }
616 }
617