Compare commits

..

No commits in common. "master" and "fix_modal_js_error" have entirely different histories.

3 changed files with 5 additions and 30 deletions

View file

@ -14,13 +14,13 @@ class RL_MailWarmer_Conversation_Handler {
$conversation_table = $wpdb->prefix . 'rl_mailwarmer_conversations'; $conversation_table = $wpdb->prefix . 'rl_mailwarmer_conversations';
// $current_time = current_time('mysql'); // $current_time = current_time('mysql');
$start_time = date('Y-m-d H:i:s', strtotime('-96 hours')); $start_time = date('Y-m-d H:i:s', strtotime('-96 hours'));
$end_time = date('Y-m-d H:i:s', strtotime('+2 hours')); $end_time = date('Y-m-d H:i:s', strtotime('+12 hours'));
// $end_time = date('Y-m-d H:i:s', strtotime('now')); // $end_time = date('Y-m-d H:i:s', strtotime('now'));
// Fetch up to 50 conversations starting within the next 24 hours // Fetch up to 50 conversations starting within the next 24 hours
$conversations = $wpdb->get_results( $conversations = $wpdb->get_results(
$wpdb->prepare( $wpdb->prepare(
"SELECT * FROM $conversation_table WHERE status = %s AND first_message_timestamp BETWEEN %s AND %s ORDER BY first_message_timestamp ASC LIMIT 5", "SELECT * FROM $conversation_table WHERE status = %s AND first_message_timestamp BETWEEN %s AND %s ORDER BY first_message_timestamp ASC LIMIT 50",
'new', 'new',
$start_time, $start_time,
$end_time $end_time
@ -353,7 +353,7 @@ class RL_MailWarmer_Conversation_Handler {
// Fetch scrubber pool if 'received_by' is not passed // Fetch scrubber pool if 'received_by' is not passed
if (!isset($args['received_by'])) { if (!isset($args['received_by'])) {
$scrubber_pool_full = self::get_email_accounts_for_pool($campaign_id, 'scrubber'); $scrubber_pool_full = self::get_email_accounts_for_pool($campaign_id, 'scrubber_test');
// Pick $num_particpants random addresses // Pick $num_particpants random addresses
$num_scrubbers = min($num_particpants, count($scrubber_pool_full)); $num_scrubbers = min($num_particpants, count($scrubber_pool_full));

View file

@ -80,7 +80,7 @@ class RL_MailWarmer_Scheduler {
* Process pending messages by delegating to the Message Handler. * Process pending messages by delegating to the Message Handler.
*/ */
public static function cron_process_pending_messages() { public static function cron_process_pending_messages() {
// action_log("====================== Running Cron to process messages ========================"); action_log("====================== Running Cron to process messages ========================");
RL_MailWarmer_Message_Handler::process_pending_messages(); RL_MailWarmer_Message_Handler::process_pending_messages();
} }
@ -88,7 +88,7 @@ class RL_MailWarmer_Scheduler {
* Process pending conversations by delegating to the Message Handler. * Process pending conversations by delegating to the Message Handler.
*/ */
public static function cron_process_upcoming_conversations() { public static function cron_process_upcoming_conversations() {
// action_log("====================== Running Cron to process conversations ========================"); action_log("====================== Running Cron to process conversations ========================");
RL_MailWarmer_Conversation_Handler::process_upcoming_conversations(); RL_MailWarmer_Conversation_Handler::process_upcoming_conversations();
} }
} }

View file

@ -371,8 +371,6 @@ add_action('wp_ajax_rl_mailwarmer_save_campaign', function () {
$post_id = isset($_POST['post_id']) ? intval($_POST['post_id']) : 0; $post_id = isset($_POST['post_id']) ? intval($_POST['post_id']) : 0;
$new_post = ($post_id == 0); $new_post = ($post_id == 0);
$calculate_timeline = isset($_POST['calculate_timeline']) ? true : false; $calculate_timeline = isset($_POST['calculate_timeline']) ? true : false;
$target_profession = false;
$target_profession_other = false;
// Prepare post data // Prepare post data
$post_data = array( $post_data = array(
@ -442,15 +440,6 @@ add_action('wp_ajax_rl_mailwarmer_save_campaign', function () {
return; return;
} }
break; break;
case 'target_profession':
$target_profession = $_POST[$field];
break;
case 'target_profession_other':
$target_profession_other = $_POST[$field];
break;
default: default:
update_field($field, sanitize_text_field($_POST[$field]), $post_id); update_field($field, sanitize_text_field($_POST[$field]), $post_id);
@ -458,20 +447,6 @@ add_action('wp_ajax_rl_mailwarmer_save_campaign', function () {
} }
} }
} }
if ($target_profession_other) {
$target_profession = $target_profession_other;
}
// If no target profession is set, choose one from the default profession pool.
if ( ! $target_profession ) {
$professions = rl_get_textarea_meta_as_array('option', 'default_profession_pool');
if ( ! empty($professions) ) {
// Assign a random profession from the list
$target_profession = $professions[array_rand($professions)];
}
}
// Set campaign owner // Set campaign owner
update_post_meta($post_id, 'owner_id', $current_user_id); update_post_meta($post_id, 'owner_id', $current_user_id);