From ed5d5379ab407ff6c74f128915c63bd2ac543358 Mon Sep 17 00:00:00 2001 From: Furniel Date: Mon, 1 May 2017 19:20:46 +0300 Subject: [PATCH] Fix Redis Test #430 --- Generic_AdminActions_Test.php | 7 ++++++- pub/js/options.js | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Generic_AdminActions_Test.php b/Generic_AdminActions_Test.php index c765832..c64032b 100644 --- a/Generic_AdminActions_Test.php +++ b/Generic_AdminActions_Test.php @@ -39,6 +39,9 @@ function w3tc_test_memcached() { */ function w3tc_test_redis() { $servers = Util_Request::get_array( 'servers' ); + $persistent = Util_Request::get_boolean( 'persistent', false ); + $password = Util_Request::get_string('password', ''); + $dbid = Util_Request::get_integer( 'dbid', 0 ); if ( count( $servers ) <= 0 ) $success = false; @@ -48,7 +51,9 @@ function w3tc_test_redis() { foreach ( $servers as $server ) { @$cache = Cache::instance( 'redis', array( 'servers' => $server, - 'persistent' => false + 'persistent' => $persistent, + 'password' => $password, + 'dbid' => $dbid ) ); if ( is_null( $cache ) ) $success = false; diff --git a/pub/js/options.js b/pub/js/options.js index 2e5ef69..6908ea8 100644 --- a/pub/js/options.js +++ b/pub/js/options.js @@ -1047,6 +1047,9 @@ jQuery(function() { jQuery.post('admin.php?page=w3tc_dashboard', { w3tc_test_redis: 1, servers: jQuery('#redis_servers').val(), + persistent : jQuery('#objectcache__redis__persistent').is(':checked'), + dbid : jQuery('#redis_dbid').val(), + password : jQuery('#redis_password').val(), _wpnonce: jQuery(this).metadata().nonce }, function(data) { status.addClass(data.result ? 'w3tc-success' : 'w3tc-error');