From 0bc66a249e35a2d1312d37598d43ac78071cafae Mon Sep 17 00:00:00 2001
From: Hendrik Klemp <hendrik.klemp@kumavision.de>
Date: Fri, 27 Dec 2013 19:19:29 +0100
Subject: [PATCH] Fix Typo

Fixed Typo
---
 index-wp-redis.php | 36 +++++++++++++++++-------------------
 1 file changed, 17 insertions(+), 19 deletions(-)

diff --git a/index-wp-redis.php b/index-wp-redis.php
index 6f16b90..cdc89cc 100644
--- a/index-wp-redis.php
+++ b/index-wp-redis.php
@@ -10,16 +10,13 @@ function getMicroTime($t)
 }
 
 
-$debug               =  false;
-
+$debug               =  true;
+$cache				 =  false;
 $ip_of_your_website  =  '127.0.0.1';
 $secret_string       =  'changeme';
 
 
 
-if(!defined('WP_USE_THEMES')) {
-    define('WP_USE_THEMES', true);
-}
 
 // so we don't confuse the cloudflare server 
 if (isset($_SERVER['HTTP_CF_CONNECTING_IP'])) {
@@ -56,6 +53,7 @@ try {
         
     // This page is cached, lets display it
     } else if ($redis->exists($redis_key)) {
+		$cache  = true;
         $html_of_page = $redis->get($redis_key);
         echo $html_of_page;
         
@@ -81,9 +79,9 @@ try {
 			
 			// When a page displays after an "HTTP 404: Not Found" error occurs, do not cache
 			// When the search was used, do not cache
-            if (!is_404() && !is_search())  {
+            if ((!is_404()) and (!is_search()))  {
                 if ($unlimited) {
-                	$redis->setex($redis_key, $html_of_page);
+                	$redis->set($redis_key, $html_of_page);
                 }
 				else
 				{
@@ -106,16 +104,16 @@ try {
     require('./wp-blog-header.php');
 }
 
-if ($_SERVER['REMOTE_ADDR'] != $ip_of_your_website) {
-    // How long did it take to load the page? (CloudFlare may strip out comments)
-    $end  = microtime();
-    $time = (@getMicroTime($end) - @getMicroTime($start));
-    echo "<!-- Cache system by Benjamin Adams. Page generated in " . round($time, 5) . " seconds. -->";
-	if ($debug) {
-		echo "<!-- wp-redis-cache-seconds  = " . $seconds_cache_redis . " -->";
-		echo "<!-- wp-redis-cache-secret  = " . $secret_string . "-->";
-		echo "<!-- wp-redis-cache-ip  = " . $ip_of_your_website . "-->";
-		echo "<!-- wp-redis-cache-unlimited = " . $unlimited . "-->";
-		echo "<!-- wp-redis-cache-debug  = " . $debug . "-->";
-	}
+
+$end  = microtime();
+$time = (@getMicroTime($end) - @getMicroTime($start));
+if ($debug) {
+	echo "<!-- Cache system by Benjamin Adams. Page generated in " . round($time, 5) . " seconds. -->";
+	echo "<!-- Site was cached  = " . $cache . " -->";
+	echo "<!-- wp-redis-cache-seconds  = " . $seconds_cache_redis . " -->";
+	echo "<!-- wp-redis-cache-secret  = " . $secret_string . "-->";
+	echo "<!-- wp-redis-cache-ip  = " . $ip_of_your_website . "-->";
+	echo "<!-- wp-redis-cache-unlimited = " . $unlimited . "-->";
+	echo "<!-- wp-redis-cache-debug  = " . $debug . "-->";
 }
+
-- 
GitLab