Title: Found 2 coding bugs
Last modified: September 1, 2016

---

# Found 2 coding bugs

 *  Resolved [Benny](https://wordpress.org/support/users/bvl/)
 * (@bvl)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/found-2-coding-bugs/)
 * Hi,
 * I just wanted to let you know that there are 2 code errors in wp-reset.php
 * At several locations you refer to user_id but you never define that.
    Maybe add`
   $user_id = $user->ID;` (before the line with glbal $wpdb) to fix that.
 * Next you use $wpdb->prepare without actually providing any args:
    `$query = $
   wpdb->prepare( "UPDATE $wpdb->users SET user_pass = '".$user->user_pass."', user_activation_key
   = '' WHERE ID = '".$user_id."' ");` To fix that replace it with this: `$query
   = $wpdb->prepare( "UPDATE $wpdb->users SET user_pass = '".$user->user_pass."',
   user_activation_key = '' WHERE ID = %d'", $user_id );`
 * _Friendly advise, please always develop with WP\_DEBUG set to true, than you 
   would have caught those errors yourself._
 * Thank you for an otherwise handy tool!
 * [https://wordpress.org/plugins/wp-reset/](https://wordpress.org/plugins/wp-reset/)

The topic ‘Found 2 coding bugs’ is closed to new replies.

 * ![](https://ps.w.org/wp-reset/assets/icon-256x256.png?rev=1906468)
 * [WP Reset](https://wordpress.org/plugins/wp-reset/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-reset/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-reset/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-reset/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-reset/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-reset/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [Benny](https://wordpress.org/support/users/bvl/)
 * Last activity: [9 years, 9 months ago](https://wordpress.org/support/topic/found-2-coding-bugs/)
 * Status: resolved