PluginProbe ʕ •ᴥ•ʔ
WP Mail SMTP by WPForms – The Most Popular SMTP and Email Log Plugin / 2.1.1
WP Mail SMTP by WPForms – The Most Popular SMTP and Email Log Plugin v2.1.1
4.9.0 0.9.6 1.0.0 1.0.1 1.0.2 1.1.0 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.3.0 1.3.1 1.3.2 1.3.3 1.4.0 1.4.1 1.4.2 1.5.0 1.5.1 1.5.2 1.6.0 1.6.2 1.7.0 1.7.1 1.8.0 1.8.1 1.9.0 2.0.0 2.0.1 2.1.1 2.2.1 2.3.1 2.4.0 2.5.0 2.5.1 2.6.0 2.7.0 2.8.0 2.9.0 3.0.1 3.0.2 3.0.3 3.1.0 3.10.0 3.11.0 3.11.1 3.2.0 3.2.1 3.3.0 3.4.0 3.5.0 3.5.1 3.5.2 3.6.1 3.7.0 3.8.0 3.8.2 3.9.0 4.0.1 4.1.0 4.1.1 4.2.0 4.3.0 4.4.0 4.5.0 4.6.0 4.7.0 4.7.1 4.8.0 trunk 0.10.0 0.10.1 0.11.1 0.11.2 0.3.1 0.3.2 0.4 0.4.1 0.4.2 0.5.0 0.5.1 0.5.2 0.6 0.7 0.8 0.8.2 0.8.3 0.8.4 0.8.5 0.8.6 0.8.7 0.9.0 0.9.1 0.9.2 0.9.3 0.9.4 0.9.5
wp-mail-smtp / vendor / woocommerce / action-scheduler / classes / schedules / ActionScheduler_IntervalSchedule.php
wp-mail-smtp / vendor / woocommerce / action-scheduler / classes / schedules Last commit date
ActionScheduler_CanceledSchedule.php 6 years ago ActionScheduler_CronSchedule.php 6 years ago ActionScheduler_IntervalSchedule.php 6 years ago ActionScheduler_NullSchedule.php 6 years ago ActionScheduler_Schedule.php 6 years ago ActionScheduler_SimpleSchedule.php 6 years ago
ActionScheduler_IntervalSchedule.php
82 lines
1 <?php
2
3 /**
4 * Class ActionScheduler_IntervalSchedule
5 */
6 class ActionScheduler_IntervalSchedule extends ActionScheduler_Abstract_RecurringSchedule implements ActionScheduler_Schedule {
7
8 /**
9 * Deprecated property @see $this->__wakeup() for details.
10 **/
11 private $start_timestamp = NULL;
12
13 /**
14 * Deprecated property @see $this->__wakeup() for details.
15 **/
16 private $interval_in_seconds = NULL;
17
18 /**
19 * Calculate when this schedule should start after a given date & time using
20 * the number of seconds between recurrences.
21 *
22 * @param DateTime $after
23 * @return DateTime
24 */
25 protected function calculate_next( DateTime $after ) {
26 $after->modify( '+' . (int) $this->get_recurrence() . ' seconds' );
27 return $after;
28 }
29
30 /**
31 * @return int
32 */
33 public function interval_in_seconds() {
34 _deprecated_function( __METHOD__, '3.0.0', '(int)ActionScheduler_Abstract_RecurringSchedule::get_recurrence()' );
35 return (int) $this->get_recurrence();
36 }
37
38 /**
39 * Serialize interval schedules with data required prior to AS 3.0.0
40 *
41 * Prior to Action Scheduler 3.0.0, reccuring schedules used different property names to
42 * refer to equivalent data. For example, ActionScheduler_IntervalSchedule::start_timestamp
43 * was the same as ActionScheduler_SimpleSchedule::timestamp. Action Scheduler 3.0.0
44 * aligned properties and property names for better inheritance. To guard against the
45 * possibility of infinite loops if downgrading to Action Scheduler < 3.0.0, we need to
46 * also store the data with the old property names so if it's unserialized in AS < 3.0,
47 * the schedule doesn't end up with a null/false/0 recurrence.
48 *
49 * @return array
50 */
51 public function __sleep() {
52
53 $sleep_params = parent::__sleep();
54
55 $this->start_timestamp = $this->scheduled_timestamp;
56 $this->interval_in_seconds = $this->recurrence;
57
58 return array_merge( $sleep_params, array(
59 'start_timestamp',
60 'interval_in_seconds'
61 ) );
62 }
63
64 /**
65 * Unserialize interval schedules serialized/stored prior to AS 3.0.0
66 *
67 * For more background, @see ActionScheduler_Abstract_RecurringSchedule::__wakeup().
68 */
69 public function __wakeup() {
70 if ( is_null( $this->scheduled_timestamp ) && ! is_null( $this->start_timestamp ) ) {
71 $this->scheduled_timestamp = $this->start_timestamp;
72 unset( $this->start_timestamp );
73 }
74
75 if ( is_null( $this->recurrence ) && ! is_null( $this->interval_in_seconds ) ) {
76 $this->recurrence = $this->interval_in_seconds;
77 unset( $this->interval_in_seconds );
78 }
79 parent::__wakeup();
80 }
81 }
82