Support » Plugin: ALO EasyMail Newsletter » Cron will not run automatically

  • Using latest version of EasyMail… plugin worked correctly for two sends after the upgrade to the latest version. Between the second and third send, the site was moved to a new server. Now, the cron will not run automatically.

    1. I have created a cron job in cPanel, with no success.

    2. I can use the URL to wp-cron.php (the same as in the cPanel cron job) in a browser to run the cron successfully, and the send advances.

    3. Deactivating and reactivating the plugin does not help.

    I assume that the server move probably caused the problem, but I cannot figure out how.

    http://wordpress.org/extend/plugins/alo-easymail/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author eventualo

    (@eventualo)

    A sample of cron task for cPanel can be:

    */5 * * * * GET http://www.example.com/blog/wp-cron.php?doing_wp_cron > /dev/null

    BTW I think you are right and I suggest that you ask to your server provider directly.

    But, do you know how to activate the cron tasks?? Because ftp wouldn’t be enough./

    As I wrote, I created a cron job in cPanel using the code supplied by the plugin, modified as suggested by cPanel to suppress the notification emails:

    http://www.clientdomain.com/wp-cron.php?doing_wp_cron > /dev/null 2>&1

    I stripped it down to the URL only, and the cron runs; however, I am now getting a “No such file or directory”. I have confirmed that wp-cron.php does exist. I also tried the path to the file.

    Launch the URL in a browser and it works.

    I installed the cron view plugin. It indicates that a newsletter is scheduled for sending. However, the newsletter is still not sending.

    @shoestringwebs i’ve got the same problem with a newsletter plugin, and on internet i didn’t find a solution, and i’ve figured it out from myself.

    First your wp-cron.php is not working and still present in root dir of your site.

    So follow my steps and tell my if works for your, for me did:

    1. Save the following code in a file called wp-cron2.php on your desktop.

    <?php
    /**
     * WordPress Cron Implementation for hosts, which do not offer CRON or for which
     * the user has not set up a CRON job pointing to this file.
     *
     * The HTTP request to this file will not slow down the visitor who happens to
     * visit when the cron job is needed to run.
     *
     * @package WordPress
     */
    
    ignore_user_abort(true);
    
    if ( !empty($_POST) || defined('DOING_AJAX') || defined('DOING_CRON') )
    	die();
    
    /**
     * Tell WordPress we are doing the CRON task.
     *
     * @var bool
     */
    define('DOING_CRON', true);
    
    if ( !defined('ABSPATH') ) {
    	/** Set up WordPress environment */
    	require_once('./wp-load.php');
    }
    
    if ( false === $crons = _get_cron_array() )
    	die();
    
    $keys = array_keys( $crons );
    $local_time = time();
    
    if ( isset($keys[0]) && $keys[0] > $local_time )
    	die();
    
    foreach ($crons as $timestamp => $cronhooks) {
    	if ( $timestamp > $local_time )
    		break;
    
    	foreach ($cronhooks as $hook => $keys) {
    
    		foreach ($keys as $k => $v) {
    
    			$schedule = $v['schedule'];
    
    			if ($schedule != false) {
    				$new_args = array($timestamp, $schedule, $hook, $v['args']);
    				call_user_func_array('wp_reschedule_event', $new_args);
    			}
    
    			wp_unschedule_event($timestamp, $hook, $v['args']);
    
     			do_action_ref_array($hook, $v['args']);
    		}
    	}
    }
    
    die();

    2. Upload the file using cPanel file manager or using a FTP program to the root of your site, near wp-cron.php

    3. You have to open wp-config.php and add this

    /** Stop Cron jobs automatically
    define('DISABLE_WP_CRON', 'true');
    define('ALTERNATE_WP_CRON', 'true');

    between lines 36-41 to take effect.

    4. Open cPanel>Cron Jobs and set up this 2 jobs

    wget -q --delete-after "http://yourdomain/wp-cron2.php?doing_wp_cron"
    wget -q --delete-after "http://yourdomain/wp-cron2.php"

    Replace yourdomain = your site URL = ex. wordpress.org
    For me is ok to check wp-cron2.php on every 30 minutes. If you want to do this more often do it.

    Why
    -q = run the wget in silent mode, you are not receiving emails about cron job with info. If you want to debug delete it to see the message error.
    –delete-after = after running a wget command a called file would be saved in the root of your domain with 0 bytes, and this commands removes it.

    My recomandation for you for a newsletter plugin. It’s very complex, standalone plugin with wysiwyg, easy to configure and set-up and you have stats for subscribed, clicked, opened, unopened posts. Really helpfully.

    Cheers,
    ionica.

    Greetings!

    Running WP 5.1
    ALO EasyMail Newsletter Version 2.4.14

    Following Ionica’s instructions, I created wp-con2.php and uploaded, made the corrections to the two mentioned cron jobs – and still nothing 🙁

    So I ran http://www.lcag.info/wp-cron.php?doing_wp_cron from the browser and the newsletter updated to
    On sending queue…Progress: 0.2%

    Not sure if this is a valid test or not but wanted to see if at least the cron job would run manually ???? seems something fired at least 🙂

    Your suggestions are greatly appreciated. If more information is needed please let me know.

    Thank you in advance

    RevKev

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Cron will not run automatically’ is closed to new replies.