• I have already set an autologin link for my account.

    Now if I go and visit my admin profile page, make a change anywhere, click submit, I get the following error:
    Failed to update autologin link.

    The only way to remove the error is to delete my autologin link and create a new one. then I can save my profile.

    I definitely don’t want to have to do that everytime because I am using that saved link in another plugin, so having to change it becomes a pita.

    *Also reading the code, I see lots of references to incomplete security fixes. Do you plan on finishing these functions?

    http://wordpress.org/extend/plugins/autologin-links/

Viewing 1 replies (of 1 total)
  • we noticed that too; delete + new is a working work-around, we fixed it more dummy-proof by adding this line;
    delete_user_meta($user_id, PKG_AUTOLOGIN_USER_META_KEY);
    around line 269

    if ($cleanedKey) {
              if (!add_user_meta($user_id, PKG_AUTOLOGIN_USER_META_KEY, $cleanedKey, True)) {
                delete_user_meta($user_id, PKG_AUTOLOGIN_USER_META_KEY);
                if (!update_user_meta($user_id, PKG_AUTOLOGIN_USER_META_KEY, $cleanedKey)) {
                  wp_die(__('Failed to update autologin link.', PKG_AUTOLOGIN_LANGUAGE_DOMAIN));
                }
              }
            } else {

    @developer:
    the problem is that update_user_meta reports FALSE when updating fails and WordPress considers trying to set the SAME value as a FAILED update.

    3 possible solutions;
    1. do not call update_user_meta if data hasn’t changed
    2. pro-actively remove any existing code (like we did)
    3. ask WordPress to not return FALSE in case of “Tried to update with same value” which in fact should not be FAILURE.

    Good luck!

Viewing 1 replies (of 1 total)
  • The topic ‘Failed to update autologin link.’ is closed to new replies.