Page 1 of 1

Quick Cache disabled my DBC Backup schedule

PostPosted: June 9th, 2010, 3:09 pm
by flymike
After installing Quick Cache, I discovered my daily database backup (by the DBC Backup plugin) was not running.
In quick-cache/includes/functions/extend-cron.inc.php, the array being passed to function ws_plugin__qcache_extend_cron_schedules() is being discarded, and only the "Every 5 Minutes" schedule is being returned. In my case, the passed array included a schedule for DBC Backup - and it was being discarded.
This Codex shows how to add a new schedule without discarding any schedules which might have been created by other plugins.

Re: Quick Cache disabled my DBC Backup schedule

PostPosted: June 21st, 2010, 7:21 pm
by Jason Caldwell
Thank you very much for reporting this.
This bug was corrected in Quick Cache v2.1.8.
Code: Select all
/*
Extends the WP_Cron schedules to support 5 minute intervals.
Attach to: add_filter("cron_schedules");
*/
if (!function_exists ("ws_plugin__qcache_extend_cron_schedules"))
   {
      function ws_plugin__qcache_extend_cron_schedules ($schedules = array ())
         {
            eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
            do_action ("ws_plugin__qcache_before_extend_cron_schedules", get_defined_vars ());
            unset ($__refs, $__v); /* Unset defined __refs, __v. */
            /**/
            $array = array ("every5m" => array ("interval" => 300, "display" => "Every 5 Minutes"));
            /**/
            return apply_filters ("ws_plugin__qcache_extend_cron_schedules", array_merge ($array, $schedules), get_defined_vars ());
         }
   }