WordPress.org

Ready to get started?Download WordPress

Forums

Email Users
Conflict with another plugin (9 posts)

  1. Andy Fragen
    Member
    Posted 1 year ago #

    I've stumbled across an interesting conflict with the 're-send-welcome-email' plugin. If I use this plugin to resend the welcome email and reset the user's password, it seems to change the user meta for your plugin from 'true' to 'false'.

    I'm not sure why this seems to happen and I know it's more an issue with the other plugin but other custom user meta that I have set doesn't seem to change. Curious.

    http://wordpress.org/extend/plugins/email-users/

  2. Mike Walsh
    Member
    Plugin Author

    Posted 1 year ago #

    I finally had a chance to look at the re-send-welcome-email plugin and I cannot see how it would have a conflict with Email-Users. It doesn't do anything except update the user's password and send a notification. This is the crux of that plugin:

    $uid = $_POST['user'];
    
    	// Generate a password
    	$password = substr(md5(uniqid(microtime())), 0, 7);
    	$user_info = get_userdata($uid);
    
    	wp_update_user(array('ID' => $uid, 'user_pass' => $password));
    
    	// Send welcome email (there might be a better function for this, I didn't check)
    	wp_new_user_notification($uid, $password);
    
    	$message = sprintf(__('E-mail sent for user %s.', 'resend_welcome_email'), $user_info->user_login);
    	printf('<div id="message" class="updated fade"><p>%s</p></div>', $message);

    What version of WordPress and what version of Email-Users are you seeing this behavior with?

  3. Andy Fragen
    Member
    Posted 1 year ago #

    I'm using WP 3.5 and Email-Users 4.3.21. I agree. I can't really see how this plugin is able to reset these data but it does do it. It's reproducible here. I have Email Users set to get notifications for posts and mass emails on with the user not able to change these.

    If I resend a welcome email. The other plugin seems to correctly resend a new email both to me as admin and the user with a new password. As admin, I look at the users info and both notification settings in Email Users are now set to false.

  4. Mike Walsh
    Member
    Plugin Author

    Posted 1 year ago #

    I think I finally figured out why this happens. It appears that the wp_update_user() function causes the profile_update filter to fire. When it fires, it calls an initialization function within Email Users which then resets the settings to their default values.

    I have changed the initialization code to be a little smarter and recognize when a user already has values set and not overwrite them. This fix should appear in 4.3.22.

  5. Andy Fragen
    Member
    Posted 1 year ago #

    Excellent, tricky little bug.

  6. Mike Walsh
    Member
    Plugin Author

    Posted 1 year ago #

    I have posted a beta release that has this problem fixed. Please check it out and let me know if you have any problems.

  7. Andy Fragen
    Member
    Posted 1 year ago #

    Sorry Mike but this still doesn't seem to be fixed.

  8. Mike Walsh
    Member
    Plugin Author

    Posted 1 year ago #

    Ugh. Now I am more confused than ever.

  9. Andy Fragen
    Member
    Posted 1 year ago #

    Unless some epiphany comes along, cause I don't get it either, it's probably easiest to put it in the documentation as a known issue. It really doesn't come up often and since I can reset in bulk in Email Users it's not such a big deal.

    It would seem to me that the two plugins shouldn't cause anything in each other to fire unless there's a namespace issue. The only thing I can think of is maybe try renaming those meta values. Interestingly nothing else in the user's profile seems to be reset.

    If you want to see this in action from my end I can set it up on my dev install, make sure it's doing its thing and send along some admin credentials.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.