From 2235fc0f74146b64d266d19228858efb9e6c151a Mon Sep 17 00:00:00 2001
From: Benjamin Adams <Armastevs@gmail.com>
Date: Mon, 15 Jul 2013 13:45:22 -0500
Subject: [PATCH] Updated docs

---
 README.md                  | 14 ++++----
 index-wp-redis.php         |  5 ++-
 wp-redis-cache/index.php   | 74 --------------------------------------
 wp-redis-cache/options.php | 11 +++---
 4 files changed, 15 insertions(+), 89 deletions(-)
 delete mode 100644 wp-redis-cache/index.php

diff --git a/README.md b/README.md
index fad018c..d1457a1 100644
--- a/README.md
+++ b/README.md
@@ -4,11 +4,11 @@ Cache Wordpress using Redis, the fastest way to date to cache Wordpress.
 
 ### Requirements
 ------
-[Wordpress](http://wordpress.org) - CMS framework/blogging system
-[Redis](http://redis.io/) - Key Value in memory caching
-[Predis](https://github.com/nrk/predis) - PHP api for Redis
+* [Wordpress](http://wordpress.org) - CMS framework/blogging system
+* [Redis](http://redis.io/) - Key Value in memory caching
+* [Predis](https://github.com/nrk/predis) - PHP api for Redis
 
-### Setup
+== Installation ==
 ------
 Install Redis, must have root access to your machine. On debian it's as simple as:
 ```bash
@@ -19,8 +19,10 @@ On other systems please refer to the [Redis website](http://redis.io/).
 Move the folder wp-redis-cache to the plugin directory and activate the plugin.  In the admin section you can set how long you will cache the post for.  By default it will cache the post for 12 hours.
 Note: This plugin is optional and is used to refresh the cache after you update a post/page
 
-Move the `index-wp-redis.php` to the root/base Wordpress directory
-Change the `index.php` to:
+Move the `index-wp-redis.php` to the root/base Wordpress directory.
+
+Move the `index.php` to the root/base Wordpress directory.  Or manually change the `index.php` to:
+
 ```php
 <?php
 require('index-wp-redis.php');
diff --git a/index-wp-redis.php b/index-wp-redis.php
index 25d63ab..5eb527b 100644
--- a/index-wp-redis.php
+++ b/index-wp-redis.php
@@ -1,8 +1,8 @@
 <?php
 
-$seconds_cache_redis = 60*60*12; // 12 hours by default
+$seconds_cache_redis = 60*60*12; // 12 hours by default, you can change in this in wp-admin options page
 $ip_of_your_website = '64.90.38.145';  //You must set this to the IP of your website
-$secret_string = "changeme";    /*This must be the same as in the wp-admin section if you want to manually refresh the cache
+$secret_string = "changeme";    /*This is if you want to manually refresh the cache
 								 ex: http://example.com/sample-post?refresh=changeme    */
 
  
@@ -24,7 +24,6 @@ $current_url = str_replace("?refresh=$secret_string", '', $current_url);  //clea
 $current_url = str_replace("&refresh=$secret_string", '', $current_url);
 $redis_key = md5($current_url);
 
-
 //Either manual refresh cache by adding ?refresh=secret_string after the URL or somebody posting a comment
 if (isset($_GET['refresh']) || $_GET['refresh']==$secret_string || ($_SERVER['HTTP_REFERER'] == $current_url && $_SERVER['REQUEST_URI'] != '/' && $_SERVER['REMOTE_ADDR'] != $ip_of_your_website)) {
 
diff --git a/wp-redis-cache/index.php b/wp-redis-cache/index.php
deleted file mode 100644
index 3dcb4e6..0000000
--- a/wp-redis-cache/index.php
+++ /dev/null
@@ -1,74 +0,0 @@
-<?php
-class wctest{
-    public function __construct(){
-        if(is_admin()){
-	    add_action('admin_menu', array($this, 'add_plugin_page'));
-	    add_action('admin_init', array($this, 'page_init'));
-	}
-    }
-	
-    public function add_plugin_page(){
-        // This page will be under "Settings"
-	add_options_page('Settings Admin', 'Settings', 'manage_options', 'test-setting-admin', array($this, 'create_admin_page'));
-    }
-
-    public function create_admin_page(){
-        ?>
-	<div class="wrap">
-	    <?php screen_icon(); ?>
-	    <h2>Settings</h2>			
-	    <form method="post" action="options.php">
-	        <?php
-                    // This prints out all hidden setting fields
-		    settings_fields('test_option_group');	
-		    do_settings_sections('test-setting-admin');
-		?>
-	        <?php submit_button(); ?>
-	    </form>
-	</div>
-	<?php
-    }
-	
-    public function page_init(){		
-	register_setting('test_option_group', 'array_key', array($this, 'check_ID'));
-		
-        add_settings_section(
-	    'setting_section_id',
-	    'Setting',
-	    array($this, 'print_section_info'),
-	    'test-setting-admin'
-	);	
-		
-	add_settings_field(
-	    'some_id', 
-	    'Some ID(Title)', 
-	    array($this, 'create_an_id_field'), 
-	    'test-setting-admin',
-	    'setting_section_id'			
-	);		
-    }
-	
-    public function check_ID($input){
-        if(is_numeric($input['some_id'])){
-	    $mid = $input['some_id'];			
-	    if(get_option('test_some_id') === FALSE){
-		add_option('test_some_id', $mid);
-	    }else{
-		update_option('test_some_id', $mid);
-	    }
-	}else{
-	    $mid = '';
-	}
-	return $mid;
-    }
-	
-    public function print_section_info(){
-	print 'Enter your setting below:';
-    }
-	
-    public function create_an_id_field(){
-        ?><input type="text" id="input_whatever_unique_id_I_want" name="array_key[some_id]" value="<?=get_option('test_some_id');?>" /><?php
-    }
-}
-
-$wctest = new wctest();
\ No newline at end of file
diff --git a/wp-redis-cache/options.php b/wp-redis-cache/options.php
index 2bf57f4..2a1fd8e 100644
--- a/wp-redis-cache/options.php
+++ b/wp-redis-cache/options.php
@@ -2,7 +2,7 @@
 /*
 Plugin Name: Wp Redis Cache
 Plugin URI: https://github.com/BenjaminAdams/wp-redis-cache
-Description: Cache Wordpress with redis
+Description: Cache Wordpress using Redis, the fastest way to date to cache Wordpress. 
 Version: 1.0
 Author: Benjamin Adams
 Author URI: http://dudelol.com
@@ -36,16 +36,15 @@ function edit_redis_options() {
     <h2>Wp-Redis Options</h2>
     <form method="post" action="options.php">
     <?php wp_nonce_field('update-options') ?>
+	
+	<p>This plugin does not work out of the box and requires additional steps.  Please follow these install instructions: <a target='_blank' href='https://github.com/BenjaminAdams/wp-redis-cache'>https://github.com/BenjaminAdams/wp-redis-cache</a></p>
+	
+	<p>If you do not have Redis installed on your machine this will NOT work! </p>
 
     <p><strong>Seconds of Caching:</strong><br />
 	How many seconds would you like to cache?  *Recommended 12 hours or 43200 seconds <br />
     <input type="text" name="wp-redis-cache-seconds" size="45" value="<?php echo get_option('wp-redis-cache-seconds'); ?>" /></p>
 
-    <p><strong>Secret String:</strong><br />
-	To refresh the cache of your post manually you will need to set a secret string so do can refresh manually like so:
-	<br />	http://example.com/post_name?refresh=secret_string.  <br />
-	<br />Important! You must change this in the index-wp-redis.php file<br />
-    <input type="text" name="wp-redis-secret" size="45" value="<?php echo get_option('wp-redis-secret'); ?>" /></p>
 
    
     <p><input type="submit" name="Submit" value="Update Options" /></p>
-- 
GitLab