redis plugin installed
Now Redis Object Cache Plugin is automatically installed when WP Cache is enabled.
This commit is contained in:
parent
404e42cd13
commit
cef1fed914
25
lib/sites
25
lib/sites
|
@ -6,8 +6,9 @@
|
||||||
source /opt/webinoly/lib/general
|
source /opt/webinoly/lib/general
|
||||||
|
|
||||||
|
|
||||||
nginx_helper_plugin() {
|
wp_cache_plugins() {
|
||||||
# Download WP (latest version)
|
if [[ ! -d /var/www/$domain/htdocs/wp-content/plugins/nginx-helper ]]; then
|
||||||
|
# Download Nginx Helper Plugin
|
||||||
sudo wget --timeout=15 -qrO /var/www/$domain/htdocs/nginx-helper-plugin.zip https://downloads.wordpress.org/plugin/nginx-helper.latest-stable.zip
|
sudo wget --timeout=15 -qrO /var/www/$domain/htdocs/nginx-helper-plugin.zip https://downloads.wordpress.org/plugin/nginx-helper.latest-stable.zip
|
||||||
sudo unzip -qq /var/www/$domain/htdocs/nginx-helper-plugin.zip -d /var/www/$domain/htdocs/wp-content/plugins/
|
sudo unzip -qq /var/www/$domain/htdocs/nginx-helper-plugin.zip -d /var/www/$domain/htdocs/wp-content/plugins/
|
||||||
sudo rm /var/www/$domain/htdocs/nginx-helper-plugin.zip
|
sudo rm /var/www/$domain/htdocs/nginx-helper-plugin.zip
|
||||||
|
@ -19,6 +20,24 @@ nginx_helper_plugin() {
|
||||||
echo "- Support for purge/url method has been disabled because it is considered a security risk."
|
echo "- Support for purge/url method has been disabled because it is considered a security risk."
|
||||||
echo "- The Purge Method should be set to “Delete local server cache file” "
|
echo "- The Purge Method should be set to “Delete local server cache file” "
|
||||||
echo "${end}"
|
echo "${end}"
|
||||||
|
else
|
||||||
|
echo "${red}Nginx Helper Plugin is already installed!${end}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ ! -d /var/www/$domain/htdocs/wp-content/plugins/redis-cache ]]; then
|
||||||
|
# Download Redis Object Cache Plugin
|
||||||
|
sudo wget --timeout=15 -qrO /var/www/$domain/htdocs/redis-cache-plugin.zip https://downloads.wordpress.org/plugin/redis-cache.latest-stable.zip
|
||||||
|
sudo unzip -qq /var/www/$domain/htdocs/redis-cache-plugin.zip -d /var/www/$domain/htdocs/wp-content/plugins/
|
||||||
|
sudo rm /var/www/$domain/htdocs/redis-cache-plugin.zip
|
||||||
|
echo ""
|
||||||
|
echo "${gre} Redis Object Cache Plugin has been installed!"
|
||||||
|
echo " Please, activate this plugin for a better experience with WordPress Object Cache."
|
||||||
|
echo "${blu} ** IMPORTANT - Plugin Settings **"
|
||||||
|
echo "- Go to “Menu > Settings > Redis” and be sure that Object Cache is enabled. "
|
||||||
|
echo "${end}"
|
||||||
|
else
|
||||||
|
echo "${red}Redis Object Cache Plugin is already installed!${end}"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -457,7 +476,7 @@ createsite() {
|
||||||
# Activate FastCgi cache
|
# Activate FastCgi cache
|
||||||
if [[ "$cache" == "-cache" && "$wp" == [123] ]]; then
|
if [[ "$cache" == "-cache" && "$wp" == [123] ]]; then
|
||||||
sudo sed -i '/php.conf/c \ include common/wpfc.conf;' /etc/nginx/sites-available/$domain
|
sudo sed -i '/php.conf/c \ include common/wpfc.conf;' /etc/nginx/sites-available/$domain
|
||||||
nginx_helper_plugin
|
wp_cache_plugins
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "${gre}Site $domain has been successfully created!${end}"
|
echo "${gre}Site $domain has been successfully created!${end}"
|
||||||
|
|
|
@ -299,14 +299,14 @@ elif [[ "$type" == "-cache" && -a /etc/nginx/sites-available/$domain ]]; then
|
||||||
iswp=$( grep -F "wpcommon.conf" /etc/nginx/sites-available/$domain )
|
iswp=$( grep -F "wpcommon.conf" /etc/nginx/sites-available/$domain )
|
||||||
if [[ -n $isphp && -n $iswp ]]; then
|
if [[ -n $isphp && -n $iswp ]]; then
|
||||||
sudo sed -i '/php.conf/c \ include common/wpfc.conf;' /etc/nginx/sites-available/$domain
|
sudo sed -i '/php.conf/c \ include common/wpfc.conf;' /etc/nginx/sites-available/$domain
|
||||||
if [[ ! -d /var/www/$domain/htdocs/wp-content/plugins/nginx-helper ]]; then
|
if [[ ! -d /var/www/$domain/htdocs/wp-content/plugins/nginx-helper || ! -d /var/www/$domain/htdocs/wp-content/plugins/redis-cache ]]; then
|
||||||
echo "${gre}"
|
echo "${gre}"
|
||||||
echo "We recommend Nginx Helper Plugin as an easy way to manage FastCGI Cache on your site."
|
echo "We recommend Nginx Helper Plugin and Redis Object Cache Plugin as an easy way to manage FastCGI and Redis Cache on your WordPress site."
|
||||||
echo "${blu} Do you want to install it now [Y/n]? "
|
echo "${blu}Do you want to install it now [Y/n]? ${end}"
|
||||||
while read -r -n 1 -s answer; do
|
while read -r -n 1 -s answer; do
|
||||||
answer=${answer:-y}
|
answer=${answer:-y}
|
||||||
if [[ $answer = [YyNn] ]]; then
|
if [[ $answer = [YyNn] ]]; then
|
||||||
[[ $answer = [Yy] ]] && nginx_helper_plugin
|
[[ $answer = [Yy] ]] && wp_cache_plugins
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
Loading…
Reference in a new issue