Automattic / newspack-custom-content-migrator

Custom migration tasks for launching and migrating Newspack sites on Atomic
5 stars 5 forks source link

Install WordPress Importer only when needed #339

Open gamebits opened 1 year ago

gamebits commented 1 year ago

If the Custom Content Migrator is active and WordPress Importer is not installed and active, CCM will do so anytime any WP-CLI command is run. For example:

$ time wp search-replace //charlestoncitypaper-staging.newspackstaging.com //charlestoncitypaper.com --all-tables-with-prefix --report-changed-only --dry-run
Installing and activating the wordpress-importer plugin now...

https://github.com/Automattic/newspack-custom-content-migrator/blob/f6d99fb05829b3b6ef0138a9fea63dbad98d6773/src/PluginSetup.php#L70-L72

It would be preferable if WordPress Importer were installed only when it is needed for the WP-CLI command being run.