Version Description
Download this release
Release Info
Developer | GamerZ |
Plugin | WP-UserOnline |
Version | 2.87.2 |
Comparing to | |
See all releases |
Code changes from version 2.87.1 to 2.87.2
- admin.php +3 -3
- readme.txt +43 -39
- scb/AdminPage.php +0 -3
- wp-stats.php +4 -4
- wp-useronline.php +3 -3
admin.php
CHANGED
@@ -61,9 +61,9 @@ class UserOnline_Options extends scbAdminPage {
|
|
61 |
}
|
62 |
|
63 |
function validate( $options, $old_data = array() ) {
|
64 |
-
$options['timeout'] = absint( $options['timeout'] );
|
65 |
-
$options['url'] = trim( $options['url'] );
|
66 |
-
$options['names'] =
|
67 |
|
68 |
foreach ( $options['templates'] as $key => $template )
|
69 |
if ( is_array( $template ) )
|
61 |
}
|
62 |
|
63 |
function validate( $options, $old_data = array() ) {
|
64 |
+
$options['timeout'] = isset( $options['timeout'] ) ? absint( $options['timeout'] ) : 0;
|
65 |
+
$options['url'] = ! empty( $options['url'] ) ? trim( $options['url'] ) : '';
|
66 |
+
$options['names'] = ! empty( $options['names'] ) ? (int) $options['names'] : 0;
|
67 |
|
68 |
foreach ( $options['templates'] as $key => $template )
|
69 |
if ( is_array( $template ) )
|
readme.txt
CHANGED
@@ -1,53 +1,53 @@
|
|
1 |
-
|
2 |
Contributors: GamerZ, scribu
|
3 |
Donate link: http://lesterchan.net/site/donation/
|
4 |
Tags: useronline, usersonline, wp-useronline, online, users, user, ajax, widget
|
5 |
Requires at least: 4.0
|
6 |
-
Tested up to: 4.
|
7 |
-
Stable tag: 2.87.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
11 |
Enable you to display how many users are online on your Wordpress blog with detailed statistics.
|
12 |
|
13 |
-
|
14 |
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).
|
15 |
|
16 |
-
|
17 |
1. Go to `WP-Admin -> Appearance -> Widgets`
|
18 |
1. The widget name is <strong>UserOnline</strong>.
|
19 |
1. Scroll down for instructions on how to create a *UserOnline Page*.
|
20 |
|
21 |
-
|
22 |
* Open `wp-content/themes/<YOUR THEME NAME>/sidebar.php` and add Anywhere:
|
23 |
|
24 |
-
|
25 |
<?php if (function_exists('users_online')): ?>
|
26 |
<p>Users online: <div id="useronline-count"><?php users_online(); ?></div></p>
|
27 |
<?php endif; ?>
|
28 |
-
|
29 |
|
30 |
-
|
31 |
[![Build Status](https://travis-ci.org/lesterchan/wp-useronline.svg?branch=master)](https://travis-ci.org/lesterchan/wp-useronline)
|
32 |
|
33 |
-
|
34 |
[https://github.com/lesterchan/wp-useronline](https://github.com/lesterchan/wp-useronline "https://github.com/lesterchan/wp-useronline")
|
35 |
|
36 |
-
|
37 |
* Plugin icon by [Freepik](http://www.freepik.com) from [Flaticon](http://www.flaticon.com)
|
38 |
|
39 |
-
|
40 |
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.
|
41 |
|
42 |
-
|
43 |
|
44 |
1. Admin - Dashboard's Right Now
|
45 |
2. UserOnline Page
|
46 |
3. Admin - Settings Page
|
47 |
|
48 |
-
|
49 |
|
50 |
-
|
51 |
1. Go to `WP-Admin -> Pages -> Add New`
|
52 |
1. Type any title you like in the post's title area
|
53 |
1. 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.
|
@@ -57,90 +57,94 @@ I spent most of my free time creating, updating, maintaining and supporting thes
|
|
57 |
|
58 |
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.
|
59 |
|
60 |
-
|
61 |
* Use:
|
62 |
-
|
63 |
<?php if (function_exists('get_most_users_online')): ?>
|
64 |
<p>Most Users Ever Online Is <?php echo get_most_users_online(); ?> On <?php echo get_most_users_online_date(); ?></p>
|
65 |
<?php endif; ?>
|
66 |
-
|
67 |
|
68 |
-
|
69 |
* Use:
|
70 |
-
|
71 |
<?php if (function_exists('get_users_browsing_site')): ?>
|
72 |
<div id="useronline-browsing-site"><?php echo get_users_browsing_site(); ?></div>
|
73 |
<?php endif; ?>
|
74 |
-
|
75 |
|
76 |
-
|
77 |
* Use:
|
78 |
-
|
79 |
<?php if (function_exists('get_users_browsing_page')): ?>
|
80 |
<div id="useronline-browsing-page"><?php echo get_users_browsing_page(); ?></div>
|
81 |
<?php endif; ?>
|
82 |
-
|
83 |
|
84 |
-
|
85 |
|
86 |
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):
|
87 |
|
88 |
`var_dump(PHP_VERSION);`
|
89 |
|
90 |
-
|
91 |
-
|
|
|
|
|
|
|
|
|
92 |
* NEW: Bump to 4.7
|
93 |
* NEW: New useronline_custom_template filter
|
94 |
|
95 |
-
|
96 |
* NEW: Remove po/mo files from the plugin
|
97 |
* NEW: Use translate.wordpress.org to translate the plugin
|
98 |
* FIXED: Update SCB Framework
|
99 |
* FIXED: Incompatible scbAdminPage::validate()
|
100 |
|
101 |
-
|
102 |
* FIXED: Notices in Widget Constructor for WordPress 4.3
|
103 |
|
104 |
-
|
105 |
* NEW: Uses WordPress native uninstall.php
|
106 |
|
107 |
-
|
108 |
* NEW: Bump to 4.0
|
109 |
|
110 |
-
|
111 |
* Show user agent when hovering over IP, instead of address lookup
|
112 |
* Use local time for UserOnline Page
|
113 |
* Fixed 'Strict Standards: Non-static method' warnings
|
114 |
* Update scb Framework
|
115 |
|
116 |
-
|
117 |
* show most recent visitors first
|
118 |
* fix duplicate entry errors
|
119 |
* fix ajax requests for SSL
|
120 |
|
121 |
-
|
122 |
* fixed settings page
|
123 |
* fixed "Return to default" buttons
|
124 |
* show user list in admin only to users with 'manage_options' capability
|
125 |
* added 'useronline_bots' filter
|
126 |
|
127 |
-
|
128 |
* don't show url and referral links for users in the admin area
|
129 |
* smarter detection via ajax requests
|
130 |
* fix SQL errors
|
131 |
|
132 |
-
|
133 |
* fix fatal error on upgrade
|
134 |
|
135 |
-
|
136 |
* fix %USERONLINE_COUNT% problem
|
137 |
|
138 |
-
|
139 |
* added option to link user names to their author page
|
140 |
* allow displaying online users from a different page than the current page
|
141 |
* bundle language files
|
142 |
* [more info](http://scribu.net/wordpress/wp-useronline/wu-2-70.html)
|
143 |
|
144 |
-
|
145 |
* fix integration with WP-Stats
|
146 |
* fix error with get_admin_page_title()
|
1 |
+
# WP-UserOnline
|
2 |
Contributors: GamerZ, scribu
|
3 |
Donate link: http://lesterchan.net/site/donation/
|
4 |
Tags: useronline, usersonline, wp-useronline, online, users, user, ajax, widget
|
5 |
Requires at least: 4.0
|
6 |
+
Tested up to: 4.9
|
7 |
+
Stable tag: 2.87.2
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
11 |
Enable you to display how many users are online on your Wordpress blog with detailed statistics.
|
12 |
|
13 |
+
## Description
|
14 |
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).
|
15 |
|
16 |
+
### Usage (With Widget)
|
17 |
1. Go to `WP-Admin -> Appearance -> Widgets`
|
18 |
1. The widget name is <strong>UserOnline</strong>.
|
19 |
1. Scroll down for instructions on how to create a *UserOnline Page*.
|
20 |
|
21 |
+
### Usage (Without Widget)
|
22 |
* Open `wp-content/themes/<YOUR THEME NAME>/sidebar.php` and add Anywhere:
|
23 |
|
24 |
+
~~~
|
25 |
<?php if (function_exists('users_online')): ?>
|
26 |
<p>Users online: <div id="useronline-count"><?php users_online(); ?></div></p>
|
27 |
<?php endif; ?>
|
28 |
+
~~~
|
29 |
|
30 |
+
### Build Status
|
31 |
[![Build Status](https://travis-ci.org/lesterchan/wp-useronline.svg?branch=master)](https://travis-ci.org/lesterchan/wp-useronline)
|
32 |
|
33 |
+
### Development
|
34 |
[https://github.com/lesterchan/wp-useronline](https://github.com/lesterchan/wp-useronline "https://github.com/lesterchan/wp-useronline")
|
35 |
|
36 |
+
### Credits
|
37 |
* Plugin icon by [Freepik](http://www.freepik.com) from [Flaticon](http://www.flaticon.com)
|
38 |
|
39 |
+
### Donations
|
40 |
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.
|
41 |
|
42 |
+
## Screenshots
|
43 |
|
44 |
1. Admin - Dashboard's Right Now
|
45 |
2. UserOnline Page
|
46 |
3. Admin - Settings Page
|
47 |
|
48 |
+
## Frequently Asked Questions
|
49 |
|
50 |
+
### Creating A UserOnline Page
|
51 |
1. Go to `WP-Admin -> Pages -> Add New`
|
52 |
1. Type any title you like in the post's title area
|
53 |
1. 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.
|
57 |
|
58 |
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.
|
59 |
|
60 |
+
### To Display Most Number Of Users Online
|
61 |
* Use:
|
62 |
+
~~~
|
63 |
<?php if (function_exists('get_most_users_online')): ?>
|
64 |
<p>Most Users Ever Online Is <?php echo get_most_users_online(); ?> On <?php echo get_most_users_online_date(); ?></p>
|
65 |
<?php endif; ?>
|
66 |
+
~~~
|
67 |
|
68 |
+
### To Display Users Browsing Site
|
69 |
* Use:
|
70 |
+
~~~
|
71 |
<?php if (function_exists('get_users_browsing_site')): ?>
|
72 |
<div id="useronline-browsing-site"><?php echo get_users_browsing_site(); ?></div>
|
73 |
<?php endif; ?>
|
74 |
+
~~~
|
75 |
|
76 |
+
### To Display Users Browsing A Page
|
77 |
* Use:
|
78 |
+
~~~
|
79 |
<?php if (function_exists('get_users_browsing_page')): ?>
|
80 |
<div id="useronline-browsing-page"><?php echo get_users_browsing_page(); ?></div>
|
81 |
<?php endif; ?>
|
82 |
+
~~~
|
83 |
|
84 |
+
### Error on activation: "Parse error: syntax error, unexpected..."
|
85 |
|
86 |
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):
|
87 |
|
88 |
`var_dump(PHP_VERSION);`
|
89 |
|
90 |
+
## Changelog
|
91 |
+
### 2.87.2
|
92 |
+
* NEW: Bump to 4.9
|
93 |
+
* FIXES: Notices in SCB Framework
|
94 |
+
|
95 |
+
### 2.87.1
|
96 |
* NEW: Bump to 4.7
|
97 |
* NEW: New useronline_custom_template filter
|
98 |
|
99 |
+
### 2.87
|
100 |
* NEW: Remove po/mo files from the plugin
|
101 |
* NEW: Use translate.wordpress.org to translate the plugin
|
102 |
* FIXED: Update SCB Framework
|
103 |
* FIXED: Incompatible scbAdminPage::validate()
|
104 |
|
105 |
+
### 2.86
|
106 |
* FIXED: Notices in Widget Constructor for WordPress 4.3
|
107 |
|
108 |
+
### 2.85
|
109 |
* NEW: Uses WordPress native uninstall.php
|
110 |
|
111 |
+
### 2.84
|
112 |
* NEW: Bump to 4.0
|
113 |
|
114 |
+
### 2.83
|
115 |
* Show user agent when hovering over IP, instead of address lookup
|
116 |
* Use local time for UserOnline Page
|
117 |
* Fixed 'Strict Standards: Non-static method' warnings
|
118 |
* Update scb Framework
|
119 |
|
120 |
+
### 2.82
|
121 |
* show most recent visitors first
|
122 |
* fix duplicate entry errors
|
123 |
* fix ajax requests for SSL
|
124 |
|
125 |
+
### 2.81
|
126 |
* fixed settings page
|
127 |
* fixed "Return to default" buttons
|
128 |
* show user list in admin only to users with 'manage_options' capability
|
129 |
* added 'useronline_bots' filter
|
130 |
|
131 |
+
### 2.80
|
132 |
* don't show url and referral links for users in the admin area
|
133 |
* smarter detection via ajax requests
|
134 |
* fix SQL errors
|
135 |
|
136 |
+
### 2.72
|
137 |
* fix fatal error on upgrade
|
138 |
|
139 |
+
### 2.71
|
140 |
* fix %USERONLINE_COUNT% problem
|
141 |
|
142 |
+
### 2.70
|
143 |
* added option to link user names to their author page
|
144 |
* allow displaying online users from a different page than the current page
|
145 |
* bundle language files
|
146 |
* [more info](http://scribu.net/wordpress/wp-useronline/wu-2-70.html)
|
147 |
|
148 |
+
### 2.62 (2010-03-07)
|
149 |
* fix integration with WP-Stats
|
150 |
* fix error with get_admin_page_title()
|
scb/AdminPage.php
CHANGED
@@ -13,7 +13,6 @@ abstract class scbAdminPage {
|
|
13 |
* $toplevel (string) If not empty, will create a new top level menu (for expected values see http://codex.wordpress.org/Administration_Menus#Using_add_submenu_page)
|
14 |
* - $icon_url (string) URL to an icon for the top level menu
|
15 |
* - $position (int) Position of the toplevel menu (caution!)
|
16 |
-
* $screen_icon (string) The icon type to use in the screen header
|
17 |
* $nonce string (default: $page_slug)
|
18 |
* $action_link (string|bool) Text of the action link on the Plugins page (default: 'Settings')
|
19 |
* $admin_action_priority int The priority that the admin_menu action should be executed at (default: 10)
|
@@ -186,7 +185,6 @@ abstract class scbAdminPage {
|
|
186 |
*/
|
187 |
protected function page_header() {
|
188 |
echo "<div class='wrap'>\n";
|
189 |
-
screen_icon( $this->args['screen_icon'] );
|
190 |
echo html( 'h2', $this->args['page_title'] );
|
191 |
}
|
192 |
|
@@ -510,7 +508,6 @@ abstract class scbAdminPage {
|
|
510 |
'toplevel' => '',
|
511 |
'position' => null,
|
512 |
'icon_url' => '',
|
513 |
-
'screen_icon' => '',
|
514 |
'parent' => 'options-general.php',
|
515 |
'capability' => 'manage_options',
|
516 |
'menu_title' => $this->args['page_title'],
|
13 |
* $toplevel (string) If not empty, will create a new top level menu (for expected values see http://codex.wordpress.org/Administration_Menus#Using_add_submenu_page)
|
14 |
* - $icon_url (string) URL to an icon for the top level menu
|
15 |
* - $position (int) Position of the toplevel menu (caution!)
|
|
|
16 |
* $nonce string (default: $page_slug)
|
17 |
* $action_link (string|bool) Text of the action link on the Plugins page (default: 'Settings')
|
18 |
* $admin_action_priority int The priority that the admin_menu action should be executed at (default: 10)
|
185 |
*/
|
186 |
protected function page_header() {
|
187 |
echo "<div class='wrap'>\n";
|
|
|
188 |
echo html( 'h2', $this->args['page_title'] );
|
189 |
}
|
190 |
|
508 |
'toplevel' => '',
|
509 |
'position' => null,
|
510 |
'icon_url' => '',
|
|
|
511 |
'parent' => 'options-general.php',
|
512 |
'capability' => 'manage_options',
|
513 |
'menu_title' => $this->args['page_title'],
|
wp-stats.php
CHANGED
@@ -3,13 +3,13 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
|
3 |
|
4 |
class UserOnline_WpStats {
|
5 |
|
6 |
-
function init() {
|
7 |
add_filter( 'wp_stats_page_admin_plugins', array( __CLASS__, 'page_admin_general_stats' ) );
|
8 |
add_filter( 'wp_stats_page_plugins', array( __CLASS__, 'page_general_stats' ) );
|
9 |
}
|
10 |
|
11 |
// Add WP-UserOnline General Stats To WP-Stats Page Options
|
12 |
-
function page_admin_general_stats( $content ) {
|
13 |
$stats_display = get_option( 'stats_display' );
|
14 |
|
15 |
$content .= '<input type="checkbox" name="stats_display[]" id="wpstats_useronline" value="useronline"' . checked( $stats_display['useronline'], 1, false ) . '/> <label for="wpstats_useronline">'.__( 'WP-UserOnline', 'wp-useronline' ).'</label><br />'."\n";
|
@@ -18,7 +18,7 @@ class UserOnline_WpStats {
|
|
18 |
}
|
19 |
|
20 |
// Add WP-UserOnline General Stats To WP-Stats Page
|
21 |
-
function page_general_stats( $content ) {
|
22 |
$stats_display = get_option( 'stats_display' );
|
23 |
|
24 |
$str = _n(
|
@@ -27,7 +27,7 @@ class UserOnline_WpStats {
|
|
27 |
get_users_online_count(), 'wp-useronline'
|
28 |
);
|
29 |
|
30 |
-
if ( $stats_display['useronline']
|
31 |
$content .=
|
32 |
html( 'p', html( 'strong', __( 'WP-UserOnline', 'wp-useronline' ) ) )
|
33 |
.html( 'ul',
|
3 |
|
4 |
class UserOnline_WpStats {
|
5 |
|
6 |
+
public static function init() {
|
7 |
add_filter( 'wp_stats_page_admin_plugins', array( __CLASS__, 'page_admin_general_stats' ) );
|
8 |
add_filter( 'wp_stats_page_plugins', array( __CLASS__, 'page_general_stats' ) );
|
9 |
}
|
10 |
|
11 |
// Add WP-UserOnline General Stats To WP-Stats Page Options
|
12 |
+
public function page_admin_general_stats( $content ) {
|
13 |
$stats_display = get_option( 'stats_display' );
|
14 |
|
15 |
$content .= '<input type="checkbox" name="stats_display[]" id="wpstats_useronline" value="useronline"' . checked( $stats_display['useronline'], 1, false ) . '/> <label for="wpstats_useronline">'.__( 'WP-UserOnline', 'wp-useronline' ).'</label><br />'."\n";
|
18 |
}
|
19 |
|
20 |
// Add WP-UserOnline General Stats To WP-Stats Page
|
21 |
+
public function page_general_stats( $content ) {
|
22 |
$stats_display = get_option( 'stats_display' );
|
23 |
|
24 |
$str = _n(
|
27 |
get_users_online_count(), 'wp-useronline'
|
28 |
);
|
29 |
|
30 |
+
if ( $stats_display['useronline'] === 1 )
|
31 |
$content .=
|
32 |
html( 'p', html( 'strong', __( 'WP-UserOnline', 'wp-useronline' ) ) )
|
33 |
.html( 'ul',
|
wp-useronline.php
CHANGED
@@ -11,7 +11,7 @@ Text Domain: wp-useronline
|
|
11 |
|
12 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
13 |
|
14 |
-
|
15 |
|
16 |
function _useronline_init() {
|
17 |
load_plugin_textdomain( 'wp-useronline' );
|
@@ -83,13 +83,13 @@ function _useronline_init() {
|
|
83 |
scbWidget::init( 'UserOnline_Widget', __FILE__, 'useronline' );
|
84 |
|
85 |
if ( is_admin() ) {
|
86 |
-
require_once
|
87 |
scbAdminPage::register( 'UserOnline_Admin_Integration', __FILE__ );
|
88 |
scbAdminPage::register( 'UserOnline_Options', __FILE__, UserOnline_Core::$options );
|
89 |
}
|
90 |
|
91 |
if ( function_exists( 'stats_page' ) )
|
92 |
-
require_once
|
93 |
|
94 |
# scbUtil::do_uninstall( __FILE__ );
|
95 |
# scbUtil::do_activation( __FILE__ );
|
11 |
|
12 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
13 |
|
14 |
+
include __DIR__ . '/scb/load.php';
|
15 |
|
16 |
function _useronline_init() {
|
17 |
load_plugin_textdomain( 'wp-useronline' );
|
83 |
scbWidget::init( 'UserOnline_Widget', __FILE__, 'useronline' );
|
84 |
|
85 |
if ( is_admin() ) {
|
86 |
+
require_once __DIR__ . '/admin.php';
|
87 |
scbAdminPage::register( 'UserOnline_Admin_Integration', __FILE__ );
|
88 |
scbAdminPage::register( 'UserOnline_Options', __FILE__, UserOnline_Core::$options );
|
89 |
}
|
90 |
|
91 |
if ( function_exists( 'stats_page' ) )
|
92 |
+
require_once __DIR__ . '/wp-stats.php';
|
93 |
|
94 |
# scbUtil::do_uninstall( __FILE__ );
|
95 |
# scbUtil::do_activation( __FILE__ );
|