Why are the IP addresses being incorrectly detected?

If you are getting identical IP addresses for all your votes, then your web server may be behind a CDN, firewall, or reverse proxy.

If this is the case, you will need to provide wp ulike with the HTTP request header that contains the real visitor IP address. If you are unsure what this means or how to find out which custom header is needed, please contact your hosting provider, server administrator, or the support team of your CDN or firewall service for assistance.

Once you know the custom HTTP request header to use, you may add it with the following code snippet:

/**
 * Add a custom HTTP request header to fix IP address detection
 * @param \Geminilabs\Vectorface\Whip $whip
 * @return void
 */
add_action('wp_ulike_whip_action', function ($whip) {
    $customHeader = 'HTTP_X_SUCURI_CLIENTIP'; // change the header as needed
    $whip->addCustomHeader($customHeader);
});
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us