├── LICENSE.md ├── README.md └── plugin.php /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 YOURLS 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Don't Log Bots [![Listed in Awesome YOURLS!](https://img.shields.io/badge/Awesome-YOURLS-C5A3BE)](https://github.com/YOURLS/awesome-yourls/) 2 | ============= 3 | 4 | Plugin for [YOURLS](http://yourls.org) `1.6+`. 5 | 6 | Description 7 | ----------- 8 | Ignore bot hits in your stats (both click count as seen in the main admin page and in detailed stats). 9 | 10 | Installation 11 | ------------ 12 | 1. In `/user/plugins`, create a new folder named `dont-log-bots`. 13 | 2. Drop these files in that directory. 14 | 3. Go to the Plugins administration page ( *eg* `http://sho.rt/admin/plugins.php` ) and activate the plugin. 15 | 4. Have fun! 16 | 17 | License 18 | ------- 19 | YOURLS' license, aka *"Do whatever the hell you want with it"*. 20 | _YOURLS - MIT License_ 21 | 22 | More 23 | ---- 24 | 25 | The list of bot user agent strings has been compiled from one of my own YOURLS setup: user-agents **looking like** bots with more than 100 hits. There is no reliable way to determine if a client is a bot or not. 26 | 27 | To check user agents on your own setup, you can try this query: 28 | 29 | ```mysql 30 | SELECT DISTINCT `user_agent` as ua, COUNT(*) as c FROM `yourls_log` GROUP BY ua ORDER BY c DESC 31 | ``` 32 | -------------------------------------------------------------------------------- /plugin.php: -------------------------------------------------------------------------------- 1 |