Skip to content
This repository has been archived by the owner on Mar 1, 2024. It is now read-only.

Commit

Permalink
1.0.3
Browse files Browse the repository at this point in the history
git-svn-id: https://plugins.svn.wordpress.org/zarza-real-ip/trunk@1201921 b8457f37-d9ea-0310-8a92-e5e31aec5664
  • Loading branch information
zarzacorp committed Jul 19, 2015
1 parent d4d918b commit da3c541
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 28 deletions.
27 changes: 15 additions & 12 deletions readme.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
=== Zarza Real IP ===
Contributors: zarzacorp
Donate link: https://zarza.com
Tags: varnish, nginx, cloudflare, incapsula, cloudlayer, real ip, comments, spam, ip, proxy, ip-address, load balancer
Requires at least: 2.7
Tested up to: 4.3
Stable tag: 1.0.2
License: GPLv3 or later
License URI: http://www.gnu.org/licenses/gpl.html
Contributors: zarzacorp
Donate link: https://zarza.com
Tags: varnish, nginx, cloudflare, incapsula, cloudlayer, real ip, comments, spam, ip, proxy, ip-address, load balancer
Requires at least: 2.7
Tested up to: 4.3
Stable tag: 1.0.3
License: GPLv3 or later
License URI: http://www.gnu.org/licenses/gpl.html

This useful and free plugin corrects automatically the user's IP address if you're behind a proxy.

Expand All @@ -16,11 +16,14 @@ Thank you for your interest in Zarza Real IP. This useful and free plugin correc

[ZARZA](https://zarza.com/software/) | AHEAD OF OUR TIME
== Changelog ==
= 1.0.3 =
* Updated: Minor documentation updates.

= 1.0.2 =
* Added $_SERVER["HTTP_CF_VISITOR"] verification to turn $_SERVER['HTTPS'] = 'on' if CloudFlare report it on.
* Improved: Added $_SERVER["HTTP_CF_VISITOR"] verification to turn $_SERVER['HTTPS'] = 'on' if CloudFlare report it on.

= 1.0.1 =
* Documentation fixes
* Updated: Minor documentation updates.

= 1.0 =
* Initial Release Launched
Expand All @@ -37,7 +40,7 @@ Automatic installation:

Manual installation:

1. Download the Zarza Real IP plugin from https://wordpress.org/plugins/zarza-real-ip/
1. Download the __Zarza Real IP__ plugin from https://wordpress.org/plugins/zarza-real-ip/
2. Extract the contents of the zip file
3. Upload the `zarza-real-ip` folder to the `/wp-content/plugins/` directory
4. Activate the Zarza Real IP plugin through the 'Plugins' menu in WordPress
4. Activate the __Zarza Real IP__ plugin through the __Plugins__ menu in WordPress
31 changes: 15 additions & 16 deletions zarza-real-ip.php
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
<?php
/*
Plugin Name: Zarza Real IP
Plugin URI: https://wordpress.org/plugins/zarza-real-ip/
Description: This useful and free plugin corrects automatically the user's IP address and allows Wordpress to use the Real IP address if you're behind a proxy or load balancer like nginx, varnish and so on. It will start working as soon as you activate it. It is also compatible with CloudFlare, Incapsula and many others.
Version: 1.0.2
Author: Zarza Corp
Author URI: https://zarza.com/
License: GPL3
Plugin Name: Zarza Real IP
Plugin URI: https://wordpress.org/plugins/zarza-real-ip/
Description: This useful and free plugin corrects automatically the user's IP address and allows Wordpress to use the Real IP address if you're behind a proxy or load balancer like nginx, varnish and so on. It will start working as soon as you activate it. It is also compatible with CloudFlare, Incapsula and many others.
Version: 1.0.3
Author: Zarza Corp
Author URI: https://zarza.com/
License: GPL3
Copyright 2015 Zarza (website : https://zarza.com)
*/

// Make sure we don't expose any info if called directly
if ( !function_exists( 'add_action' ) ) {
echo "I'm a plugin, not much I can do when called directly. Thank you!";
exit;
}
defined('ABSPATH') or die("I'm a plugin, not much I can do when called directly."); # From wp-load.php

$zrz_ip_headers = array(
'HTTP_CF_CONNECTING_IP', //CloudFlare
'HTTP_X_FORWARDED_FOR', //Incapsula, Cloudlayer
'HTTP_CF_CONNECTING_IP', #CloudFlare
'HTTP_X_FORWARDED_FOR', #Incapsula, Cloudlayer
'HTTP_X_FORWARDED',
'HTTP_FORWARDED_FOR',
'HTTP_FORWARDED',
Expand All @@ -27,7 +26,7 @@

foreach($zrz_ip_headers as $z) {

if($_SERVER[$z] == "127.0.0.1" || !(isset($_SERVER[$z]))){ // If some header is reporting localhost let's continue
if( ($_SERVER[$z] == "127.0.0.1") || !(isset($_SERVER[$z])) ) { # If some header is reporting localhost let's continue

unset($_SERVER[$z]);
continue;
Expand Down Expand Up @@ -55,7 +54,7 @@
}

// Fix issues with HTTPS
if (($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') || strpos($_SERVER["HTTP_CF_VISITOR"], "https") ) {
if (($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') || (strpos($_SERVER["HTTP_CF_VISITOR"], "https")) ) {
$_SERVER['HTTPS'] = 'on';
}

Expand All @@ -65,4 +64,4 @@
ZARZA | A HEAD OF OUR TIME
https://zarza.com
*/
*/

0 comments on commit da3c541

Please sign in to comment.