• Resolved umairrockx

    (@umairrockx)


    Hello,

    All the ajax calls are taking too long from YITH wishlist plugin.
    If the plugin is activated it slows down the add the cart to feature too and it takes ages to add to the cart.
    However, if I deactivate the YITH plugin, other AJAX calls don’t take too long.

    I checked MAX_connections on my database (because i thought, it may be the problem), however its value is set to 1000, which is big enough.
    Let me know if anybody has faced similar problem and how did they fix it?

    regards

Viewing 15 replies - 1 through 15 (of 15 total)
  • Plugin Author YITHEMES

    (@yithemes)

    Hi there

    Plugin do not interact in any way with Add to Cart process, so it is really strange that it slows down those requests

    May I ask you to check how many wishlists do you have in your database?
    If plugin’s ajax call are slow, it may be related to the high number of records in db, that could be caused by spam visit to add to wishlist urls

    Thread Starter umairrockx

    (@umairrockx)

    Hi,
    I am just setting up the site, there are no wishlists in the db.

    The ajax calls from wishlist plugin are taking too long, which delays other features of the website.
    ( https://imgur.com/a/Ux54M1X )

    If i deactivate plugin, everything seems to go fine.

    If you want, i can send you my admin login access, if you’d like to check? If you want, let me know where can I send.

    Thank you for your kind reply,
    Regards

    • This reply was modified 4 years, 1 month ago by umairrockx.
    Plugin Author YITHEMES

    (@yithemes)

    Hi there

    Unfortunatley I cannot accept any admin access to your site, since this is explicitely prohibited by the regulateions of this forum

    Besides I cannot reproduce this issue on my local installation, nor on our live demo (I cannot see any specific slowdown due to wishlist plugin, and AJAX calls are executed with normal delays)

    Could you please share with me url to your test site? I’d like to check waterfall, and test Wishlist operation, to see if I can spot something strange

    Thread Starter umairrockx

    (@umairrockx)

    Hi,

    That is fine, no worries. I really appreciate you taking out time by giving me your kind replies. It means a lot to me.

    Is it possible that I can send you the site url privately and not on public forum?

    I will really appreciate that.

    Regards

    Thread Starter umairrockx

    (@umairrockx)

    Hi there,

    Here is the link: https://tiny.cc/mjh0tz

    Sorry, I just used URL shortner so that I can delete it later once you know the link, the reason being its still in development stages and I haven’t equipped it with security plugins yet.

    Anyway, so once you access the site. Please hover the cursor over the product on home page, you can see the everything has loaded, but the wishlist heart keeps loading for long period of time and until that’s loaded, the add to cart doesn’t work.
    Everything else loads promptly, but I don’t know why the wishlist plugin keeps loading for some time.
    You can see the same behaviour at the product page too.
    If I deactivate the plugin, there is no issue with the speed of site.
    Its just the AJAX call from the wishlist plugin causing issue.

    From my simple troubleshooting, here are the few things I did:
    1. In general settings of plugin, I have tried enabling and disabling “Enable Ajax Loading”, makes no difference to the issue.
    2. I have tried deactivating the plugin and dropping the plugin’s DB tables, and reinstalled again. Still same problem persists.
    3. I installed any other plugin and they work fine. However, with my theme, your plugin is most compatible, so its important for me that it works for me! ??

    I would appreciate your kind reply at earliest convenience.

    Sincere Regards

    Plugin Author YITHEMES

    (@yithemes)

    Hi there

    Thank you for sharing url to your site
    I just checked and I can see that the on page loading a lot of ajax calls are performed to refresh Add to Wishlist buttons

    This is peculiar, and I think it could be the source of the problem (many ajax call thrown at the same time to the server may make it respond slower than usual)

    So I checked why this is happening, and is seems that you homepage contains a lot of “Add to cart” forms, then ones that you usually see on single product page, with variation selection
    Each one of them triggers found_variation event, forcing wishlist to reload ATW button, so that template matches current selected variation

    This is the expected behaviour, but what is odd to me is that those forms are hidden and (at leaast that’s what seems to me) never appear in the page

    Here an example of these hidden forms, that I’ve shown for demonstration purpose

    Now, talking about how to improve, surely removing those forms instead of hiding them would stop any ajax call to be performed, and would drastically reduce the number of ndoes in the page, improving overall page loading time
    If this is not possible, maybe I could suggest some workaround to disable reload of ATW button when a variation is selected (this is a relatively new feature, and I could introduce some filter to completely disable it)

    Please, let me know what you think

    Thread Starter umairrockx

    (@umairrockx)

    Hi,

    Thank you again for your kind reply.
    That is indeed the case. You’re absolutely right. I did a bit of digging and found out that, that is happening because at catelogue pages, some customers may want to add the product to the cart directly. So, that is why, that feature is there that loads all the variants on the catalouge pages. Those options are there, but hidden.

    The problem is that, wishlist plugin send Ajax calls to each of the variant. It is only gonna be problem because I have few designs with 4-5 different colours and as I add more products, its only gonna get longer.
    If I disable swatches on catalouge page, the plugin works fine and page load speeds up. However, I want to keep that feature as it looks professional and convenient for the customers.

    So, if its okay, would you help me with the workaround that you mentioned that you’d disable ATW button multiple ajax calls/reloads when variations are there on shop pages, etc.?

    Let me know, thanks again for taking out time to reply me. It really means a lot.

    Regards

    • This reply was modified 4 years, 1 month ago by umairrockx.
    Plugin Author YITHEMES

    (@yithemes)

    Hi there

    sure, I’ll be glad to help
    So, please, download following files, and upload them on your server as described

    class.yith-wcwl-frontend.php -> wp-content/plugins/yith-woocommerce-wishlist-premium/includes/
    jquery.yith-wcwl.js -> wp-content/plugins/yith-woocommerce-wishlist-premium/assets/js/unminified/
    jquery.yith-wcwl.js -> wp-content/plugins/yith-woocommerce-wishlist-premium/assets/js/

    These changes will be officially released with next version of the plugin, so you don’t have to worry about future updates

    Finally, please copy the following code and paste it at the end of functions.php file of your theme or child theme

    add_filter( 'yith_wcwl_reload_on_found_variation', '__return_false' );
    
    Thread Starter umairrockx

    (@umairrockx)

    Hi there,

    Thank you so much! It really means a lot. That worked 100%.
    However, that means now , the customers cannot select product variant. It just adds the product. In the wishlist page too, it leads it directly to the product single page.
    Is there any way in options, like the customer can select variant on wishlish page and add product to cart straight away from there.

    Again, thanks for the enough help already. I really appreciate that. Thanks a ton!

    Best Regards

    Edit: I guess, what I just asked, if we do that, then it will be the old problem to wishlist page then. Isn’t?

    • This reply was modified 4 years, 1 month ago by umairrockx.
    • This reply was modified 4 years, 1 month ago by umairrockx.
    Plugin Author YITHEMES

    (@yithemes)

    Hi again

    Well, you’re right indeed; there is no reason to disable variation handling while also disabling template refresh on found variation
    Please, try these new and updated files:

    jquery.yith-wcwl-js -> wp-content/plugins/yith-woocommerce-wishlist-premium/assets/js/unminified/
    jquery.yith-wcwl-js -> wp-content/plugins/yith-woocommerce-wishlist-premium/assets/js/

    Thread Starter umairrockx

    (@umairrockx)

    Thank you so much! You’re a star! Worked like a charm.

    Plugin Author YITHEMES

    (@yithemes)

    Hi there

    We are doing our best to improve our plugins. Our target is to develop and release the best free plugins for WooCommerce, but to achieve this we need your help. Please leave a good review to support us and help our growth ??

    Thread Starter umairrockx

    (@umairrockx)

    Thank you so much, you’re the best! Left a well deserved 5* review.

    Hello there I have the same issue on Porto Theme. Ajax Calls are taking too long. Could you provide the files again. The We-Transfer is expired.

    Thank you!

    I am also facing the same problem, appreciate if you share those files again want to try them.
    Thanks

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘AJAX calls from Wishlist is taking too long’ is closed to new replies.