| 1 |
<?php |
| 2 |
// @codingStandardsIgnoreFile |
| 3 |
/** |
| 4 |
* Cron routines handled by s2Member (inner processing routines). |
| 5 |
* |
| 6 |
* Copyright: © 2009-2011 |
| 7 |
* {@link http://websharks-inc.com/ WebSharks, Inc.} |
| 8 |
* (coded in the USA) |
| 9 |
* |
| 10 |
* Released under the terms of the GNU General Public License. |
| 11 |
* You should have received a copy of the GNU General Public License, |
| 12 |
* along with this software. In the main directory, see: /licensing/ |
| 13 |
* If not, see: {@link http://www.gnu.org/licenses/}. |
| 14 |
* |
| 15 |
* @package s2Member\Cron_Jobs |
| 16 |
* @since 3.5 |
| 17 |
*/ |
| 18 |
if(!defined('WPINC')) // MUST have WordPress. |
| 19 |
exit ('Do not access this file directly.'); |
| 20 |
|
| 21 |
if(!class_exists('c_ws_plugin__s2member_cron_jobs_in')) |
| 22 |
{ |
| 23 |
/** |
| 24 |
* Cron routines handled by s2Member (inner processing routines). |
| 25 |
* |
| 26 |
* @package s2Member\Cron_Jobs |
| 27 |
* @since 3.5 |
| 28 |
*/ |
| 29 |
class c_ws_plugin__s2member_cron_jobs_in |
| 30 |
{ |
| 31 |
/** |
| 32 |
* Extends WP-Cron schedules to support 10 minute intervals. |
| 33 |
* |
| 34 |
* @package s2Member\Cron_Jobs |
| 35 |
* @since 3.5 |
| 36 |
* |
| 37 |
* @attaches-to ``add_filter('cron_schedules');`` |
| 38 |
* |
| 39 |
* @param array $schedules Expects an array of WP_Cron schedules passed in by the Filter. |
| 40 |
* |
| 41 |
* @return array Array of WP_Cron schedules after having added a 10 minute cycle. |
| 42 |
*/ |
| 43 |
public static function extend_cron_schedules($schedules = array()) |
| 44 |
{ |
| 45 |
foreach(array_keys(get_defined_vars()) as $__v) $__refs[$__v] =& $$__v; |
| 46 |
do_action('ws_plugin__s2member_before_extend_cron_schedules', get_defined_vars()); |
| 47 |
unset($__refs, $__v); |
| 48 |
|
| 49 |
$array = array('every10m' => array('interval' => 600, 'display' => 'Every 10 Minutes')); |
| 50 |
|
| 51 |
return apply_filters('ws_plugin__s2member_extend_cron_schedules', array_merge($array, $schedules), get_defined_vars()); |
| 52 |
} |
| 53 |
|
| 54 |
/** |
| 55 |
* Allows the Auto-EOT Sytem to be processed through a server-side Cron Job. |
| 56 |
* |
| 57 |
* @package s2Member\Cron_Jobs |
| 58 |
* @since 3.5 |
| 59 |
* |
| 60 |
* @attaches-to ``add_action('init');`` |
| 61 |
*/ |
| 62 |
public static function auto_eot_system_via_cron() |
| 63 |
{ |
| 64 |
do_action('ws_plugin__s2member_before_auto_eot_system_via_cron', get_defined_vars()); |
| 65 |
|
| 66 |
if(!empty($_GET['s2member_auto_eot_system_via_cron'])) |
| 67 |
{ |
| 68 |
if($GLOBALS['WS_PLUGIN__']['s2member']['o']['auto_eot_system_enabled']) |
| 69 |
{ |
| 70 |
c_ws_plugin__s2member_auto_eots::auto_eot_system(); // Process. |
| 71 |
do_action('ws_plugin__s2member_during_auto_eot_system_via_cron', get_defined_vars()); |
| 72 |
} |
| 73 |
exit(); // Clean exit. |
| 74 |
} |
| 75 |
do_action('ws_plugin__s2member_after_auto_eot_system_via_cron', get_defined_vars()); |
| 76 |
} |
| 77 |
} |
| 78 |
} |
| 79 |
|