• Hi folks,

    Wasn’t sure what the best forum for my question was, so I’ve arrived at this one as my best guess.

    I have developed a system for promoting my wordpress sites from dev/staging to production. This all works fine. However, following a 3rd party plugin update I started seeing an issue, which is this: the updated plugin throws a Class Not Found error when being activated from the command line (wp plugin activate <some-plugin>). The missing class is specific to the plugin, not some core class.

    Ok so the plugin is at fault, that’s understood. But what I don’t understand is that the plugin activates just fine from the dashboard. I thought the command line was a shell on top of core code just like the dashboard is. Shouldn’t both result in the same outcome be it success or fail?

    If not, what could be causing the difference in results?

    Thanks in advance
    Steve

    p.s. I’ve reported the issue to the plugin developer. But I’d like to know if there’s also some issue with WP to cause one method to successfully activate a plugin and another not.

    • This topic was modified 4 years, 9 months ago by Jan Dembowski.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Tyler

    (@tylerthedude)

    Hi Steve,

    This isn’t any type of issue with WordPress since CLI support is built directly into the WordPress Core. Many plugins that offer CLI support will integrate their own commands, so there is just most likely an issue with the plugin’s CLI that’s causing issues when trying to activate the plugin from command-line.

    Regards,
    Tyler

    Thread Starter skyhawkpictures

    (@skyhawkmedia)

    Ahh ok, certainly that would explain it. Thanks for the info Tyler.

    Thread Starter skyhawkpictures

    (@skyhawkmedia)

    One follow up question: I’ve debugged the offending plugin (in lieu of the plugin author debugging it themselves!) and I’ve found the issue. Is there anything in the WP core functionality that allows me to check in code if activation is specifically from the CLI to distinguish it from the dashboard?
    e.g. if ( wp_ActivationFromCLI() ) {…}

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Command Line Plugin Activation Fails’ is closed to new replies.