0

I am using download monitor plugin and wordfence. There are too many files to download for both restricted to members and anyone else.

Here is my problem's description; The main problem is user's clicking the same download button over and over. The other problem is that the site content and resources could be exploited.

%80 of my download monitor log records are showing that the same file is being downloaded for at least 3-4 (6-7 in some occasions) times at the same time period (following seconds) and the other one is this: my site has approximately 1000 files to download. Users (subscribers and guests) can download them non-stop; seems like exploitation. (by the way guests can not download the "member only" files; this is not the problem what i am asking)

A general rule to regularize all types of downloads: giving a lag for 15 seconds after any download for any user is fair enough i think. i hope that there is another way than recording ip numbers to the database.

Here is an example site that works with same logic what i want: http://altyazi.org/sub/s/420936/The-Sealed-Room.html On that page if you click the “altyaziyi indir” button too soon a blank page will be seen that writes “flood control” on top left of the new page. so i do not think that this site’s system is recording my ip and then query it with time interval and gives a result as that flood control page… operation seems more simpler than that..

I asked the plugin supporters about this problem, but they did not offer me any solution. I also asked on the wordfence plugin support page, but they did not even return. I asked the hosting company and they said "we don't have any service like that".

Thank you so much for your patience. I would really appreciate if you could offer me a solution other than hiring a developer or complicated ways :)

0

You should implement cookies.

In js file, you have to write a click handler for Load button. In handler, you should check if cookie is already exists. If not, you need to create cookie containing current time and allow user to proceed (propagate click event).

If cookie exists, compare current time with time stored in cookie. If interval is less than 15 sec, block click (preventDefault(), return false).

If interval is more than 15 sec, update cookie and allow further execution of click event.

This is the skeleton of algorithm to solve your task. If you have some experience in javascript, you can create this piece of code by yourself. Otherwise it is better to hire a developer.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.