Support » Plugin: WP-UserOnline » [Plugin: WP-UserOnline] small bug report

  • in wp-useronline.php:50 $most variable gets the default ‘date’ value as a timestamp, but the option reads a mysql time, and later on template-tags.php:40 get_most_users_online_date does not convert the option.

    changes needed:

    wp-useronline.php:50

    $most = new scbOptions( 'useronline_most', __FILE__, array(
    	'count' => 1,
    	'date' => current_time( 'mysql' )
    ) );

    template-tags.php:40

    function get_most_users_online_date() {
    	return UserOnline_Template::format_date( UserOnline_Core::$most->date, true );
    }

    http://wordpress.org/extend/plugins/wp-useronline/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author scribu

    (@scribu)

    Yes, the date is stored as a timestamp, but it is converted when necessary.

    Relevant lines:

    core.php:

    // Maybe Update Most User Online
    		if ( self::$useronline > self::$most->count ) {
    			self::$most->update( array(
    				'count' => self::$useronline,
    				'date' => current_time( 'timestamp' )
    			) );
    		}

    template-tags.php:

    function get_most_users_online_date() {
    	return UserOnline_Template::format_date( UserOnline_Core::$most->date );
    }

    So, I’m not sure what the problem is.

    PS: If the issue is that it’s called ‘date’ when it’s actually a timestamp, I agree that it’s misleading.

    That said, it’s not worth it to change to a mysql date string, since it would also require some code to upgrade the existing data when users update the plugin.

    On a site I’ve got January 1, 1970 as date for most users online, because the option is stored in the database in mysql format, and it’s also trowing a php notice.

    Maybe it’s a bug for old installs only. On a newer install I’ve got the date stored as timstamp in the database.

    Plugin Author scribu

    (@scribu)

    Yeah, deleting the option will probably fix it.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: WP-UserOnline] small bug report’ is closed to new replies.