HOW TO SETUP CRON JOBS FOR MULTISITE WORDPRESS

The CryptoWoo plugin for WordPress can be used on a multisite network. For frequent, consistent, and reliable exchange rate updates and payment processing, we recommend setting up a server-side cron-job instead of relying on the included wp-cron that will only run when visitors are browsing your website. =

Step 1: Edit the WP-Config file

Add this line to your wp-config.php file right below your multisite constants:

define('CWOO_MULTISITE', true);

Step 2: Create a multisite WP-cron file

Create the file wp-cron-multisite.php to your website root with this content:

<?php
/**
 * WP Cron on WordPress Multisite installs: Get blog urls from database and curl wp-cron.php for each site.
 * Copy this file in your WordPress root directory and create external cronjobs like in the example below:
 *    * * * * * wget -q -O - "http://mydomain.com/wp-cron-multisite.php" > /dev/null 2>&1
 **/
require './wp-load.php';
global $wpdb;
echo esc_html( time() );
$blogs = $wpdb->get_results( "SELECT domain, path FROM $wpdb->blogs WHERE archived='0' AND deleted ='0' LIMIT 0,300" );

foreach ( $blogs as $blog ) {
	$rc = wp_safe_remote_get( 'http://' . $blog->domain . ( $blog->path ? $blog->path : '/' ) . 'wp-cron.php' );
}

Step 3: Setup external server-side cronjobs

Point your external cronjobs to wp-cron-multisite.php instead of wp-cron.php

* * * * * wget -q -O - "http://mydomain.com/wp-cron-multisite.php" > /dev/null 2>&1