• Resolved ciaran12

    (@ciaran12)


    Hi Drew,

    Exact Same issue here on a site with pretty permalinks. The page I have the shortcode on is a private page at:

    https://www.davidridgeway.co.uk/wordpress/download-shortcode-test-page.html

    but when it is clicked it tries to take you to:

    [audio src="https://www.davidridgeway.co.uk/wordpress/download/https://https://davidridgeway.co.uk/wordpress/wp-content/uploads/01-Relaxation.mp3" /]

    I have:

    flushed permalinks
    deactivated all other plugins
    Checked that forced-download.php is in wp-content folder

    All to no avail. Any help here would be great, your plugin seems to fit an essential need of this site, one I’d like to employ a lot more, but I’m really struggling to get it to work.

    Cheers!

    https://www.ads-software.com/plugins/download-shortcode/

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author Drew Jaynes

    (@drewapicture)

    Hi, thanks for making your own topic. I wonder if you could do a couple of things for me to help you better troubleshoot.

    1. Publish your download link on a public-facing page I can access.

    2. Provide an example of exactly what you’re using in the post editor, shortcode, link, and all.

    Thread Starter ciaran12

    (@ciaran12)

    While this site is not fully finished, you can view the shortcode here, on a puplic page, as it’s intended:

    https://www.davidridgeway.co.uk/wordpress/contact-david-ridgeway.html

    so, in the ‘visual’ post editor I entered the following:

    [download label=”Download Test”]https://davidridgeway.co.uk/wordpress/wp-content/uploads/01-Relaxation.mp3[/download]

    intending it to say ‘Download Test’ and to force a download of an mp3 housed at https://davidridgeway.co.uk/wordpress/wp-content/uploads/01-Relaxation.mp3

    Thanks for your swift response, Drew, very appreciated!

    Plugin Author Drew Jaynes

    (@drewapicture)

    The good news is that I can definitely confirm the file is located in the correct place and it appears that your permalink settings are in order. And yet the issue persists.

    As I’m sure you’re well aware, you definitely aren’t the first person to report this issue, or rather, an issue very similar to this. I’ve never actually be able to reproduce the problem on any of my test environments to date.

    So in the short term, if you need a stop-gap solution, you can do the link replacement manually to enable your forced download. So in the case of this URL:

    https://davidridgeway.co.uk/wordpress/wp-content/uploads/01-Relaxation.mp3

    you’d just replace wp-content/uploads with download. Like this:

    https://davidridgeway.co.uk/wordpress/download/01-Relaxation.mp3

    And in your post editor, you’d just paste in the manually-modified link a give it a label like any other link.

    I’m going to take some time today/tomorrow to see if I can’t force the issue and figure out what’s going on here.

    Thread Starter ciaran12

    (@ciaran12)

    Thanks Drew, I’ll definitely go for the stop gap as I’d like to hand this over to the owner in the next week.

    So, let me see if I’ve understood you absolutely perfectly!…

    where I have, in the visual editor, the following:

    [download label=”Download Test”]https://davidridgeway.co.uk/wordpress/wp-content/uploads/01-Relaxation.mp3[/download]

    I will instead place:

    [download label=”Download Test”]https://davidridgeway.co.uk/wordpress/download/01-Relaxation.mp3[/download]

    is that correct?

    Thanks, Drew.

    Plugin Author Drew Jaynes

    (@drewapicture)

    is that correct?

    Actually no. The shortcode is what normally handles the replacement for you. By manually replacing the link, you’d just insert it as you would any other link.:

    • (Text tab)
      <a href="https://davidridgeway.co.uk/wordpress/download/01-Relaxation.mp3">Download Test</a>
    • (Visual tab)
      Just click the link icon (looks like a chain link), and input in the information.
    Thread Starter ciaran12

    (@ciaran12)

    Hi Drew,

    I’m sorry, I must be being really stoopid here. But if I, in text editor, replace the shortcode

    [download label="Download Test"]https://davidridgeway.co.uk/wordpress/wp-content/uploads/01-Relaxation.mp3[/download]

    with the following:

    Download Test

    won’t that mean that the mp3 will play rather than download? I’m really keen to have it download, rather than play.

    Apologies if I’m grossly misunderstanding you here, and I really appreciated your time and patience!

    Thread Starter ciaran12

    (@ciaran12)

    aaah, sorry… the second blockquote was meant to contain the following:

    <a href="https://davidridgeway.co.uk/wordpress/download/01-Relaxation.mp3">Download Test</a>

    Plugin Author Drew Jaynes

    (@drewapicture)

    I think you’re missing the point.

    The point is that the download shortcode, e.g. [download] is what handles replacing the provided URL with the link needed to force the download.

    You still need the plugin to handle the download but you can build the force-download link manually.

    In short, if the shortcode was working correctly, this code in the post editor:

    [download label="Download Test"]https://davidridgeway.co.uk/wordpress/wp-content/uploads/01-Relaxation.mp3[/download]

    should have produced this link on the front-end:
    Download Test

    But it didn’t.

    The stop-gap solution I’m suggesting is simply to build the link yourself.

    Thread Starter ciaran12

    (@ciaran12)

    Hey Drew,

    that’s what I hoped you were telling me to do, but the instructions seemed to contradict that, unless I’ve misinterpreted them. Anyway, I went ahead and gave it a go and got some weird results.

    First off I (in visual) highlighted the url (alone) in the shortcode and clicked the link editor, changing the target url to:

    [audio src="https://www.davidridgeway.co.uk/wordpress/download/01-Relaxation.mp3" /]

    before realising that actually I don’t have a downloads folder in the wordpress folder :(. I realised that after a few failed attempts. So I redirected to another location where I have the blasted mp3 which is…

    [audio src="https://www.davidridgeway.co.uk/01-Relaxation.mp3" /]

    When I tried this on the front end, I got a 404, being sent to the following:

    https://www.davidridgeway.co.uk/wordpress/wordpress/download/

    ???

    Have I missed something or there something odd going on here?

    Plugin Author Drew Jaynes

    (@drewapicture)

    OK. I guess I’ll try to explain this one last time.

    If the plugin was working correctly, you’d use the following in the post editor:

    [download label="Download Test"]https://davidridgeway.co.uk/wordpress/wp-content/uploads/01-Relaxation.mp3[/download]

    But for you, the plugin isn’t working. So. WITH the stop-gap described in my previous replies, you would use this in the post editor instead:

    <a href="https://davidridgeway.co.uk/wordpress/download/01-Relaxation.mp3">Download Test</a>

    Notice that “[download label="Download Test]” etc. are nowhere to be found. Just insert the link. Using the shortcode here is completely redundant and unnecessary.

    before realising that actually I don’t have a downloads folder in the wordpress folder

    An integral part of the plugin is some under-the-hood magic that tricks WordPress into believing there’s a “downloads” directory, when in fact the file lives in wp-content/uploads/ instead.

    Here, try it by copying this URL into your browser’s address bar: https://davidridgeway.co.uk/wordpress/download/01-Relaxation.mp3

    This URL “rewrite” is intentional. You’ll notice that if you directly visit the “rewritten” URL above, that a “Save File” dialog will pop-up. The sole purpose of the plugin, in the end is to force the download.

    If you still need help beyond this point of explanation, I’m not sure what to tell you. Sorry.

    Thread Starter ciaran12

    (@ciaran12)

    No need to be unsure – your explanation worked.

    Thanks for providing a workaround and hope you manage to track down the problem so you don’t have to explain it to more people.

    Much appreciated!

    Hi Drew,
    Having similar problems. Got the href to work one time but never again. Here is what I have in the page and neither work. I have reset permalinks, I have shut down Safari, cleared cache, restated. Tried in FF as well but no joy.

    https://bottleshockopen.com/test

    Any ideas?

    [download label=”Participant Entry Form and Bottle Labels”]https://bottleshockopen.com/download/WineEntryandLabels20140605_distributed.pdf[/download]

    <a href="https://bottleshockopen.com/download/WineEntryandLabels20140605_distributed.pdf">Participant Entry Form</a>

    Thanks,
    Greg

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Shortcode redirects to a bloated (and broken) url’ is closed to new replies.