Changeset 1821515
- Timestamp:
- 02/13/2018 05:21:16 PM (8 years ago)
- Location:
- order-emails-log-for-woocommerce/trunk
- Files:
-
- 2 edited
-
email-log.php (modified) (1 diff)
-
order-emails-log-for-woocommerce.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
order-emails-log-for-woocommerce/trunk/email-log.php
r1604485 r1821515 9 9 private $order_id; 10 10 11 static function installDatabaseTables() {12 13 global $wpdb;14 15 require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );16 17 $charset_collate = $wpdb->get_charset_collate();18 19 $tableName = self::table_name();20 21 $wpdb->query("CREATE TABLE IF NOT EXISTS `$tableName` (22 `id` INT NOT NULL AUTO_INCREMENT,23 `order_id` INT NOT NULL,24 `timestamp` DATETIME NOT NULL,25 `host` VARCHAR(200) NULL ,26 `receiver` VARCHAR(200) NOT NULL DEFAULT '0',27 `subject` VARCHAR(400) NOT NULL DEFAULT '0',28 `message` TEXT NULL,29 `headers` TEXT NULL,30 `attachments` VARCHAR(800) NULL ,31 `meta1` TEXT NULL,32 `meta2` TEXT NULL,33 PRIMARY KEY (`id`)34 ) {$charset_collate};");35 36 }37 38 11 static function unInstallDatabaseTables() { 39 12 global $wpdb; -
order-emails-log-for-woocommerce/trunk/order-emails-log-for-woocommerce.php
r1604485 r1821515 4 4 * Plugin URI: 5 5 * Description: Logs sent emails related to orders, and displays them in a table on the order screen. 6 * Version: 1. 16 * Version: 1.2 7 7 * Author: RaiserWeb 8 8 * Author URI: http://www.raiserweb.com … … 32 32 } 33 33 34 34 include( 'email-log.php' ); 35 35 36 add_action( 'plugins_loaded', 'WOEL_plugin_init', 0 ); 36 37 function WOEL_plugin_init(){ … … 49 50 } 50 51 51 52 52 // include plugin files 53 include( 'email-log.php' ); 54 include( 'settings.php' ); 55 56 // install table on activation 57 register_activation_hook( __FILE__, array( 'WOEL_Email_Log', 'installDatabaseTables' ) ); 58 59 53 include( 'settings.php' ); 54 60 55 // init the email log filter and actions 61 56 $WOEL_Email_Log = new WOEL_Email_Log; 62 57 $WOEL_Email_Log->addFilterActions(); 63 64 65 58 66 59 // Add Meta container admin shop_order pages 67 60 add_action( 'add_meta_boxes', 'WOEL_add_meta_box_edit_order_page' ); … … 80 73 return $methods; 81 74 } 82 add_filter('woocommerce_integrations', 'add_WOEL_settings_integration' ); 83 84 85 75 add_filter('woocommerce_integrations', 'add_WOEL_settings_integration' ); 86 76 87 77 } … … 89 79 } 90 80 81 82 // plugin activation 83 function WOEL_installDatabaseTables() { 84 85 global $wpdb; 86 87 require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); 88 89 $charset_collate = $wpdb->get_charset_collate(); 90 91 $tableName = WOEL_Email_Log::table_name(); 92 93 $wpdb->query("CREATE TABLE IF NOT EXISTS `$tableName` ( 94 `id` INT NOT NULL AUTO_INCREMENT, 95 `order_id` INT NOT NULL, 96 `timestamp` DATETIME NOT NULL, 97 `host` VARCHAR(200) NULL , 98 `receiver` VARCHAR(200) NOT NULL DEFAULT '0', 99 `subject` VARCHAR(400) NOT NULL DEFAULT '0', 100 `message` TEXT NULL, 101 `headers` TEXT NULL, 102 `attachments` VARCHAR(800) NULL , 103 `meta1` TEXT NULL, 104 `meta2` TEXT NULL, 105 PRIMARY KEY (`id`) 106 ) {$charset_collate};"); 107 108 } 109 register_activation_hook( __FILE__, 'WOEL_installDatabaseTables' );
Note: See TracChangeset
for help on using the changeset viewer.