Logging downloads

If you want to, you can log downloads done from a post or a page.

Preparations:
In the Theme Options, click on ‘Log files’ in the sidebar.
Check the ‘Enable’ checkbox.
Save options.

Enter a shortcode in editor:
(Note: All but the shortcode is standard WordPress stuff.)
In the editor, start with this:
[[kiss_log download='']]
Put the cursor between the ” signs (it’s easier to get it right this way).
Then click on Upload/Insert.
Choose a file (a binary one, like a zip file).
‘Show’ the file.
Enter a good title. This text is what will be shown to users.
Click on ‘File URL’ under the ‘Link URL’ (it might be the default).
Then ‘Insert into Post’.
You now have something like this:
[[kiss_log download='This is an awesome file']]
Save the post and see if it works. You should get the normal download dialog. Check if you get the file ok.
Note that the logging occurs when the link is clicked, there’s no way to know if the user actually downloaded the file.
Check in ‘Theme Options / Log files’ that the logging worked.

Log size:
The log file is self maintained. When the number of entries gets past 1000 it deletes all but the 100 latest.
This check occurs every time someone enters Theme Options.

(Technically the log file isn’t really a file, the data is kept in the options table.)

 

Leave a Reply

Your email address will not be published. Required fields are marked *

*

Help

WordPress theme: Kippis 1.13