Download Counter for WordPress

I’m crazy about numbers. I won’t do anything with them, but I just like them. Just like to watch counters increase, or graphics to grow. Since WordPress does offer attaching downloads to pages, but doesn’t keep track of statistical information about these downloads, I wrote this plugin.

I should mention statistical information is a big word for just another download counter, since that is main purpose of this plugin.

Features:

  • Keeps track of the amount of downloads of a certain file.
  • Keeps track of the last download time
  • Allows you to reset the counter
  • Allows you to add counters to both internal and external urls
  • Can use fancy urls (like /downloads/file.zip)
  • Can print the amount of downloads, the filesize and the last modified date in a post.

Installation

Download the zip-file and extract the wp-downloadcounter directory to you wp-content/plugins directory. Go to the plugins page in your wordpress administration panel, and Activate the Download Counter plugin. On Activation, a table with the name [$prefix]downloadstats gets created, and two options will be added. The table nor the options will be removed when deactivating the plugin! After activation, it is important that you update the Permalink Structure. You can do this at your Site administration, under Options. The reason for this update is that after Saving the Permalink Structure page, WordPress will "ask" all the plugins if they want to register some specials URL’s. The download counter plugin will register the specified download slug as a special url with WordPress. If you don’t want to do this, you’ll have to disable Pretty Links.

Management

After activating the plugin, you can manage the downloads under Management -> Downloads. Choose Add Download to add a download to the list. In the topmost editbox, you should fill in a unique name, since this name will be used in the created url. In the second editbox you should fill in the target URL. Click Save and the download is added to the list. The overview window allows you to reset the counters for a download, to edit a download (which will not reset the counters) and to delete a download. Of course, when deleting a download, only the download counter for that download will be removed, the file at the target URL will not be removed.

Using tags in your posts

When writing a post or a page, you may want to add the URL or the amount of downloads in your post. Using [ download(downloadname) ] (without the spaces) will be replaced with the download url, [ downloadcounter(downloadname) ] will be replaced with the amount of downloads, [ downloadsize(downloadname) ] will print the size of the download (in GB, MB, kB or B), [ downloadupdated(downloadname) ] will print the last modified date, using the WordPress setting you’ve specified for the date format. When creating a link, you could, for instance, use <a href="[ download(file.zip) ]">Download</a> (of course, again, without the spaces within the [] brackets).

Finally, when using downloadsize of downloadupdated, you can specify one extra argument. With downloadsize, you  can add ,false to prevent the usage of the GB, MB, kB or B postfixes. So, for example, using [ downloadsize(file.zip, false) ] will just display the size in bytes. With downloadupdated, you can enter a PHP date format string as extra argument. For example, [ downloadupdated(file.zip, d-m-Y) ] will display a date like 27-11-2008.

Retrieving download information from PHP

Since version 0.6 is it possible to get information about the downloads using PHP, so you can use this information directly in your templates or in you own plugins. Only one function is important at the moment:

download_information($download_name, $return_information = DOWNLOAD_URL | DOWNLOAD_AMOUNT)

This function will return an array with the requested information. You can specify what information to return by the argument $return_information. The file downloadcounter-options.php contains the correct define statements which can be used. Currently only URL, Amount, Size and Last Modified Date are available.

Using the code

$info = download_information(wp-downloadcounter.zip, DOWNLOAD_URL | DOWNLOAD_AMOUNT | DOWNLOAD_SIZE | DOWNLOAD_LASTMODIFIED | DOWNLOAD_LASTDOWNLOAD);
var_dump($info);

returns:

array(4) { ["url"]=> string(73) "http://bovendeur.org/downloads/wp-downloadcounter.zip" ["amount"]=> string(4) "5200" ["size"]=> int() ["lastmodified"]=> int(1240433734) }

Downloading

You can download this plugin here (size 0 B). This plugin has been downloaded 5200 times This file was last updated on 22-04-2009. If you have any comments (nice or not), please don’t be shy. Post them on this page!

Important note when upgrading

Since the database table is altered (a column for storing the user id is added) you’ll have to re-activate the plugin. Forget to do this, and NO logs will be written to the database!

If you’re using Pretty Links and are going to update your blog to WordPress 2.7, you’ll have to press the Save Changes button (without making any changes, read above why) on the Permalinks Settings page again to make this plugin work again. In my setup, I didn’t find the Permalinks page anywhere in the menu, but entering the url /wordpress/wp-admin/option-permalink.php did the trick.

Changelog

2009-04-22

  • Added French translation (thanks to Laurent)
  • Fixed missing strings in the pot file (also thanks to Laurent)
  • The option Items per Page now also limits the amount of items seen in the Available Downloads list

