The Download Protect plugin has received an update. This includes some fixes and some improvements (with some more to come in another update soon).
First, I changed the way the plugin generates the file key. Previously, this had involved hashing the file name. However, there were some problems with this that resulted in filename collisions. So I changed the process to generate the key from a random string instead. Since the key is a hash just to provide a link to the file, it wasn’t really necessary to do it based on the file name (since we’re not comparing the key in a manner like you would a password hash).
The date format default for stats display was changed to YYYY-MM-DD to be more universal. The date format can be filtered using wpmem_dp_stats_date_format, so you can make it whatever you want if the new default doesn’t appeal to you.
The file table in Media > Download Protect received a major upgrade! It is now sortable by title, file, key, and date. Oh… and I added a date column. You can now customize the number of rows displayed for this table (and some others – more on that later). The default is 20, but if you need to see more (or less), the Downloads tab has some new settings you can adjust and this is one of them. Just set the number of rows you want to display for the file table. The sorting, addition of the date column, and the ability to list more files, along with the previous update’s addition of search, should make the table a lot more easily used for those with large libraries of protected files.
Along with this, for ease of use, if you’ve got a big library of protected files some people have indicated it is cumbersome to go get the link to the file in the table. While the updates mentioned above should help, I also added directly to the Media Manager. Now, in the Media Manager when you open the modal of file details, if the file is protected, it will indicate that it is a protected file and will give you the protected link for you to copy (and use where needed).
Download statistics for the user profile were updated to take advantage of WP-Members 3.2.5’s new user profile tabs. I’ll be updating other extensions to take advantage of this as well, so as these upgrades come out, you’ll have a nice tabbed interface to view additional user data. This is another area where I added a setting so while the default number of file downloads to display on the profile is 5, you can change this in the settings to be more or less. Same with the full stats table – the default is 20 rows of data per page, but this setting can be changed in the Downloads tab.
There were some other code improvements made, and also a troublesome bug was fixed. There was a bug that caused the file key to not get picked up when non-logged in user logged in via the download error page. Depending on how you have things set up, this may not have been an issue but it went something like this: If a non-logged in user clicked a protected link, they were taken to the download error page (location set in the plugin’s settings). There they had a login form to log in, and when doing so, they would then receive a button to retry the download. The problem was that at the end, there was an issue with the query string encoding for the file key and thus the key was not picked up so the download button did not link correctly to the file. This bug as been fixed in this update.
There are a couple of additional things I am working on for a 1.3.1 update – namely, fixing the wpmem_dp_verify filter, and that will be coming soon. But because this update has a bug fix, I didn’t want to hold it back for that additional work to complete, so it will come out separately. In the meantime, if you have any trouble with the update, let me know!