Plugin Directory

Changeset 3048298

Timestamp:
03/09/2024 04:09:47 PM (5 months ago)
Author:
sajjad67
Message:

Fixed Plugin settings XSS vulnerability.

Location:
wp-edit-username
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • wp-edit-username/tags/1.0.5/admin/ajax-handler.php

    r3047088 r3048298  
    55function wpeu_update_user_name()
    66{
    7     // ---------------------------------------------------------
    8     // Check if current_user_can() functions exists in this scope
    9     // ---------------------------------------------------------
    10     if( ! function_exists( 'wp_get_current_user' ) )
    11     {
    12         include( ABSPATH . "wp-includes/pluggable.php" );
    13     }
     7    if( ! current_user_can( 'edit_users' ) ) die();
    148
    15     if( ! current_user_can( 'edit_users' ) )
    16     {
    17         return;
    18     }
     9    if ( isset( $_POST['wp_edit_username_nonce'] ) && wp_verify_nonce( $_POST['wp_edit_username_nonce'], 'wp_edit_username_action' ) )
     10    {
     11        $new_username       = sanitize_user( $_POST['new_username'] );
     12       
     13        $current_username   = sanitize_user( $_POST['current_username'] );
    1914
    20     $_POST = array_map( 'trim', array_map( 'strip_tags', $_POST ) );
     15);
    2116
    22     extract( $_POST );
     17);
    2318
    24     $response = array();
     19        // ---------------------------------------------------------
     20        // check if new_username is empty
     21        // ---------------------------------------------------------
     22        if( empty( $new_username ) || empty( $current_username ) )
     23        {
     24            $response['alert_message'] = __( 'Username Can Not be Empty!', 'wp-edit-username' );
     25           
     26            wp_send_json( $response ); die();
     27        }
    2528
    26     // ---------------------------------------------------------
    27     // check if new_username is empty
    28     // ---------------------------------------------------------
    29     if( empty( $new_username ) || empty( $current_username ) )
    30     {
    31         $response['alert_message'] = __( 'Username Can Not be Empty!' );
    32        
    33         wp_send_json( $response ); die();
    34     }
     29// ---------------------------------------------------------
     30        // Check if username consists invalid illegal character
     31// ---------------------------------------------------------
     32_username ) )
     33{
     34' );
     35           
     36wp_send_json( $response ); die();
     37}
    3538
    36     // ---------------------------------------------------------
    37     // Check if username consists invalid illegal character
    38     // ---------------------------------------------------------
    39     if( ! validate_username( $new_username ) )
    40     {
    41         $response['alert_message'] = __( 'Username can not have illegal characters' );
    42        
    43         wp_send_json( $response ); die();
    44     }
     39        // ---------------------------------------------------------
     40        // Filters the list of blacklisted usernames.
     41        //
     42        // @https://developer.wordpress.org/reference/hooks/illegal_user_logins/
     43        // ---------------------------------------------------------
     44        $illegal_user_logins = array_map( 'strtolower', (array) apply_filters( 'illegal_user_logins', array() ) );
    4545
    46     // ---------------------------------------------------------
    47     // Filters the list of blacklisted usernames.
    48     //
    49     // @https://developer.wordpress.org/reference/hooks/illegal_user_logins/
    50     // ---------------------------------------------------------
    51     $illegal_user_logins = array_map( 'strtolower', (array) apply_filters( 'illegal_user_logins', array() ) );
     46        if ( in_array( $new_username, $illegal_user_logins ) )
     47        {
     48            $response['alert_message'] =  __( 'Sorry, that username is not allowed.', 'wp-edit-username' );
     49           
     50            wp_send_json( $response ); die();
     51        }
    5252
    53     if ( in_array( $new_username, $illegal_user_logins ) )
    54     {
    55         $response['alert_message'] =  __( 'Sorry, that username is not allowed.' );
    56        
    57         wp_send_json( $response ); die();
    58     }
     53        // ---------------------------------------------------------
     54        // If $new_username already registered
     55        // ---------------------------------------------------------
     56        if( username_exists( $new_username ) )
     57        {
     58            $response['alert_message'] =  __( 'Sorry, that username already exists and not available.', 'wp-edit-username' );
     59           
     60            wp_send_json( $response ); die();
     61        }
    5962
    60     // ---------------------------------------------------------
    61     // If $new_username already registered
    62     // ---------------------------------------------------------
    63     if( username_exists( $new_username ) )
    64     {
    65         $response['alert_message'] =  __( 'Sorry, that username already exists and not available.' );
    66        
    67         wp_send_json( $response ); die();
    68     }
     63        global $wpdb;
    6964
    70     global $wpdb;
     65        // ---------------------------------------------------------
     66        // Change / Update Username With old one
     67        // ---------------------------------------------------------
     68        $query  = $wpdb->prepare( "UPDATE $wpdb->users SET user_login = %s WHERE user_login = %s", $new_username, $current_username );
     69       
     70        $result = $wpdb->query( $query );
    7171
    72     // ---------------------------------------------------------
    73     // Change / Update Username With old one
    74     // ---------------------------------------------------------
    75     $query  = $wpdb->prepare( "UPDATE $wpdb->users SET user_login = %s WHERE user_login = %s", $new_username, $current_username );
    76    
    77     $result = $wpdb->query( $query );
     72        $options = get_option( 'wpeu_register_settings_fields' );
    7873
    79     if ( $result > 0 )
    80     {
    81         $response['success_message'] =  sprintf( 'Username Updated from <code>%s</code> to <code>%s</code>.', $current_username, $new_username );
     74if ( $result > 0 )
     75{
     76$response['success_message'] =  sprintf( 'Username Updated from <code>%s</code> to <code>%s</code>.', $current_username, $new_username );
    8277
    83         $options = get_option( 'wpeu_register_settings_fields' );
     78            if ( isset( $options['wpeu_send_email_field'] ) && $options['wpeu_send_email_field'] == 'on' )
     79            {
     80                $user_email = $wpdb->get_var( $wpdb->prepare( "SELECT user_email FROM $wpdb->users WHERE user_login = %s", $new_username ) );
    8481
    85         if ( $options['wpeu_send_email_field'] == 'on' )
    86         {
    87             $user_email = $wpdb->get_var( $wpdb->prepare( "SELECT user_email FROM $wpdb->users WHERE user_login = %s", $new_username ) );
     82                if ( isset( $options['wpeu_email_receiver_field'] ) )
     83                {                       
     84                    if ( $options['wpeu_email_receiver_field'] == 'user_only' )
     85                    {   
     86                        $to         = array( sanitize_email( $user_email ) );
     87                    }
     88                    elseif ( $options['wpeu_email_receiver_field'] == 'admin_only' )
     89                    {   
     90                        $to         = array();
     91                       
     92                        $admins     = get_users( 'role=Administrator' );
     93                       
     94                        foreach ( $admins as $admin )
     95                        {
     96                            $to[]   = sanitize_email( $admin->user_email );
     97                        }
     98                    }
     99                    elseif ( $options['wpeu_email_receiver_field'] == 'admin_user' )
     100                    {
     101                        $to         = array( sanitize_email( $user_email ) );
     102                       
     103                        $admins     = get_users( 'role=Administrator' );
     104                       
     105                        foreach ( $admins as $admin )
     106                        {
     107                            $to[]   = sanitize_email( $admin->user_email );
     108                        }
     109                    }
     110                }
    88111
    89             if ( $options['wpeu_email_receiver_field'] == 'user_only' )
    90             {   
    91                 $to = array( $user_email );
    92             }
    93             elseif ( $options['wpeu_email_receiver_field'] == 'admin_only' )
    94             {   
    95                 $to = array();
    96                
    97                 $admins = get_users( 'role=Administrator' );
    98                
    99                 foreach ( $admins as $admin )
    100                 {
    101                     $to[] = $admin->user_email;
    102                 }
    103             }
    104             elseif ( $options['wpeu_email_receiver_field'] == 'admin_user' )
    105             {
    106                 $to = array( $user_email );
    107                
    108                 $admins = get_users( 'role=Administrator' );
    109                
    110                 foreach ( $admins as $admin )
    111                 {
    112                     $to[] = $admin->user_email;
    113                 }
    114             }
     112                $subject = apply_filters( 'wp_username_changed_email_subject', $subject = $options['wpeu_email_subject_field'], $old_username, $new_username );
    115113
    116             $subject = apply_filters( "wp_username_changed_email_subject", $subject = $options['wpeu_email_subject_field'], $old_username, $new_username );
     114_field'], $old_username, $new_username );
    117115
    118             $body    = apply_filters( "wp_username_changed_email_body", $body = $options['wpeu_email_body_field'], $old_username, $new_username );
     116                $user    = get_user_by( 'login', $new_username );
     117       
     118                if( $user )
     119                {
     120                    $body = str_replace( [ '{{first_name}}', '{{last_name}}', '{{display_name}}', '{{full_name}}', '{{old_username}}', '{{new_username}}' ], [ $user->first_name, $user->last_name, $user->display_name, $user->first_name . ' ' . $user->last_name, $current_username, $new_username ], $body );
     121                }
    119122
    120             $user    = get_user_by( 'login', $new_username );
    121    
    122             if( $user )
    123             {
    124                 $body = str_replace( [ '{{first_name}}', '{{last_name}}', '{{display_name}}', '{{full_name}}', '{{old_username}}', '{{new_username}}' ], [ $user->first_name, $user->last_name, $user->display_name, $user->first_name .' '. $user->last_name, $current_username, $new_username ], $body );
    125             }
     123                $headers = array( 'Content-Type: text/html; charset=UTF-8' );
    126124
    127             $headers = array( 'Content-Type: text/html; charset=UTF-8' );
     125                foreach ( $to as $email )
     126                {
     127                    wp_mail( $email, $subject, $body, $headers );
     128                }
     129            }
     130        }
    128131
    129             foreach ( $to as $email )
    130             {
    131                 wp_mail( $email, $subject, $body, $headers );
    132             }
    133         }
    134     }
     132        // ---------------------------------------------------------
     133        // Change / Update nicename if == username
     134        // ---------------------------------------------------------
     135        $query = $wpdb->prepare( "UPDATE $wpdb->users SET user_nicename = %s WHERE user_login = %s AND user_nicename = %s", $new_username, $new_username, $current_username );
     136       
     137        $wpdb->query( $query );
    135138
    136     // ---------------------------------------------------------
    137     // Change / Update nicename if == username
    138     // ---------------------------------------------------------
    139     $query = $wpdb->prepare( "UPDATE $wpdb->users SET user_nicename = %s WHERE user_login = %s AND user_nicename = %s", $new_username, $new_username, $current_username );
    140    
    141     $wpdb->query( $query );
     139// ---------------------------------------------------------
     140name if == username
     141// ---------------------------------------------------------
     142name = %s", $new_username, $new_username, $current_username );
     143       
     144$wpdb->query( $query );
    142145
    143     // ---------------------------------------------------------
    144     // Change / Update display name if == username
    145     // ---------------------------------------------------------
    146     $query  = $wpdb->prepare( "UPDATE $wpdb->users SET display_name = %s WHERE user_login = %s AND display_name = %s", $new_username, $new_username, $current_username );
    147    
    148     $wpdb->query( $query );
     146        // ---------------------------------------------------------
     147        // Update Username on Multisite
     148        // ---------------------------------------------------------
     149        if( is_multisite() )
     150        {
     151            $super_admins = (array) get_site_option( 'site_admins', array( 'admin' ) );
     152           
     153            $array_key = array_search( $current_username, $super_admins );
    149154
    150     // ---------------------------------------------------------
    151     // Update Username on Multisite
    152     // ---------------------------------------------------------
    153     if( is_multisite() )
    154     {
    155         $super_admins = (array) get_site_option( 'site_admins', array( 'admin' ) );
    156        
    157         $array_key = array_search( $current_username, $super_admins );
     155            if( $array_key )
     156            {
     157                $super_admins[ $array_key ] = $new_username;
     158            }
     159           
     160            update_site_option( 'site_admins' , $super_admins );
     161        }
     162    }
     163    else
     164    {
     165        $response['alert_message'] =  __( 'Nonce verification failed.', 'wp-edit-username' );
     166    }
    158167
    159         if( $array_key )
    160         {
    161             $super_admins[ $array_key ] = $new_username;
    162         }
    163        
    164         update_site_option( 'site_admins' , $super_admins );
    165     }
    166 
    167     wp_send_json( $response ); die();
     168    wp_send_json( $response ); die();
    168169}
  • wp-edit-username/tags/1.0.5/admin/js/script.js

    r2976213 r3048298  
    88
    99    var $wpeu_new_username = $( "#wpeu_new_username" );
     10
     11
    1012   
    1113    var $wpeu_message = $( "#wpeu_message" );
     
    2022       
    2123        $update_user_name_tigger.removeAttr( 'disabled' );
    22     } );
     24    });
    2325
    2426    $( "#cancel_button" ).click( function( event )
     
    2729       
    2830        $wpeu_message.empty().hide();
    29     } );
     31    });
    3032
    3133    $wpeu_new_username.keyup( function( event )
     
    3941            $update_user_name_tigger.removeAttr( 'disabled' );
    4042        }
    41     } );
     43    });
    4244
    4345    $( document ).on( 'click', "#update_user_name_tigger", function( e )
     
    5052        {   
    5153            action : 'wpeu_update_user_name',
     54
     55
    5256           
    5357            current_username : $input.val(),
     
    7680                $wpeu_message.addClass( 'alert-success' ).html( msg.success_message ).show();
    7781            }
    78         } );
    79     } );
    80 } );
     82        });
     83    });
     84});
  • wp-edit-username/tags/1.0.5/admin/modal.php

    r2976213 r3048298  
    2020                            </div>
    2121                            <input type="text" class="form-control" id="wpeu_new_username" placeholder="<?php echo __( 'New Username' ); ?>" aria-label="Username" aria-describedby="basic-addon1">
     22
     23
    2224                        </div>
    2325                    </div>
  • wp-edit-username/tags/1.0.5/includes/settings.php

    r2976213 r3048298  
    1919
    2020    <div class="wrap">
    21         <h2 style="background-image: <?php echo $icon; ?>;background-repeat:  no-repeat;background-position: left 12px;background-size: 25px;padding-left: 30px;">
    22             Edit Username Settings
     21    <h2 style="background-image: <?php echo $icon; ?>;background-repeat:  no-repeat;background-position: left 12px;background-size: 25px;padding-left: 30px;">
     22        Edit Username Settings
    2323        </h2>
    24         <form action="options.php" method="post"><?php
     24    <form action="options.php" method="post"><?php
    2525           
    2626            settings_fields( 'wpeu_settings_group' );
     
    2828            do_settings_sections( 'wpeu_settings_section' );
    2929
    30             submit_button( 'Save Changes' ); ?>
     30            submit_button(); ?>
    3131
    32         </form>
     32    </form>
    3333    </div>
    3434 <?php }
     
    4242    add_settings_section(
    4343        'wpeu_main_settings_section',
    44         'Notifications Settings',
     44        ' Settings',
    4545        'wpeu_main_settings_description',
    4646        'wpeu_settings_section'
     
    5050    add_settings_field(
    5151        'wpeu_send_email_field_setting',
    52         'Send Email',
     52        'Send Email',
    5353        'wpeu_send_email_field_setting',
    5454        'wpeu_settings_section',
     
    5959    add_settings_field(
    6060        'wpeu_email_receiver_field',
    61         'Send Emails To',
     61        'Send Emails To',
    6262        'wpeu_email_receiver_field_setting',
    6363        'wpeu_settings_section',
     
    6868    add_settings_field(
    6969        'wpeu_email_subject_field',
    70         'Email Subject',
     70        'Email Subject',
    7171        'wpeu_email_subject_field_setting',
    7272        'wpeu_settings_section',
     
    7777    add_settings_field(
    7878        'wpeu_email_body_field',
    79         'Email Body Text',
     79        'Email Body Text',
    8080        'wpeu_email_body_field_setting',
    8181        'wpeu_settings_section',
     
    9696    $options = get_option( 'wpeu_register_settings_fields' );
    9797   
    98     $options['wpeu_send_email_field'] = trim( $arr_input['wpeu_send_email_field'] );
     98    $options['wpeu_send_email_field'] = ( $arr_input['wpeu_send_email_field'] );
    9999   
    100     $options['wpeu_email_receiver_field'] = trim( $arr_input['wpeu_email_receiver_field'] );
     100    $options['wpeu_email_receiver_field'] = ( $arr_input['wpeu_email_receiver_field'] );
    101101   
    102     $options['wpeu_email_subject_field'] = trim( $arr_input['wpeu_email_subject_field'] );
     102    $options['wpeu_email_subject_field'] = ( $arr_input['wpeu_email_subject_field'] );
    103103   
    104     $options['wpeu_email_body_field'] = trim( $arr_input['wpeu_email_body_field'] );
     104    $options['wpeu_email_body_field'] = ( $arr_input['wpeu_email_body_field'] );
    105105   
    106106    return $options;
     
    111111    $options = get_option( 'wpeu_register_settings_fields' ); ?>
    112112
    113     <input type="checkbox" name="wpeu_register_settings_fields[wpeu_send_email_field]" <?php checked( 'on', $options['wpeu_send_email_field'],true); ?> />
     113<input type="checkbox" name="wpeu_register_settings_fields[wpeu_send_email_field]" <?php checked( 'on', $options['wpeu_send_email_field'],true); ?> />
    114114<?php }
    115115
     
    118118    $options = get_option( 'wpeu_register_settings_fields' ); ?>
    119119
    120     <input type="radio" name="wpeu_register_settings_fields[wpeu_email_receiver_field]" value="admin_only" <?php checked( 'admin_only' == $options['wpeu_email_receiver_field'] ); ?> /> Admins Only
    121 
    122     <input type="radio" name="wpeu_register_settings_fields[wpeu_email_receiver_field]" value="user_only" <?php checked( 'user_only' == $options['wpeu_email_receiver_field'] ); ?> /> User Only
    123    
    124     <input type="radio" name="wpeu_register_settings_fields[wpeu_email_receiver_field]" value="admin_user" <?php checked( 'admin_user' == $options['wpeu_email_receiver_field'] ); ?> /> Admins & User
     120    <input type="radio" name="wpeu_register_settings_fields[wpeu_email_receiver_field]" value="admin_only" <?php checked( 'admin_only' == $options['wpeu_email_receiver_field'] ); ?> /> Admin Only
     121   
     122    <input type="radio" name="wpeu_register_settings_fields[wpeu_email_receiver_field]" value="admin_user" <?php checked( 'admin_user' == $options['wpeu_email_receiver_field'] ); ?> /> Admin & User
    125123<?php }
    126124
     
    129127    $options = get_option( 'wpeu_register_settings_fields' ); ?>
    130128
    131     <input type="text" class="widefat" name="wpeu_register_settings_fields[wpeu_email_subject_field]" value="<?php if ( isset( $options['wpeu_email_subject_field'] ) ){ echo $options['wpeu_email_subject_field']; } else { echo 'Username Changed!'; } ?>" />
     129'; } ?>" />
    132130<?php }
    133131
     
    136134    $options = get_option( 'wpeu_register_settings_fields' ); ?>
    137135
    138     <textarea class="widefat" style="min-height: 150px;" name="wpeu_register_settings_fields[wpeu_email_body_field]" ><?php if ( isset( $options['wpeu_email_body_field'] ) ){ echo $options['wpeu_email_body_field']; } else { echo 'Your Username has been changed'; } ?></textarea>
    139 
    140     <p>Available shortcodes are : <code>{{first_name}}</code> <code>{{last_name}}</code> <code>{{display_name}} <code>{{full_name}}</code> <code>{{old_username}}</code> <code>{{new_username}}</code></p>
     136    <textarea class="widefat" style="min-height: 150px;" name="wpeu_register_settings_fields[wpeu_email_body_field]" ><?php if ( isset( $options['wpeu_email_body_field'] ) ){ echo esc_textarea( $options['wpeu_email_body_field'] ); } else { echo 'Your Username has been changed'; } ?></textarea>
    141137<?php }
  • wp-edit-username/tags/1.0.6/assets/js/script.js

    r3047088 r3048298  
    88
    99    var $wpeu_new_username          = $( "#wpeu_new_username" );
     10
     11
    1012   
    1113    var $wpeu_message               = $( "#wpeu_message" );
     
    4951        var data =
    5052        {   
    51             action              : 'wpeu_update_user_name',
     53            action              : 'wpeu_update_user_name',
    5254           
    53             current_username    : $input.val(),
     55            .val(),
    5456           
    55             new_username        : $wpeu_new_username.val()
     57            current_username        : $input.val(),
     58           
     59            new_username            : $wpeu_new_username.val()
    5660        };
    5761
  • wp-edit-username/tags/1.0.6/wp-edit-username.php

    r3047088 r3048298  
    222222        public function email_subject_field_setting()
    223223        {
    224             ?><input type="text" class="widefat" name="wpeu_register_settings_fields[wpeu_email_subject_field]" value="<?php if ( isset( $this->options['wpeu_email_subject_field'] ) ){ echo esc_html__( $this->options['wpeu_email_subject_field'] ); } else { _e( 'Username Changed!', 'wp-edit-username' ); } ?>" /><?php
     224            ?><input type="text" class="widefat" name="wpeu_register_settings_fields[wpeu_email_subject_field]" value="<?php if ( isset( $this->options['wpeu_email_subject_field'] ) ){ echo esc_( $this->options['wpeu_email_subject_field'] ); } else { _e( 'Username Changed!', 'wp-edit-username' ); } ?>" /><?php
    225225        }
    226226
     
    228228        {
    229229            ?>
    230                 <textarea class="widefat" style="min-height: 150px;" name="wpeu_register_settings_fields[wpeu_email_body_field]" ><?php if ( isset( $this->options['wpeu_email_body_field'] ) ){ echo esc_html( $this->options['wpeu_email_body_field'] ); } else { _e( 'Your Username has been changed', 'wp-edit-username' ); } ?></textarea>
     230                <textarea class="widefat" style="min-height: 150px;" name="wpeu_register_settings_fields[wpeu_email_body_field]" ><?php if ( isset( $this->options['wpeu_email_body_field'] ) ){ echo esc_( $this->options['wpeu_email_body_field'] ); } else { _e( 'Your Username has been changed', 'wp-edit-username' ); } ?></textarea>
    231231
    232232                <p><?php _e( 'Available shortcodes are', 'wp-edit-username' ); ?> : <code>{{first_name}}</code> <code>{{last_name}}</code> <code>{{display_name}}</code> <code>{{full_name}}</code> <code>{{old_username}}</code> <code>{{new_username}}</code></p>
     
    277277                                    </div>
    278278                                    <input type="text" class="form-control" id="wpeu_new_username" placeholder="<?php echo __( 'New Username', 'wp-edit-username' ); ?>" aria-label="Username" aria-describedby="basic-addon1">
     279
     280
    279281                                </div>
    280282                            </div>
     
    297299        public function update_user_name()
    298300        {
     301
     302
     303
     304
    299305            if( ! current_user_can( 'edit_users' ) ) die();
    300306
    301             $_POST              = array_map( 'trim', array_map( 'strip_tags', $_POST ) );
    302 
    303             extract( $_POST );
    304 
    305             $response           = array();
    306 
    307             $to                 = array();
    308 
    309             $new_username       = sanitize_user( $new_username );
    310            
    311             $current_username   = sanitize_user( $current_username );
    312 
    313             // ---------------------------------------------------------
    314             // check if new_username is empty
    315             // ---------------------------------------------------------
    316             if( empty( $new_username ) || empty( $current_username ) )
     307            if ( ! isset( $_POST['new_username'] ) && ! isset( $_POST['current_username'] ) )
    317308            {
    318                 $response['alert_message'] = __( 'Username Can Not be Empty!', 'wp-edit-username' );
     309                $response['alert_message'] = __( 'Invalid fields!', 'wp-edit-username' );
     310                   
     311                wp_send_json( $response ); die();
     312            }
     313
     314            if ( isset( $_POST['wp_edit_username_nonce'] ) && wp_verify_nonce( $_POST['wp_edit_username_nonce'], 'wp_edit_username_action' ) )
     315            {
     316                $new_username       = sanitize_user( $_POST['new_username'] );
    319317               
    320                 wp_send_json( $response ); die();
    321             }
    322 
    323             // ---------------------------------------------------------
    324             // Check if username consists invalid illegal character
    325             // ---------------------------------------------------------
    326             if( ! validate_username( $new_username ) )
    327             {
    328                 $response['alert_message'] = __( 'Username can not have illegal characters', 'wp-edit-username' );
     318                $current_username   = sanitize_user( $_POST['current_username'] );
     319
     320                // ---------------------------------------------------------
     321                // check if new_username is empty
     322                // ---------------------------------------------------------
     323                if( empty( $new_username ) || empty( $current_username ) )
     324                {
     325                    $response['alert_message'] = __( 'Username Can Not be Empty!', 'wp-edit-username' );
     326                   
     327                    wp_send_json( $response ); die();
     328                }
     329
     330                // ---------------------------------------------------------
     331                // Check if username consists invalid illegal character
     332                // ---------------------------------------------------------
     333                if( ! validate_username( $new_username ) )
     334                {
     335                    $response['alert_message'] = __( 'Username can not have illegal characters', 'wp-edit-username' );
     336                   
     337                    wp_send_json( $response ); die();
     338                }
     339
     340                // ---------------------------------------------------------
     341                // Filters the list of blacklisted usernames.
     342                //
     343                // @https://developer.wordpress.org/reference/hooks/illegal_user_logins/
     344                // ---------------------------------------------------------
     345                $illegal_user_logins = array_map( 'strtolower', (array) apply_filters( 'illegal_user_logins', array() ) );
     346
     347                if ( in_array( $new_username, $illegal_user_logins ) )
     348                {
     349                    $response['alert_message'] =  __( 'Sorry, that username is not allowed.', 'wp-edit-username' );
     350                   
     351                    wp_send_json( $response ); die();
     352                }
     353
     354                // ---------------------------------------------------------
     355                // If $new_username already registered
     356                // ---------------------------------------------------------
     357                if( username_exists( $new_username ) )
     358                {
     359                    $response['alert_message'] =  __( 'Sorry, that username already exists and not available.', 'wp-edit-username' );
     360                   
     361                    wp_send_json( $response ); die();
     362                }
     363
     364                global $wpdb;
     365
     366                // ---------------------------------------------------------
     367                // Change / Update Username With old one
     368                // ---------------------------------------------------------
     369                $query  = $wpdb->prepare( "UPDATE $wpdb->users SET user_login = %s WHERE user_login = %s", $new_username, $current_username );
    329370               
    330                 wp_send_json( $response ); die();
    331             }
    332 
    333             // ---------------------------------------------------------
    334             // Filters the list of blacklisted usernames.
    335             //
    336             // @https://developer.wordpress.org/reference/hooks/illegal_user_logins/
    337             // ---------------------------------------------------------
    338             $illegal_user_logins = array_map( 'strtolower', (array) apply_filters( 'illegal_user_logins', array() ) );
    339 
    340             if ( in_array( $new_username, $illegal_user_logins ) )
    341             {
    342                 $response['alert_message'] =  __( 'Sorry, that username is not allowed.', 'wp-edit-username' );
    343                
    344                 wp_send_json( $response ); die();
    345             }
    346 
    347             // ---------------------------------------------------------
    348             // If $new_username already registered
    349             // ---------------------------------------------------------
    350             if( username_exists( $new_username ) )
    351             {
    352                 $response['alert_message'] =  __( 'Sorry, that username already exists and not available.', 'wp-edit-username' );
    353                
    354                 wp_send_json( $response ); die();
    355             }
    356 
    357             global $wpdb;
    358 
    359             // ---------------------------------------------------------
    360             // Change / Update Username With old one
    361             // ---------------------------------------------------------
    362             $query  = $wpdb->prepare( "UPDATE $wpdb->users SET user_login = %s WHERE user_login = %s", $new_username, $current_username );
    363            
    364             $result = $wpdb->query( $query );
    365 
    366             if ( $result > 0 )
    367             {
    368                 $response['success_message'] =  sprintf( 'Username Updated from <code>%s</code> to <code>%s</code>.', $current_username, $new_username );
    369 
    370                 if ( isset( $this->options['wpeu_send_email_field'] ) && $this->options['wpeu_send_email_field'] == 'on' )
    371                 {
    372                     $user_email = $wpdb->get_var( $wpdb->prepare( "SELECT user_email FROM $wpdb->users WHERE user_login = %s", $new_username ) );
    373 
    374                     if ( isset( $this->options['wpeu_email_receiver_field'] ) )
    375                     {                       
    376                         if ( $this->options['wpeu_email_receiver_field'] == 'user_only' )
    377                         {   
    378                             $to         = array( sanitize_email( $user_email ) );
    379                         }
    380                         elseif ( $this->options['wpeu_email_receiver_field'] == 'admin_only' )
    381                         {   
    382                             $to         = array();
    383                            
    384                             $admins     = get_users( 'role=Administrator' );
    385                            
    386                             foreach ( $admins as $admin )
     371                $result = $wpdb->query( $query );
     372
     373                if ( $result > 0 )
     374                {
     375                    $response['success_message'] =  sprintf( 'Username Updated from <code>%s</code> to <code>%s</code>.', $current_username, $new_username );
     376
     377                    if ( isset( $this->options['wpeu_send_email_field'] ) && $this->options['wpeu_send_email_field'] == 'on' )
     378                    {
     379                        $user_email = $wpdb->get_var( $wpdb->prepare( "SELECT user_email FROM $wpdb->users WHERE user_login = %s", $new_username ) );
     380
     381                        if ( isset( $this->options['wpeu_email_receiver_field'] ) )
     382                        {                       
     383                            if ( $this->options['wpeu_email_receiver_field'] == 'user_only' )
     384                            {   
     385                                $to         = array( sanitize_email( $user_email ) );
     386                            }
     387                            elseif ( $this->options['wpeu_email_receiver_field'] == 'admin_only' )
     388                            {   
     389                                $to         = array();
     390                               
     391                                $admins     = get_users( 'role=Administrator' );
     392                               
     393                                foreach ( $admins as $admin )
     394                                {
     395                                    $to[]   = sanitize_email( $admin->user_email );
     396                                }
     397                            }
     398                            elseif ( $this->options['wpeu_email_receiver_field'] == 'admin_user' )
    387399                            {
    388                                 $to[]   = sanitize_email( $admin->user_email );
     400                                $to         = array( sanitize_email( $user_email ) );
     401                               
     402                                $admins     = get_users( 'role=Administrator' );
     403                               
     404                                foreach ( $admins as $admin )
     405                                {
     406                                    $to[]   = sanitize_email( $admin->user_email );
     407                                }
    389408                            }
    390409                        }
    391                         elseif ( $this->options['wpeu_email_receiver_field'] == 'admin_user' )
     410
     411                        $subject = apply_filters( 'wp_username_changed_email_subject', $subject = $this->options['wpeu_email_subject_field'], $old_username, $new_username );
     412
     413                        $body    = apply_filters( 'wp_username_changed_email_body', $body = $this->options['wpeu_email_body_field'], $old_username, $new_username );
     414
     415                        $user    = get_user_by( 'login', $new_username );
     416               
     417                        if( $user )
    392418                        {
    393                             $to         = array( sanitize_email( $user_email ) );
    394                            
    395                             $admins     = get_users( 'role=Administrator' );
    396                            
    397                             foreach ( $admins as $admin )
    398                             {
    399                                 $to[]   = sanitize_email( $admin->user_email );
    400                             }
     419                            $ );
     420                       
     421
     422                       
     423
     424                       
     425                       
     426                           
    401427                        }
    402428                    }
    403 
    404                     $subject = apply_filters( 'wp_username_changed_email_subject', $subject = $this->options['wpeu_email_subject_field'], $old_username, $new_username );
    405 
    406                     $body    = apply_filters( 'wp_username_changed_email_body', $body = $this->options['wpeu_email_body_field'], $old_username, $new_username );
    407 
    408                     $user    = get_user_by( 'login', $new_username );
    409            
    410                     if( $user )
     429                }
     430
     431                // ---------------------------------------------------------
     432                // Change / Update nicename if == username
     433                // ---------------------------------------------------------
     434                $query = $wpdb->prepare( "UPDATE $wpdb->users SET user_nicename = %s WHERE user_login = %s AND user_nicename = %s", $new_username, $new_username, $current_username );
     435               
     436                $wpdb->query( $query );
     437
     438                // ---------------------------------------------------------
     439                // Change / Update display name if == username
     440                // ---------------------------------------------------------
     441                $query  = $wpdb->prepare( "UPDATE $wpdb->users SET display_name = %s WHERE user_login = %s AND display_name = %s", $new_username, $new_username, $current_username );
     442               
     443                $wpdb->query( $query );
     444
     445                // ---------------------------------------------------------
     446                // Update Username on Multisite
     447                // ---------------------------------------------------------
     448                if( is_multisite() )
     449                {
     450                    $super_admins = (array) get_site_option( 'site_admins', array( 'admin' ) );
     451                   
     452                    $array_key = array_search( $current_username, $super_admins );
     453
     454                    if( $array_key )
    411455                    {
    412                         $body = str_replace( [ '{{first_name}}', '{{last_name}}', '{{display_name}}', '{{full_name}}', '{{old_username}}', '{{new_username}}' ], [ $user->first_name, $user->last_name, $user->display_name, $user->first_name . ' ' . $user->last_name, $current_username, $new_username ], $body );
     456                        $;
    413457                    }
    414 
    415                     $headers = array( 'Content-Type: text/html; charset=UTF-8' );
    416 
    417                     foreach ( $to as $email )
    418                     {
    419                         wp_mail( $email, $subject, $body, $headers );
    420                     }
    421                 }
    422             }
    423 
    424             // ---------------------------------------------------------
    425             // Change / Update nicename if == username
    426             // ---------------------------------------------------------
    427             $query = $wpdb->prepare( "UPDATE $wpdb->users SET user_nicename = %s WHERE user_login = %s AND user_nicename = %s", $new_username, $new_username, $current_username );
    428            
    429             $wpdb->query( $query );
    430 
    431             // ---------------------------------------------------------
    432             // Change / Update display name if == username
    433             // ---------------------------------------------------------
    434             $query  = $wpdb->prepare( "UPDATE $wpdb->users SET display_name = %s WHERE user_login = %s AND display_name = %s", $new_username, $new_username, $current_username );
    435            
    436             $wpdb->query( $query );
    437 
    438             // ---------------------------------------------------------
    439             // Update Username on Multisite
    440             // ---------------------------------------------------------
    441             if( is_multisite() )
     458                   
     459                    update_site_option( 'site_admins' , $super_admins );
     460                }
     461            }
     462            else
    442463            {
    443                 $super_admins = (array) get_site_option( 'site_admins', array( 'admin' ) );
    444                
    445                 $array_key = array_search( $current_username, $super_admins );
    446 
    447                 if( $array_key )
    448                 {
    449                     $super_admins[ $array_key ] = $new_username;
    450                 }
    451                
    452                 update_site_option( 'site_admins' , $super_admins );
     464                $response['alert_message'] =  __( 'Nonce verification failed.', 'wp-edit-username' );
    453465            }
    454466
  • wp-edit-username/trunk/admin/ajax-handler.php

    r2721337 r3048298  
    55function wpeu_update_user_name()
    66{
    7     // ---------------------------------------------------------
    8     // Check if current_user_can() functions exists in this scope
    9     // ---------------------------------------------------------
    10     if( ! function_exists( 'wp_get_current_user' ) )
     7    if( ! current_user_can( 'edit_users' ) ) die();
     8
     9    if ( isset( $_POST['wp_edit_username_nonce'] ) && wp_verify_nonce( $_POST['wp_edit_username_nonce'], 'wp_edit_username_action' ) )
    1110    {
    12         include( ABSPATH . "wp-includes/pluggable.php" );
    13     }
     11        $new_username       = sanitize_user( $_POST['new_username'] );
     12       
     13        $current_username   = sanitize_user( $_POST['current_username'] );
    1414
    15     if( ! current_user_can( 'edit_users' ) )
    16     {
    17         return;
    18     }
     15        $response           = array();
    1916
    20     $_POST = array_map( 'trim', array_map( 'strip_tags', $_POST ) );
     17);
    2118
    22     extract( $_POST );
     19        // ---------------------------------------------------------
     20        // check if new_username is empty
     21        // ---------------------------------------------------------
     22        if( empty( $new_username ) || empty( $current_username ) )
     23        {
     24            $response['alert_message'] = __( 'Username Can Not be Empty!', 'wp-edit-username' );
     25           
     26            wp_send_json( $response ); die();
     27        }
    2328
    24     $response = array();
     29        // ---------------------------------------------------------
     30        // Check if username consists invalid illegal character
     31        // ---------------------------------------------------------
     32        if( ! validate_username( $new_username ) )
     33        {
     34            $response['alert_message'] = __( 'Username can not have illegal characters', 'wp-edit-username' );
     35           
     36            wp_send_json( $response ); die();
     37        }
    2538
    26     // ---------------------------------------------------------
    27     // check if new_username is empty
    28     // ---------------------------------------------------------
    29     if( empty( $new_username ) || empty( $current_username ) )
    30     {
    31         $response['alert_message'] = __( 'Username Can Not be Empty!' );
     39        // ---------------------------------------------------------
     40        // Filters the list of blacklisted usernames.
     41        //
     42        // @https://developer.wordpress.org/reference/hooks/illegal_user_logins/
     43        // ---------------------------------------------------------
     44        $illegal_user_logins = array_map( 'strtolower', (array) apply_filters( 'illegal_user_logins', array() ) );
     45
     46        if ( in_array( $new_username, $illegal_user_logins ) )
     47        {
     48            $response['alert_message'] =  __( 'Sorry, that username is not allowed.', 'wp-edit-username' );
     49           
     50            wp_send_json( $response ); die();
     51        }
     52
     53        // ---------------------------------------------------------
     54        // If $new_username already registered
     55        // ---------------------------------------------------------
     56        if( username_exists( $new_username ) )
     57        {
     58            $response['alert_message'] =  __( 'Sorry, that username already exists and not available.', 'wp-edit-username' );
     59           
     60            wp_send_json( $response ); die();
     61        }
     62
     63        global $wpdb;
     64
     65        // ---------------------------------------------------------
     66        // Change / Update Username With old one
     67        // ---------------------------------------------------------
     68        $query  = $wpdb->prepare( "UPDATE $wpdb->users SET user_login = %s WHERE user_login = %s", $new_username, $current_username );
    3269       
    33         wp_send_json( $response ); die();
    34     }
    35 
    36     // ---------------------------------------------------------
    37     // Check if username consists invalid illegal character
    38     // ---------------------------------------------------------
    39     if( ! validate_username( $new_username ) )
    40     {
    41         $response['alert_message'] = __( 'Username can not have illegal characters' );
    42        
    43         wp_send_json( $response ); die();
    44     }
    45 
    46     // ---------------------------------------------------------
    47     // Filters the list of blacklisted usernames.
    48     //
    49     // @https://developer.wordpress.org/reference/hooks/illegal_user_logins/
    50     // ---------------------------------------------------------
    51     $illegal_user_logins = array_map( 'strtolower', (array) apply_filters( 'illegal_user_logins', array() ) );
    52 
    53     if ( in_array( $new_username, $illegal_user_logins ) )
    54     {
    55         $response['alert_message'] =  __( 'Sorry, that username is not allowed.' );
    56        
    57         wp_send_json($response); die();
    58     }
    59 
    60     // ---------------------------------------------------------
    61     // If $new_username already registered
    62     // ---------------------------------------------------------
    63     if( username_exists( $new_username ) )
    64     {
    65         $response['alert_message'] =  __( 'Sorry, that username already exists and not available.' );
    66        
    67         wp_send_json( $response ); die();
    68     }
    69 
    70     global $wpdb;
    71 
    72     // ---------------------------------------------------------
    73     // Change / Update Username With old one
    74     // ---------------------------------------------------------
    75     $query  = $wpdb->prepare( "UPDATE $wpdb->users SET user_login = %s WHERE user_login = %s", $new_username, $current_username );
    76    
    77     $result = $wpdb->query( $query );
    78 
    79     if ( $result > 0 )
    80     {
    81         $response['success_message'] =  sprintf( 'Username Updated from <code>%s</code> to <code>%s</code>.', $current_username, $new_username );
     70        $result = $wpdb->query( $query );
    8271
    8372        $options = get_option( 'wpeu_register_settings_fields' );
    8473
    85         if ( $options['wpeu_send_email_field'] == 'on' )
     74        if ( $ )
    8675        {
    87             $email = $wpdb->get_var( $wpdb->prepare( "SELECT user_email FROM $wpdb->users WHERE user_login = %s", $new_username ) );
     76            $ );
    8877
    89             if ( $options['wpeu_email_receiver_field'] == 'admin_only' )
    90             {   
    91                 $to = array( $email );
    92             }
    93             elseif ( $options['wpeu_email_receiver_field'] == 'admin_user' )
     78            if ( isset( $options['wpeu_send_email_field'] ) && $options['wpeu_send_email_field'] == 'on' )
    9479            {
    95                 $to = array( $email );
    96                
    97                 $admins = get_users( 'role=Administrator' );
    98                
    99                 foreach ( $admins as $admin )
     80                $user_email = $wpdb->get_var( $wpdb->prepare( "SELECT user_email FROM $wpdb->users WHERE user_login = %s", $new_username ) );
     81
     82                if ( isset( $options['wpeu_email_receiver_field'] ) )
     83                {                       
     84                    if ( $options['wpeu_email_receiver_field'] == 'user_only' )
     85                    {   
     86                        $to         = array( sanitize_email( $user_email ) );
     87                    }
     88                    elseif ( $options['wpeu_email_receiver_field'] == 'admin_only' )
     89                    {   
     90                        $to         = array();
     91                       
     92                        $admins     = get_users( 'role=Administrator' );
     93                       
     94                        foreach ( $admins as $admin )
     95                        {
     96                            $to[]   = sanitize_email( $admin->user_email );
     97                        }
     98                    }
     99                    elseif ( $options['wpeu_email_receiver_field'] == 'admin_user' )
     100                    {
     101                        $to         = array( sanitize_email( $user_email ) );
     102                       
     103                        $admins     = get_users( 'role=Administrator' );
     104                       
     105                        foreach ( $admins as $admin )
     106                        {
     107                            $to[]   = sanitize_email( $admin->user_email );
     108                        }
     109                    }
     110                }
     111
     112                $subject = apply_filters( 'wp_username_changed_email_subject', $subject = $options['wpeu_email_subject_field'], $old_username, $new_username );
     113
     114                $body    = apply_filters( 'wp_username_changed_email_body', $body = $options['wpeu_email_body_field'], $old_username, $new_username );
     115
     116                $user    = get_user_by( 'login', $new_username );
     117       
     118                if( $user )
    100119                {
    101                     $to[] = $admin->user_email;
     120                    $body = str_replace( [ '{{first_name}}', '{{last_name}}', '{{display_name}}', '{{full_name}}', '{{old_username}}', '{{new_username}}' ], [ $user->first_name, $user->last_name, $user->display_name, $user->first_name . ' ' . $user->last_name, $current_username, $new_username ], $body );
     121                }
     122
     123                $headers = array( 'Content-Type: text/html; charset=UTF-8' );
     124
     125                foreach ( $to as $email )
     126                {
     127                    wp_mail( $email, $subject, $body, $headers );
    102128                }
    103129            }
     130
    104131
    105             $subject = apply_filters( "wp_username_changed_email_subject", $subject = $options['wpeu_email_subject_field'] );
     132        // ---------------------------------------------------------
     133        // Change / Update nicename if == username
     134        // ---------------------------------------------------------
     135        $query = $wpdb->prepare( "UPDATE $wpdb->users SET user_nicename = %s WHERE user_login = %s AND user_nicename = %s", $new_username, $new_username, $current_username );
     136       
     137        $wpdb->query( $query );
    106138
    107             $body = apply_filters( "wp_username_changed_email_body", $body = $options['wpeu_email_body_field'] );
     139        // ---------------------------------------------------------
     140        // Change / Update display name if == username
     141        // ---------------------------------------------------------
     142        $query  = $wpdb->prepare( "UPDATE $wpdb->users SET display_name = %s WHERE user_login = %s AND display_name = %s", $new_username, $new_username, $current_username );
     143       
     144        $wpdb->query( $query );
     145
     146        // ---------------------------------------------------------
     147        // Update Username on Multisite
     148        // ---------------------------------------------------------
     149        if( is_multisite() )
     150        {
     151            $super_admins = (array) get_site_option( 'site_admins', array( 'admin' ) );
    108152           
    109             $body .= __( " Old Username was : $old_username .\nNew Username is : $new_username" );
     153            $ );
    110154
    111             $headers = array( 'Content-Type: text/html; charset=UTF-8' );
    112 
    113             foreach ( $to as $email )
     155            if( $array_key )
    114156            {
    115                 wp_mail( $email, $subject, $body, $headers );
     157                ;
    116158            }
     159
     160
    117161        }
    118162    }
    119 
    120     // ---------------------------------------------------------
    121     // Change / Update nicename if == username
    122     // ---------------------------------------------------------
    123     $query = $wpdb->prepare( "UPDATE $wpdb->users SET user_nicename = %s WHERE user_login = %s AND user_nicename = %s", $new_username, $new_username, $current_username );
    124    
    125     $wpdb->query( $query );
    126 
    127     // ---------------------------------------------------------
    128     // Change / Update display name if == username
    129     // ---------------------------------------------------------
    130     $query  = $wpdb->prepare( "UPDATE $wpdb->users SET display_name = %s WHERE user_login = %s AND display_name = %s", $new_username, $new_username, $current_username );
    131    
    132     $wpdb->query( $query );
    133 
    134     // ---------------------------------------------------------
    135     // Update Username on Multisite
    136     // ---------------------------------------------------------
    137     if( is_multisite() )
     163    else
    138164    {
    139         $super_admins = (array) get_site_option( 'site_admins', array( 'admin' ) );
    140        
    141         $array_key = array_search( $current_username, $super_admins );
    142 
    143         if( $array_key )
    144         {
    145             $super_admins[ $array_key ] = $new_username;
    146         }
    147        
    148         update_site_option( 'site_admins' , $super_admins );
     165        $response['alert_message'] =  __( 'Nonce verification failed.', 'wp-edit-username' );
    149166    }
    150167
  • wp-edit-username/trunk/admin/js/script.js

    r2721335 r3048298  
    88
    99    var $wpeu_new_username = $( "#wpeu_new_username" );
     10
     11
    1012   
    1113    var $wpeu_message = $( "#wpeu_message" );
     
    5052        {   
    5153            action : 'wpeu_update_user_name',
     54
     55
    5256           
    5357            current_username : $input.val(),
  • wp-edit-username/trunk/admin/modal.php

    r2735092 r3048298  
    2020                            </div>
    2121                            <input type="text" class="form-control" id="wpeu_new_username" placeholder="<?php echo __( 'New Username' ); ?>" aria-label="Username" aria-describedby="basic-addon1">
     22
     23
    2224                        </div>
    2325                    </div>
  • wp-edit-username/trunk/includes/settings.php

    r2735092 r3048298  
    9696    $options = get_option( 'wpeu_register_settings_fields' );
    9797   
    98     $options['wpeu_send_email_field'] = trim( $arr_input['wpeu_send_email_field'] );
     98    $options['wpeu_send_email_field'] = ( $arr_input['wpeu_send_email_field'] );
    9999   
    100     $options['wpeu_email_receiver_field'] = trim( $arr_input['wpeu_email_receiver_field'] );
     100    $options['wpeu_email_receiver_field'] = ( $arr_input['wpeu_email_receiver_field'] );
    101101   
    102     $options['wpeu_email_subject_field'] = trim( $arr_input['wpeu_email_subject_field'] );
     102    $options['wpeu_email_subject_field'] = ( $arr_input['wpeu_email_subject_field'] );
    103103   
    104     $options['wpeu_email_body_field'] = trim( $arr_input['wpeu_email_body_field'] );
     104    $options['wpeu_email_body_field'] = ( $arr_input['wpeu_email_body_field'] );
    105105   
    106106    return $options;
     
    127127    $options = get_option( 'wpeu_register_settings_fields' ); ?>
    128128
    129     <input type="text" class="widefat" name="wpeu_register_settings_fields[wpeu_email_subject_field]" value="<?php if ( isset( $options['wpeu_email_subject_field'] ) ){ echo $options['wpeu_email_subject_field']; } else { echo 'subject'; } ?>" />
     129    <input type="text" class="widefat" name="wpeu_register_settings_fields[wpeu_email_subject_field]" value="<?php if ( isset( $options['wpeu_email_subject_field'] ) ){ echo ; } else { echo 'subject'; } ?>" />
    130130<?php }
    131131
     
    134134    $options = get_option( 'wpeu_register_settings_fields' ); ?>
    135135
    136     <textarea class="widefat" style="min-height: 150px;" name="wpeu_register_settings_fields[wpeu_email_body_field]" ><?php if ( isset( $options['wpeu_email_body_field'] ) ){ echo $options['wpeu_email_body_field']; } else { echo 'Your Username has been changed'; } ?></textarea>
     136    <textarea class="widefat" style="min-height: 150px;" name="wpeu_register_settings_fields[wpeu_email_body_field]" ><?php if ( isset( $options['wpeu_email_body_field'] ) ){ echo ; } else { echo 'Your Username has been changed'; } ?></textarea>
    137137<?php }
  • wp-edit-username/trunk/readme.txt

    r3047088 r3048298  
    33Tags: user,user-profile,profile-edit,edit,ajax,update,change-username,username
    44Requires at least: 5.6
    5 Tested up to: 6.3
     5Tested up to: 6.
    66Stable tag: 1.0.6
    77License: GPLv2
Note: See TracChangeset for help on using the changeset viewer.