Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › WP eStore Troubleshooting › Link Expired for no apparent reason
Tagged: Custom Download Validation Script Location, custom_download.php, download.php, estore, Link Expired
- This topic has 12 replies, 2 voices, and was last updated 13 years, 2 months ago by wzp.
-
AuthorPosts
-
September 13, 2011 at 5:11 pm #4307provision147Spectator
I am using WP eMember Version v7.0.2 and WP eStore Version v3.4.9. I have a Multi Blog site where my second-blog site is in a sub-directory rather than a sub-domain. It is in the second (sub) blog site where I have downloadable products set up. To the best of my knowledge everything is set up properly and everything works until I click the download links for any product ID. Rather than taking me to the downloadable file it simply displays a blank page with the following two words… “link expired”. I have set the expiry to 4444 hours, but no matter what I put there, it matters not. I have tried several things, including generating an encrypted links through Admin Functions which also display the same message.
September 13, 2011 at 5:16 pm #36581wzpModeratorPlease upgrade to the latest version of eStore and try again…
September 16, 2011 at 12:16 am #36582provision147SpectatorOkay, I completely removed WP eStore from the site/s and removed all WP eStore database tables putting everything back to square one. I deactivated all plugins except WP eMember. I installed the upgrade to v5.9.6 and carefully went through the settings and added a downloadable product. I did a test purchase which worked great but for the fact that I get the same result when I click on the generated link. A page that displays “Link expired”. When I generate a link using Admin Functions the log file says:
[09/16/2011 12:12 AM] – SUCCESS :Generating download link for single file.
I am at a loss.
September 16, 2011 at 1:04 am #36583wzpModeratorI noticed in your original post, you said you have a multiple blog site. Is eStore only installed on one of those blogs?
September 16, 2011 at 1:39 am #36584provision147SpectatoreStore is installed on the primary blog (www.matteroflife.ca) and activated on the sub-blog (www.domain.ca/sub_blog)
Go here to try it out…
http://www.domain.ca/sub_blog/member-page/download/
Log in as… *****REDACTED*****
September 16, 2011 at 1:53 am #36585wzpModeratorI am suspicious about whether or not a link generated by eStore on the sub blog, is inadvertently invoking the download.php script on the primary blog. If you are not using eStore on the primary blog, try deleting the plugin from there.
September 16, 2011 at 2:48 am #36586provision147SpectatorThanks for your rapid responses! You are a real blessing!
I can’t delete it from the primary blog. That is how WordPress Multi-site works. All the plugins are installed in the primary blog server and thereby become available and activated on each individual sub-blog. Every pluggin on my sub-blog is set up and activated in this way, including eMember (working flawlessly) as well as all my other plugins.
BTW, although eStore is installed on the primary blog, it is not activated there.
I also deactivated eMember to see if somehow it was interfering. Nope!
September 16, 2011 at 4:05 am #36587provision147SpectatorI think I may have found the solution thanks to you, as you are thanked for sorting this issue out at the bottom of this article in the forum…
http://www.tipsandtricks-hq.com/ecommerce/how-to-customize-the-encrypted-download-url-224
September 16, 2011 at 4:41 am #36588provision147SpectatorI am getting closer. I followed the instructions in the article above placing ‘cppmembers’ in the new (custom) “download.php” file and uploaded it to the http://www.matteroflife.ca/downloads/ directory.
the line is… $wp_home_dir = ‘sub_blog’;
I also revised the “Download Validation Script Location” field to reflect the new location of the “download.php” file to be “http://www.domain.ca/downloads/”
However, I now get the following error…
===========================================
Warning: scandir(sub_blog) [function.scandir]: failed to open dir: No such file or directory in /home/domain/public_html/downloads/download.php on line 33
Warning: scandir() [function.scandir]: (errno 13): Permission denied in /home/domain/public_html/downloads/download.php on line 33
Please tell us “the Custom Download Validation Script could not find the WordPress home directory, because the script is not properly configured.” Thank you!
September 16, 2011 at 11:51 am #36589wzpModeratorThe error occurs because the custom script is having trouble finding the correct location of the active eStore plugin directory. Because there is more than 1 copy of the plugin and WordPress installed, it gets confused. I suppose that, given you seem to be code savvy, you could always hack the custom script and give it some “help,” by just hard coding the proper path to the active eStore plugin directory.
That would fix the problem for the immediacy. In order to fix the problem for future customers, and “for greater humanity,” I’d need to study your configuration. If you’d like, please drop me a line on my contact form TheAssurer.com/contact and I will get back to you.
September 16, 2011 at 6:59 pm #36590wzpModeratorOkay, issue resolved, here is the lowdown on what happened…
The “Download Validation Script Location” must ***ALWAYS*** be at or below the WordPress root directory. Normally, this maps to the same PHYSICAL directory as your WordPress installation. But under WordPress Multi-Site, there is only one physical WordPress installation directory, and rewrite rules are used to map network blogs into LOGICAL directory or domain paths.
In this case, the networked blog had a logical URL path of domain.ca/sub_blog and thus /sub_blog became the LOGICAL WordPress root directory.
Therefore, the Download Validation Script Location must be set as: domain.ca/sub_blog/downloads/
However, back in the PHYSICAL world, the actual location of the downloads directory is in the location you’d specify if you were to use a custom script location of domain.ca/downloads/ on the main blog.
I know, it’s complicated… Normally, a warning message appears in the settings menu that explains all of this, but because of the logical remapping that takes place on subdirectory installations, the warning logic gets confused.
September 16, 2011 at 8:48 pm #36591provision147SpectatorThanks once again for being so diligent to resolve this. I was tearing my hair out for sure! Please remove any references in the above thread to links and log in information.
Much appreciated!
September 16, 2011 at 10:06 pm #36592wzpModeratorRedactions completed.
-
AuthorPosts
- You must be logged in to reply to this topic.