From 0038c5fcdf340374bd01139b3faa07af879a3a44 Mon Sep 17 00:00:00 2001 From: Erick Hitter <ehitter@gmail.com> Date: Tue, 25 Feb 2014 22:56:42 -0800 Subject: [PATCH] Further code cleanup --- index-wp-redis.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index-wp-redis.php b/index-wp-redis.php index fd07dad..cd9c108 100644 --- a/index-wp-redis.php +++ b/index-wp-redis.php @@ -70,7 +70,7 @@ try { echo "<!-- using predis as a backup -->\n"; } - include_once( "wp-content/plugins/wp-redis-cache/predis5.2.php" ); //we need this to use Redis inside of PHP + include_once dirname( __FILE__ ) . '/wp-content/plugins/wp-redis-cache/predis5.2.php' ); //we need this to use Redis inside of PHP $redis = new Predis_Client( array( 'host' => $redis_server, 'port' => $redis_port, @@ -123,7 +123,7 @@ 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() ) and ( ! is_search() ) ) { + if ( ! is_404() && ! is_search() ) { if ( $unlimited ) { $redis->set( $redis_key, $html_of_page ); } else { -- GitLab