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 +56 -28 2.1.22.5.2 View file →
@@ -86,9 +86,9 @@
86 86 *
87 87 * @return object
88 88 */
89 89 private function get_public_styles() {
90 - $rtl_suffix = is_rtl() ? '-rtl' : '';
90 + $rtl_suffix = is_rtl() ? '-rtl' : '';
91 91 $this->styles[] = [
92 92 'handle' => 'rtsb-fonts',
93 93 'src' => rtsb()->get_assets_uri( 'css/frontend/rtsb-fonts.css' ),
94 94 ];
@@ -104,12 +104,14 @@
104 104 'handle' => 'rtsb-frontend',
105 105 'src' => rtsb()->get_assets_uri( 'css/frontend/frontend' . $rtl_suffix . '.css' ),
106 106 ];
107 107
108 + /*
108 109 $this->styles[] = [
109 110 'handle' => 'swiper',
110 111 'src' => rtsb()->get_assets_uri( 'vendor/swiper/css/swiper-bundle.min.css' ),
111 112 ];
113 + */
112 114
113 115 if ( BuilderFns::is_builder_preview() && 'elementor' == Fns::page_edit_with( get_the_ID() ) ) {
114 116 $this->styles[] = [
115 117 'handle' => 'photoswipe',
@@ -269,8 +271,9 @@
269 271 /**
270 272 * Register scripts.
271 273 */
272 274 $this->register_public_scripts();
275 + // wp_enqueue_style( 'swiper' );
273 276 /**
274 277 * Enqueue scripts.
275 278 */
276 279 if ( BuilderFns::is_builder_preview() && 'elementor' === Fns::page_edit_with( get_the_ID() ) ) {
@@ -276,9 +279,8 @@
276 279 if ( BuilderFns::is_builder_preview() && 'elementor' === Fns::page_edit_with( get_the_ID() ) ) {
277 280 /**
278 281 * Styles.
279 282 */
280 - wp_enqueue_style( 'swiper' );
281 283 wp_enqueue_style( 'photoswipe' );
282 284 wp_enqueue_style( 'photoswipe-default-skin' );
283 285 wp_enqueue_style( 'elementor-editor-style-fix' );
284 286 wp_enqueue_style( 'woocommerce-general' );
@@ -322,18 +324,20 @@
322 324 wp_localize_script(
323 325 'rtsb-public',
324 326 'rtsbPublicParams',
325 327 [
326 - 'ajaxUrl' => esc_url( self::$ajaxurl ),
327 - 'homeurl' => home_url(),
328 - 'wcCartUrl' => wc_get_cart_url(),
329 - 'addedToCartText' => esc_html__( 'Product Added', 'shopbuilder' ),
330 - 'browseCartText' => esc_html__( 'Browse Cart', 'shopbuilder' ),
331 - 'noProductsText' => apply_filters( 'rtsb/global/no_products_text', esc_html__( 'No more products to load', 'shopbuilder' ) ),
332 - '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' => [
333 337 'position' => Fns::get_option( 'general', 'notification', 'notification_position', 'center-center' ),
334 338 ],
335 - rtsb()->nonceId => wp_create_nonce( rtsb()->nonceText ),
339 + rtsb()->nonceId => wp_create_nonce( rtsb()->nonceText ),
336 340 ]
337 341 );
338 342 }
339 343
@@ -346,9 +350,20 @@
346 350 /**
347 351 * Styles.
348 352 */
349 353 wp_register_style( 'rtsb-admin-app', rtsb()->get_assets_uri( 'css/backend/admin-settings.css' ), '', $this->version );
350 - // wp_register_style( 'rtsb-admin-global', rtsb()->get_assets_uri( 'css/backend/admin-global.css' ), '', $this->version );
354 + wp_register_style( 'rtsb-fonts', rtsb()->get_assets_uri( 'css/frontend/rtsb-fonts.css' ), '', $this->version );
355 +
356 + $current_screen = get_current_screen();
357 +
358 + if ( 'edit-rtsb_builder' === $current_screen->id ) {
359 + if ( ! function_exists( 'woocommerce_get_asset_url' ) ) {
360 + include_once WC_ABSPATH . 'includes/wc-template-functions.php';
361 + }
362 +
363 + wp_deregister_style( 'select2' );
364 + wp_register_style( 'select2', plugins_url( 'assets/css/select2.css', WC_PLUGIN_FILE ) ); // phpcs:ignore WordPress.WP.EnqueuedResourceParameters.MissingVersion
365 + }
351 366 wp_register_style( 'rtsb-templatebuilder', rtsb()->get_assets_uri( 'css/backend/template-builder.css' ), '', $this->version );
352 367
353 368 /**
354 369 * Scripts.
@@ -354,9 +369,8 @@
354 369 * Scripts.
355 370 */
356 371 wp_register_script( 'rtsb-admin-app', rtsb()->get_assets_uri( 'js/backend/admin-settings.js' ), '', $this->version, true );
357 372 wp_register_script( 'rtsb-templatebuilder', rtsb()->get_assets_uri( 'js/backend/template-builder.js' ), '', $this->version, true );
358 -
359 373 }
360 374
361 375 /**
362 376 * Enqueues admin scripts.
@@ -371,8 +385,13 @@
371 385 width: auto;
372 386 height: 22px;
373 387 padding: 4px 0;
374 388 }
389 + .post-type-rtsb_builder li#wp-admin-bar-WPML_ALS_all,
390 + .post-type-rtsb_builder li.language_all{
391 + display: none;
392 + }
393 +
375 394 <?php
376 395 $admin_global_style = ob_get_clean();
377 396 // Speed Optimization.
378 397 wp_add_inline_style( 'admin-menu', $admin_global_style );
@@ -379,9 +398,20 @@
379 398 // wp_enqueue_style( 'rtsb-admin-global' );
380 399
381 400 global $pagenow;
382 401
383 - if ( 'admin.php' === $pagenow && ! empty( $_GET['page'] ) && 'rtsb-settings' === $_GET['page'] ) {
402 + $whitelisted_pages = [ 'rtsb-settings', 'rtsb-get-help', 'rtsb-themes' ];
403 + $current_page = ! empty( $_GET['page'] ) ? sanitize_text_field( wp_unslash( $_GET['page'] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended
404 +
405 + if ( 'admin.php' === $pagenow && ! empty( $_GET['page'] ) && in_array( $current_page, $whitelisted_pages, true ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
406 + /**
407 + * Styles.
408 + */
409 + wp_enqueue_style( 'rtsb-admin-app' );
410 + wp_enqueue_style( 'rtsb-fonts' );
411 + }
412 +
413 + if ( 'admin.php' === $pagenow && ! empty( $_GET['page'] ) && 'rtsb-settings' === $_GET['page'] ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
384 414 // Elementor Console Error Fixed For "rtsb-settings" Page.
385 415 wp_dequeue_script( 'elementor-admin-top-bar' );
386 416 wp_dequeue_script( 'elementor-common' );
387 417 wp_dequeue_script( 'elementor-dev-tools' );
@@ -396,13 +426,8 @@
396 426 wp_dequeue_style( 'e-theme-ui-light' );
397 427 wp_dequeue_style( 'elementor-common' );
398 428
399 429 /**
400 - * Styles.
401 - */
402 - wp_enqueue_style( 'rtsb-admin-app' );
403 -
404 - /**
405 430 * Scripts.
406 431 */
407 432 wp_enqueue_script( 'updates' );
408 433 wp_enqueue_script( 'rtsb-admin-app' );
@@ -409,16 +434,19 @@
409 434 wp_localize_script(
410 435 'rtsb-admin-app',
411 436 'rtsbParams',
412 437 [
413 - 'ajaxurl' => esc_url( self::$ajaxurl ),
414 - 'homeurl' => home_url(),
415 - 'restApiUrl' => esc_url_raw( rest_url() ),
416 - 'rest_nonce' => wp_create_nonce( 'wp_rest' ),
417 - 'nonce' => wp_create_nonce( rtsb()->nonceText ),
418 - 'sections' => Settings::instance()->get_sections(),
419 - 'pages' => Fns::get_pages(),
420 - 'hasPro' => rtsb()->has_pro() ? 'yes' : 'no'
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(),
421 449 ]
422 450 );
423 451 } else {
424 452 $current_screen = get_current_screen();
@@ -431,9 +459,9 @@
431 459 * Styles.
432 460 */
433 461 wp_enqueue_style( 'rtsb-templatebuilder' );
434 462
435 - wp_enqueue_style( 'select2', plugins_url( 'assets/css/select2.css', WC_PLUGIN_FILE ) );
463 + wp_enqueue_style( 'select2', plugins_url( 'assets/css/select2.css', WC_PLUGIN_FILE ) ); // phpcs:ignore WordPress.WP.EnqueuedResourceParameters.MissingVersion
436 464
437 465 wp_enqueue_script( 'selectWoo' );
438 466 /**
439 467 * Scripts.
@@ -446,9 +474,9 @@
446 474 [
447 475 'ajaxurl' => esc_url( self::$ajaxurl ),
448 476 'homeurl' => home_url(),
449 477 rtsb()->nonceId => wp_create_nonce( rtsb()->nonceText ),
450 - 'hasPro' => rtsb()->has_pro() ? 'yes' : 'no'
478 + 'hasPro' => rtsb()->has_pro() ? 'yes' : 'no',
451 479 ]
452 480 );
453 481 }
454 482 }