WordPress.org

Support

Support » Plugins and Hacks » WP-PostRatings » [Resolved] [Plugin: WP-PostRatings] Privacy suggestion

[Resolved] [Plugin: WP-PostRatings] Privacy suggestion

Viewing 1 replies (of 1 total)
  • I found the answer. In wp-postratings/wp-postratings.php

    Find:

    ### Function: Get IP Address
    if(!function_exists('get_ipaddress')) {
    	function get_ipaddress() {
    		if (empty($_SERVER["HTTP_X_FORWARDED_FOR"])) {
    			$ip_address = $_SERVER["REMOTE_ADDR"];
    		} else {
    			$ip_address = $_SERVER["HTTP_X_FORWARDED_FOR"];
    		}
    		if(strpos($ip_address, ',') !== false) {
    			$ip_address = explode(',', $ip_address);
    			$ip_address = $ip_address[0];
    		}
    		return esc_attr($ip_address);
    	}
    }

    And replace it with:

    ### Function: Get IP Address
    if(!function_exists('get_ipaddress')) {
    	function get_ipaddress() {
    		if (empty($_SERVER["HTTP_X_FORWARDED_FOR"])) {
    			$ip_address = '127.0.0.1';
    		} else {
    			$ip_address = '127.0.0.1';
    		}
    		if(strpos($ip_address, ',') !== false) {
    			$ip_address = explode(',', $ip_address);
    			$ip_address = $ip_address[0];
    		}
    		return esc_attr($ip_address);
    	}
    }

    Notice your localhost IP might be different, if it does not work, ask your provider what localhost IP they are using. This tweak is not update proof so save it into a text file and re-do it after update.

    Other than that it´s a great plugin.

Viewing 1 replies (of 1 total)
  • The topic ‘[Resolved] [Plugin: WP-PostRatings] Privacy suggestion’ is closed to new replies.
Skip to toolbar