• Resolved Ruud Laan

    (@ruudjoyo)


    Hi!

    For a project I am working on the downloads stopped working with version 4.7.72. Version 4.7.71 still works normally.

    Version 4.7.72 adds a spinner to the download button we use. When clicking the button, the download happens in the background (I see it in the network tab of developer tools) and the spinner spins until it reaches 100%.

    Then nothing happens after that. Where normally the downloaded file (PDF) is opened, nothing happens.

    Could this be related? https://www.ads-software.com/support/topic/download-is-loading-and-doesnt-start-instant/

    Thanks,
    Ruud

Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Author Razvan Aldea

    (@raldea89)

    Hello Ruud,

    Could you please give us a link with a test download so we can have a look?

    Warmly,
    Razvan

    Thread Starter Ruud Laan

    (@ruudjoyo)

    Hi Razvan,

    Thanks for your fast reply. It is a membership site. Let me work on this and get you a test account. How can I send credentials to you?

    • This reply was modified 1 year, 10 months ago by Ruud Laan.
    Plugin Author Razvan Aldea

    (@raldea89)

    Hey Ruud,

    As per this forum rules, we are not allowed to ask or receive credentials, even for testing purposes. Could you simply create a test Download that does not require for a visitor to be a member of the website and place the shortcode on a test page so we can test the download process?

    Warmly,
    Razvan

    Thread Starter Ruud Laan

    (@ruudjoyo)

    I see. Need to set up a version where we can test some stuff then.

    Our setup also uses RCP with the RCP/DLM addon

    Will get back to you tomorrow with a link.

    Thanks!

    Thread Starter Ruud Laan

    (@ruudjoyo)

    Hi Razvan,

    We set up a test page: https://caninecondistg.wpengine.com/test-dlm/

    In an incognito browser both links work normally on version 4.7.72, the unrestricted version opens de PDF, the RCP restricted version shows the restriction notification page.

    When logged-in, both buttons upon click start getting a spinner, count to 100% and then nothing.

    When downgrading to 4.7.71 it starts working again.

    I upgraded again to 4.7.72 for you to test, but unsure if this description can help you.

    Thanks,
    Ruud

    Plugin Author Razvan Aldea

    (@raldea89)

    Are you using any caching system that hard caches the pages?

    Thread Starter Ruud Laan

    (@ruudjoyo)

    Hi Razvan,

    This staging site is on the WP Engine platform; Page caching is a standard feature and is always on. We can request cache exclusions. Caching might be related but the problem lies when logged in, which in normal circumstances already excludes caching.

    This is the result for when I try the download when logged in =>

    
    accept-ranges: bytes
    cache-control: max-age=600, must-revalidate
    content-description: File Transfer
    content-disposition: inline
    content-length: 129305
    content-transfer-encoding: binary
    content-type: application/pdf
    date: Wed, 11 Jan 2023 13:22:18 GMT
    dlm-download-id: 5926
    dlm-version-id: 5929
    expires: Wed, 11 Jan 1984 05:00:00 GMT
    pragma: no-cache
    server: nginx
    vary: Accept-Encoding,Cookie
    x-cache: MISS
    x-cache-group: normal
    x-cacheable: SHORT
    x-orig-cache-control: no-cache, must-revalidate, max-age=0
    x-powered-by: WP Engine
    x-robots-tag: noindex, nofollow

    When attempting this multiple times I get the same response headers. The PDF file itself is being downloaded and visible in the response data, but after reaching 100% nothing happens.

    I retested the not logged in version and it also now seems to no longer work getting the same results. So could you please try and test on the test page to see what results you get? => https://caninecondistg.wpengine.com/test-dlm/

    Thread Starter Ruud Laan

    (@ruudjoyo)

    I did some further testing and replaced the dlm-xhr.js file with the 4.7.71 version. (with SCRIPT_DEBUG=1) and that worked. The download works as expected. I since replaced it again with the new version to allow further testing.

    Thanks,
    Ruud

    Plugin Author Razvan Aldea

    (@raldea89)

    Thank you for the info Ruud.

    The main problem is that the header with the name of the file is not transmitted, thus triggering a JS error. We made some changes in version 4.7.72 regarding the way the XHR download is triggered, now every “download link” will be managed by XHR. Previously only links with the class “download-link” or “download-button” was triggering the XHR.

    The reason I asked about the caching system was because one inline JS constant ( so right before the <script> in the <head> ) that we added in version 4.7.72 was missing although the JS present then on the website from was 4.7.72.

    Now, the main problem is: why is the file name not being sent? Do you have any code in the htaccess that disallows the sending of file name header?

    Warmly,
    Razvan

    Thread Starter Ruud Laan

    (@ruudjoyo)

    Hi Razvan,

    >one inline JS constant was missing

    Can you tell me which inline constant was missing or is it no longer missing now?

    >why is the file name not being sent? Do you have any code in the htaccess that disallows the sending of file name header?

    The .htaccess file just has the default WP stuff. But perhaps WP Engine does some stuff with their nginx setup. Can you tell me which header is supposed to exist with the filename?

    Thanks

    Plugin Author Razvan Aldea

    (@raldea89)

    The JS constant is not missing anymore.

    The header is content-disposition which seems to only give inline as a value ( here is where we try to set it : https://github.com/WPChill/download-monitor/blob/4.7.72/src/DownloadHandler.php#L760 )

    Warmly,
    Razvan

    Thread Starter Ruud Laan

    (@ruudjoyo)

    Hi Razvan,

    We found the issue. the Content-Disposition is set to ‘inline’ from a custom plugin which then messes up the whole filename thing and generates the error (perhaps catch this error?)

    Now looking with the team for a solution on how to change this or not use XHR.

    Thanks for your help

    Plugin Author Razvan Aldea

    (@raldea89)

    I’ve added a tichet on github ( https://github.com/WPChill/download-monitor/issues/1183 ), we’ll try to implement a way to get the info without servers/other plugins interference.

    Warmly,
    Razvan

    This topic will be marked as resolved due to inactivity and because we have an open ticket on GitHub regarding this. Please keep in mind that the ‘resolved’ status is only for this support thread, not the issue on GitHub.

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Download button shows spinner, ends at 100% but then stops’ is closed to new replies.