PluginProbe
ShopBuilder – WooCommerce Builder For Elementor / 2.5.3
ShopBuilder – WooCommerce Builder For Elementor v2.5.3
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 +67 -29 2.0.32.5.3 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.
@@ -365,14 +379,39 @@
365 379 *
366 380 * @return void
367 381 */
368 382 public function enqueue_backend_scripts( $hook ) {
383 + ob_start(); ?>
384 + #adminmenu .toplevel_page_rtsb .wp-menu-image img {
385 + width: auto;
386 + height: 22px;
387 + padding: 4px 0;
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 + }
369 393
370 - wp_enqueue_style( 'rtsb-admin-global' );
394 + <?php
395 + $admin_global_style = ob_get_clean();
396 + // Speed Optimization.
397 + wp_add_inline_style( 'admin-menu', $admin_global_style );
398 + // wp_enqueue_style( 'rtsb-admin-global' );
371 399
372 400 global $pagenow;
373 401
374 - 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
375 414 // Elementor Console Error Fixed For "rtsb-settings" Page.
376 415 wp_dequeue_script( 'elementor-admin-top-bar' );
377 416 wp_dequeue_script( 'elementor-common' );
378 417 wp_dequeue_script( 'elementor-dev-tools' );
@@ -387,13 +426,8 @@
387 426 wp_dequeue_style( 'e-theme-ui-light' );
388 427 wp_dequeue_style( 'elementor-common' );
389 428
390 429 /**
391 - * Styles.
392 - */
393 - wp_enqueue_style( 'rtsb-admin-app' );
394 -
395 - /**
396 430 * Scripts.
397 431 */
398 432 wp_enqueue_script( 'updates' );
399 433 wp_enqueue_script( 'rtsb-admin-app' );
@@ -400,16 +434,20 @@
400 434 wp_localize_script(
401 435 'rtsb-admin-app',
402 436 'rtsbParams',
403 437 [
404 - 'ajaxurl' => esc_url( self::$ajaxurl ),
405 - 'homeurl' => home_url(),
406 - 'restApiUrl' => esc_url_raw( rest_url() ),
407 - 'rest_nonce' => wp_create_nonce( 'wp_rest' ),
408 - 'nonce' => wp_create_nonce( rtsb()->nonceText ),
409 - 'sections' => Settings::instance()->get_sections(),
410 - 'pages' => Fns::get_pages(),
411 - '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(),
449 + 'hasElementor' => defined( 'ELEMENTOR_VERSION' ),
412 450 ]
413 451 );
414 452 } else {
415 453 $current_screen = get_current_screen();
@@ -422,9 +460,9 @@
422 460 * Styles.
423 461 */
424 462 wp_enqueue_style( 'rtsb-templatebuilder' );
425 463
426 - wp_enqueue_style( 'select2', plugins_url( 'assets/css/select2.css', WC_PLUGIN_FILE ) );
464 + wp_enqueue_style( 'select2', plugins_url( 'assets/css/select2.css', WC_PLUGIN_FILE ) ); // phpcs:ignore WordPress.WP.EnqueuedResourceParameters.MissingVersion
427 465
428 466 wp_enqueue_script( 'selectWoo' );
429 467 /**
430 468 * Scripts.
@@ -437,9 +475,9 @@
437 475 [
438 476 'ajaxurl' => esc_url( self::$ajaxurl ),
439 477 'homeurl' => home_url(),
440 478 rtsb()->nonceId => wp_create_nonce( rtsb()->nonceText ),
441 - 'hasPro' => rtsb()->has_pro() ? 'yes' : 'no'
479 + 'hasPro' => rtsb()->has_pro() ? 'yes' : 'no',
442 480 ]
443 481 );
444 482 }
445 483 }