deepak-rajpal
6/15/2015 - 2:49 PM

mailpress wordpress automatic cron execution issue

mailpress wordpress automatic cron execution issue

1) May be Scheduled wp-cron.php is not gettig executed. There is no wp-cron.php executing at regular interval (after checking access file)
2) Check .htaccess file for any restriction. and wp-config for alternate wp-cron ON/OFF.
3) http://dansgalaxy.co.uk/2010/11/15/wp-cron-and-multisite-headache/ (curl solution)
4) increase timeout => 0.01 to timeout => 1.00 in wp-includes/cron.php
5) Add alternate cron using wp-config

DEV:
Mannual Url: http://multisite.com/site1/wp-cron.php
MAILTO=er.deepakrajpal@gmail.com
*/5 * * * * /usr/bin/wget http://multisite.com/site1/wp-cron.php >/dev/null

Scheduling column queries: we checked old schedule jobs that we want to delete in mailpress plugin.
------------query 1---------------
$wpdb->query( 
	$wpdb->prepare( 
		"
                DELETE FROM $wpdb->options
		 WHERE option_name = %s
		",
	        'MailPress_monthly_category_4' 
        )
);
--------------query 2---------------
$wpdb->query( 
	$wpdb->prepare( 
		"
                DELETE FROM $wpdb->options
		 WHERE option_id = %d
		",
	        1059
        )
);
-------------query to display coloumn---------
$myrows = $wpdb->get_results( "SELECT * FROM $wpdb->options WHERE option_name = 'MailPress_monthly_category_4'" );
print_r ($myrows);

$myrows = $wpdb->get_results( "SELECT * FROM $wpdb->options WHERE option_name = 'MailPress_monthly'" );
print_r ($myrows);
---------------------------------------------


Final solution: 
manual hitting wp-cron.php (using http://multisite.com/site1/wp-cron.php in IE browser) finally worked. so mailpress mail every month gets fired when hit that urls by admin once.