• Hello –

    I recently discovered that my wp-cli and wc-cli were no longer working on my site. I would run any wp command and it would have zero output at all. If I run wp-cli command with the --skip-plugins option, it works.

    I checked the tips at https://make.ww.wp.xz.cn/cli/handbook/identify-plugin-theme-conflict/ which give a tip on how to find which plugin causes an issue.

    It gives this command:
    wp plugin list --field=name --status=active --skip-plugins | xargs -n1 -I % wp --skip-plugins=% plugin get % --field=name

    I changed it to this one so I could see what it was doing:

    for i in $(wp plugin list --field=name --status=active --skip-plugins); do echo -n "$i: " ; wp --skip-plugins=$i plugin get $i --field=name; echo ""; done

    Running this command basically iterates through all the plugins, and then for each one, attempts to run a basic wp plugin get command while skipping that plugin.

    When I ran it, two plugins showed up:

    
    wp-html-mail:   wp-html-mail
    wp-html-mail-woocommerce:   wp-html-mail-woocommerce
    

    and sure enough, if I skip wp-html-mail plugin in my command, commands work:

    
    wp --skip-plugins=wp-html-mail role list
    +------------------+------------------+
    | name             | role             |
    +------------------+------------------+
    | Administrator    | administrator    |
    [snip]
    

    I’m running 2.9 of both wp-html-mail and wp-html-mail-woocommerce:

    
    wp --skip-plugins plugin get wp-html-mail
    +-------------+----------------------------------------------------------------------------------+
    | Field       | Value                                                                            |
    +-------------+----------------------------------------------------------------------------------+
    | name        | wp-html-mail                                                                     |
    | title       | WP HTML Mail                                                                     |
    | author      | Hannes Etzelstorfer                                                              |
    | version     | 2.9                                                                              |
    | description | Create your own professional email design for all your outgoing WordPress
    emails |
    | status      | active                                                                           |
    +-------------+----------------------------------------------------------------------------------+
    
    
    wp --skip-plugins plugin get wp-html-mail-woocommerce
    +-------------+-------------------------------------------------------+
    | Field       | Value                                                 |
    +-------------+-------------------------------------------------------+
    | name        | wp-html-mail-woocommerce                              |
    | title       | WP HTML Mail - WooCommerce                            |
    | author      | Hannes Etzelstorfer // codemiq                        |
    | version     | 2.9                                                   |
    | description | Beautiful responsive mails for your WooCommerce store |
    | status      | active                                                |
    +-------------+-------------------------------------------------------+
    

    This is the most recent version I was emailed about earlier this month.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hey @whallify
    Thank your for this perfect problem description. I wish all users would describe their problems so detailed as you do!
    We are going to have a look at the issue.
    best regards, Hannes

    Thread Starter whallify

    (@whallify)

    Thank you for the kind words.

    For anyone out there waiting for a fix like I am, the following two workarounds might help:

    The first is to edit the WP-CLI config file to use defaults that help the situation. Values like these can also be placed into a YAML-formatted configuration, described further here:
    https://make.ww.wp.xz.cn/cli/handbook/config/

    For example, make a ~/.wp-cli/config.yml file that contains the following line:

    skip-plugins: wp-html-mail

    This file can be helpful for many things, like setting a default path or user for WooCommerce lookups

    $ cat ~/.wp-cli/config.yml
    path: /var/www/html
    user: myspecialuser
    skip-plugins: wp-html-mail
    

    Secondly, an alias can be created (assumes Linux shell). Put the following into the ~/.bash_aliases or ~/.profile

    alias wp2="wp --skip-plugins=wp-html-mail"

    and instead of using WP-CLI with the wp command, use wp2 instead.

    This can also be helpful if using WC-CLI and always needing to add a user

    alias wp2="wp --skip-plugins=wp-html-mail --user=username"

    • This reply was modified 7 years, 1 month ago by whallify.
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘wp-cli stops working with wp-html-mail’ is closed to new replies.