I’ve tried to fix it myself.
Changed line 299 from:
$userIp = $_SERVER["REMOTE_ADDR"];
To:
if (isset($_SERVER["REMOTE_ADDR"])) {
$userIp = $_SERVER["REMOTE_ADDR"];
}
However, then this happens:
[19-Dec-2018 11:48:03 UTC] PHP Notice: Undefined variable: userIp in /home/macmagazine/public_html/wp-content/plugins/insert-post-ads/includes/geotargeting.php on line 305
I’ll just wait for your official support.
@insertpostads Any help here, please?
hey Rafael!
Do you use local server?
@rfischmann try to replace
$_SERVER[“REMOTE_ADDR”];
With:
$_SERVER[“HTTP_X_REAL_IP”];
@insertpostads Hi! Thanks for getting back to me.
I don’t know what you mean by “use local server”. This is running live.
I tried what you said and the error just changed slightly:
[04-Jan-2019 12:40:02 UTC] PHP Notice: Undefined index: HTTP_X_REAL_IP in /home/macmagazine/public_html/wp-content/plugins/insert-post-ads/includes/geotargeting.php on line 299
@insertpostads Any help on the issue above? My error_log keeps getting hammered by that PHP Notice, once every minute…
[09-Mar-2019 01:09:02 UTC] PHP Notice: Undefined index: REMOTE_ADDR in /home/macmagazine/public_html/wp-content/plugins/insert-post-ads/includes/geotargeting.php on line 299
Issue remains, unfortunately.