It does not work correctly con CloudFlare
-
Hello, I use LiteSpeed ??Cache (recommended configuration) with CloudFlare, my site loads fast and works well, after about 24 hours the Quick view function does not work on WooCommerce products, it stays loading forever, if I clear LiteSpeed ??cache it comes back to work perfectly, the next day the problem appears again
-
please provide the report number
you can get in toolbox -> report -> click “send to LiteSpeed”
Número de informe:?JACDPYOV
this sounds like a typical nonce issue
please search
woosq_quickview
in yoru plugin or theme, and share me like 10 lines before and after on where it is foundExcuse me, should I search for the word woosq_quickviewen within the source code of the plugin or theme?
I found in 2 parts of the source code the word ‘woosq_quickviewen’ inside a .js file
$(document).on(‘click touch’, ‘.woosq-overlay, .woosq-close’, function() {
woosq_close();
});
})(jQuery);function woosq_open(id, effect, context) {
jQuery(‘body’).addClass(‘woosq-open’);if (woosq_vars.view === ‘sidebar’) {
//sidebar
woosq_loading();var data = { action: 'woosq_quickview', product_id: id, nonce: woosq_vars.nonce, }; jQuery.post(woosq_vars.ajax_url, data, function(response) { jQuery('.woosq-sidebar').html(response); woosq_loaded(); jQuery(document.body).trigger('woosq_loaded', [id]); });
} else {
// popup
if (-1 === jQuery.inArray(id, woosq_ids)) {
woosq_ids.push(id);
woosq_products.push({src: woosq_vars.ajax_url + ‘?product_id=’ + id});
}——————-
jQuery.magnificPopup.open({ items: woosq_products, type: 'ajax', mainClass: main_class, removalDelay: 160, overflowY: 'scroll', fixedContentPos: true, tClose: woosq_vars.close, gallery: { tPrev: woosq_vars.prev, tNext: woosq_vars.next, enabled: woosq_vars.next_prev === 'yes', }, ajax: { settings: { type: 'GET', data: { action: 'woosq_quickview', nonce: woosq_vars.nonce, }, }, }, callbacks: { open: function() { if (woosq_vars.hashchange === 'yes') { location.href = location.href.split('#')[0] + '#woosq'; } }, ajaxContentAdded: function() { jQuery(document.body).trigger('woosq_loaded', [id]); }, close: function() { if (woosq_vars.hashchange === 'yes') { if (location.hash) history.go(-1); } }, afterClose: function() { jQuery(document.body).trigger('woosq_close', [id]); }, }, }, index); }
Also in a .php file
function wpcsm_locations( $locations ) {
$locations[‘WPC Smart Quick View’] = [
‘woosq_before_thumbnails’ => esc_html__( ‘Before thumbnails’, ‘woo-smart-quick-view’ ),
‘woosq_after_thumbnails’ => esc_html__( ‘After thumbnails’, ‘woo-smart-quick-view’ ),
‘woosq_before_summary’ => esc_html__( ‘Before summary’, ‘woo-smart-quick-view’ ),
‘woosq_after_summary’ => esc_html__( ‘After summary’, ‘woo-smart-quick-view’ ),
‘woosq_before_title’ => esc_html__( ‘Before title’, ‘woo-smart-quick-view’ ),
‘woosq_after_title’ => esc_html__( ‘After title’, ‘woo-smart-quick-view’ ),
‘woosq_before_rating’ => esc_html__( ‘Before rating’, ‘woo-smart-quick-view’ ),
‘woosq_after_rating’ => esc_html__( ‘After rating’, ‘woo-smart-quick-view’ ),
‘woosq_before_price’ => esc_html__( ‘Before price’, ‘woo-smart-quick-view’ ),
‘woosq_after_price’ => esc_html__( ‘After price’, ‘woo-smart-quick-view’ ),
‘woosq_before_excerpt’ => esc_html__( ‘Before excerpt’, ‘woo-smart-quick-view’ ),
‘woosq_after_excerpt’ => esc_html__( ‘After excerpt’, ‘woo-smart-quick-view’ ),
‘woosq_before_meta’ => esc_html__( ‘Before meta’, ‘woo-smart-quick-view’ ),
‘woosq_after_meta’ => esc_html__( ‘After meta’, ‘woo-smart-quick-view’ ),
‘woosq_product_summary:39’ => esc_html__( ‘Before suggested products’, ‘woo-smart-quick-view’ ),
‘woosq_product_summary:41’ => esc_html__( ‘After suggested products’, ‘woo-smart-quick-view’ ),
];return $locations; } function wcml_multi_currency( $ajax_actions ) { $ajax_actions[] = 'woosq_quickview'; return $ajax_actions; } public static function get_settings() { return apply_filters( 'woosq_get_settings', self::$settings ); } public static function get_setting( $name, $default = false ) { if ( ! empty( self::$settings ) ) { if ( isset( self::$settings[ $name ] ) ) { $setting = self::$settings[ $name ]; } else { $setting = $default; } } else { $setting = get_option( 'woosq_' . $name, $default ); }
hm ? please try search
woosq_vars
Hello, the plugin I use is “WPC Smart Quick View for WooCommerce”
woosq_vars is found 1 time in a .php file and 30 times in a .js file
The following fragment is from the PHP file
// main style & js wp_enqueue_style( 'woosq-frontend', WOOSQ_URI . 'assets/css/frontend.css', [], WOOSQ_VERSION ); wp_enqueue_script( 'woosq-frontend', WOOSQ_URI . 'assets/js/frontend.js', [ 'jquery', 'wc-add-to-cart-variation' ], WOOSQ_VERSION, true ); wp_localize_script( 'woosq-frontend', 'woosq_vars', [ 'ajax_url' => admin_url( 'admin-ajax.php' ), 'nonce' => wp_create_nonce( 'woosq-security' ), 'view' => self::get_setting( 'view', 'popup' ), 'effect' => self::get_setting( 'effect', 'mfp-3d-unfold' ), 'scrollbar' => self::get_setting( 'perfect_scrollbar', 'yes' ), 'auto_close' => self::get_setting( 'auto_close', 'yes' ), 'hashchange' => apply_filters( 'woosq_hashchange', 'no' ), 'cart_redirect' => get_option( 'woocommerce_cart_redirect_after_add' ), 'cart_url' => apply_filters( 'woocommerce_add_to_cart_redirect', wc_get_cart_url(), null ), 'close' => self::localization( 'close', esc_html__( 'Close (Esc)', 'woo-smart-quick-view' ) ), 'next_prev' => self::get_setting( 'next_prev', 'yes' ), 'next' => self::localization( 'next', esc_html__( 'Next (Right arrow key)', 'woo-smart-quick-view' ) ), 'prev' => self::localization( 'prev', esc_html__( 'Previous (Left arrow key)', 'woo-smart-quick-view' ) ), 'thumbnails_effect' => self::get_setting( 'content_image_lightbox', 'no' ), 'related_slick_params' => apply_filters( 'woosq_related_slick_params', json_encode( apply_filters( 'woosq_related_slick_params_arr', 'slidesToShow' => 2, 'slidesToScroll' => 2, 'dots' => true, 'arrows' => false, 'adaptiveHeight' => true, 'rtl' => is_rtl() ) ) ), 'thumbnails_slick_params' => apply_filters( 'woosq_thumbnails_slick_params', json_encode( apply_filters( 'woosq_thumbnails_slick_params_arr', 'slidesToShow' => 1, 'slidesToScroll' => 1, 'dots' => true, 'arrows' => true, 'adaptiveHeight' => false, 'rtl' => is_rtl() ) ) ), 'thumbnails_zoom_params' => apply_filters( 'woosq_thumbnails_zoom_params', json_encode( apply_filters( 'woosq_thumbnails_zoom_params_arr', [ 'duration' => 120, 'magnify' => 1 ] ) ) ), 'quick_view' => isset( $_REQUEST['quick-view'] ) ? absint( sanitize_key( $_REQUEST['quick-view'] ) ) : 0, ] ); }
woosq-security
please go to Cache -> ESI -> enable ESI, add above string into ESI nonce list , save and purge all.
Very good, I have done what you told me, I will wait to see if it has really been resolved and I will let you know in a couple of days.
Thank you so much.
- The topic ‘It does not work correctly con CloudFlare’ is closed to new replies.