Created
August 15, 2025 09:09
-
-
Save davidperezgar/7f519ad5b0a5021a7288174f0ea11b6b to your computer and use it in GitHub Desktop.
Add WooCommerce to bin install-wp-tests.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Installs WooCommerce plugin in the test environment | |
install_woocommerce() { | |
local PLUGIN_DIR="$WP_CORE_DIR/wp-content/plugins" | |
mkdir -p "$PLUGIN_DIR" | |
if [[ $WP_VERSION == "8.0" ]]; then | |
WOOCOMMERCE_URL="https://downloads.wordpress.org/plugin/woocommerce.7.9.0.zip" | |
else | |
WOOCOMMERCE_URL="https://downloads.wordpress.org/plugin/woocommerce.zip" | |
fi | |
download "$WOOCOMMERCE_URL" "$TMPDIR/woocommerce.zip" | |
unzip -q "$TMPDIR/woocommerce.zip" -d "$TMPDIR/" | |
rm -rf "$PLUGIN_DIR/woocommerce" | |
mv "$TMPDIR/woocommerce" "$PLUGIN_DIR/woocommerce" | |
echo "WooCommerce plugin installed successfully." | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment