Skip to content

Commit

Permalink
Simplify plugin activation by using the all param
Browse files Browse the repository at this point in the history
  • Loading branch information
edjeavons committed Apr 15, 2023
1 parent fbb7b96 commit 64b9381
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/Commands/CreateSite.php
Original file line number Diff line number Diff line change
Expand Up @@ -353,11 +353,7 @@ private function install_plugins() {
Helpers::composer_command( 'require ' . implode( ' ', $plugins['always'] ), $this->install_directory );
Helpers::composer_command( 'require --dev ' . implode( ' ', $plugins['dev'] ), $this->install_directory );

$all_plugins = array_map(
fn( string $value) => substr( $value, strpos( $value, '/' ) + 1 ),
array_merge( $plugins['always'], $plugins['dev'] )
);
Helpers::wp_command( 'plugin activate ' . implode( ' ', $all_plugins ), $this->wp_directory );
Helpers::wp_command( 'plugin activate --all', $this->wp_directory );

// Limit login attempts
Helpers::wp_add_option( 'limit_login_lockout_notify', '""', true, $this->wp_directory );
Expand Down Expand Up @@ -403,7 +399,7 @@ private function install_plugins() {
*/
private function install_woocommerce() {
Helpers::composer_command( 'require wpackagist-plugin/woocommerce wpackagist-plugin/woocommerce-gateway-stripe', $this->install_directory );
Helpers::wp_command( 'plugin activate woocommerce woocommerce-gateway-stripe', $this->wp_directory );
Helpers::wp_command( 'plugin activate --all', $this->wp_directory );

// Options
Helpers::wp_update_option( 'woocommerce_default_country', 'GB', $this->wp_directory );
Expand Down

0 comments on commit 64b9381

Please sign in to comment.