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 / migration / ActionScheduler_DBStoreMigrator.php
wp-mail-smtp / vendor / woocommerce / action-scheduler / classes / migration Last commit date
ActionMigrator.php 6 years ago ActionScheduler_DBStoreMigrator.php 6 years ago BatchFetcher.php 6 years ago Config.php 6 years ago Controller.php 6 years ago DryRun_ActionMigrator.php 6 years ago DryRun_LogMigrator.php 6 years ago LogMigrator.php 6 years ago Runner.php 6 years ago Scheduler.php 6 years ago
ActionScheduler_DBStoreMigrator.php
48 lines
1 <?php
2
3 /**
4 * Class ActionScheduler_DBStoreMigrator
5 *
6 * A class for direct saving of actions to the table data store during migration.
7 *
8 * @since 3.0.0
9 */
10 class ActionScheduler_DBStoreMigrator extends ActionScheduler_DBStore {
11
12 /**
13 * Save an action with optional last attempt date.
14 *
15 * Normally, saving an action sets its attempted date to 0000-00-00 00:00:00 because when an action is first saved,
16 * it can't have been attempted yet, but migrated completed actions will have an attempted date, so we need to save
17 * that when first saving the action.
18 *
19 * @param ActionScheduler_Action $action
20 * @param \DateTime $scheduled_date Optional date of the first instance to store.
21 * @param \DateTime $last_attempt_date Optional date the action was last attempted.
22 *
23 * @return string The action ID
24 * @throws \RuntimeException When the action is not saved.
25 */
26 public function save_action( ActionScheduler_Action $action, \DateTime $scheduled_date = null, \DateTime $last_attempt_date = null ){
27 try {
28 /** @var \wpdb $wpdb */
29 global $wpdb;
30
31 $action_id = parent::save_action( $action, $scheduled_date );
32
33 if ( null !== $last_attempt_date ) {
34 $data = [
35 'last_attempt_gmt' => $this->get_scheduled_date_string( $action, $last_attempt_date ),
36 'last_attempt_local' => $this->get_scheduled_date_string_local( $action, $last_attempt_date ),
37 ];
38
39 $wpdb->update( $wpdb->actionscheduler_actions, $data, array( 'action_id' => $action_id ), array( '%s', '%s' ), array( '%d' ) );
40 }
41
42 return $action_id;
43 } catch ( \Exception $e ) {
44 throw new \RuntimeException( sprintf( __( 'Error saving action: %s', 'action-scheduler' ), $e->getMessage() ), 0 );
45 }
46 }
47 }
48