Block unfair hits
Moderator: General Support Moderators
Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting.
Forum Post Assistant - If you are serious about wanting help, you should use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting.
Forum Post Assistant - If you are serious about wanting help, you should use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10
-
- Joomla! Apprentice
- Posts: 15
- Joined: Wed Sep 26, 2018 7:23 am
Block unfair hits
Dear Sir,
as you well know, visits to joomla articles (hits) increase by reloading the page and this is not fair. It is also true that if a person goes to read the same article several times in a day it is right that the reading increases.
Is it possible to block the wise ones that increase the readings to their article with F5 limiting the increase in visits after 1 hour?
If I do F5 continuously does not increase the reading, if I return to read it after an hour it is right to count a new hit.
I hope to solve with your advice,
best regards
Walter
as you well know, visits to joomla articles (hits) increase by reloading the page and this is not fair. It is also true that if a person goes to read the same article several times in a day it is right that the reading increases.
Is it possible to block the wise ones that increase the readings to their article with F5 limiting the increase in visits after 1 hour?
If I do F5 continuously does not increase the reading, if I return to read it after an hour it is right to count a new hit.
I hope to solve with your advice,
best regards
Walter
Last edited by toivo on Wed Sep 26, 2018 8:04 am, edited 1 time in total.
Reason: mod note: moved, not related to 3.x Extensions
Reason: mod note: moved, not related to 3.x Extensions
- effrit
- Joomla! Guru
- Posts: 846
- Joined: Sun Nov 12, 2017 2:21 pm
- Location: middle of Russia
- Contact:
Re: Block unfair hits
i guess it will not solve the problem unless you close the articles from unregistered visitors, because hundreds of bots will increase the counter.
http://effrit.com/joomla | clean Word/Excel tables: http://r91228pz.bget.ru
-
- Joomla! Apprentice
- Posts: 15
- Joined: Wed Sep 26, 2018 7:23 am
Re: Block unfair hits
it would be enough to set the time limiting with ip?
but I do not know how I can do it
but I do not know how I can do it
-
- Joomla! Guru
- Posts: 561
- Joined: Thu Jan 12, 2017 10:13 am
Re: Block unfair hits
You mean based on $remoteAddr you want to allow visitors of your site read your articles based on a timescale and after that for like 24 hours they are not able to read more?
Kian William
Kian William
- effrit
- Joomla! Guru
- Posts: 846
- Joined: Sun Nov 12, 2017 2:21 pm
- Location: middle of Russia
- Contact:
Re: Block unfair hits
i mean what today this counter show unreal hight numbers because of many site scanners/bots so you cant use it as valid visitor counter unless u block content from unregistered users.
and IP isnt enough because of proxy servers.
and IP isnt enough because of proxy servers.
http://effrit.com/joomla | clean Word/Excel tables: http://r91228pz.bget.ru
-
- Joomla! Apprentice
- Posts: 15
- Joined: Wed Sep 26, 2018 7:23 am
Re: Block unfair hits
what concerns me to limit are the young guys who go on an acquaintance's article and with F5 the visits increase. I just block these, not even novice hackers
-
- Joomla! Guru
- Posts: 561
- Joined: Thu Jan 12, 2017 10:13 am
Re: Block unfair hits
How could you know those visitors are young or old? how you check it?
Kian William
Kian William
-
- Joomla! Apprentice
- Posts: 15
- Joined: Wed Sep 26, 2018 7:23 am
Re: Block unfair hits
I know because they told me
- effrit
- Joomla! Guru
- Posts: 846
- Joined: Sun Nov 12, 2017 2:21 pm
- Location: middle of Russia
- Contact:
Re: Block unfair hits
i guess u can try increase "session time" for 2-3 hours. if i understand it right this counter must use session or cookies.
but this is not recommended via increasing security risks.
so the right solution will be making plugin for decreasing hitcounter based on cookies or even IP (in this case your DB size will increased).
example
https://joomla.stackexchange.com/questi ... -the-pages
but this is not recommended via increasing security risks.
so the right solution will be making plugin for decreasing hitcounter based on cookies or even IP (in this case your DB size will increased).
example
https://joomla.stackexchange.com/questi ... -the-pages
http://effrit.com/joomla | clean Word/Excel tables: http://r91228pz.bget.ru
-
- Joomla! Guru
- Posts: 561
- Joined: Thu Jan 12, 2017 10:13 am
Re: Block unfair hits
I can tell you what to do to limit time access to an article for registered users and prevent them from being logged for a spell of time but your viewers could be of any age unless you develop a form that requires a copy of birth-cirtificate. There might be other ways but I developed this simple logic as I am typing, if it could be of use, I will be happy to help you.
Kian William
Kian William
-
- Joomla! Apprentice
- Posts: 15
- Joined: Wed Sep 26, 2018 7:23 am
Re: Block unfair hits
it is not a counter but hits the joomla article
it would be enough for me to limit the bill at any hour. if a visitor starts to do F5 does not count, but counts if he returns after one hour
it would be enough for me to limit the bill at any hour. if a visitor starts to do F5 does not count, but counts if he returns after one hour
- effrit
- Joomla! Guru
- Posts: 846
- Joined: Sun Nov 12, 2017 2:21 pm
- Location: middle of Russia
- Contact:
Re: Block unfair hits
this is EXACTLY the same (hits = visit/view counter).
if you cant understand how to solve problem based on my advise you must hire programmer for this.
or maybe there is free plugin for this but i cant find one.
http://effrit.com/joomla | clean Word/Excel tables: http://r91228pz.bget.ru
-
- Joomla! Apprentice
- Posts: 15
- Joined: Wed Sep 26, 2018 7:23 am
Re: Block unfair hits
I think the only way will be the plugin that you have recommended to me, thank you very much.
I think that joomla should adopt this default option
thank you so much
I think that joomla should adopt this default option
thank you so much
- effrit
- Joomla! Guru
- Posts: 846
- Joined: Sun Nov 12, 2017 2:21 pm
- Location: middle of Russia
- Contact:
Re: Block unfair hits
i agree. i will post this suggestion to Joomla 4 thread.
http://effrit.com/joomla | clean Word/Excel tables: http://r91228pz.bget.ru
-
- Joomla! Apprentice
- Posts: 15
- Joined: Wed Sep 26, 2018 7:23 am
Re: Block unfair hits
but it would be necessary to find a way for the memory of the database to be deleted every hour, is it possible with a cron? but how do you do it?
the plugin allows you to count a single visit forever, works on groups but you can not set a refresh time?
the plugin allows you to count a single visit forever, works on groups but you can not set a refresh time?
- effrit
- Joomla! Guru
- Posts: 846
- Joined: Sun Nov 12, 2017 2:21 pm
- Location: middle of Russia
- Contact:
Re: Block unfair hits
the logic depend of where you will store visited articles ID's.
if u make it based on Cookies then DB will be not involved. so u only consern will be this Cookie size.
and for DB you can use cron and clean this table every 1 weak, for example.
if u make it based on Cookies then DB will be not involved. so u only consern will be this Cookie size.
and for DB you can use cron and clean this table every 1 weak, for example.
http://effrit.com/joomla | clean Word/Excel tables: http://r91228pz.bget.ru
- brian
- Joomla! Master
- Posts: 12785
- Joined: Fri Aug 12, 2005 7:19 am
- Location: Leeds, UK
- Contact:
Re: Block unfair hits
You do realise that it is optional to display the hits - personally the first thing I do on a site is to make sure it is not displaying hits on the frontend
"Exploited yesterday... Hacked tomorrow"
Blog http://brian.teeman.net/
Joomla Hidden Secrets http://hiddenjoomlasecrets.com/
Blog http://brian.teeman.net/
Joomla Hidden Secrets http://hiddenjoomlasecrets.com/
- effrit
- Joomla! Guru
- Posts: 846
- Joined: Sun Nov 12, 2017 2:21 pm
- Location: middle of Russia
- Contact:
Re: Block unfair hits
@brian, we talk about make it useful not invisible.
http://effrit.com/joomla | clean Word/Excel tables: http://r91228pz.bget.ru
-
- Joomla! Apprentice
- Posts: 15
- Joined: Wed Sep 26, 2018 7:23 am
Re: Block unfair hits
could you give me a directive how I can use the cron?
- effrit
- Joomla! Guru
- Posts: 846
- Joined: Sun Nov 12, 2017 2:21 pm
- Location: middle of Russia
- Contact:
Re: Block unfair hits
sorry, i am not such developer.
and firstly u must make the plugin.
and firstly u must make the plugin.
http://effrit.com/joomla | clean Word/Excel tables: http://r91228pz.bget.ru
- effrit
- Joomla! Guru
- Posts: 846
- Joined: Sun Nov 12, 2017 2:21 pm
- Location: middle of Russia
- Contact:
Re: Block unfair hits
Look like we have good chance to get rid of mad increment in 3.x version.
and i made simple plugin for writing id of articles in cookies, so bright future is near ).
and i made simple plugin for writing id of articles in cookies, so bright future is near ).
http://effrit.com/joomla | clean Word/Excel tables: http://r91228pz.bget.ru
- effrit
- Joomla! Guru
- Posts: 846
- Joined: Sun Nov 12, 2017 2:21 pm
- Location: middle of Russia
- Contact:
Re: Block unfair hits
I made the plugin. It use cookies and prevent multiply hits count, also visits of search bots don't count.
https://yadi.sk/d/lkyrvAibes66Ag
https://yadi.sk/d/lkyrvAibes66Ag
http://effrit.com/joomla | clean Word/Excel tables: http://r91228pz.bget.ru
-
- Joomla! Hero
- Posts: 2897
- Joined: Fri Jul 05, 2013 10:35 am
- Location: Parts Unknown
Re: Block unfair hits
Logic should be reversed. Hits should be blocked when needed, not by default. Now they're blocked everywhere.effrit wrote: ↑Tue Oct 02, 2018 6:25 pmI made the plugin. It use cookies and prevent multiply hits count, also visits of search bots don't count.
https://yadi.sk/d/lkyrvAibes66Ag
You can also get category ID from input instead from model. This will avoid unnecessary DB query.
- effrit
- Joomla! Guru
- Posts: 846
- Joined: Sun Nov 12, 2017 2:21 pm
- Location: middle of Russia
- Contact:
Re: Block unfair hits
The logic is right.
Because for corporate site with blog, for example, u need only one category with counter and other will be without it. Just because of DB caching. This is how i see it.
So if anyone want different logic he must change the code.
Thanks for catID suggestion, will use it.
Because for corporate site with blog, for example, u need only one category with counter and other will be without it. Just because of DB caching. This is how i see it.
So if anyone want different logic he must change the code.
Thanks for catID suggestion, will use it.
http://effrit.com/joomla | clean Word/Excel tables: http://r91228pz.bget.ru
-
- Joomla! Hero
- Posts: 2897
- Joined: Fri Jul 05, 2013 10:35 am
- Location: Parts Unknown
Re: Block unfair hits
I don't think you understood me. You are now blocking hits on all components. This is because you set hitcount to 0 on all pages. Instead, you should set it after performing the checks in your plugin.
- effrit
- Joomla! Guru
- Posts: 846
- Joined: Sun Nov 12, 2017 2:21 pm
- Location: middle of Russia
- Contact:
Re: Block unfair hits
Hm, look like i must check "context" then.
http://effrit.com/joomla | clean Word/Excel tables: http://r91228pz.bget.ru
- effrit
- Joomla! Guru
- Posts: 846
- Joined: Sun Nov 12, 2017 2:21 pm
- Location: middle of Russia
- Contact:
Re: Block unfair hits
@SharkyKZ, seems i cant deactivate hits only for com_content.
i tried other plugin triggers but problem is the hit DB query already done if trigger not onAfterInitialise.
and inside this trigger i cant get context data, so it's dead end...
but good part is - PR we made is merged, so in next Joomla version disabling standard articles hits will be possible via options so i will can remove this part from plugin.
also getting category ID don't look safe because for uncategorised articles it return nothing, so i must assume what current id = 2:
$catid = $jinput->getInt('catid', 2);
i tried other plugin triggers but problem is the hit DB query already done if trigger not onAfterInitialise.
and inside this trigger i cant get context data, so it's dead end...
but good part is - PR we made is merged, so in next Joomla version disabling standard articles hits will be possible via options so i will can remove this part from plugin.
also getting category ID don't look safe because for uncategorised articles it return nothing, so i must assume what current id = 2:
$catid = $jinput->getInt('catid', 2);
http://effrit.com/joomla | clean Word/Excel tables: http://r91228pz.bget.ru
-
- Joomla! Hero
- Posts: 2897
- Joined: Fri Jul 05, 2013 10:35 am
- Location: Parts Unknown
Re: Block unfair hits
Use onAfterRoute.
In Joomla articles can't be uncategorised. Each article must have a category assigned.also getting category ID don't look safe because for uncategorised articles it return nothing
- effrit
- Joomla! Guru
- Posts: 846
- Joined: Sun Nov 12, 2017 2:21 pm
- Location: middle of Russia
- Contact:
Re: Block unfair hits
try get ID of article inside uncategorised via input.
it return nothing.
for other categories it return number.
it return nothing.
for other categories it return number.
http://effrit.com/joomla | clean Word/Excel tables: http://r91228pz.bget.ru
- effrit
- Joomla! Guru
- Posts: 846
- Joined: Sun Nov 12, 2017 2:21 pm
- Location: middle of Russia
- Contact:
Re: Block unfair hits
implemented suggestions of SharkyKZ, new version.
https://yadi.sk/d/IypdyLc5zz8sKg
https://yadi.sk/d/IypdyLc5zz8sKg
http://effrit.com/joomla | clean Word/Excel tables: http://r91228pz.bget.ru