show text If special user is logged

I am not sure exactly what you are asking for, but, if you want to target a specific user ID, just do something like: // set special user id $special_user_id = 5; $current_user_id = get_current_user_id(); if ( $special_user_id == $current_user_id ){ echo ‘special user is online’; } You get the idea.

Generate unique number when registering a new user

This way would work … the user_register action is fired when the user is stored in the data base. You can add meta data to a user with add_metadata. add_action( ‘user_register’, ‘myplugin_registration_save’, 10, 1 ); function myplugin_registration_save( $user_id ) { add_metadata( $user_id, ‘unique_number’, date( ‘Y’ ).str_pad( $user_id, 4 ) ); }

get_users() timeout on big userbase — options to divide query?

You are on the right track with the batch idea. You’ll need a combination of parameters in your get_users() call. A combination of the “number” and “offset” parameters should get you what you need. In the example below $count is a reference to the batch that’s currently running. <?php // inside a loop where $count … Read more

Updating user meta

One of two functions you’ll need; update_user_meta or add_user_meta – more often than not you’ll just need the former, but it’s worth noting the difference: add_post_meta will only create an entry if the $unique parameter is false, or if there is no existing data for $meta_key. update_post_meta will add if no data exists yet, otherwise … Read more

Sort users by userID by default on users.php

You can use pre_get_users since WP 4.0.0 function my_user_sort( $query_args ){ if( is_admin() && !isset($_GET[‘orderby’]) ) { $query_args->query_vars[‘orderby’] = ‘ID’; } return $query_args; } add_action( ‘pre_get_users’, ‘my_user_sort’ );

*wpupdateuser* user_login in my WordPress database

wpupdateuser does not appear correct. Is it a compromise? Possibly not if you are allowing user registrations. A Google search for wpupdateuser reveals numerous sites where this username appears. Make sure WP and plugins are up to date.

User Last Login Sort Column

I don’t see anywhere in your code that the query is being modified. Just flagging a column to be sortable doesn’t mean it knows how to sort the data – it will just add the little up/down arrow and make the column clickable but you have to intercept the query var accordingly and tell WP … Read more