From d52f0fe866914074fcb6da91ed539bbf9330ada1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristhian=20Mart=C3=ADnez=20Ochoa?= Date: Wed, 25 Apr 2018 14:00:22 -0600 Subject: [PATCH] fixed multiple wp redis Fixed an issue when multiple WP installation have redis enabled causing an unexpected behavior like wrong redirections. --- lib/sites | 4 ++++ plugins/site | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/sites b/lib/sites index 857565b..4df7aba 100644 --- a/lib/sites +++ b/lib/sites @@ -393,6 +393,10 @@ _EOF_ sudo sed -i "/'LOGGED_IN_SALT'/c \define('LOGGED_IN_SALT', '$SALT_LOGGS');" /var/www/$domain/wp-config.php sudo sed -i "/'NONCE_SALT'/c \define('NONCE_SALT', '$SALT_NONCS');" /var/www/$domain/wp-config.php + # Redis Conf + sudo sed -i "/stop editing/i \define('WP_REDIS_SELECTIVE_FLUSH', true);" /var/www/$domain/wp-config.php + sudo sed -i "/stop editing/i \define('WP_CACHE_KEY_SALT', 'redis_object_cache_for_wp_$domain);" /var/www/$domain/wp-config.php + # Multisite wp-config if [[ "$type" == "-wpsubdir" || "$type" == "-wpsubdom" ]]; then sudo sed -i "/stop editing/i \define('WP_ALLOW_MULTISITE', true);" /var/www/$domain/wp-config.php diff --git a/plugins/site b/plugins/site index 44e0db0..177f04b 100644 --- a/plugins/site +++ b/plugins/site @@ -152,7 +152,7 @@ elif [[ "$domain" == "-delete-all" && -z "$type" && -z "$cache" ]]; then for site in "/etc/nginx/sites-available"/* do domi=$(echo $site | cut -f 5 -d "/") - [[ $domi != "html" && $domi != "default" && $domi != $(conf_read tools-port) ]]; then + if [[ $domi != "html" && $domi != "default" && $domi != $(conf_read tools-port) ]]; then echo "${gre}Your site ${blu}${domi}${gre} has been successfully deleted! ${end}" fi done