-
Search Results
-
Hello WPDM Support,
We’d like to supply you with some further information about an issue reported to you before Xmas last year about your Download Manager Plug In. Yesterday we updated your plugin and the following issue (included below) and previously reported to you occurred again. This time after applying our fix to your code the issue was not resolved with our fix. Therefore, we would like to tell you about our second fix to your code and ask if you can please investigate this issue which is causing your plug n to be incompatible with our WordPress / Themify installation.
Fix 2
——
This fix is similar to the first one but has been applied in this file: class.Package.php.
Around line 1319/1320 we have removed the call to wp_reset_query() and replaced it with: wp_reset_post_data().
The previous reported fault and our fix which incidentally still needs to be applied in addition to this new one follows:Previously Reported Issue
———————————–
We have identified a fault with Download Manager and are sending you this short report to assist you in resolving the issue which starts with some background information about how it used to work and how we are using WPDM with Themify theme, finally we have fixed the problem but would like to know if our fix is compatible with a future update to WPDM.1) The expected & actual behaviour prior to a recent update of Themify / WordPress
1.1) We add the [wpdm_package] shortcode in this form: [wpdm_package id="6239" template="55c1e8d58c991”] to posts.
Inline image 2
1.2) We then set Themify to include posts to a page using the Query Posts facility.
Inline image 3
1.3) What we expect to happen.
Prior to a recent update to Themify or WPDM (we’re unsure which one has caused the problem) the short code that was added to the post using the Query Posts facility would render the download package to the screen and the page content would finish. Obviously, because the shortcode is the last item of content in the included post.
The issue
————-2) After a recent update the content no longer finishes at the end of the last included post and the additional content included via the embedded short code. Instead the content of the page that includes the posts is added to the end of the page after the last post / embedded shortcode.
2.1) Our FIX!
We’ve replaced the call to wp_reset_query() with wp_reset_postdata() and the duplicate page content is no longer added at the end of the page. See below for reference to approx line 360 in class.ShortCodes.php
function Package($params)
{
extract($params);if(!isset($id)) return ”;
$id = (int)$id;
if(get_post_type($id) != ‘wpdmpro’) return ”;
$postlink = site_url(‘/’);
if (isset($pagetemplate) && $pagetemplate == 1) {
$template = get_post_meta($id,’__wpdm_page_template’, true);
$wpdm_package[‘page_template’] = stripcslashes($template);
$data = wpdm_fetch_template($template, $id, ‘page’);
$siteurl = site_url(‘/’);
return “<div class=’w3eden’>{$data}</div>”;
}$template = isset($params[‘template’])?$params[‘template’]:get_post_meta($id,’__wpdm_template’, true);
if($template == ”) $template = ‘link-template-calltoaction3.php’;
$html = “<div class=’w3eden’>” . \WPDM\Package::fetchTemplate($template, $id, ‘link’) . “</div>”;wp_reset_postdata();
//wp_reset_query();return $html;
}If this was the source of the problem please can you update your source code so that your next update to WPDM doesn’t remove our fix.
Thanks in advance.
—
Hi – if I include a youtube link in a download description (e.g.
https://www.youtube.com/watch?v=n_vHrUapxSQ), WordPress displays a youtube player in the admin, but on the frontend, all I see is the printed URL – it isn’t being parsed. Is that a problem with WPDM or my theme?edit: just tested adding a youtube URL to a non-download-related page on the site and it worked. Is there an issue with parsing/shortcodes on Download Description content?
I the last hours I try to understand the structure of your documentation and actually I can not find anything which I´m looking for, so hopefully I get my answers in that way quickly.
I have three main questions:
I bought the WPDM Directory Add-on to have a category page. When I then click on one category I get a page with all files which are in that category. Therefore the archive.php template is been used. When I need a specific template just for the download page and I do not want to use the archive.php template for that as this is been used globally and not just for the download manager, how can I do that?
On the same page as above I want to display the title of the selected category as title? What PHP echo function can I use for that?
When I enter any category, I´m completly loosing the relation to the parent download page even if in the url it looks like it is a child of the category overview page. The classes on the menu item like “current-menu-item” or “current-menu-parent” will not be set and then no menu item is active. But still it should set the “Download” menu item to active even if I´m in one of the download categories.
Hi there,
I guess I’ve found a problem in your code, regarding JavaScript redirect after downloading single file from files package.
The problem exists in line
347ofclass.FileList.phpwhere you add a<script>tag with click event for the Download button.Let’s take a look at your piece of code:
jQuery('.inddl').click(function() { var tis = this; jQuery.post('https://someexampleurl.com', { wpdmfileid: '1234', wpdmfile: jQuery(this).attr('file'), actioninddlpvr: 1, filepass: jQuery(jQuery(this).attr('pass')).val() }, function(res) { res = res.split('|'); var ret = res[1]; if (ret == 'error') jQuery(jQuery(tis).attr('pass')).addClass('input-error'); if (ret == 'ok') location.href = jQuery(tis).attr('rel') + '&_wpdmkey=' + res[2]; }); });This is the piece of code that contains an issue:
if (ret == 'ok') location.href = jQuery(tis).attr('rel') + '&_wpdmkey=' + res[2];jQuery(tis).attr('rel')takesrelattribute value and appends it to current url, so if my package is athttps://someexampleurl.com/download/packageand I click the download button which hasrel="nofollow"attribute, I am redirected to:
https://someexampleurl.com/download/package/nofollow&_wpdmkey=WPDMKEYwhich gives me a 404 page.As you can see,
?rel=is missing in your code where you overridelocation.hrefand that redirects to non existing page. You don’t even check whether there is any query variable in the URL or not, which may lead to something like this:https://someexampleurl.com/&_wpdmkey=WPDMKEY.Also, if you try to download the file while being connected to slow network, it doesn’t fire the
save file dialogeverytime, redirect is fired earlier instead.I will fix it on my own, but future update will override my fixes. That’s why I’m posting the issue here. I hope you will fix it as soon as possible.