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 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.
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. 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).
Downloading
You can download this plugin here. This plugin has been downloaded 1056 times. If you have any comments (nice or not), please don’t be shy. Post them on this page!
Changelog
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.
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.
Thanks..
[…] Açıklamalı 232 Wordpress eklentisi (Agu. 15, 2007 !!) (Wordpress plugin list),[…]
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
If you download this theme leave some feedback. Tell me if you like it, or if there are any improvements you would like to be made.
[downloadcounter(wordpress_night_theme.zip)]
<a href=”[download(wordpress_night_theme.zip)]” rel=”nofollow”>Download Theme!</a>
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?
Please visit my site at: http://cristian79.altervista.org/wordpress
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.