Compare commits

..

3 Commits
3.0.2 ... 3.0.3

Author SHA1 Message Date
4ad317ac7b Release MP3 3.0.3 2017-10-03 21:37:51 +03:00
7cccebbf2c Merge pull request #1135 from mailpoet/wp_sync_collations_fix
Get rid of WP user IDs updating query in favor of an insert-update due to collation problems [MAILPOET-1132]
2017-10-03 21:01:44 +03:00
e4f76ee9eb Get rid of WP user IDs updating query in favor of an insert-update due to collation problems [MAILPOET-1132] 2017-10-03 20:52:35 +03:00
3 changed files with 7 additions and 15 deletions

View File

@ -80,7 +80,6 @@ class WP {
static function synchronizeUsers() { static function synchronizeUsers() {
self::updateSubscriberWPUserIds();
self::updateSubscribersEmails(); self::updateSubscribersEmails();
self::insertSubscribers(); self::insertSubscribers();
self::removeFromTrash(); self::removeFromTrash();
@ -93,17 +92,6 @@ class WP {
return true; return true;
} }
private static function updateSubscriberWPUserIds() {
global $wpdb;
$subscribers_table = Subscriber::$_table;
Subscriber::raw_execute(sprintf('
UPDATE IGNORE %s mps
JOIN %s as wu ON mps.email = wu.user_email
SET mps.wp_user_id = wu.ID
WHERE mps.wp_user_id IS NULL
', $subscribers_table, $wpdb->users));
}
private static function updateSubscribersEmails() { private static function updateSubscribersEmails() {
global $wpdb; global $wpdb;
$subscribers_table = Subscriber::$_table; $subscribers_table = Subscriber::$_table;
@ -123,6 +111,7 @@ class WP {
SELECT wu.id, wu.user_email, "subscribed", CURRENT_TIMESTAMP() FROM %s wu SELECT wu.id, wu.user_email, "subscribed", CURRENT_TIMESTAMP() FROM %s wu
LEFT JOIN %s mps ON wu.id = mps.wp_user_id LEFT JOIN %s mps ON wu.id = mps.wp_user_id
WHERE mps.wp_user_id IS NULL WHERE mps.wp_user_id IS NULL
ON DUPLICATE KEY UPDATE wp_user_id = wu.id
', $subscribers_table, $wpdb->users, $subscribers_table)); ', $subscribers_table, $wpdb->users, $subscribers_table));
} }

View File

@ -4,7 +4,7 @@ if(!defined('ABSPATH')) exit;
/* /*
* Plugin Name: MailPoet 3 (new) * Plugin Name: MailPoet 3 (new)
* Version: 3.0.2 * Version: 3.0.3
* Plugin URI: http://www.mailpoet.com * Plugin URI: http://www.mailpoet.com
* Description: Create and send newsletters, post notifications and welcome emails from your WordPress. * Description: Create and send newsletters, post notifications and welcome emails from your WordPress.
* Author: MailPoet * Author: MailPoet
@ -20,7 +20,7 @@ if(!defined('ABSPATH')) exit;
*/ */
$mailpoet_plugin = array( $mailpoet_plugin = array(
'version' => '3.0.2', 'version' => '3.0.3',
'filename' => __FILE__, 'filename' => __FILE__,
'path' => dirname(__FILE__), 'path' => dirname(__FILE__),
'autoloader' => dirname(__FILE__) . '/vendor/autoload.php', 'autoloader' => dirname(__FILE__) . '/vendor/autoload.php',

View File

@ -4,7 +4,7 @@ Tags: newsletter, email, welcome email, post notification, autoresponder, signup
Requires at least: 4.6 Requires at least: 4.6
Tested up to: 4.8 Tested up to: 4.8
Requires PHP: 5.3 Requires PHP: 5.3
Stable tag: 3.0.2 Stable tag: 3.0.3
License: GPLv3 License: GPLv3
License URI: https://www.gnu.org/licenses/gpl-3.0.html License URI: https://www.gnu.org/licenses/gpl-3.0.html
@ -114,6 +114,9 @@ Stop by our [support site](https://www.mailpoet.com/support).
== Changelog == == Changelog ==
= 3.0.3 - 2017-10-03 =
* Fixed: mixed collation error in WordPress user synchronization. Thanks Chris, Till, Robin, Robero, @Seph, @kaiwen and others for the reports!
= 3.0.2 - 2017-10-03 = = 3.0.2 - 2017-10-03 =
* Improved: plugin capabilities can be managed with Members plugin; * Improved: plugin capabilities can be managed with Members plugin;
* Improved: removes unsightly horizontal scrollbar in some parts of the newsletter editor; * Improved: removes unsightly horizontal scrollbar in some parts of the newsletter editor;