forked from simlabs-apps/yourls-pseudonymize
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplugin.php
32 lines (26 loc) · 937 Bytes
/
plugin.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
/*
Plugin Name: Anonymise
Plugin URI: https://github.com/wlabarron/yourls-anonymise
Description: Anonymise the IP address and user agent in YOURLS logs. User's country of origin is now also not recorded, since it's based on IP.
Version: 1.0
Author: wlabarron
Author URI: https://github.com/wlabarron/
*/
yourls_add_filter( 'get_IP', 'wlabarron_anonymise_IP' );
yourls_add_filter( 'get_user_agent', 'wlabarron_anonymise_user_agent' );
yourls_add_filter( 'get_referrer', 'wlabarron_anonymise_referrer' );
yourls_add_filter( 'shunt_geo_ip_to_countrycode', 'wlabarron_shunt_country' );
function wlabarron_anonymise_IP( $ip ) {
return "";
}
function wlabarron_anonymise_user_agent( $ua ) {
return "-";
}
function wlabarron_anonymise_referrer( $referrer ) {
return "-";
}
function wlabarron_shunt_country( $location = false, $ip = '', $default = '' ) {
return "";
}
?>