Version Description
Download this release
Release Info
Developer | GamerZ |
Plugin | WP-UserOnline |
Version | 2.87.3 |
Comparing to | |
See all releases |
Code changes from version 2.87.2 to 2.87.3
- admin.php +4 -4
- bots.php +88 -21
- core.php +1 -1
- readme.txt +9 -4
- scb/AdminPage.php +0 -1
- template-tags.php +1 -1
- wp-useronline.php +7 -7
admin.php
CHANGED
@@ -48,7 +48,7 @@ class UserOnline_Admin_Integration extends scbAdminPage {
|
|
48 |
|
49 |
class UserOnline_Options extends scbAdminPage {
|
50 |
|
51 |
-
function setup() {
|
52 |
$this->textdomain = 'wp-useronline';
|
53 |
|
54 |
$this->args = array(
|
@@ -60,7 +60,7 @@ class UserOnline_Options extends scbAdminPage {
|
|
60 |
$this->option_name = 'useronline';
|
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;
|
@@ -74,7 +74,7 @@ class UserOnline_Options extends scbAdminPage {
|
|
74 |
return $options;
|
75 |
}
|
76 |
|
77 |
-
function page_head() {
|
78 |
?>
|
79 |
<style type="text/css">
|
80 |
.form-table td {vertical-align: top}
|
@@ -99,7 +99,7 @@ class UserOnline_Options extends scbAdminPage {
|
|
99 |
<?php
|
100 |
}
|
101 |
|
102 |
-
function page_content() {
|
103 |
$options = $this->options->get();
|
104 |
$defaults = $this->options->get_defaults();
|
105 |
|
48 |
|
49 |
class UserOnline_Options extends scbAdminPage {
|
50 |
|
51 |
+
public function setup() {
|
52 |
$this->textdomain = 'wp-useronline';
|
53 |
|
54 |
$this->args = array(
|
60 |
$this->option_name = 'useronline';
|
61 |
}
|
62 |
|
63 |
+
public 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;
|
74 |
return $options;
|
75 |
}
|
76 |
|
77 |
+
public function page_head() {
|
78 |
?>
|
79 |
<style type="text/css">
|
80 |
.form-table td {vertical-align: top}
|
99 |
<?php
|
100 |
}
|
101 |
|
102 |
+
public function page_content() {
|
103 |
$options = $this->options->get();
|
104 |
$defaults = $this->options->get_defaults();
|
105 |
|
bots.php
CHANGED
@@ -2,34 +2,101 @@
|
|
2 |
|
3 |
function useronline_get_bots() {
|
4 |
$bots = array(
|
5 |
-
'
|
6 |
-
'
|
7 |
-
'
|
8 |
'Alex' => 'ia_archiver',
|
9 |
-
'Lycos' => 'lycos',
|
10 |
-
'Ask Jeeves' => 'jeeves',
|
11 |
-
'Altavista' => 'scooter',
|
12 |
'AllTheWeb' => 'fast-webcrawler',
|
13 |
-
'
|
14 |
-
'
|
15 |
-
'
|
16 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
'Findexa' => 'findexa',
|
18 |
-
'
|
19 |
'Gais' => 'gaisbo',
|
20 |
-
'
|
21 |
-
'
|
22 |
-
'
|
23 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
'PubSub' => 'pubsub',
|
25 |
-
'
|
|
|
26 |
'RadioUserland' => 'userland',
|
27 |
-
'
|
28 |
-
'
|
29 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
'Yandex' => 'yandex',
|
31 |
-
'
|
32 |
-
'Ahrefs' => 'AhrefsBot'
|
33 |
);
|
34 |
|
35 |
return apply_filters( 'useronline_bots', $bots );
|
2 |
|
3 |
function useronline_get_bots() {
|
4 |
$bots = array(
|
5 |
+
'360Spider' => '360spider',
|
6 |
+
'AddThis' => 'addthis',
|
7 |
+
'Ahrefs' => 'ahrefsbot',
|
8 |
'Alex' => 'ia_archiver',
|
|
|
|
|
|
|
9 |
'AllTheWeb' => 'fast-webcrawler',
|
10 |
+
'Altavista' => 'scooter',
|
11 |
+
'Amazon' => 'amazonaws.com',
|
12 |
+
'Anders Pink' => 'anderspinkbot',
|
13 |
+
'Apple' => 'applebot',
|
14 |
+
'Archive.org' => 'archive.org_bot',
|
15 |
+
'Ask Jeeves' => 'jeeves',
|
16 |
+
'Baidu' => 'baidu',
|
17 |
+
'Become.com' => 'become.com',
|
18 |
+
'Bing' => 'bingbot',
|
19 |
+
'Bing Preview' => 'bingpreview',
|
20 |
+
'BLEXBot' => 'blexbot',
|
21 |
+
'Bloglines' => 'bloglines',
|
22 |
+
'Blog Search Engine' => 'blogsearch',
|
23 |
+
'BUbiNG' => 'bubing',
|
24 |
+
'CCBot' => 'ccbot',
|
25 |
+
'CFNetwork' => 'cfnetwork',
|
26 |
+
'Cliqzbot' => 'cliqzbot',
|
27 |
+
'Crawl' => 'crawl',
|
28 |
+
'Curl' => 'Curl',
|
29 |
+
'DotBot' => 'dotbot',
|
30 |
+
'DuckDuckGo' => 'duckduckbot',
|
31 |
+
'EveryoneSocialBot' => 'everyonesocialbot',
|
32 |
+
'Exalead' => 'exabot',
|
33 |
+
'Facebook' => 'facebook',
|
34 |
+
'Facebook Preview' => 'facebookexternalhit',
|
35 |
+
'faceBot' => 'facebot',
|
36 |
+
'Feedfetcher' => 'Feedfetcher',
|
37 |
'Findexa' => 'findexa',
|
38 |
+
'Flipboard Preview' => 'FlipboardProxy',
|
39 |
'Gais' => 'gaisbo',
|
40 |
+
'Gigabot' => 'gigabot',
|
41 |
+
'Gluten Free' => 'gluten free crawler',
|
42 |
+
'Google' => 'google',
|
43 |
+
'Grid' => 'gridbot',
|
44 |
+
'GroupHigh' => 'grouphigh',
|
45 |
+
'Heritrix' => 'heritrix',
|
46 |
+
'IA Archiver' => 'ia_archiver',
|
47 |
+
'Inktomi' => 'slurp@inktomi',
|
48 |
+
'IPS Agent' => 'ips-agent',
|
49 |
+
'James' => 'james bot',
|
50 |
+
'KomodiaBot' => 'komodiabot',
|
51 |
+
'Konqueror' => 'konqueror',
|
52 |
+
'Lindex' => 'linkdexbot',
|
53 |
+
'Linkfluence' => 'linkfluence',
|
54 |
+
'Lycos' => 'lycos',
|
55 |
+
'Maui' => 'mauibot',
|
56 |
+
'Mediatoolkit' => 'mediatoolkitbot',
|
57 |
+
'MetaURI' => 'metauri',
|
58 |
+
'MJ12bot' => 'mj12bot',
|
59 |
+
'MojeekBot' => 'mojeekBot',
|
60 |
+
'Moreover' => 'moreover',
|
61 |
+
'MSN' => 'msnbot',
|
62 |
+
'NBot' => 'nbot',
|
63 |
+
'oBot' => 'oBot',
|
64 |
+
'NextLinks' => 'findlinks',
|
65 |
+
'PaperLiBot' => 'paperliBot',
|
66 |
+
'PhantomJS' => 'phantomjs',
|
67 |
+
'Proximic' => 'proximic',
|
68 |
'PubSub' => 'pubsub',
|
69 |
+
'Qwantify' => 'qwantify',
|
70 |
+
'Radian6' => 'radian6',
|
71 |
'RadioUserland' => 'userland',
|
72 |
+
'Moz' => 'rogerbot',
|
73 |
+
'SEOkicks' => 'seokicks-robot',
|
74 |
+
'SemrushBot' => 'semrushbot',
|
75 |
+
'Seznam' => 'seznam',
|
76 |
+
'SiteExplorer' => 'siteexplorer',
|
77 |
+
'Slurp' => 'slurp',
|
78 |
+
'Sogou' => 'Sogou',
|
79 |
+
'OpenLinkProfiler.org' => 'spbot',
|
80 |
+
'SurveyBot' => 'surveybot',
|
81 |
+
'Syndic8' => 'syndic8',
|
82 |
+
'Technorati' => 'technorati',
|
83 |
+
'TelegramBot' => 'telegrambot',
|
84 |
+
'TraceMyFile' => 'tracemyfile',
|
85 |
+
'Trendsmap' => 'trendsmap',
|
86 |
+
'Turnitin.com' => 'turnitinbot',
|
87 |
+
'The Tweeted Times' => 'tweetedtimes',
|
88 |
+
'TweetmemeBot' => 'tweetmemeBot',
|
89 |
+
'Twingly' => 'twingly',
|
90 |
+
'Twitter' => 'twitterbot',
|
91 |
+
'Wget' => 'wget',
|
92 |
+
'WhatsApp' => 'whatsapp',
|
93 |
+
'WhoisSource' => 'surveybot',
|
94 |
+
'WiseNut' => 'zyborg',
|
95 |
+
'Xenu Link Sleuth' => 'xenu link sleuth',
|
96 |
+
'XoviBot' => 'xoviBot',
|
97 |
+
'Yahoo' => 'yahoo',
|
98 |
'Yandex' => 'yandex',
|
99 |
+
'YisouSpider' => 'yisouspider'
|
|
|
100 |
);
|
101 |
|
102 |
return apply_filters( 'useronline_bots', $bots );
|
core.php
CHANGED
@@ -126,7 +126,7 @@ class UserOnline_Core {
|
|
126 |
$timestamp = current_time( 'mysql' );
|
127 |
|
128 |
// Purge table
|
129 |
-
$wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->useronline WHERE user_ip = %s OR timestamp < DATE_SUB(%s, INTERVAL %d SECOND)", $user_ip, $timestamp, self::$options->timeout ) );
|
130 |
|
131 |
// Insert Users
|
132 |
$data = compact( 'timestamp', 'user_type', 'user_id', 'user_name', 'user_ip', 'user_agent', 'page_title', 'page_url', 'referral' );
|
126 |
$timestamp = current_time( 'mysql' );
|
127 |
|
128 |
// Purge table
|
129 |
+
$wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->useronline WHERE (user_id <> 0 AND user_id = %d) OR (user_id = 0 AND user_agent = %s AND user_ip = %s) OR (timestamp < DATE_SUB(%s, INTERVAL %d SECOND))", $user_id, $user_agent, $user_ip, $timestamp, self::$options->timeout ) );
|
130 |
|
131 |
// Insert Users
|
132 |
$data = compact( 'timestamp', 'user_type', 'user_id', 'user_name', 'user_ip', 'user_agent', 'page_title', 'page_url', 'referral' );
|
readme.txt
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
# WP-UserOnline
|
2 |
Contributors: GamerZ, scribu
|
3 |
-
Donate link:
|
4 |
Tags: useronline, usersonline, wp-useronline, online, users, user, ajax, widget
|
5 |
Requires at least: 4.0
|
6 |
-
Tested up to:
|
7 |
-
Stable tag: 2.87.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -88,9 +88,14 @@ Make sure your host is running PHP 5. The only foolproof way to do this is to ad
|
|
88 |
`var_dump(PHP_VERSION);`
|
89 |
|
90 |
## Changelog
|
|
|
|
|
|
|
|
|
|
|
91 |
### 2.87.2
|
92 |
* NEW: Bump to 4.9
|
93 |
-
*
|
94 |
|
95 |
### 2.87.1
|
96 |
* NEW: Bump to 4.7
|
1 |
# WP-UserOnline
|
2 |
Contributors: GamerZ, scribu
|
3 |
+
Donate link: https://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: 5.2
|
7 |
+
Stable tag: 2.87.3
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
88 |
`var_dump(PHP_VERSION);`
|
89 |
|
90 |
## Changelog
|
91 |
+
### 2.87.3
|
92 |
+
* FIXED: Duplicated Settings Saved admin_notices
|
93 |
+
* FIXED: Missing arrow
|
94 |
+
* FIXED: Updated bots list
|
95 |
+
|
96 |
### 2.87.2
|
97 |
* NEW: Bump to 4.9
|
98 |
+
* FIXED: Notices in SCB Framework
|
99 |
|
100 |
### 2.87.1
|
101 |
* NEW: Bump to 4.7
|
scb/AdminPage.php
CHANGED
@@ -130,7 +130,6 @@ abstract class scbAdminPage {
|
|
130 |
|
131 |
if ( isset( $this->option_name ) ) {
|
132 |
add_action( 'admin_init', array( $this, 'option_init' ) );
|
133 |
-
add_action( 'admin_notices', 'settings_errors' );
|
134 |
}
|
135 |
|
136 |
add_action( 'admin_menu', array( $this, 'page_init' ), $this->args['admin_action_priority'] );
|
130 |
|
131 |
if ( isset( $this->option_name ) ) {
|
132 |
add_action( 'admin_init', array( $this, 'option_init' ) );
|
|
|
133 |
}
|
134 |
|
135 |
add_action( 'admin_menu', array( $this, 'page_init' ), $this->args['admin_action_priority'] );
|
template-tags.php
CHANGED
@@ -97,7 +97,7 @@ function users_online_page() {
|
|
97 |
function is_user_online( $user_id ) {
|
98 |
global $wpdb;
|
99 |
|
100 |
-
return (bool) $wpdb->get_var( $wpdb
|
101 |
}
|
102 |
|
103 |
function get_useronline_( $output, $type = 'site' ) {
|
97 |
function is_user_online( $user_id ) {
|
98 |
global $wpdb;
|
99 |
|
100 |
+
return (bool) $wpdb->get_var( $wpdb->prepare( "SELECT COUNT( * ) FROM $wpdb->useronline WHERE user_id = %d LIMIT 1", $user_id ) );
|
101 |
}
|
102 |
|
103 |
function get_useronline_( $output, $type = 'site' ) {
|
wp-useronline.php
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
Plugin Name: WP-UserOnline
|
4 |
-
Plugin URI:
|
5 |
Description: Enable you to display how many users are online on your Wordpress site
|
6 |
-
Version: 2.87.
|
7 |
Author: Lester 'GaMerZ' Chan
|
8 |
Author URI: https://lesterchan.net
|
9 |
Text Domain: wp-useronline
|
@@ -14,12 +14,12 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
|
14 |
include __DIR__ . '/scb/load.php';
|
15 |
|
16 |
function _useronline_init() {
|
17 |
-
load_plugin_textdomain( 'wp-useronline' );
|
18 |
|
19 |
-
require_once
|
20 |
-
require_once
|
21 |
-
require_once
|
22 |
-
require_once
|
23 |
|
24 |
new scbTable( 'useronline', __FILE__, "
|
25 |
timestamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
1 |
<?php
|
2 |
/*
|
3 |
Plugin Name: WP-UserOnline
|
4 |
+
Plugin URI: https://lesterchan.net/portfolio/programming/php/
|
5 |
Description: Enable you to display how many users are online on your Wordpress site
|
6 |
+
Version: 2.87.3
|
7 |
Author: Lester 'GaMerZ' Chan
|
8 |
Author URI: https://lesterchan.net
|
9 |
Text Domain: wp-useronline
|
14 |
include __DIR__ . '/scb/load.php';
|
15 |
|
16 |
function _useronline_init() {
|
17 |
+
load_plugin_textdomain( 'wp-useronline', false, dirname( plugin_basename( __FILE__ ) ) );
|
18 |
|
19 |
+
require_once __DIR__ . '/core.php';
|
20 |
+
require_once __DIR__ . '/template-tags.php';
|
21 |
+
require_once __DIR__ . '/deprecated.php';
|
22 |
+
require_once __DIR__ . '/widget.php';
|
23 |
|
24 |
new scbTable( 'useronline', __FILE__, "
|
25 |
timestamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|