mirror of
https://github.com/N0rthernL1ghts/wordpress.git
synced 2024-11-23 14:13:27 +01:00
Optimize plugin installer performance
Implement manual plugin existence check. WP-CLI is quite slow and processing large list of plugins delays container boot too much
This commit is contained in:
parent
f3ce642242
commit
e9c35c6bd2
|
@ -2,6 +2,7 @@
|
|||
set -e
|
||||
|
||||
PLUGIN_LIST="${WORDPRESS_PLUGIN_LIST:-}"
|
||||
WP_CONTENT_PATH="/var/www/${WEB_ROOT}/wp-content"
|
||||
|
||||
echo "> Automated WordPress Plugin Installer"
|
||||
|
||||
|
@ -20,6 +21,13 @@ for PLUGIN_NAME in ${PLUGIN_LIST}; do
|
|||
WP_PLUGIN_INSTALL_ARGS="${WP_PLUGIN_INSTALL_ARGS} --version=${PLUGIN[1]}"
|
||||
fi
|
||||
|
||||
PLUGIN_PATH="${WP_CONTENT_PATH}/plugins/${PLUGIN[0]}"
|
||||
|
||||
if [ -d "${PLUGIN_PATH}" ] || [ -f "${PLUGIN_PATH}.php" ]; then
|
||||
echo "> Plugin '${PLUGIN[0]}' already installed and will be skipped."
|
||||
continue
|
||||
fi
|
||||
|
||||
echo "> Installing plugin '${PLUGIN[0]}' version '${PLUGIN[1]}'"
|
||||
wp plugin install ${WP_PLUGIN_INSTALL_ARGS}
|
||||
done
|
Loading…
Reference in New Issue
Block a user