- Make sure you have the required WP_CLI::add_comand() line configured in your plugin/theme
- Install and configure the WP CLI app:
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
chmod +x wp-cli.phar
mv wp-cli.phar /var/www/vhosts/yoursidefolder/wp-cli.phar - Test command. Eg.: /var/www/vhosts/yoursitefolder/usr/bin/php /var/www/vhosts/yoursidefolder/wp-cli.phar –path=/var/www/vhosts/yoursidefolder/httpdocs <action_name> <action_method>
- Add the cron job to your server’s config
Blog
-
How to configure WP CLI cron job in Plesk / Hostpress.de
-
Node.js update package.json to the latest versions of the dependencies
Using npx:
npx npm-check-updates -u npm installUsing npm-check-updates package:
npm i -g npm-check-updates ncu -u npm install -
CHMOD recursively on directories and files
Directories:
find /path/to/directory -type d -exec chmod 755 {} +Files
find /path/to/directory -type f -exec chmod 644 {} +Examples for current directory
Sub-Directories:
find ./* -type d -exec chmod 755 {} +Files in current directory and sub-directories
find ./* -type f -exec chmod 644 {} + -
SSH login using key flag
ssh -p 22 -i ~/.ssh/<name_of_key> <username>@<host> -
Change WooCommerce order emails subject
/* * goes in theme functions.php or a custom plugin * * Subject filters: * woocommerce_email_subject_new_order * woocommerce_email_subject_customer_processing_order * woocommerce_email_subject_customer_completed_order * woocommerce_email_subject_customer_invoice * woocommerce_email_subject_customer_note * woocommerce_email_subject_low_stock * woocommerce_email_subject_no_stock * woocommerce_email_subject_backorder * woocommerce_email_subject_customer_new_account * woocommerce_email_subject_customer_invoice_paid **/ add_filter('woocommerce_email_subject_new_order', 'change_admin_email_subject', 1, 2); function change_admin_email_subject( $subject, $order ) { global $woocommerce; $blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES); $subject = sprintf( '[%s] New Customer Order (# %s) from Name %s %s', $blogname, $order->id, $order->billing_first_name, $order->billing_last_name ); return $subject; }