Enable you to display how many users are online on your WordPress blog with detailed statistics.
PHP JavaScript
Latest commit 57e25aa Dec 8, 2016 @lesterchan Bump WordPress 4.7
Permalink
Failed to load latest commit information.
scb @ 95b23ac Fix #10, use WP.org for lang Dec 7, 2015
.gitmodules read-only scb submodule May 28, 2011
.travis.yml Adding Feb 24, 2015
README.md Bump WordPress 4.7 Dec 8, 2016
admin.php Use array() instead of [] Feb 24, 2016
bots.php add Ahrefs bot Nov 7, 2012
core.php Removed is_ssl() Jul 23, 2014
deprecated.php whitespace Jul 3, 2010
template-tags.php Add a filter to allow customization of the Users Online Now page (see: May 29, 2016
uninstall.php Use WordPress native uninstall.php Oct 11, 2014
useronline.dev.js
useronline.js add Plugin News link Aug 30, 2010
widget.php
wp-stats.php whitespace Jul 3, 2010
wp-useronline.php Bump WordPress 4.7 Dec 8, 2016

README.md

WP-UserOnline

Contributors: GamerZ, scribu
Donate link: http://lesterchan.net/site/donation/
Tags: useronline, usersonline, wp-useronline, online, users, user, ajax, widget
Requires at least: 4.0
Tested up to: 4.7
Stable tag: 2.87.1
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Enable you to display how many users are online on your Wordpress blog with detailed statistics.

Description

This plugin enables you to display how many users are online on your Wordpress site, with detailed statistics of where they are and who they are (Members/Guests/Search Bots).

Build Status

Build Status

Development

https://github.com/lesterchan/wp-useronline

Credits

Donations

I spent most of my free time creating, updating, maintaining and supporting these plugins, if you really love my plugins and could spare me a couple of bucks, I will really appreciate it. If not feel free to use it without any obligations.

Installation

You can either install it automatically from the WordPress admin, or do it manually:

  1. Unzip the archive and put the wp-useronline folder into your plugins folder (/wp-content/plugins/).
  2. Activate the plugin from the Plugins menu.

General Usage (With Widget)

  1. Go to WP-Admin -> Appearance -> Widgets
  2. The widget name is UserOnline.
  3. Scroll down for instructions on how to create a UserOnline Page.

General Usage (Without Widget)

  • Open wp-content/themes/<YOUR THEME NAME>/sidebar.php and add Anywhere:

<?php if (function_exists('users_online')): ?> <p>Users online: <div id="useronline-count"><?php users_online(); ?></div></p> <?php endif; ?>

Creating A UserOnline Page

  1. Go to WP-Admin -> Pages -> Add New
  2. Type any title you like in the post's title area
  3. If you ARE using nice permalinks, after typing the title, WordPress will generate the permalink to the page. You will see an 'Edit' link just beside the permalink.
  4. Click 'Edit' and type in useronline in the text field and click 'Save'.
  5. Type [page_useronline] in the post's content area
  6. Click 'Publish'

If you ARE NOT using nice permalinks, you need to go to WP-Admin -> Settings -> UserOnline and under 'UserOnline URL', you need to fill in the URL to the UserOnline Page you created above.

Screenshots

  1. Admin - Dashboard's Right Now
  2. UserOnline Page
  3. Admin - Settings Page

Frequently Asked Questions

To Display Most Number Of Users Online

  • Use: <?php if (function_exists('get_most_users_online')): ?> <p>Most Users Ever Online Is <?php echo get_most_users_online(); ?> On <?php echo get_most_users_online_date(); ?></p> <?php endif; ?>

To Display Users Browsing Site

  • Use: <?php if (function_exists('get_users_browsing_site')): ?> <div id="useronline-browsing-site"><?php echo get_users_browsing_site(); ?></div> <?php endif; ?>

To Display Users Browsing A Page

  • Use: <?php if (function_exists('get_users_browsing_page')): ?> <div id="useronline-browsing-page"><?php echo get_users_browsing_page(); ?></div> <?php endif; ?>

Error on activation: "Parse error: syntax error, unexpected..."

Make sure your host is running PHP 5. The only foolproof way to do this is to add this line to wp-config.php (after the opening <?php tag):

var_dump(PHP_VERSION);

Changelog

2.87.1

  • NEW: Bump to 4.7
  • NEW: New useronline_custom_template filter

2.87

  • NEW: Remove po/mo files from the plugin
  • NEW: Use translate.wordpress.org to translate the plugin
  • FIXED: Update SCB Framework
  • FIXED: Incompatible scbAdminPage::validate()

2.86

  • FIXED: Notices in Widget Constructor for WordPress 4.3

2.85

  • NEW: Uses WordPress native uninstall.php

2.84

  • NEW: Bump to 4.0

2.83

  • Show user agent when hovering over IP, instead of address lookup
  • Use local time for UserOnline Page
  • Fixed 'Strict Standards: Non-static method' warnings
  • Update scb Framework

2.82

  • show most recent visitors first
  • fix duplicate entry errors
  • fix ajax requests for SSL

2.81

  • fixed settings page
  • fixed "Return to default" buttons
  • show user list in admin only to users with 'manage_options' capability
  • added 'useronline_bots' filter

2.80

  • don't show url and referral links for users in the admin area
  • smarter detection via ajax requests
  • fix SQL errors

2.72

  • fix fatal error on upgrade

2.71

  • fix %USERONLINE_COUNT% problem

2.70

  • added option to link user names to their author page
  • allow displaying online users from a different page than the current page
  • bundle language files
  • more info

2.62 (2010-03-07)

  • fix integration with WP-Stats
  • fix error with get_admin_page_title()

2.61 (2010-02-12)

  • fix fatal error with scbWidget

2.60 (2010-02-12)

  • display admin page titles
  • use domaintools.com instead of arin.net
  • removed ip2nation code and flag images
  • simpler uninstallation procedure
  • much cleaner code
  • more info

2.50 (2009-06-01)

  • new: Works For WordPress 2.8 Only
  • new: Javascript Now Placed At The Footer
  • new: Uses jQuery Instead Of tw-sack
  • new: Minified Javascript Instead Of Packed Javascript
  • new: Renamed useronline-js-packed.js To useronline-js.js
  • new: Renamed useronline-js.js To useronline-js.dev.js
  • new: Translate Javascript Variables Using wp_localize_script()
  • new: Use _n() Instead Of __ngettext() And _n_noop() Instead Of __ngettext_noop()
  • new: Uses New Widget Class From WordPress
  • new: Merge Widget Code To wp-useronline.php And Remove wp-useronline-widget.php
  • fixed: Uses $SERVER['PHP_SELF'] With plugin_basename(__FILE_) Instead Of Just $_SERVER['REQUEST_URI']
  • fixed: Pages Without Name, Use Pages Use $_SERVER['REQUEST_URI'] Instead

2.40 (2008-12-12)

  • new: Works For WordPress 2.7 Only
  • new: Uses plugins_url() And site_url()
  • new: Cache IPs of ip2nation by Kambiz R. Khojasteh
  • new: Country Flags Images Are Now Included As Part Of The Plugin
  • new: Right To Left Language Support by Kambiz R. Khojasteh
  • new: Better Translation Using __ngetext() by Anna Ozeritskaya
  • new: Output Of useronline_page() Applied To "useronline_page" Filter by Kambiz R. Khojasteh
  • new: Called useronline_textdomain() In create_useronline_table() by Kambiz R. Khojasteh
  • fixed: SSL Support

2.31 (2008-07-16)

  • new: Works For WordPress 2.6
  • fixed: MYSQL Charset Issue Should Be Solved
  • fixed: Do Not Show WP-Stats Link If There Is No WP-Stats

2.30 (2008-06-01)

  • new: Works For WordPress 2.5 Only
  • new: Uses Shortcode API
  • new: Uses /wp-useronline/ Folder Instead Of /useronline/
  • new: Uses wp-useronline.php Instead Of useronline.php
  • new: Uses wp-useronline-widget.php Instead Of useronline-widget.php
  • new: Renamed useronline-js.php To useronline-js.js and Move The Dynamic Javascript Variables To The PHP Pages
  • new: Uses useronline-js-packed.js
  • new: Added Users Online To Dashboard "Right Now"
  • new: Use number_format_i18n() Instead
  • fixed: Should Use display_name Instead Of user_name If WP-Stats Is Not Installed
  • fixed: XSS Vulnerability

2.20 (2007-10-01)

  • new: Works For WordPress 2.3 Only
  • new: Templates Options Added
  • new: Ability To Uninstall WP-UserOnline
  • new: Uses WP-Stats Filter To Add Stats Into WP-Stats Page

2.11 (2007-06-01)

  • new: Referral Link Is Now Shown On The UserOnline Page
  • fixed: Uses WordPress's Default Date And Time Format
  • fixed: Able To Leave Blank For 'UserOnline URL' Option To Disable Link To UserOnline Page

2.10 (2007-02-01)

  • new: Works For WordPress 2.1 Only
  • new: Renamed useronline-js.js to useronline-js.php To Enable PHP Parsing

2.06 (2007-01-02)

  • new: useronline.php Now Handles The AJAX Processing Instead Of index.php
  • new: Localize WP-UserOnline
  • fixed: JavaScript onLoad Function Conflict By zeug
  • fixed: AJAX Not Working On Servers Running On PHP CGI
  • fixed: IP2Nation Will Now Work Whether Or Not WP-Stats Is Activated

2.05 (2006-10-01)

  • new: UserOnline Is Now Embedded Into A Page, And Hence No More Integrating Of UserOnline Page (Removed wp-useronline.php)
  • new: Changed In WP-UserOnline Structure: Members Mean Registered Users and Guests Mean Comment Authors
  • new: get_users_browsing_site(false) And get_users_browsing_page(false) Will Now Return An Array Containing Total Users, Total Members, Total Guests and Total Bots Online
  • new: Added Widget Title Option To WP-UserOnline Widget
  • fixed: Invalid IP Error
  • fixed: If Site URL Doesn't Match WP Option's Site URL, WP-UserOnline Will Not Work

2.04 (2006-07-01)

  • new: AJAX Is Now Used For Updating Users Online Every 1 Minute Without Refreshing The Page
  • new: You Can Now Place Users Online Count And Users Browsing Site Data On The Sidebar As A Widget
  • new: UserOnline Options Panel And The Code That WP-UserOnline Generated Is XHTML 1.0 Transitional
  • new: Added Useronline Options In WP Administration Panel Under 'Options -> Useronline'
  • new: If You Have ip2nation Plugin Installed, The User's/Guest's Country Flag Will Be Displayed

2.03 (2006-04-01)

  • new: Added get_users_browsing_site(); To Display Users Browsing The Site
  • fixed: wp-stats.php Link
  • fixed: Some Grammer Errors, Credit To xclouds (http://www.xclouds.com/)

2.02 (2006-03-01)

2.01 (2006-02-01)

  • new: Added Users Browsing Page
  • new: Added Most Users Ever Online
  • fixed: Added UNIQUE Key Instead Of Primary Key To Test Whether It Will Solve Duplicate Entry Errors
  • fixed: Quotes Issue In Page Title

2.00 (2006-01-01)

  • new: Compatible With Only WordPress 2.0
  • new: Better Installer
  • new: GPL License Added
  • new: Page Title Added To wp-useronline.php
  • new: Added Extra Bots, Credit To Greg Perry (http://www.gregrperry.com/)
  • fixed: Cleaner Codes