sleep 60;

echo "WP CLI init"

# !/usr/bin/env sh

# Install WordPress.
# wp core install \
#     --path="/var/www/html"\
#     --title="Biuro" \
#     --admin_user="biuro" \
#     --admin_password="laikinas2587" \
#     --admin_email="info@biuro.eu" \
#     --url="https://dev.biuro.lt" \
#     --skip-email

# https://www.exove.com/blog/developing-with-wordpress-part-4-wp-cli-basics/

# https://developer.wordpress.org/cli/commands/

# WP update
wp core update --force
wp core update-db --network

# Update permalink structure.
wp option update permalink_structure "/%postname%/" --skip-themes --skip-plugins
# wp option update timezone_string "Europe/Vilnius"
# wp option update date_format "Y-m-d"
wp option update time_format "H:i"

# Install plugins
# wp plugin install permalink-manager --force --activate-network
wp plugin install pods --activate-network
wp plugin install polylang --activate-network
wp plugin install wordpress-seo --activate-network
wp plugin install loco-translate --activate-network;
wp plugin install google-sitemap-generator --activate-network;

# Update all plugins
wp plugin update --all

# Activate plugin.
wp plugin activate akismet --network

wp plugin activate biuro-contacts --network
wp plugin activate biuro-feedbacks --network
wp plugin activate biuro-html --network
wp plugin activate biuro-sections --network
wp plugin activate biuro-services --network
wp plugin activate biuro-values --network

wp plugin activate cookies-warning --network
wp plugin activate data-controller --network
wp plugin activate jobs-importer --network

# WP themes
wp theme update --all
wp theme activate biuro

# Update translations
wp language core update
wp language theme update --all
wp language plugin update --all

echo "WP CLI done. Ready to use."
