WordPress.org

Forums

Antispam Bee
[PATCH] Cronjob is not rescheduled when only cronjob_interval changes (1 post)

  1. UmkaDK
    Member
    Posted 3 years ago #

    Sergej,

    I found a little bug in the "Spam will be automatically deleted after XX days" feature. If I enable this option and then modify the number of days (ie: cronjob_interval) then the init_scheduled_hook() is not re-run.

    By default, cronjob_interval is set to 0, so enabling this feature then changing the number of days to 14 (for example), makes it appear as if the feature does not work.

    The following is a quick patch to fix this problem. To install, save attached patch into ab.patch file inside /wp-content/plugins directory and apply it with cd /wp-content/plugins && patch -p0 < ab.patch.

    diff -Nur antispam-bee/inc/gui.class.php antispam-bee/inc/gui.class.php
    --- antispam-bee/inc/gui.class.php	2012-02-13 13:10:43.000000000 -0800
    +++ antispam-bee/inc/gui.class.php	2012-03-06 10:00:55.000000000 -0800
    @@ -120,7 +120,7 @@
    
     		/* Cron stoppen? */
    -		if ( $options['cronjob_enable'] && !self::get_option('cronjob_enable') ) {
    +		if ( $options['cronjob_enable'] && (!self::get_option('cronjob_enable') || $options['cronjob_interval'] != self::get_option('cronjob_interval') ) ) {
     			self::init_scheduled_hook();
     		} else if ( !$options['cronjob_enable'] && self::get_option('cronjob_enable') ) {
     			self::clear_scheduled_hook();
    @@ -468,4 +468,4 @@
     			</form>
     		</div>
     	<?php }
    -}
    \ No newline at end of file
    +}

    http://wordpress.org/extend/plugins/antispam-bee/

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Antispam Bee
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic