Title: Fixed Plugin
Last modified: August 22, 2016

---

# Fixed Plugin

 *  [ryan360](https://wordpress.org/support/users/ryan360/)
 * (@ryan360)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/fixed-plugin/)
 * I used to use this plugin frequently to troubleshoot member issues on a large
   membership site built by [https://www.visualizedigital.com](https://www.visualizedigital.com)
 * This plugin does not work since they deprecated get_userdatabylogin. Here is 
   the revised source to make the plugin work again:
 *     ```
       <?php
       /*
       * Plugin Name: Skeleton Key
       * Plugin URI: http://github.com/sant0sk1/wp-skeleton-key
       * Description: Gives administrators a skeleton key (their own password) to login as any user they'd like.
       * Author: Jerod Santo
       * Author URI: http://jerodsanto.net
       * Version: 1.1.1
       * */
   
       // HOOK ME UP
       add_filter('authenticate', 'authenticate_with_skeleton_key', 10, 3);
   
       function authenticate_with_skeleton_key($user, $username, $password) {
         if (is_a($user, 'WP_User')) { return $user; }
   
         if (!empty($username) && !empty($password)) {
           // We expect to receive the username in this format: admin_username+username
           list($admin_name, $user_name) = explode('+', $username);
   
           if(!empty($admin_name) && !empty($user_name) && $admin_name != $user_name){
             $userdata  = get_user_by('login',$user_name);
             $admindata = get_user_by('login',$admin_name);
   
             $admin = new WP_User($admindata->ID);
   
             if( $admin->has_cap('level_10') && $userdata ){ // Make sure the first username was an admin
               if (wp_check_password($password, $admindata->user_pass, $admindata->ID)) {
                 return new WP_User($userdata->ID); // Return the second username as the logged in user.
               }
             }
           }
         }
         return new WP_Error;
       }
       ?>
       ```
   
 * [https://wordpress.org/plugins/skeleton-key/](https://wordpress.org/plugins/skeleton-key/)

The topic ‘Fixed Plugin’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/skeleton-key.svg)
 * [Skeleton Key](https://wordpress.org/plugins/skeleton-key/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/skeleton-key/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/skeleton-key/)
 * [Active Topics](https://wordpress.org/support/plugin/skeleton-key/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/skeleton-key/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/skeleton-key/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [ryan360](https://wordpress.org/support/users/ryan360/)
 * Last activity: [11 years, 6 months ago](https://wordpress.org/support/topic/fixed-plugin/)
 * Status: not resolved