/** * The LogRotation supports the limitation of stored mails by date. * @since 1.6.0. */ static function limitNumberOfMailsByTime() { global $wpml_settings, $wpdb; $tableName = WPML_Plugin::getTablename('mails'); if ($wpml_settings['log-rotation-delete-time'] == '1') { $days = $wpml_settings['log-rotation-delete-time-days']; if ($days > 0) { $wpdb->query("DELETE FROM `{$tableName}` WHERE DATEDIFF( NOW(), `timestamp`) >= {$days}"); } } }
function test_charset_email() { global $wpdb; $tableName = WPML_Plugin::getTablename('mails'); $to = array('*****@*****.**', '*****@*****.**'); $subject = rand_str(); $message = "Řekl, že přijde, jestliže v konkurzu zvítězí"; wp_mail($to, $subject, $message); $rows = $wpdb->get_results("SELECT * FROM {$tableName}"); $row = $rows[0]; $this->assertTrue(strpos($row->message, "?") === false); }
/** * See: http://plugin.michael-simpson.com/?page_id=101 * Drop plugin-created tables on uninstall. * @return void */ protected function unInstallDatabaseTables() { global $wpdb; $tableName = WPML_Plugin::getTablename('mails'); $wpdb->query("DROP TABLE IF EXISTS `{$tableName}`"); }