Find latest/published version of post using wp-cli

Answering my own question, the current revision has these properties as compared to revisions: The post_status will be “publish” not “inherit”. The post_parent will be 0 The post_type will be “post” not “revision”. Additionally, the ID of the current revision doesn’t change when you update the post; instead, the older version is given a new … Read more

WP-CLI – How to install a plugin from a remote server

wp plugin install https://example.tld/path-to-zip-file/file.zip This fails because example.com port 443 was blocked or example.com may be have no SSL certificate. If you try now, you will get Warning: Download failed. “Not Found” Error: No plugins installed.

Is WP-CLI safe to use in a hosting environment? Why?

It seems to be safe, since most of the hosting companies around the globe that offer LAMP (Linux, Apache, MySQL, PHP) hosting services are providing it with WP-CLI already installed. That said, generally speaking, WP-CLI is nothing but a bunch of WordPress functions implemented to run from the command line. So, I understand that everything … Read more

WP changes siteurl, but some URLs then don’t work

The easiest (and proper, IMHO) was is to make changes to the wp-options table. Using the update_option in the wp-config.php is not the proper way to do it. (And I’m not a big fan of changing the values in the wp-config.php file.) It’s possible that adding a trailing slash might help (depends on your hosting … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)