diff --git a/README.md b/README.md index 301df07..dfdfc01 100755 --- a/README.md +++ b/README.md @@ -58,6 +58,9 @@ This plugin detects HTML by checking the headers sent by other WordPress plugins [Can I use the Postmark for WordPress plugin with Divi contact forms?](https://postmarkapp.com/support/article/1128-can-i-use-the-postmark-for-wordpress-plugin-with-divi-contact-forms) ## Changelog +### v1.12.4 +* Fixes potential collation mismatch errors from date comparisons during old sending logs deletion. + ### v1.12.3 * Uses count() for check of logs query result count. diff --git a/postmark.php b/postmark.php index 0de9645..43b0d87 100644 --- a/postmark.php +++ b/postmark.php @@ -3,7 +3,7 @@ * Plugin Name: Postmark (Official) * Plugin URI: https://postmarkapp.com/ * Description: Overrides wp_mail to send emails through Postmark - * Version: 1.12.3 + * Version: 1.12.4 * Author: Andrew Yates & Matt Gibbs */ @@ -31,7 +31,7 @@ class Postmark_Mail { */ public function __construct() { if ( ! defined( 'POSTMARK_VERSION' ) ) { - define( 'POSTMARK_VERSION', '1.12.3' ); + define( 'POSTMARK_VERSION', '1.12.4' ); } if ( ! defined( 'POSTMARK_DIR' ) ) { @@ -374,7 +374,7 @@ function pm_clear_old_logs() { $wpdb->prepare( "SELECT COUNT(*) FROM $table_name - WHERE %s < DATE_SUB(NOW(), INTERVAL %d DAY) + WHERE BINARY(%s) < BINARY(DATE_SUB(NOW(), INTERVAL %d DAY)) LIMIT 500", 'log_entry_date', 7 @@ -387,7 +387,7 @@ function pm_clear_old_logs() { $wpdb->query( $wpdb->prepare( "DELETE FROM $table_name - WHERE %s < DATE_SUB(NOW(), INTERVAL %d DAY) + WHERE BINARY(%s) < BINARY(DATE_SUB(NOW(), INTERVAL %d DAY)) LIMIT %d", 'log_entry_date', 7, diff --git a/readme.txt b/readme.txt index c9ea9b5..48edd0c 100644 --- a/readme.txt +++ b/readme.txt @@ -90,13 +90,16 @@ And save the changes to the file. 1. Postmark WP Plugin Settings screen. == Changelog == -= v 1.12.3 = += v1.12.4 = +* Fixes potential collation mismatch errors from date comparisons during old sending logs deletion. + += v1.12.3 = * Uses count() for check of logs query result count. -= v 1.12.2 = += v1.12.2 = * Corrects SQL for deletion of log entries older than 7 days. -= v 1.12.1 = += v1.12.1 = * Checks if stream_name is set in settings before determining which stream to use. = v1.12 =