Title: wp-cli command does not work
Last modified: November 20, 2017

---

# wp-cli command does not work

 *  Resolved [David Anderson / Team Updraft](https://wordpress.org/support/users/davidanderson/)
 * (@davidanderson)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/wp-cli-command-does-not-work/)
 *     ```
       $ wp mailchimp-sync all
       Fatal error: Uncaught Error: Class 'MC4WP\Sync\CLI\UserHandler' not found in wp-content/plugins/mailchimp-sync/src/cli/class-command.php:34
       Stack trace:
       #0 phar://wp/php/WP_CLI/Dispatcher/CommandFactory.php(86): MC4WP\Sync\CLI\Command->__construct()
       #1 [internal function]: WP_CLI\Dispatcher\CommandFactory::WP_CLI\Dispatcher\{closure}(Array, Array)
       #2 phar://wp/php/WP_CLI/Dispatcher/Subcommand.php(421): call_user_func(Object(Closure), Array, Array)
       #3 phar://wp/php/WP_CLI/Runner.php(336): WP_CLI\Dispatcher\Subcommand->invoke(Array, Array, Array)
       #4 phar://wp/php/WP_CLI/Runner.php(343): WP_CLI\Runner->run_command(Array, Array)
       #5 phar://wp/php/WP_CLI/Runner.php(1034): WP_CLI\Runner->_run_command_and_exit()
       #6 phar://wp/php/WP_CLI/Bootstrap/LaunchRunner.php(23): WP_CLI\Runner->start()
       #7 phar://wp/php/bootstrap.php(75): WP_CLI\Bootstrap\LaunchRunner->process(Object(WP_CLI\B in wp-content/plugins/mailchimp-sync/src/cli/class-command.php on line 34
       ```
   

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [Danny van Kooten](https://wordpress.org/support/users/dvankooten/)
 * (@dvankooten)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/wp-cli-command-does-not-work/#post-9706341)
 * Hey David,
 * Nice catch. We have just pushed version 1.6.1 in which this is fixed. Sorry about
   the error creeping in in the first place.
 *  Thread Starter [David Anderson / Team Updraft](https://wordpress.org/support/users/davidanderson/)
 * (@davidanderson)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/wp-cli-command-does-not-work/#post-9706879)
 * [@dvankooten](https://wordpress.org/support/users/dvankooten/)
 * Thanks…. though…. it still doesn’t work. The site has many thousands of users.
   We were hoping to use WP-CLI because using it via the WP dashboard times out 
   with only half of the users done. But WP-CLI is now (1.6.1) doing this…
 *     ```
       $ wp mailchimp-sync all
       0 users found.
       Warning: Invalid argument supplied for foreach() in wp-includes/class-wp-list-util.php on line 153
       Warning: Invalid argument supplied for foreach() in wp-content/plugins/mailchimp-sync/src/cli/class-command.php on line 80
       Working  100% [==================================================================================================] 0:00 / 0:00
       Success: Done!
       ```
   
 * David
 *  Plugin Author [Danny van Kooten](https://wordpress.org/support/users/dvankooten/)
 * (@dvankooten)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/wp-cli-command-does-not-work/#post-9710978)
 * Hey David,
 * You’re absolute right. I was able to replicate the issue, it only seemed to occur
   when no “user role” setting was configured in the plugin settings.
 * Version 1.6.2 should fix it.
 * Cheers, Danny
 *  Thread Starter [David Anderson / Team Updraft](https://wordpress.org/support/users/davidanderson/)
 * (@davidanderson)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/wp-cli-command-does-not-work/#post-9711101)
 * Thanks – it’s now working.
 * David

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘wp-cli command does not work’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/mailchimp-sync_cfeefa.svg)
 * [MC4WP: Mailchimp User Sync](https://wordpress.org/plugins/mailchimp-sync/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/mailchimp-sync/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/mailchimp-sync/)
 * [Active Topics](https://wordpress.org/support/plugin/mailchimp-sync/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/mailchimp-sync/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/mailchimp-sync/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [David Anderson / Team Updraft](https://wordpress.org/support/users/davidanderson/)
 * Last activity: [8 years, 6 months ago](https://wordpress.org/support/topic/wp-cli-command-does-not-work/#post-9711101)
 * Status: resolved