• Resolved oanhtran1804

    (@oanhtran1804)


    Hi. Please check with “Admin Columns” plugin, when i active your plugin, all defaul collum is lost, only left colums created by this plugin. Thanks

Viewing 11 replies - 1 through 11 (of 11 total)
  • Thread Starter oanhtran1804

    (@oanhtran1804)

    Fixed thanks. Because action too fast. Website error somehow, after try deactive and active everything work back

    Plugin Author Andrew Lima

    (@andrewza)

    Thank you for the feedback @oanhtran1804, we will look into this and possibly delay the time of the action to load later.

    I have created the issue here -> https://github.com/andrewlimaza/when-last-login/issues/18

    Please feel free to add to this ??

    Thread Starter oanhtran1804

    (@oanhtran1804)

    Hi, there is no problem at all. Just because i action too fast. (I was active/deactive few plugin too much in short time).

    By the way. Is the anyway custom code to get last login only, because i just need this?

    I’m trying following code, can you help me correct it?

    // set the last login date
    add_action(‘wp_login’,’set_last_login’, 0, 2);
    function set_last_login($login, $user) {
    $user = get_user_by(‘login’,$login);
    $time = current_time( ‘timestamp’ );
    $last_login = get_user_meta( $user->ID, ‘_last_login’, ‘true’ );
    if(!$last_login){
    update_usermeta( $user->ID, ‘_last_login’, $time );
    }else{
    update_usermeta( $user->ID, ‘_last_login_prev’, $last_login );
    update_usermeta( $user->ID, ‘_last_login’, $time );
    }
    }
    // get last login date
    function get_last_login($user_id,$prev=null){
    $last_login = get_user_meta($user_id);
    $time = current_time( ‘timestamp’ );
    if(isset($last_login[‘_last_login_prev’][0]) && $prev){
    $last_login = get_user_meta($user_id, ‘_last_login_prev’, ‘true’ );
    }else if(isset($last_login[‘_last_login’][0])){
    $last_login = get_user_meta($user_id, ‘_last_login’, ‘true’ );
    }else{
    update_usermeta( $user_id, ‘_last_login’, $time );
    $last_login = $last_login[‘_last_login’][0];
    }
    return $last_login;
    }

    Plugin Author Andrew Lima

    (@andrewza)

    You are able to get the user’s last login by getting the user meta, as per this line of code.

    $last_login = get_user_meta($user_id, '_last_login', 'true' );

    Plugin Author Andrew Lima

    (@andrewza)

    Also it seems that the code mentioned above is not from When Last Login, here is a link to our code for tracking the login – https://github.com/andrewlimaza/when-last-login/blob/master/when-last-login.php#L256-L304

    I hope this helps ??

    Thread Starter oanhtran1804

    (@oanhtran1804)

    Thanks. So i just copy code #L256-L304 , add direct to function.php . Do i any any change for this case?
    Then i can deactive your plugin right?

    WHY?
    Because i just need know user Last login and Last login IP that your plugin given. But record login log which i don’t need. I had it from analystic, security, user activity tracking. Which is too much same function. I’m working on custom code add direct to fuction.php

    Plugin Author Andrew Lima

    (@andrewza)

    Thank you for the feedback, we have a built in function to disable the log, and I think we should make it an option instead of a filter.

    Add the following snippet of code to your theme’s functions.php or custom plugin –
    add_filter( 'when_last_login_show_records_table', '__return_false' );

    This will remove the ‘All Login Records’ from running at all ??

    I hope this helps.

    Plugin Author Andrew Lima

    (@andrewza)

    Here is our development schedule to improve on this -> https://github.com/andrewlimaza/when-last-login/issues/19

    Thread Starter oanhtran1804

    (@oanhtran1804)

    So why do you not make become 2 plugins
    1) Plugin 1: Continue develop this plugin more and more
    2) Plugin 2: Just simple plugin by added colum “last-login” and “last-login-IP” to user list. DONE. I belive this plugin will super light weight for these people need simple thing like me.

    Plugin Author Andrew Lima

    (@andrewza)

    It’s a bit difficult to release a plugin per feature as people want more features and from a development point of view it can become a lot of work, especially since we do not get paid for doing this initial work.

    We keep the plugin as light-weight as possible and we are looking at improving When Last Login to revolve around the user login process and some of the data we need for some of our paid for add-ons such as the user statistics and so on.

    We are focused as to not going to far off the original idea for When Last Login and still introduce some new features and make the settings easier than ever!

    Our idea is to release a couple of more features that you can easily toggle on/off by a checkbox to make WLL as modular as possible without affecting people that would like the minimal features.

    Thread Starter oanhtran1804

    (@oanhtran1804)

    I see. Thank you so much for explain.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘BUG with Admin Columns’ is closed to new replies.