File: /var/www/innodrive/cron/dryqueue.php
<?php
define('CRON_ROOT', __DIR__ . '/');
define('SHORTINIT', true);
define( 'BASE_PATH', realpath(CRON_ROOT . '../public/') . '/' );
if( php_sapi_name() !== 'cli' ) {
die("Meant to be run from command line");
}
if (!empty($argv[1])) {
define('APPLICATION_ENV', $argv[1]);
} else {
define('APPLICATION_ENV', 'production');
}
global $wp, $wp_query, $wp_the_query, $wp_rewrite, $wp_did_header, $wpdb, $phpmailer;
require(BASE_PATH . 'wp-load.php');
require(CRON_ROOT . 'wp-mock.php');
require(CRON_ROOT . 'wp-mailer.php');
require(BASE_PATH . 'wp-includes/post.php');
require(BASE_PATH . 'wp-content/plugins/e-mailer/e-mailer.php');
require(BASE_PATH . 'wp-content/plugins/import/import.php');
do_action('phpmailer_init');
$jobs = $wpdb->get_results('SELECT id FROM queue WHERE DATE(created_at) >= "2021-03-13" ORDER BY created_at ASC');
foreach($jobs as $job) {
Queue::dryRunJob($job->id);
}