1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95:
<?php
class Inbound_Mailer_Activation_Update_Routines {
public static function create_default_unsubscribe_page_x() {
$title = __( 'Unsubscribe' , 'inbound-email' );
if( null == get_page_by_title( $title ) ) {
$post_id = wp_insert_post(
array(
'comment_status' => 'closed',
'ping_status' => 'closed',
'post_title' => $title,
'post_status' => 'publish',
'post_type' => 'page',
'post_content' => '[inbound-email-unsubscribe]'
)
);
Inbound_Options_API::update_option( 'inbound-email' , 'unsubscribe-page' , $post_id);
}
}
public static function create_email_queue_table() {
Inbound_Mailer_Activation::create_email_queue_table();
}
public static function alter_inbound_email_queue_add_fields_1() {
global $wpdb;
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
$table_name = $wpdb->prefix . "inbound_email_queue";
$charset_collate = $wpdb->get_charset_collate();
$row = $wpdb->get_results( "SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name = '{$table_name}' AND column_name = 'list_ids'" );
if(empty($row)){
$wpdb->get_results( "ALTER TABLE {$table_name} ADD `job_id` bigint(20) NOT NULL" );
$wpdb->get_results( "ALTER TABLE {$table_name} ADD `rule_id` bigint(20) NOT NULL" );
$wpdb->get_results( "ALTER TABLE {$table_name} ADD `post_id` bigint(20) NOT NULL" );
$wpdb->get_results( "ALTER TABLE {$table_name} ADD `list_ids` text NOT NULL" );
$wpdb->get_results( "ALTER TABLE {$table_name} ADD `tokens` mediumtext NOT NULL" );
}
}
public static function alter_inbound_email_queue_alter_fields() {
global $wpdb;
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
$table_name = $wpdb->prefix . "inbound_email_queue";
$charset_collate = $wpdb->get_charset_collate();
$wpdb->get_results( "ALTER TABLE {$table_name} MODIFY COLUMN `tokens` MEDIUMTEXT " );
}
}