Skip to content

Advanced Queue Setup In CLI mode

khungate edited this page Jul 25, 2023 · 9 revisions

Advanced Queue Setup In CLI Mode

Welcome to the guide on setting up an Advanced Queue in Command Line Interface (CLI) Mode for your Mailchimp integration with WooCommerce. This guide will help you understand how to optimize the queue processing system for your specific needs.

Overview

The Need for Advanced Queue Setup

From version v2.3 onwards, the queue processing system has been switched to Action Scheduler. This guide provides instructions on how to set up an advanced queue in CLI mode, which can be more efficient and reliable for larger sites or sites with specific server configurations.

Preparation

Removing Redundant Constants

If you have any of the following constants in your wp-config.php file, please remove them:

DISABLE_WP_HTTP_WORKER
MAILCHIMP_USE_CURL
MAILCHIMP_REST_LOCALHOST
MAILCHIMP_REST_IP
MAILCHIMP_DISABLE_QUEUE

Running the Queue Process

Options

You have two options to run the queue process using a cronjob command:

  1. Run it on a cron schedule every minute. Use the following command, replacing "yourdomain.com" with your actual domain, and "/full/path/to/install/" with the full path to your WordPress installation:
* * * * * /usr/bin/wp --url=http://yourdomain.com --path=/full/path/to/install/ action-scheduler run --group="mc-woocommerce"
  1. Use a process manager like Monit or Supervisord. The command is similar to the one above, but without the cron schedule:
/usr/bin/wp --url=http://yourdomain.com --path=/full/path/to/install/ run --group="mc-woocommerce"

Advanced Usage

For more advanced uses of the Mailchimp for WooCommerce/Action Scheduler CLI, please refer to the Action Scheduler documentation. Remember to always use the --group option as follows: --group="mc-woocommerce".

Legacy Versions (Prior to v2.3)

If you're using a version of the plugin prior to v2.3, it's recommended to run the queue in CLI mode. First, define a constant in your config file as follows: define('DISABLE_WP_HTTP_WORKER', true);. Then, you have two options to run this process:

  1. Run it on a cron schedule every minute. Use the following command, replacing "yourdomain.com" and "/full/path/to/install/" as explained above:
* * * * * /usr/bin/wp --url=http://yourdomain.com --path=/full/path/to/install/ queue listen
  1. Use a process manager like Monit or Supervisord. The command is similar to the one above, but without the cron schedule:
/usr/bin/wp --url=http://yourdomain.com --path=/full/path/to/install/ queue listen
Clone this wiki locally