• Resolved henkesan

    (@henkesan)


    The problem occurs in every product-category that has more than 3 pages of products. After page 2 products stops loading with the loader.gif keeps spinning.
    This ONLY happens for visitors/logged-out users.
    As soon as I log in to the site and visit the site as logged-in user, YITH infinite scrolling works perfectly fine.

    I use the theme Shoptimizer and followed their guide for configuring your plugin:
    https://www.commercegurus.com/docs/shoptimizer-theme/infinite-scrolling/

    I have contacted the developer of Shoptimizer that gave me this reply:

    “This is a redirect issue. The screenshot below there are too many 301 redirect.
    “This one shows 301 redirects because of the string URL at the end “?_=1727256257822”
    “/produkt-kategori/rakning/page/3/?_=1727256257822”

    After that I contacted our webhost with the information from Shoptimizer and our webhost replied with:

    “After checking the site and confirming that it works logged in but not logged out, looks like there is an interesting behavior from the infinite scrolling. When the page 2 is loaded, it does not redirects, it just returns a 200 status. However, for page 3, 4 and the next ones, the request is always a 301”

    There where a lot of screenshots provided which I can’t upload here, but you can see all of this by inspecting the site in Chrome DevTools Console:
    “Failed to load resource: net::ERR_TOO_MANY_REDIRECTS
    rakning/page/3/?_=1727191051465:1″

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Support crodriguez1991

    (@crodriguez1991)

    Hello there,

    I hope you’re doing well :D.

    Our plugin doesn’t add any random parameter to the URL. It simply make a redirect in order to load the content via ajax and show the result in the current page.

    Probably it’s a conflict with other plugin or custom code that adds random parameter.

    I suggest you to do make a test and disable all plugins leaving only our plugin and WooCommerce enabled and check if you have the same problem.

    If yes, try to change your theme and use a default theme like TwentySixteen.

    Please, try it and let me know.

    Have a good day.

    Thread Starter henkesan

    (@henkesan)

    I’ve tried everything, literally everything.

    Disabled all plugins, switched themes, re-saving permalinks, disabled Cloudflare Enterprise, deleted all redirects in RankMath, and deactivated RankMath. Nothing helps.

    Shoptimizer theme developer replied with this screenshot (the problem always happens when /page/3/ is about to load on any product-category)

    I discussed all of the problems I have experienced and uploaded the image to ChatGPT (I have of course also had long dialogues with our web host rocket.net and the theme developer):

    The screenshot you shared shows an important detail about the behavior of the pagination between /page/2/ and /page/3/. The HTTP/2 301 redirect on /page/3/ is coming from WordPress based on the x-redirect-by: WordPress header. This confirms that the redirect issue is being triggered by WordPress rather than the server or Cloudflare.

    Key Observations:

    • /page/2/ returns a 200 OK response.
    • /page/3/ returns a 301 redirect response, with the redirect being initiated by WordPress (x-redirect-by: WordPress).

    Possible Causes:

    1. Trailing Ampersand in URL: Notice in the screenshot that the URL for /page/3/ contains &_= twice: /page/3/?nocache=&&_=1727937172210 This double & in the URL might be causing the problem. It looks like the AJAX request is adding an extra &_ parameter, possibly due to the infinite scroll plugin’s JavaScript logic. WordPress might be interpreting this as an invalid request and issuing a 301 redirect. In contrast, the URL for /page/2/ is: /page/2/?nocache=&_1727937172210 The trailing query parameters look correct here, and that’s why the request succeeds. This inconsistency might be what’s breaking the request for /page/3/.

    Troubleshooting Steps:

    1. Fix JavaScript Issue in Infinite Scroll Plugin: The duplicate &_ in the URL for /page/3/ likely originates from the Yith Infinite Scrolling plugin’s AJAX request. You can:
      • Inspect the plugin’s JavaScript code that handles the pagination logic. Check where the query parameters are being appended to the URL and ensure that &_= is added only once.
      • You could also try updating the plugin if you’re not using the latest version, as it might be a bug that has been fixed in a newer release.

    I later tried this plugin instead:
    Load More Products for WooCommerce – WordPress plugin | www.ads-software.com – https://www.ads-software.com/plugins/load-more-products-for-woocommerce/

    Which has the same basic structure of infinite scrolling via AJAX pagination. And it worked flawlessly for both logged-in and logged-out users.

    If “Load More Products for WooCommerce” works without any issues, it confirms that the problem was indeed tied to the Yith Infinite Scrolling plugin, likely due to how it handles pagination or query strings (the &_= issue) specifically for certain pages like /page/3/.

    Interesting, I just came to figure out why infinite scroll was broken on my shoptimizer site as well… would love to get to the bottom of this. I’m actually using the pro version and it broke recently.

    Thread Starter henkesan

    (@henkesan)

    @duainem1 Thank you! Maybe we can help each other going to the bottom of the root of this problem.

    In my current troubleshooting conclusion, there is either something wrong with YITH infinite scrolling or something related to specific web hosts (maybe Cloudflare, but I’m not sure).

    @duainem1 What web host are you using? We are using Rocket.net

    I can also verify that the problem is not related to the theme Shoptimizer, as I got the same problem with the theme Storefront on another website. (it works great logged-in, but not as visitor/logged-out)

    Thread Starter henkesan

    (@henkesan)

    @crodriguez1991 Please have a look at this, more users are having the same problem as us.

    Plugin Support Pablo Pérez

    (@pperez001)

    Hi there,

    We will release a new update of the plugin with some improvements that should help with the issue you are experiencing. Please, once that update releases ( which will be soon ), please check your problem with the new version and let us know if the issue persists.

    Plugin Support Facundo Arano

    (@aranofacundo)

    Hi there,

    We have released the new update which contains the fix my colleague mentioned.

    Please check it and let us know if the issue is solved.

    Thread Starter henkesan

    (@henkesan)

    @pperez001 @aranofacundo

    Thank you so much for the update! This fixed everything ??
    Everything is now solved ??

Viewing 8 replies - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.