• Resolved Torchy

    (@torkild)


    Is there a way to prevent logging of downloads if it matches a predefined IP address?
    (A bit like the blacklist IP)

    Many employees here download files from the website, and it logs it every time, which skews the data for prospective customers who download the same files.

    Thank you.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Razvan Aldea

    (@raldea89)

    Hello @torkild ,

    You might hook to this filter, define an array of IPs and return false if there is a match between the user’s IP address and one defined by you. This will disable the log creation for that download call.

    Warmly,
    Razvan

    Thread Starter Torchy

    (@torkild)

    Thanks for this.

    I also got this routine from your support email.

    To ignore a list of IPs you can add the following code at the end of your theme or child theme functions.php file. The file should be located in wordpress_install_directory/wp-content/themes/YOUR_ACTIVE_THEME/functions.php .

    function check_ip_blacklist( $is_enabled ) {
    $current_ip = $_SERVER['REMOTE_ADDR'];

    // Add your agent's ips here.
    $blacklisted_ips = array(
    '192.168.0.1',
    'other IP addresses',
    );

    if ( in_array( $current_ip, $blacklisted_ips ) ) {
    return false;
    }

    return $is_enabled;


    I have implemented it (with our IP included), and it seems to be doing the trick.

    • This reply was modified 1 month, 2 weeks ago by Torchy.
Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.