Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install and activate plugins using wp-cli instead of downloading all the files #19

Open
csalzano opened this issue Jun 15, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@csalzano
Copy link
Owner

No description provided.

@csalzano csalzano added the enhancement New feature or request label Jun 15, 2022
@csalzano
Copy link
Owner Author

csalzano commented Jul 5, 2022

	# install all active plugins basd on the `active_plugins` option value
	wp option get active_plugins --format=json | php -r "foreach( json_decode( fgets(STDIN) ) as \$value ) { \$p=explode('/',\$value);fwrite(STDOUT, (is_array( \$p ) ? \$p[0] : \$p).PHP_EOL); }" | xargs -n1 bash -c '
	VERSION=$(wp plugin get $0 --field=version --quiet)
	echo "Trying to install ${0}"
	if [ ${#VERSION} -gt 0 ]
	then
		echo "Specifying version ${VERSION}"
		wp plugin install $0 --version=${VERSION}
	else
		echo "No version number found"
		wp plugin install $0
	fi'

Only works for plugins on wordpress.org and plugins for which we have .zip download links, so "download" is still kinda better. What if we check for a local version or get a better command than scp in the download?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant