WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: Register Plus] Can't update Website in user profile (18 posts)

  1. StrangeAttractor
    Member
    Posted 5 years ago #

    I seem to have found a strange problem with the Register Plus plugin...

    If (and only if) you have included the Website field in your registration form, and the user fills it in during registration, this field cannot be changed when editing that user's profile.

    For example, if the user filled in their registration form with the website "http://www.google.com", and you (or the logged in user) attempt to edit the profile to change the url to "http://www.yahoo.com", and save the profile, it will not change the field, but retain the original information. This does not happen (insofar as I can tell) with any other field on the profile -- all other fields can be updated.

    It only happens if you allow users to fill in the Website (this is stored as "user_url" in the database) during registration. In other words, if you do not include the "website" field in the registration form, you can freely update the website without problems.

    I have two questions here:

    1) can anyone else verify that this happens to them with Register Plus

    2) Any idea what might be the problem here? It's an issue because it means that neither users nor administrators can change the user_url in the Website field once it has initially been entered in the Registration form. (And again, I emphasize that there is no problem if the Website field wasn't included in the registration form).

    I am using WordPress 2.6.5 -- tried this on a totally clean Kubrick installation with no other plugins installed or active. Using Firefox 3.x as my browser.

    http://wordpress.org/extend/plugins/register-plus/

  2. StrangeAttractor
    Member
    Posted 5 years ago #

    Well, I've narrowed it down to the fact that Register Plus puts the user_url in the wp_usermeta table, instead of the wp_user table, where it should be stored.

    But I don't know how to make update the wp_user table instead. I've been fooling around with this for about 30 hours now. (No real PHP background -- what I know just comes from hacking wordpress files.)

    Any help? Anyone? It's cold out here, and there are wolves...

  3. khandu
    Member
    Posted 5 years ago #

  4. StrangeAttractor
    Member
    Posted 5 years ago #

    Well, I'm glad to see someone else has noticed this bug, too.

    See my thread here:

    http://wordpress.org/support/topic/247593

    I think that using wp_update_user in the code for storing the website instead of update_usermeta might work, but I haven't tried it yet.

    I'll let you know how it works out, unless someone beats me to it (please, someone, beat me to it).

  5. StrangeAttractor
    Member
    Posted 5 years ago #

    Ok, this seems to work (use at your own risk, but I think it's fine...).

    open register-plus.php

    around line 1756 you should find this:

    if( $regplus['website'] && $_POST['website'] )
    		update_usermeta( $user_id, 'user_url', $wpdb->prepare($_POST['website']));

    change that to this:

    if( $regplus['website'] && $_POST['website'] )
    $new_website = $wpdb->prepare($_POST['website']);
     $credentials=(array ( 'ID'=>$user_id,'user_url'=>$new_website ) );
    wp_update_user ($credentials);

    I've tested it a few times and it correctly writes the user_url (website) to the wp_user table. If you edit the user profile, you'll find the website correctly in the field, AND it can now be updated, because it is being stored in the correct table....

  6. khandu
    Member
    Posted 5 years ago #

    Works for me as an administrator editing my own account..

    tried to edit a users account (editor level) .. did not work..

  7. StrangeAttractor
    Member
    Posted 5 years ago #

    Was it with a user account that was already created before you made the edit on the plugin? Because if so, it already put the website in the wrong table.

    Try registering a new user and see if it works.

    I'll test it out too and let you know...

  8. ogopogo
    Member
    Posted 5 years ago #

    I've been scratching my head on this problem for a few days now as well. Haven't applied the suggested fix yet. Any ideas on a quick way to import already existing users' website fields from the wp_usermeta table into the wp_user table without re-registering all of the existing users?

  9. StrangeAttractor
    Member
    Posted 5 years ago #

    There may be another fix involved, too -- discovered my fix doesn't work when you try to put in a new user from the Author and Users panel...

    I think I know how to fix it, but haven't tested yet... more soon...

    Any ideas on a quick way to import already existing users' website fields from the wp_usermeta table into the wp_user table without re-registering all of the existing users?

    Yes, I would like to know that, too. Is there a way to do it easily from myPHPadmin?

  10. khandu
    Member
    Posted 5 years ago #

    i have also emailed the author of the plugin to help.. but no response..

    maybe more pressure from u guys can help

    http://skullbit.com/wordpress-plugin/register-plus/ email him via contact link..

  11. StrangeAttractor
    Member
    Posted 5 years ago #

    Ok, I think I've got it now. I made a small mistake in the code I posted above (missing curly brackets for the IF statement) and that's why it wasn't working right.

    It's basically the same fix -- Khandu, I would really appreciate it if you tried this out and let me know if it works for you. I've tried it under various conditions (logging in as user, as admin, etc.) and it seems to work fine, and works for creating new users under Author and Users Panel.

    SO...

    open register-plus.php

    around line 1756 change this:

    if( $regplus['website'] && $_POST['website'] )
    		update_usermeta( $user_id, 'user_url', $wpdb->prepare($_POST['website']));

    to this:

    if( $regplus['website'] && $_POST['website'] )	{
    	$credentials = array('ID'=>$user_id,'user_url'=>$wpdb->prepare($_POST['website'])));
    	wp_update_user ($credentials);
    		}

    Please let me know if it works for you.

  12. khandu
    Member
    Posted 5 years ago #

    if( $regplus['website'] && $_POST['website'] ) {
    $credentials = array('ID'=>$user_id,'user_url'=>$wpdb->prepare($_POST['website'])));
    wp_update_user ($credentials);
    }

    It had a extra ) .. removed that

    still does not work.. did not update for a editor level user..

    just want to tell u this user was already created before applying the above fix.. i have not created a new user

  13. StrangeAttractor
    Member
    Posted 5 years ago #

    still does not work.. did not update for a editor level user..

    just want to tell u this user was already created before applying the above fix.. i have not created a new user

    It will only work for new users, because for users entered before the fix, the user_url is already in the usermeta table instead of the users table.

    So you can either delete and re-register the old user's account once you've made the fix, or you can manually go into your MySQL database and delete the user_url row for that user in the usersmeta table and put the data (the website url) in the user_url slot for that user in the users table.

    If it's only one user you have to change it's not a big deal.

    But what I really wanted to know is if it works for you for NEWLY registered users....

  14. Jeremy Boggs
    Member
    Posted 4 years ago #

    This may not be the ideal solution, and I don't think it solves the bug, but it is a workaround that does save the website field for user profiles in the admin panel, for existing users. Not sure if this works for new users.

    In register-plus.php, at line 1639, I added the following:

    if($_POST['url']) { update_usermeta($user_ID, 'user_url', $_POST['url']); }

    This should be added inside the SaveProfile() function, right before its closing "}".

    All this is doing is taking the value of form field with a name value of 'url', and updating the usermeta table with the POST from that field.

  15. kazaashi
    Member
    Posted 4 years ago #

    *deleted*

  16. triplemoons
    Member
    Posted 4 years ago #

    Anyone get this working properly? I have over 160 users, so manually changing the URLs is not an option. Has the creator abandoned the plugin?

  17. triplemoons
    Member
    Posted 4 years ago #

    Since it's apparent the developer has abandoned the plugin...

    What are the repercussions of removing this plugin? Is their another option to have email verification for users?

  18. Jeremy Boggs
    Member
    Posted 4 years ago #

    triplemoons: I posted a solution a while back on this thread. Still works for me, but after digging more into the plugin I still don't know why this one field doesn't save. All the other default user fields seem to without a problem.

Topic Closed

This topic has been closed to new replies.

About this Topic