• First of all thanks for a great plugin which I’ve found after trying all others I guess and finally got what I’ve wanted: the simple, user-friendly yet a smart way to organize our download files in a new, large website I’m building. All is working fine, I’ve only changed few things in the code to modify outputs graphically.

    My question is: how the plugin will behave and handle with several thousands of downloads? Especially I’m interested in logs size and cache duration (I’ve temporally set it to 0 to monitor changes made in code). We have over 10 000 audio files in our website managing by another plugin and – though it works – it performs rather poorly.

    Any thoughts on this?

    And one more thing. Is there a possibility of paginations long lists when using [ddownload_list]?

    PS. Happy New Year!

    https://www.ads-software.com/plugins/delightful-downloads/

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author A5hleyRich

    (@a5hleyrich)

    Hi there,

    Thanks for the positive feedback! At present the plugin isn’t ideally suited to storing a large amount of log files, but it all depends on your database server performance. In a recent support request another user has logged 15 million downloads before noticing issues, however I would really advise against allowing that many logs to build up.

    The next major update to Delightful Downloads is going to completely overhaul how statistics are monitored, thus increasing performance and allow for automatic purging of old logs as well as the ability to export them. However in the meantime you will need to manually run SQL queries to remove older logs. You can see an example of how to do this in this support thread.

    As for the caching, it depends on how many downloads you have and site traffic. It really seems a waste of resources if you are querying the database on every page load to generate a list of downloads. When listing 100 downloads and displaying their download count next to each you are essentially querying the database 101 times, opposed to just once with caching enabled.

    Pagination is not currently supported by [download_list] but it will be added in the future. You will need to look at custom queries for this functionality.

    Ashley

    Thread Starter phoros

    (@phoros)

    Thank you very much for the quickest response I’ve ever had at this forum since ever! Hats off!

    We have a custom server configured especially for us so there shouldn’t be any problems here. With MySQL as well – I’ll manage. Actually we want to know numbers of downloads – that’s all. Do they stay properly counted & displayed when I’ll delete old/all logs?

    Thanks for a cache explanation. Now it’s clear to me and I’ll set it to default 10 min when I’m done with customizing Your plugin.

    I’ll wait for a pagination option – it will take a while to make our new website crowded with files so no problem here.

    Once again thanks for this great piece of code.
    I let myself to ask You for help if I’d stuck somewhere.

    Cheers!
    Chris from Poland

    Plugin Author A5hleyRich

    (@a5hleyrich)

    Chris,

    The only thing you will lose when deleting logs is the ability to show download counts via date range. When calculating total downloads the plugin actually tots up the count field in each individual download on the Edit Download screen. Therefor as long as this count is correct, you should have no problem.

    As for the customisation of outputs how are you handling these? Are you making changes to the plugin code or using the output filters? I really need to update the docs to include this feature when I get 10 minutes.

    Ashley

    Thread Starter phoros

    (@phoros)

    I’m playing with the code alas. I perfectly know disadvantages of such solutions (updates etc.) but I get used to do this for many years – it allows to keep me things in control in my own way. I’m not good with php so I don’t touch anything if I don’t have to but I change html/css where I need with no regrets. If I don’t change too much I also keep all parameters in one place if it’s possible. For example in Your code I’ve only changed (default) styles of single downloads and lists from
    <a href="%url%" title="%title%" rel="nofollow">%title%</a>
    to

    <div style="border:1px solid #ddd;padding:5px 10px 10px 10px; margin-bottom:10px;">
    <div style="font-size:0.75em;color:gray;">
    <i class="icon-time" title="Data dodania pliku do archiwum"></i>%date%
    <i class="icon-hdd" title="Rozmiar pliku"></i>%filesize%
    <i class="icon-download-alt" title="Ilo?? pobrań"></i>%count%</div>
    <a href="%url%" title="%title%" rel="nofollow">
    <i class="icon-save"></i> <span style="font-size:1.1em;">%title%</span></a></div>

    (Titles in Polish)
    And removed <ul> <li> tags in the list output/shotcode.

    As I mentioned I know it sucks from many points of view but it also has it’s advantages.

    I’m not familiar with filters, I’ve never used them. Maybe it’s high time to know them?… ??

    Chris

    Plugin Author A5hleyRich

    (@a5hleyrich)

    Filters are just what you need. If you add the following code to your theme’s functions.php file you will add an additional option to both the Default Style and Default List Style drop downs within the Delightful Downloads settings screen. You can then use them as you would any other style.

    function custom_button( $styles ) {
    	$styles['custom_output'] = array(
    		 		'name'			=> 'Custom Output',
    		 		'format'		=> '<div style="border:1px solid #ddd;padding:5px 10px 10px 10px; margin-bottom:10px;">
    									<div style="font-size:0.75em;color:gray;">
    									<i class="icon-time" title="Data dodania pliku do archiwum"></i>%date%
    									<i class="icon-hdd" title="Rozmiar pliku"></i>%filesize%
    									<i class="icon-download-alt" title="Ilo?? pobrań"></i>%count%</div>
    									<a href="%url%" title="%title%" rel="nofollow">
    									<i class="icon-save"></i> <span style="font-size:1.1em;">%title%</span></a></div>'
    	);
    
    	return $styles;
    }
    add_filter( 'dedo_get_styles', 'custom_button' );
    
    function custom_list( $styles ) {
    	$styles['custom_output'] = array(
    		 		'name'			=> 'Custom Output',
    		 		'format'		=> '<div style="border:1px solid #ddd;padding:5px 10px 10px 10px; margin-bottom:10px;">
    									<div style="font-size:0.75em;color:gray;">
    									<i class="icon-time" title="Data dodania pliku do archiwum"></i>%date%
    									<i class="icon-hdd" title="Rozmiar pliku"></i>%filesize%
    									<i class="icon-download-alt" title="Ilo?? pobrań"></i>%count%</div>
    									<a href="%url%" title="%title%" rel="nofollow">
    									<i class="icon-save"></i> <span style="font-size:1.1em;">%title%</span></a></div>'
    	);
    
    	return $styles;
    }
    add_filter( 'dedo_get_lists', 'custom_list' );

    You can’t remove <ul> or <li> but it would be easy enough to remove the list styling using the class of ‘ddownloads_list’.

    This way you are free to update the plugin without breaking your styles.

    Ashley

    Thread Starter phoros

    (@phoros)

    Ashley, you’re incredible…
    In every single point.
    Thank you very much!
    I’ll use your solution right away.

    I’ve just proposed Your plugin to the rest of our team and they liked it very much. They asked for one more thing: tags. Is there possibility of generating a list of all tags which would be linking to proper (tagged with them) lists of downloads? We don’t want to multiply categories and use tags instead. It would be a complete, optimal option for us. I don’t know the whole code of Yours but I suppose it wouldn’t be too difficult (conditional loops?).

    Chris

    Plugin Author A5hleyRich

    (@a5hleyrich)

    You cannot automatically generate a list of tags which links to the relevant files. You would have to manually manage this, however you can output downloads that have a specific tag like so:

    [ddownload_list tags="image"]

    Thread Starter phoros

    (@phoros)

    Yes, I tried and considered this. Not so much to do it nicely.

    Ashley, thanks once again for Your help & tips.
    I’ll recommend Your plugin wherever I can and will use it in future projects. I’ll catch You if I’d have to.

    Great job!
    Chris

    Plugin Author A5hleyRich

    (@a5hleyrich)

    Cheers Chris, glad to help.

    Ashley

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Lots of downloads – cache, logs and pagination’ is closed to new replies.