This plugin was originally based on Tacoded's now-delted IP Click Details.
Developed for Your Own URL Shortener (YOURLS) v1.9.2 and above.
Check it out on my own website: yourls.dreamhosters.com.
I use the Sleeky theme, but the default works, although the table columns may get smushed.
Please make sure that you are following all local privacy laws while using this plugin.
This version uses WhichBrowser to parse the user-agent for device and browser information.
It also fetches the location of the click and local time based off of the IP address.
The information is displayed in a table in the stats page of each link below the click count graph.
If you really want to use this version, please check out the relevant installation instructions.
All relevant files are in the version1 folder, anything else is for the most recent version (see below).
This version contains everything in version 1, but also tracks many more stats for device fingerprinting.
Things like device battery, orientation, language, and screen info can be collected with some Javascript.
However, it is no longer available (i.e. removed from this repository) because it hacked core files.
Additionally, the way the data was transferred from the browser meant that it was always one click behind.
This version tracks everything from version 2, but does it does so without hacking core files.
Instead, the client side information is collected with Javascript and sent to yourls_log via AJAX.
Specifically, a new column gets created and appended to specifically for this information.
I cannot take credit for all of this, as it was Loganathan who gave me the reference code.
Version 3 still has all of the functionality as the previous, and some newly added features as well.
Firstly, the WhichBrowser dependency has been removed since it was confusing for users.
The plugin now uses UAParser.js and some custom regex matching to display the same information.
The incognito detection is much better thanks to Joe12387, and adblock detection is more accurate.
There is a dedicated settings page where you can input your own ipinfo.io API token.
This page is also where you must input your signature token to allow for passwordless API calls.
A temporary 302 redirect is sent to help ensure that every click is accounted for.
Lastly, there are charts that breakdown the devices, platforms, and browsers for all the clicks.
This feature was inspired by another plugin that was actually inspired from this plugin.
Note that if JavaScript is not enabled in the browser, the click should still be logged.
However, the extended information introduced in version 2 will unfortunately not be.
The click will also show up as 'Unknown' in the charts due to how they are rendered.
This version is not nearly as extensive as version 3, but has some notable improvements.
First, it fixes the fact that clicks without extended metrics show up as 'Unknown' in charts.
There is an uninstall.php script that deletes the stored options and information.
Since that script runs upon deactivation, there is a flag to prevent data loss.
Lastly, even more metrics are collected client side with Javascript to be logged.
This includes hardware information, user preferences, and extended display data.
All data generated with version 3 will still be rendered without any compatibility issues.
- In
/user/plugins, create a new folder nameddevice-details. - Download the
plugin.php,incognito.js, anduaparser.jsfiles from this repository. - Add all three files into the newly created directory.
- Go to the Plugins admin page (eg.
http://sho.rt/admin/plugins.php) and activate it. - Even if the admin area is private, you can make the link stats page public.
- Do this by adding
define('YOURLS_PRIVATE_INFOS', false);toconfig.php.
- Do this by adding
- If you are worried about the passwordless API calls, you can decrease the nonce life.
- Do this by adding
define('YOURLS_NONCE_LIFE', 7200);toconfig.php.
- Do this by adding
Alternatively, version 3 of this plugin is compatible with both Download Plugins and Download Delete, so copy and paste the URL of this repository and set the branch to be main to install it.
- [] Support uaparser.min.js
- [] Support incognito.min.js
Sachin Agrawal: I'm a self-taught programmer who knows many languages and I'm into app, game, and web development. For more information, check out my website or Github profile. If you would like to contact me, my email is github@sachin.email.
This package is licensed under the MIT License.
