• I am extending the cPanel UAPI with a Perl module. I have successfully added several methods that run different WP-CLI commands. Some I don’t need to capture the output like wp plugin activate, and some that I do, like wp plugin list have the --format=json arg. However when I run wp plugin uninstall, the child exits and sends “Deactivating plugins…” to stdout, the rest of the action does not perform. This does deactivate the plugin(s), just does not uninstall or delete. Using the the --quiet does not help. Is the part of the intended behavior of this command? Can any one offer suggestions on how to work around this?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Dion

    (@diondesigns)

    According to the docs, wp-cli will not by default uninstall/delete a plugin if it is active.

    https://developer.www.ads-software.com/cli/commands/plugin/uninstall/

    Can you uninstall plugins manually from the command line?

    Thread Starter twoelevenjay

    (@twoelevenjay)

    More specifically the docs say WP-CLI will delete active plugins with wp plugin delete, however it will not uninstall active plugins with wp plugin uninstall unless using the --deactivate argument. I have tested it from the Perl module on inactive /active plugins, with / without the --deactivate argument, and also with --quiet argument it hide the message “Deactivating plugins…”. None of these complete. If using –deactivate without –quiet it returns “Deactivating plugins…”, otherwise it returns and empty string.

    Yes I have tested all of these from the command line and they all uninstall successfully. Something is missing that is present in the shell environment and not in the Perl program. I have tried readpipe(), exec(), system(), and open(), they all behave the same way.

    • This reply was modified 5 years, 3 months ago by twoelevenjay.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Can not run wp plugin uninstall from Perl module’ is closed to new replies.