2009-02-14

  • Fixed a bug which prevented the statistics to update. The bug was found by a couple of users, but with the help of Chris Bergman we were able to fix this one. The problem was the PHP timelimit, which was expired after the file was sent to the client. Since this plugin writes the statistical information at the end of the script, this part of the script was never executed. Solution is to set the timelimit to 0 before the call to readfile, and reset the timelimit to the configured value after the call to readfile. Chris, thank you for your help on this one!

2009-01-13

  • Fixed a bug which prevented files from being downloaded. Bug found by Kerry and Niuray, and fixed by Niuray. Original fix (and website) can be found in the comments.

2008-12-03

  • Fixed some issues with PHP4
  • Added DOWNLOAD_LASTMODIFIED for use with the download_information function
  • Added Italian language (thanks to Gianni Diurno).

2008-12-01

  • Added paging to the Downloads log (as requested by Mike, #44)
  • Added logged on user to Downloads log (as requested by anon, #38)
  • Added a function (download_information), which returns an array of information about the specified file (as requested by SAn, #47)
  • Added [ downloadupdated(<downloadname>, <php date format>) ] as possible tag.
  • Added [ downloadsize(<downloadname> ] as possible tag.

2008-10-26

  • Added paging to the Available Downloads list.
  • Added other options to determine the mime type of a file, including the file-command (if it’s available) and a longer list of hard-coded mime-types.

2008-03-19

  • Local downloads are now handled by the script, so that the filename can be send to the browser. This should prevent the browser from download .htm or other named files.
  • Changed some PHP tags which could cause errors on some configurations.

2007-07-08

  • Fixed bug posted by Steve in the comments (thanx to Dave for submitting the fixes).
  • Added a second table to store the ip-address, referer and date/time for each download.
  • Added a configuration section to change the settings.

 

151 Responses to “Download Counter for WordPress”


  • Grats for the blog! You missed an info page with your email, can you please contact me? :)

  • I’ve installed the plugin per the directions, but when I try go to the Manage area, I’m getting the following error message:

    Parse error: syntax error, unexpected ‘;’ in /home/sgvhumane/public_html/runamutt/wp-content/plugins/wp-downloadcounter/downloadcounter-options.php on line 48

    Any thoughts? I’m running the latest WordPress – 2.2.

  • Steve, I got the same error.

    Line 48 can be fixed by editing downloadcounter-options.php and adding an extra closing parenthesis to the urlencode statement.

    Find: $_POST['download_name']);

    Replace with: $_POST['download_name']));

    Line 96 also needs to be changed:

    Find: (isset($download)

    Replace with: isset($download)

  • @Steve, @Dave:

    Steve, I’ve noticed it, and just saw the fixes Dave submitted. Thanx, Dave :-)

    Right now, I’m about to submit version 0.2, which will also log who downloaded which file, with referer and date/time. Of course, this bug will also be fixed. Just strange that I didn’t notice it before…

  • I am having some problems. I cannot seem to get any of the files to be listed under “Available Downloads.” This could be my mistake (I am a novice!), but am greatly perplexed by this. Also, where do I see the stats?

  • doesn’t seem to work for me. doesn’t show up anywhere once activated. not in the dashboard, not in options. can’t figure it out.

  • @ljames:

    The plugin should come available under Manage at the Site Administration. I’ve choosen the Manage tab, since you’ll have to Manage your downloads.

  • Awesome – thanks guys!

  • hi R-win,

    I keep getting this error… any advice on how to fix it?

    Parse error: syntax error, unexpected ‘;’ in…./plugins/downloadcounter-options.php on line 48

    Thanks. :)

  • @christine:

    that sounds like a old version. Try the new version at http://bovendeur.org/2007/07/06/download-counter/

  • what changes do we have to make to permalinks?

  • @metallicpeach

    No changes at all, you just have to press Update. When you press Update, WordPress will call each plugin to see if they have any redirections required. The Dowload Counter plugin does require one additional redirection, so taking this step is required after installation, and after you’ve changed the slug.

  • Thanks for the great plug in that actually works! i have had to go through a few now and host of them produce a header issue.

    one suggestion, i had some files named the same as the folders and that produced errors, so maybe something could be don’t about bout that, or some documentation on it so people don’t think its broken.

    Thanks again.

  • Thanks man.

    I have been searching for this plugin from so many days. Finally I got what I wanted. Thanks for developing such a nice plugin.

  • Nice plug-in! :)

    A subjection make it AJAX. Some kind of icon for the file that are linked to be downloaded, upon click, scrolls down (loads the file info and the link in a window that appears below the icon or something like that) and the amount of downloads will be showed, latest update, and maybe other stuff)

    I have seen something like my suggestion but haven’t found anything about such plug-in, this has that potential do be “that” plug-in! :)

  • So, I have the plug-in loaded, but I can’t seem to get it working.

    Under “Available downloads” it shows the download I added. The link “without counter” works just fine (it links directly to the .zip file I have). The link “with counter” does not (it doesn’t include the whole filename, it cuts part of it off).

    Entering “[download(myname)]” into my post displays the text of the link for the “with counter”, which as stated before doesn’t work because it’s linking to a file that doesn’t exist.

    I’ve updated my permalink structure, although I am not sure what that actually does.

    Any help would be appreciated. Thanks. :)

  • I have this error under Download-section :

    WordPress database error: [Table 'progcom.wp_downloadstats' doesn't exist]
    select download_id, download_name, download_url, download_added, download_count, download_last from wp_downloadstats

  • Nice plug-in! But I get an error when trying to add a download. It just says:

    Cannot load

    How can I fix that? Thanks in advance!!

  • Hello,

    Very nice plug-in ! But it doesn’t work for me :-( Links generation works fine, just look this url

    http://dxgengine.progmansoft.com/?download=dxg380

    But plugin seems do nothing, maybe i do a mistake :-)
    I think ‘request’ wordpress hook probably not available in wordpress version 2.0

  • nice… but am having trouble. every time i download ‘with counter’, it adds 2 downloads to the count.

    why is this? can i do anything about it?

  • Hi,

    thank you for your excellent plugin! It’s just what I need for my homepage :) .

    One minor problem, though – I don’t quite know if it’s a plugin bug or a problem with Firefox:

    When using the “Right-Click –> Save as” command for a file which uses the download including download counter, the file saved is a .htm file full of gibberish. In IE7 and Opera, it works just fine.

  • I’m having the same issue as Till. The download link generated is an .htm file, which seems to download, but I would like to have the file download in its original format (.mp3).

    I’m going to keep going, I’m sure there is an easy solution.

    Sweet plugin though! If I can get it working as I like, I would be happy to paypal you a small donation;

  • when usin the link with a tak it never can find the file url. then when i go back to edit it, the link with the take is always changed somehow. why is it not staying like i type it in.

  • Very nice plugin! Haven’t installed it yet, but I’m working on it, and by the installation notes you wrote I can see it’s one of the best plugins that does this!
    Great job!

  • I installed the plugin as required but it won’t show the number of downloads… Any idea why?

    Page:http://www.awholeuniverse.com/design/night-theme-wordpress-theme

  • Hi,

    I installed the plug-in as described in this post, but whenever I click on the “Add download” from the manage -> downloads I receive this error message :

    Cannot load .

    Could you please help me to solve it.
    Thanks in advance

    Cheers

  • When I tryed to activate the plugin the next error has been dumped by WordPress:

    Fatal error: Cannot redeclare class DownloadCounter in /var/www/viernes.org/htdocs/wp-content/plugins/wp-downloadcounter/downloadcounter-config.php on line 25

    Any idea? Thanks.

  • # mv wp-downloadcounter wp-dcounter

    And the redeclare error has gone.

  • Cannot load wp-downloadcounter/downloadcounter-options.php:

    Hmmmm… plugin it’s outdated?

  • After a while struggling to configure the permalink thing I got it to work, and I love it.
    Very very simple to use, nice job!

  • I am having a hard time installing this plugin in my blog..
    I have activated it and did the necessary operations, but nothings happening.

  • I’m get this error:

    WordPress database error: [Table 'wp_xxxxxxx.wp_downloadstats' doesn't exist]

    On Downloads in Manage. :(

  • Hi.,

    Can someone who has got this to work lay out step by step instructions?

    I’m finding the steps to take on this page miss gaps and don’t quite explain what I need to know.

    For example, why do I need to update the Permalink structure?

    Do I link to the exact .zip file of my download or to the download page?

    Be great if these questions could be answered…

    Thanks

    Martin

  • I’m having the same problem as Till and Adrian:

    “When using the “Right-Click –> Save as” command for a file which uses the download including download counter, the file saved is a .htm file full of gibberish. In IE7 and Opera, it works just fine.

    The download link generated is an .htm file, which seems to download, but I would like to have the file download in its original format (.mp3)”.

    Did anyone find a solution, please?

  • is it possible to add user’s name so you can keep track of who clicks what.

  • The problem remains:

    Plugin could not be activated because it triggered a fatal error.

    Fatal error: Cannot redeclare class DownloadCounter in /var/www/viernes.org/htdocs/wp-content/plugins/wp-downloadcounter/downloadcounter-config.php on line 25

    I have the WP2.5.

    Thanks.

  • Excellent plugin Erwin, it’s exactly what I was looking for.

  • thanks for the plugin.it works great.

    @Queru: I’m using WP2.5. too and I don’t have that problem.Perhaps it because of conflict with function name using by others plugin.

  • sorry for double posting.I just want to help @The ‘sell photos online’ Dude and others that have problem.

    the easiest way to solve that problem is to uncheck the checkbox in configuration. so download links will be generated as /?download=
    no need to update permalink structure or whatever. :)

  • Great plugin…exactly what I was looking for :D!

    I was having the same problem with the “with counter” links, but I followed arejae’s advice and unchecked the box and now everything’s perfect.

    Thanks again!

  • Great plugin! this has been a useful plugin and we really appreciate the work put into the development.

    I have a bug/error/request to make. I’ve noticed the tracker page stops loading once you have more than 6000-7000 logs ( which is a in fact too long a log to review on one page).

    I was wondering if you can add a feature where we specify how many logs per page we want to see. Say 500 logs per page or 100 logs per page.

    Let me know if this is possible.

    Thanks in advance!

  • Mike,

    Great idea. I’ll try to look into this within a week. The reason it’s not in there, is that I’m not getting that much downloads ;-)

  • Hi,

    thank you for your excellent plugin! It’s just what I need for my homepage :) .

    One minor problem, though – I don’t quite know if it’s a plugin bug or a problem with Firefox:

    When using the “Right-Click –> Save as” command for a file which uses the download including download counter, the file saved is a .htm file full of gibberish. In IE7 and Opera, it works just fine.

    ———————

    The same here! Any solution??

    Thanks

  • Hello.

    I need to insert file size (megabytes) to the page.

    It will be great to have tag like this: [downloadsize(Test.zip)]. So, the visitor not only will get the link, but will see the size of the file he wants to download.

    Other request: please provide PHP function (in addition to [download(...)] tag) which will return download information by the download name: download count, download size, last download time, download link.

    It is important for me, because I want to write something like this: “file downloaded 123 times”. In English, you write “time” after digit 1, and “times” after 2,3,… So, you have no problem since download count>1 : you can always write “times”. But in Russian, we have complex rules for the correct form words BEFORE the number and for the word AFTER number. So, I want to make PHP function which will call you function to get download count. It is inconvenient and ineffective to call “edit_content” function for this task.

  • It can not Reset/Edit/Delete

    But it work now.

    Why? My wordpress is Version 2.6.2

  • Hello, and thank you for the great plugin.

    I do have one slight bug/quirk to report, however. When I click a download link to a pdf in Firefox, it would seem that the $content_type variable is not being properly set, which results in the browser trying to interpret the pdf as html when the “open” option is selected (rather than “save”).

    You can see this in action if you visit my website (linked in my name) and click the “free download” pdf link in Firefox, then choose “Open with.”

    I tried adding a pdf case to the switch($pathinfo['extension']) statement, but that didn’t seem to change it.

    Any suggestions?

  • @The Tim,

    I will have to look into this. I think I should replace the switch with something like the file command (if it’s available). However, I do think it has something to do with the switch statement for not recognizing PDF files.

    Regards,

    Erwin

  • Excelent posts and good comments. I wish good luck from Autoversicherung

  • Hey r-win,

    it’s really a great plugin, you provide here. This is what I was searching for a few days. Why didn’t I find in in the official plugin database?

    Unfortunately, its not working the way it should: Counter-Links are generated fine and files can be downloaded without problems. Only, the downloads are not counted!

    There are no entries in “wp2_downloadtracking”. Why? Is there an Update? Please help me! (if this is possible by mail) I’m using WordPress 2.6.2.

  • Hello. I love this plugin! I finally have a chance to keep a track of how many times a file has been downloaded.

    I use it on posts such as http://www.ericastjohn.com/resources/brushes-photoshop/musical-notes-pscs3-brushes/

    I have been trying to get the counter to work for it to show how many time on the post, but I cannot get it to work. Any suggestions? I am using WP 2.7 and it seems to work otherwise.

    [ downloadcounter(downloadname) ] is what I tried to use (without the spaces) but I am not sure which name I should use in the link on the page.

  • Hi,

    I love this plugin, I have been using it for a long ime to track the number of downloads on my free WP themes.

    Two days ago I updated my blog to WP 2.7.2 beta, and ever since then, the downloads do not work when using the pretty links.

    Is the plugin incompatable with WP 2.7? If so, are you going to release a compatible version?

    Thanks for your time, I’m looking forward to your reply.

    Kind Regards
    ~Cobus Bester

  • Really good read, nice to read a good blog at last!

  • Hi Erwin,

    Thanks for the update!

    I downloaded the new one and tried to upgrade but it would not activate ( using wp 2.7 rc1)

    I get this error:

    Parse error: syntax error, unexpected T_STATIC, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or ‘}’ in /homepages/18/d1227dgs3/htdocs/foldername/wp-content/plugins/wp-downloadcounter/downloadcounter-config.php on line 191

    What could I be doing wrong?

    Regards,
    Mike

  • Any chance I can get v0.5 somewhere while you look into the issue with v0.6?

    Thanks for your help!

  • @Mike,

    try editing the plugin (with WordPress you can), and search for the line

    static $headers = Array();

    replace the word static with private and try again. It is, however, weird that static doesn’t work, but I’ll look into that when I get home.

  • Hi Guys!
    Great blog. I found it a bit tricky to install like most readers above…
    Finally got there and this is fantastic.

    A few points of advice.
    Be careful with permissions. I thought i had to change permissions to allow writing, at least that was the error i was getting intially. Turns out don’t touch any permissions at all.

    When you add a download the Name that you use needs to be exactly the same(case sensitive) in any posts you will be adding the counter to.

    The url is exactly that.
    The enitre url of where the download is. For some reason i just thought i had to type the file in here like test.zip when in fact you require the entire url http://www.yourdomain.com/downloads/test.zip

    I also got it working with seo friendly urls activated.
    If you using seo friendly urls leave your custom structure and pretty links on.

    Just leave or use downloads as your slug. Then create a directory called downloads in the root of your site.
    Upload files to that directory.

    Hope this helps. Sorry its late here and my eyes are slowly but surely closing.
    Cheers! :)

    Thanks again great plugin!

  • @Evan

    You wrote “Just leave or use downloads as your slug. Then create a directory called downloads in the root of your site.
    Upload files to that directory.”.

    Actually, don’t do that!!! In the .htaccess which WordPress uses a check to the actual file and directory is made. If the requested file exists as a physical file on you website, it will be served directly by your webserver, without calling any PHP code. The file will download ok, but you wont register any downloads with the downloadcounter!

    On this site, I just upload files to the upload folder of WordPress, in the downloadcounter I add the full URL as URL (something like http://projects.bovendeur.org/wp-content/uploads/2008/12/file.zip). The URL generated by the downloadcounter will be something like http://projects.bovendeur.org/downloads/file.zip. Because this file doesn’t exists, WordPress will load. Because you’ve updated the permalinks, WordPress will load the downloadcounter, and lets it handle the request. The downloadcounter will then register the download and sends the file to the client.

  • After a while struggling to configure the permalink thing I got it to work, and I love it.
    Very very simple to use, nice job!

  • Erwin thanks for your help / reply.
    I get what you are saying but my download counter appears to be working perfectly with the slug pointing straight at my downloads directory.
    I can even see the recorded ip addresses that have downloaded the file.

    Weird….

    Even if download the file the counter jumps.

  • Worked like a charm! Amazingly useful plugin. Take a look at my usage at http://beerpla.net/2008/12/22/mastering-the-linux-shell-bash-shortcuts-explained/.

    Thanks, Erwin.

  • This plugin worked great until I upgraded to WP2.7. I am using a Win2003 Server (iis). I can download the files fine from a direct link. The problem is whne they use the “download with counter” code they download but are considered invalid. This is zips, jpgs & xls files.

    ANyone else see this behavior?

    Thanks All,

  • Just upgraded to 2.7, press “Save Changes” work nice…

  • Hi,Kerry, I met the same problem as you said, and I modified a little to the source code, it works fine in my website now, you could check my site for details(In Chinese, but you could see the modified code and download link ):
    http://www.niuray.com/wp/wp-downloadcounter-bug-fix/

  • The Plugin file itself appears to missing from the latest zip online. Only the config and options pages are in the directory

  • @Tim:

    Actually, no, that’s it.

  • I don’t understand, how look the code if i want insert counter to my template?

  • Hi. I’ve just upgraded to 1.0.
    First thing to say is that the link on this page (http://projects.bovendeur.org/downloads/wp-downloadcounter.zip) still seems to be serving 0.8.
    Second, I don’t understand why it now uses its own MIME type analysis, with various MIME types hardcoded into the plugin, in preference to using mime_content_type(). It was the other way around before wasn’t it?

    Some months ago I sent you a patch so that one didn’t have to type the full URL for a local file (by far the most common case), just the path part of the URL. eg instead of “http://www.mysite.com/uploads/a.mp3″, one can just put “/uploads/a.mp3″. Judging by the number of comments from people who don’t realise that they have to use the full URL at present, I still think this could be a useful change. Also avoids filling the database with references to the domainname, which then become problematic if the domainname ever changes. Anyway if you’d like me to send a patch against 1.0 I’m happy to do so :)

    Cheers for what remains a most useful plugin :)

  • sorry to ask such basic questions…but:

    what is a “download slug?” I’m not sure what goes in the download slug box on the configuration page

    also, when adding downloads, is the URL the actual location of the file itself, or the page visitors see my download button?

    Thanks very much!

  • Erwin,

    I downloaded your script, downloads work fine but statistics are not updated. Counter keeps displaying 0 and so are the values in the db. Apache + PHP log show nothing weird… Any ideas? Using WP 2.7 and Download Counter 1.0…

    tnx

  • @Quextal:
    Since a couple of users experienced problems with e.g. pdf files, I’ve decided to use another type of mime-type detection. At first, by using a list of hard-coded values. If this list is not enough, the function finfo_open is used. If no mime-type is found, the function mime_content_type is used (if it’s available). If still no mime-type is found, the file command is used (again, if it’s available). If still no mime-type could be determined, the mime-type application/force-download is used.
    Please do send the patch again. I cannot find it in my mailbox, but I think it is a great idea!

    @Warren:
    The download slug is the name for the “sub-directory” part in the download URL. In my case, the download slug is “downloads”. The URL becomes then “http://home.bovendeur.org/downloads/filename.zip”.

    When you add downloads, you add the URL to the actual file on your server. The “download url” is the URL your download button should point to.

    @Chris:
    We’ve already discussed this by mail, which resulted in a new version. Thank you for switching the update of the statistics and the readfile command. Without this fix, I wouldn’t have found this issue!

  • Feature Request:
    Ability to empty the Tracking Table, or limit the amount of data in there. Even keep the last 60 days.

    second:
    click download, take you to a second page with the ability to post a donation link then download. like this (http://robm.me.uk/wp-content/plugins/downloads.php?version=1.5&name=downloads)

    Other then that great job! :)

  • Great plugin, thank you.

    Is it normal that downloads are not logged when I’m logged in as admin?

  • Sorry, admin downloads are actually logged. I had not refreshed the log page.

  • Thank you! Works great! :)

  • It will be more perfect if able to sort files by name, directory, etc, and disable those confusing “ID” numbers.

  • Excellent plugin!

    I just wanted to leave my thanks.

  • Hi,
    thanks for the excellent plugin.

    I have a question:
    I wanted to know if it was possible to see one download for IP address.

    Sorry for bad English.
    Zed92

  • I upgraded this plugin to the latest version today.
    I lost all counters, all download links etc. The download-manager.php thing does not work anymore.
    Anyways, since there are fewer downloadable files, i thought i will add them again. But the url and file name aint working. I am getting 404 errors every time.

    Did i do something wrong? Please guide me!
    Thanks

  • Hi Again
    I managed to get the things back up again.

    Furthermore i will just like to ask if there is a way i can get my counter back. Can i edit the counters in some way like via MySQL?

  • Were did you get your blog design?

  • Good day, I took the last update on the plugin which is amazing and works wonderfully, however after the update I lost all my download links, and data etc. I am in the process of rebuilding them, however when I test the download from the page it works fine, but it does not seem to log as a download.

    Any information would be greatly appreciated.

    Cheers

    KennyG

  • Downloaded your latest version today (updated on 22-04-2009), but I can not install. Please help, I can`t find error.

    Fatal error: Cannot redeclare download_information() (previously declared in /home/sanikblo/public_html/wp-content/plugins/wp-downloadcounter/downloadcounter-config.php:443) in /home/sanikblo/public_html/wp-content/plugins/wp-downloadcounter/downloadcounter-config.php on line 465

  • Hi,

    Your plugin is great. Thx so much. I have some questions about the plugin. I’m a newbie when it comes to wordpress.

    Since I have ~200 downloads on my “Available Download” list, the list is too long and it’s difficult to add download now as the button is at the bottom of the page. Is there any way I can breakdown that list to four different pages, each with 50 download links each?

    Also, I would like to list on my front page a list of 10 most recent added downloads. Is there anyway for me to do that?

    Thx so much again.

  • Whats wrong ? I confused. couple of weeks ago I updated the downloadcounter automatically. weeks later I recognized, that the downloadcounter does not work. Problem with database and so on.. same as described in some posts here.
    Finally I used my old version.

    Now I recognized, that download-counter.php version 1.1 comes from Andy Staines (http://www.stuff.yellowswordfish.com/download-counter/)
    but this link does not work anymore. Andy seems to be fine with simplepress now.

    After upgrade I got a total other counter from this webpage. totally different in usage and not compatible to the further ones.
    How can this happen. whats the reason for this ?
    Actually I am not lucky with this situation.

  • it is possible to create a list (table) ol all active downloads like in CP whith download name and download couter, in post’s or pages??

  • hi! pls help me your plugin is not working for. i’m using custom field to point my downdload links to the file not inside the post itself. is that has something to do with it? thanks

  • The actual downloading part of the plugin works fine and it even registers the number of downloads correctly but what doesn’t work for me is displaying the SIZE of the file. It just says Size=0kb. Any ideas? Thanks.

  • Does this plugin work with WP-Cache and/or Widget Cache?

  • Download Counter for WordPress at projects @ bovendeur.org great article thank you.

  • Is there going to be an upgrade for this plugin any time soon? It’s not working with WordPress 2.8…

  • It is present just enoughly.Thank.I like this.

  • Hi,
    well done work, easy to customize. thanx a lot.

  • Thanks for this amazing plugin!

    Just one thing, it only allow one download at a time, from file’s top every time (that means no transmission resuming at break-points nor multiple downloading). When a file is being downloading, you can’t even browse your site, all your accesses to the site are blocked until file is downloaded.

    Could you please add an option to redirect to target URL only instead of outputting the target file’s content?

  • Hi there,

    Since upgrading to wp 2.8.4 I am missing all download statistics. Downloads are still working correctly. The download plugin page which is under Tools now says: There are no downloads available yet.

  • Is there any way to display the total number of downloads from every download file with a simple php call to the table where these counters are stored? Or any other alternative?

  • Hello,

    I have a problem when using your plugin for a large file (~150 Mb) on the website. Unlike the regular download which work like a charm (tested on various connections), the one with the counter fails during the download of the file.

    Examples can be found at : http://www.theleme-lejeu.com/download-test/
    Type “dltest” in the “Mot de passe” field

    Thanks for your plugin.

    Gilles

  • seems like the plugin counter dosnt work while downloading big files. its works great on the other file though. but not with the bigger file size. you can see it here.. http://download-brushes.com/13-cloud-brushes.html

  • Plugin working incorrectly.
    Some files work just fine, but some files do not open at a clique on “With counter” and normally open at a clique on “Without counter”.

  • Hi,

    I just tried ur plugin with WordPress 2.8.5 it seems fine but there’s 1 issue with downloadsize, it always return 0 B

  • Hey,

    Love the script, I have been using it for a very long time now. I had a visitor let me know that one of my links was not working. http://www.studiolounge.net/files/address-book-2 I gave it a try and get the error:

    C:downloadpathtempname could not be saved, because the source file could not be read.

    Try again later, or contact the server administrator.

    The files/folders are 755 if I use the direct file path and not the clean with counter path the downloads work perfect.

    I am running WordPress 2.8.5

    Cheers

  • this plugin works exactly as described. thank you for this wonderful tool. i looked for a donate button of some sort but you don’t have one! thanks again!

  • Sometimes I found in the record that the same IP was downloading but it was recorded as several downloads. In fact they should be one download as the time difference between each downloads of the same IP is only 1 or 2 seconds.

  • Does this plugin works with WordPress 2.8.6?

    I’ve tried it but, added an download but the link ‘with counter’ displays a wrong (not working) link.

  • I just found out that it seems to work when ‘Use pretty links’ is uncheked.

  • Great plugin for counters. I was in a search of counter plugin for my new project http://www.premiumwpthemes.in

  • Sometimes I found in the record that the same IP was downloading but it was recorded as several downloads. In fact they should be one download as the time difference between each downloads of the same IP is only 1 or 2 seconds

  • Hi,
    Great plugin and I used to use it. I upgraded lately to WP2.9.1 and now when trying to add a new file I get an error message:
    Warning: strtotime() expects parameter 1 to be string, resource given in /wp-content/plugins/wp-downloadcounter/downloadcounter-config.php on line 293
     
    and the date using the [downloadupdated] shortcode, is sown as 1-1-1970.
    How can it be fixed?
    Thanks,
    Maor

  • thanks you for this great plugin
    If you update this plugin you could check the handling of download managers, I just realized that one download with flashget was counted as 8 downloads, this is what might happened to Dallas Cao in a comment above

  • Hey. This plugin looks great. However I wonder if it's possible to display the amount of downloads based on a custom fields. On my site all posts got a download with the same custom field but file name is varying from post to post since users can upload their own files. Thanks!

  • thans you teşekkürler

  • Any specific instructions for adding the download stats to an admins dashboard?

  • The plug-in worked well until I updated WP to 3.0.
    Now the links generated by the counter don't work anymore, idea how to fix it?

  • Will the version for WordPress 3.01?

  • Thank you very much. It's a good plugin. No clutter, just function. 

  • Hi

    I would like to share the spanish translations I've made for this fantastic plugin.
    Me gustaría compartir la traducción al español que he hecho de este fantástico plugin.

    http://www.informacioniphone.com/2010/12/wordpress-download-counter.html

    The .zip file contains the spanish po and the mo files.
    El archivo .zip contiene los archivos .po y .mo en español.

    I appreciate that you included the Spanish translation for your next plugin release.
    Te agradeceria que incluyeras esta traducción al español en tu siguiente versión del plugin.

    Thanks you for your plugin.
    Gracias por tu plugin.

    http://www.informacioniphone.com

    • I think I didn’t reply yet, but thank you for your Spanish translation. I’ve added it to my source repository, and it will be included with the next release.

  • Il semble que vous soyez un expert dans ce domaine, vos remarques sont tres interessantes, merci.

    - Daniel

  • Nice website, hope you continue to work on it ^_^

  • Thanks for this amazing plugin!
    Just one thing, it only allow one download at a time, from file’s top every time (that means no transmission resuming at break-points nor multiple downloading). When a file is being downloading, you can’t even browse your site, all your accesses to the site are blocked until file is downloaded.

    • I don’t think I have this problem, but I’ll look into it. Since every request to your site should be handled separately by your webserver, it should not be an issue at all.

  • I really like your blog.. very nice colors & theme. Did you create this website yourself or did you hire someone to do it for you? Plz answer back as I’m looking to design my own blog and would like to find out where u got this from. many thanks

  • Hey there
    I came across an error while trying to use the download counter on larger files, others have as well.. The problem is that on some setups, the full file path is not correctly obtained, and
     $filesize = filesize($path);
    fails without the FULL path, resulting in a 0 byte error (see readfile php documentation)
    This is due to the following line failing:
    $path = realpath(ABSPATH . str_replace(get_option('siteurl'), '', $url->download_url));
    For me, I simply substituted that for:
    $path = "WEBSITE/" + $url->download_url;
    It works adequately but has no safety checking on it… I changed it in 3 places.. 
    Hope this helps

  • Thank you sooo much for this pluging. I couldnt get it to fully work out though.
    The pretty links work perfectly to get the download url and the downloads ammount, but they dont register the download on the data base (it works without pretty links) so I had to tried inserting a number of downloads directly on the db. Nor it works to get the file size nor the last update.
    I dont have wordpress installed on the main root directory of my site, but the whole blog is displayed on the main root (its redirected thorugh the wp settings), so my home url is one and my siteurl are different, that´s why I think it doesn´t work using pretty links, but I don´t know how to fix it.
    I think I have to exchange some siteurl for home on the congif php, but I cant get it to work out… :(

    I hope you can fix this, for blogs which are not hosted on the main root, with the next version.
    Thank you very much anyway!
     

  • I'm using WP 3.0 and the download count won't work with fancy URL. If you uncheck that box it will work.

  • Great plugin. Thanks =)

  •  

    I think I didn’t reply yet, but thank you for your Spanish translation. I’ve added it to my source repository, and it will be included with the next release.

     

     

  • good information hanks for you great…

  • hey, i really like your plugin. it's just what i need. unfortunately though, it seems to corrupt my zip files. after downloading i can't extract them. would appreciate a hint on how to fix this.. cheers

  • Hi, I am wondering if this product would work in a widget? I tried downloading another download counter, but my download is in a side bar widget, and not in a post. Would this work there?

  • in case someone else has a problem with corrupt files after using this plugin:
    apparently using a cache plugin or minification plugin, which enables gzip compression for your files corrupts zip files (and maybe others). 
    excluding the directory "download-manager-files" in your uploads folder  (or if you use pretty links – the pretty permalink aswell) from gzipping will leave your files intact.
    this plugin is awesome! cheers

  •  
    Thanks for sharing with us. this is such a great information. i have just bookmarked your site and waiting for your next post

  • Hi, I am trying to use this plug in in my template files hover whatever I do the code you provided keeps returning NULL. The Counter all all works fine on single pages. But I want to display the number of download on my showcase page before they get to the single page view. So far I have not luck with it.. Can help me please?
     
    Thank you for the great plugin!!!

  • If it doesn't work, try to replace the @readfile line with echo(file_get_contents( …
    The readfile may rise an unreported error on your server.

  • Hey Hidden, I'm not exactly sure where you are referring to replace that, is that the full code you posted?

    Also I noticed that the shortcodes can only work if I use them with in the editor, Is there a way to get them working in the excerpt?

  • I had a visitor let me know that one of my links was not working.

  • Nice Plugin :)
    One Question:
    How can I make a Downloadcounter for ALL my Downloads?

  • Is it really that difficult to also leave a fully explained example for newbies?

    • @Siddharth: Is it really that hard to leave a constructive comment? If you miss something on this page, please tell me. As far as I’m aware, the page is written so that newbies should be able to start working with this plugin. Not sure what you miss, but don’t hesitate to explain!

Leave a Reply