Notice: Undefined index: HTTP_ACCEPT_LANGUAGE in /home/tbolleke/public_html/index.php on line 11
Notice: Undefined index: HTTP_REFERER in /home/tbolleke/public_html/index.php on line 12
global $wpdb;
$sql = "SELECT COUNT(DISTINCT claim_id) FROM {$wpdb->actionscheduler_actions} WHERE claim_id != 0 AND status IN ( %s, %s)";
$sql = $wpdb->prepare( $sql, array( self::STATUS_PENDING, self::STATUS_RUNNING ) ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
return (int) $wpdb->get_var( $sql ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
}
public function get_claim_id( $action_id ) {
global $wpdb;
$sql = "SELECT claim_id FROM {$wpdb->actionscheduler_actions} WHERE action_id=%d";
$sql = $wpdb->prepare( $sql, $action_id ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
return (int) $wpdb->get_var( $sql ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
}
public function find_actions_by_claim_id( $claim_id ) {
global $wpdb;
$action_ids = array();
$before_date = isset( $this->claim_before_date ) ? $this->claim_before_date : as_get_datetime_object();
$cut_off = $before_date->format( 'Y-m-d H:i:s' );
$sql = $wpdb->prepare(
"SELECT action_id, scheduled_date_gmt FROM {$wpdb->actionscheduler_actions} WHERE claim_id = %d ORDER BY priority ASC, attempts ASC, scheduled_date_gmt ASC, action_id ASC",
$claim_id
);
// Verify that the scheduled date for each action is within the expected bounds (in some unusual
// cases, we cannot depend on MySQL to honor all of the WHERE conditions we specify).
foreach ( $wpdb->get_results( $sql ) as $claimed_action ) { // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
if ( $claimed_action->scheduled_date_gmt <= $cut_off ) {
$action_ids[] = absint( $claimed_action->action_id );
}
}
return $action_ids;
}
public function release_claim( ActionScheduler_ActionClaim $claim ) {
global $wpdb;
$action_ids = $wpdb->get_col( $wpdb->prepare( "SELECT action_id FROM {$wpdb->actionscheduler_actions} WHERE claim_id = %d", $claim->get_id() ) );
$row_updates = 0;
if ( count( $action_ids ) > 0 ) {
$action_id_string = implode( ',', array_map( 'absint', $action_ids ) );
$row_updates = $wpdb->query( "UPDATE {$wpdb->actionscheduler_actions} SET claim_id = 0 WHERE action_id IN ({$action_id_string})" ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
}
$wpdb->delete( $wpdb->actionscheduler_claims, array( 'claim_id' => $claim->get_id() ), array( '%d' ) );
if ( $row_updates < count( $action_ids ) ) {
throw new RuntimeException(
sprintf(
__( 'Unable to release actions from claim id %d.', 'action-scheduler' ),
$claim->get_id()
)
);
}
}
public function unclaim_action( $action_id ) {
global $wpdb;
$wpdb->update(
$wpdb->actionscheduler_actions,
array( 'claim_id' => 0 ),
array( 'action_id' => $action_id ),
array( '%s' ),
array( '%d' )
);
}
public function mark_failure( $action_id ) {
global $wpdb;
$updated = $wpdb->update(
$wpdb->actionscheduler_actions,
array( 'status' => self::STATUS_FAILED ),
array( 'action_id' => $action_id ),
array( '%s' ),
array( '%d' )
);
if ( empty( $updated ) ) {
throw new \InvalidArgumentException( sprintf( __( 'Unidentified action %s', 'action-scheduler' ), $action_id ) ); //phpcs:ignore WordPress.WP.I18n.MissingTranslatorsComment
}
}
public function log_execution( $action_id ) {
global $wpdb;
$sql = "UPDATE {$wpdb->actionscheduler_actions} SET attempts = attempts+1, status=%s, last_attempt_gmt = %s, last_attempt_local = %s WHERE action_id = %d";
$sql = $wpdb->prepare( $sql, self::STATUS_RUNNING, current_time( 'mysql', true ), current_time( 'mysql' ), $action_id ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
// phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
$status_updated = $wpdb->query( $sql );
if ( ! $status_updated ) {
throw new Exception(
sprintf(
__( 'Unable to update the status of action %1$d to %2$s.', 'action-scheduler' ),
$action_id,
self::STATUS_RUNNING
)
);
}
}
public function mark_complete( $action_id ) {
global $wpdb;
$updated = $wpdb->update(
$wpdb->actionscheduler_actions,
array(
'status' => self::STATUS_COMPLETE,
'last_attempt_gmt' => current_time( 'mysql', true ),
'last_attempt_local' => current_time( 'mysql' ),
),
array( 'action_id' => $action_id ),
array( '%s' ),
array( '%d' )
);
if ( empty( $updated ) ) {
throw new \InvalidArgumentException( sprintf( __( 'Unidentified action %s', 'action-scheduler' ), $action_id ) ); //phpcs:ignore WordPress.WP.I18n.MissingTranslatorsComment
}
do_action( 'action_scheduler_completed_action', $action_id );
}
public function get_status( $action_id ) {
global $wpdb;
$sql = "SELECT status FROM {$wpdb->actionscheduler_actions} WHERE action_id=%d";
$sql = $wpdb->prepare( $sql, $action_id ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
$status = $wpdb->get_var( $sql ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
if ( null === $status ) {
throw new \InvalidArgumentException( __( 'Invalid action ID. No status found.', 'action-scheduler' ) );
} elseif ( empty( $status ) ) {
throw new \RuntimeException( __( 'Unknown status found for action.', 'action-scheduler' ) );
} else {
return $status;
}
}
}
Fatal error: Uncaught Error: Class 'ActionScheduler_DBStore' not found in /home/tbolleke/public_html/wp-content/plugins/mailpoet/vendor/woocommerce/action-scheduler/classes/abstracts/ActionScheduler_Store.php:171
Stack trace:
#0 /home/tbolleke/public_html/wp-content/plugins/mailpoet/vendor/woocommerce/action-scheduler/classes/abstracts/ActionScheduler.php(16): ActionScheduler_Store::instance()
#1 /home/tbolleke/public_html/wp-content/plugins/mailpoet/vendor/woocommerce/action-scheduler/classes/abstracts/ActionScheduler.php(101): ActionScheduler::store()
#2 /home/tbolleke/public_html/wp-content/plugins/mailpoet/vendor/woocommerce/action-scheduler/action-scheduler.php(19): ActionScheduler::init('/home/tbolleke/...')
#3 /home/tbolleke/public_html/wp-content/plugins/mailpoet/vendor/woocommerce/action-scheduler/classes/ActionScheduler_Versions.php(39): action_scheduler_initialize_3_dot_6_dot_4()
#4 /home/tbolleke/public_html/wp-includes/class-wp-hook.php(339): ActionScheduler_Versions::initialize_latest_version()
#5 /home/tbol in /home/tbolleke/public_html/wp-content/plugins/mailpoet/vendor/woocommerce/action-scheduler/classes/abstracts/ActionScheduler_Store.php on line 171