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