WordPress.org

Ready to get started?Download WordPress

Forums

ThreeWP Activity Monitor
'WordPress' user activity in ThreeWP Activity Monitor (2 posts)

  1. mateo423
    Member
    Posted 2 years ago #

    My ThreeWP Activity Monitor version: 2.9
    On my list of activities in ThreeWP Activity Monitor, I found that users activity where showd as a "WordPress" activity e.g. "WordPress logged in to...". But in fact, the WordPress was certain user. I fixed this with commenting lines:

    if ( ! $this->cache['user'][$user_id] instanceof WP_User )
    {
    $this->cache['user'][$user_id] = new stdClass();
    $this->cache['user'][$user_id]->user_login = 'Wordpress';
    }

    in private function cache_user($user_id).
    It seems like the value returned by the get_userdata function is not the instance of WP_User. Maybe authors could explain this or fix?

    http://wordpress.org/extend/plugins/threewp-activity-monitor/

  2. Ov3rfly
    Member
    Posted 2 years ago #

    I have the same problem with WordPress 3.2.1 and ThreeWP Activity Monitor 2.9, all activities are shown as "WordPress".

    After using the fix of mateo423, the issue is resolved.

    Changed file ThreeWP_Activity_Monitor.php starting at line 1414:

    private function cache_user($user_id)
    {
    	if ( isset($this->cache['user'][$user_id]) )
    		return;
    
    	$this->cache['user'][$user_id] = get_userdata($user_id);
    
    	/*
    	if ( ! $this->cache['user'][$user_id] instanceof WP_User )
    	{
    		$this->cache['user'][$user_id] = new stdClass();
    		$this->cache['user'][$user_id]->user_login = 'WordPress';
    	}
    	*/
    }

    Thanks for your fix, mateo423!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic