Support » Plugin: Jetpack by WordPress.com » Wrong ip & Shows my hosting ip with Cloudflare

  • Resolved smohannagaraj

    (@smohannagaraj)


    Cloudflare shows wrong ip. I get the same ip always that was my hosting ip.

    I have another statistics plugin. But it works correctly with correct ip.

    But cloudflare is my only problem.

    URGENT.
    Please!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Actually i am using a mu-plugin for wp statistics to get correct ip.
    if ( isset( $_SERVER[“HTTP_CF_CONNECTING_IP”] ) ) {
    $_SERVER[‘REMOTE_ADDR’] = $_SERVER[“HTTP_CF_CONNECTING_IP”];
    }

    Is there any similar way?

    I dont want to change the plugin system.

    But i want to fix only mine.

    Plugin Contributor Stef

    (@erania-pinnera)

    Hi there,

    Could you post your site URL here, so I can have a look?
     
    If you want it to remain private, you can also contact us via this contact form:
    Contact Support.

    Thanks!

    <?php
    /*
    Plugin Name: Correct IP – SSMRASU
    Description: Get correct visitor ip.
    Version: 1.1.0
    Author: SSMRASU
    Author URI: https://fb.com/ssmrasu
    */
    if ( isset( $_SERVER[“HTTP_CF_CONNECTING_IP”] ) ) {
    $_SERVER[‘REMOTE_ADDR’] = $_SERVER[“HTTP_CF_CONNECTING_IP”];
    foreach ( array (
    //’HTTP_HOST’,
    //’SERVER_PORT’,
    ‘//HTTPS’,
    //’GD_PHP_HANDLER’,
    ‘HTTP_AKAMAI_ORIGIN_HOP’,
    ‘HTTP_CF_CONNECTING_IP’,
    ‘HTTP_CLIENT_IP’,
    ‘HTTP_FASTLY_CLIENT_IP’,
    //’HTTP_FORWARDED’,
    //’HTTP_FORWARDED_FOR’,
    ‘HTTP_INCAP_CLIENT_IP’,
    ‘HTTP_TRUE_CLIENT_IP’,
    ‘HTTP_X_CLIENTIP’,
    ‘HTTP_X_CLUSTER_CLIENT_IP’,
    //’HTTP_X_FORWARDED’,
    //’HTTP_X_FORWARDED_FOR’,
    ‘HTTP_X_IP_TRAIL’,
    ‘HTTP_X_REAL_IP’,
    //’HTTP_X_VARNISH’,
    ‘REMOTE_ADDR’
    ) as $header ) {
    if ( isset( $_SERVER[ $header ] ) ) {
    $_SERVER[ $header ] = $_SERVER[“HTTP_CF_CONNECTING_IP”];
    }
    }
    }

    Create a mu-plugin.

    If anyone don’t know about it, search for google. It is very easy.

    Thank U!

    Plugin Support KokkieH

    (@kokkieh)

    Hi there,

    This does not sound like it is related to Jetpack. CloudFlare support might be in a better position to help you with this.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Wrong ip & Shows my hosting ip with Cloudflare’ is closed to new replies.