MAMP PRO WP-CLI Error: Error establishing a database connection

I followed the install instructions at wp-cli.org and am unable to connect to database. I am using a newly installed (this morning) version of MAMP PRO. which php /usr/bin/php echo $WP_CLI_PHP /Applications/MAMP/bin/php/php5.5.14/bin/php wp –info PHP binary: /usr/bin/php PHP version: 5.5.14 php.ini used: WP-CLI root dir: phar://wp-cli.phar WP-CLI packages dir: WP-CLI global config: WP-CLI project config: … Read more

How can I add an RSS widget using WP-CLI?

I can add an rss widget with this command: wp widget add rss my-sidebar –title=News –items=5 But when I add a URL parameter, like this: wp widget add rss my-sidebar –title=News –items=5 –url=”https://news.example.com/feed/” Or like this: wp widget add rss my-sidebar –title=News –items=5 –url=https://news.example.com/feed/ Or like this: wp widget add rss my-sidebar –title=News –items=5 –url=”https://news.example.com/feed/” … Read more

wp-cli: wp term generate xxxxx – Error: ‘xxxxx’ is not a registered taxonomy

I’m writing a WP CLI command which creates and updates taxonomies using wp_insert_term. Actions on my custom taxonomies are not accepted since they don’t show up as registered. The wp-cli included Term_Command itself uses wp_insert_term and allows actions on default taxonomies but errors on custom taxonomies. Various searches suggest custom taxonomies aren’t registered until init. … Read more

How to verify a correct wp-cli installation?

I’ve installed wp-cli (or so I think) on my VPS, Centos 6.9. when I’m logged in as my user, wp is found; but when I run wp –info from my home directory; I receive: PHP binary: /usr/local/bin/php PHP version: 5.6.30 php.ini used: /usr/local/lib/php.ini WP-CLI root dir: phar://wp-cli.phar WP-CLI vendor dir: phar://wp-cli.phar/vendor WP_CLI phar path: /home/myusername … Read more

In a continuous integration environment how do you implement the database entries for plugins and themes

I’m setting up a wordpress continuous integration environment – git->composer->bitbucket-AWS codepipeline, etc. I have yet to figure out how I automate, for the development team, the setup of the WordPress meta data stored in the database. Theme customization, plugin setup/configuration, how to handle licensed plugins such as Offload Media Pro – where I can’t share … Read more

WP CLI: there has been critical error

I am using WordPress 5.3 minimal installation and currently have not installed any other plugins. I have installed WP CLI and below is the output of wp-info: OS: Linux 5.0.0-1025-gcp #26~18.04.1-Ubuntu SMP Mon Nov 11 13:09:18 UTC 2019 x86_64 Shell: /bin/bash PHP binary: /usr/bin/php7.3 PHP version: 7.3.8-1+ubuntu16.04.1+deb.sury.org+1 php.ini used: /etc/php/7.3/cli/php.ini WP-CLI root dir: phar://wp-cli.phar/vendor/wp-cli/wp-cli WP-CLI … Read more

WP WPQuery, not running properly in WP CLI

I’m running a simple query just to find simple WooCommerce products, here is the query which works fine in the header of the site: $args = array( ‘post_type’ => ‘product’, ‘posts_per_page’ => -1, ‘tax_query’ => array( array( ‘taxonomy’ => ‘product_type’, ‘field’ => ‘slug’, ‘terms’ => array(‘simple’) ), ), ); $simpleProducts = new WP_Query($args); This query … Read more

How to get all posts related to a term with WP-CLI?

I want to get all french brands. When I try with post type brand, it works (for example it returns 1000 results). wp post list –post_type=brand If I add a parameter: taxonomy term (–<taxonomy>=term_slug) wp post list –post_type=brand –origin=france or wp post list –post_type=brand –season=winter It still returns same quantity of results (1000 results). I … Read more