WP-UserOnline - Version 2.85

Version Description

  • NEW: Uses WordPress native uninstall.php
Download this release

Release Info

Developer GamerZ
Plugin Icon WP-UserOnline
Version 2.85
Comparing to
See all releases

Code changes from version 2.84 to 2.85

Files changed (3) hide show
  1. readme.txt +12 -5
  2. uninstall.php +56 -0
  3. wp-useronline.php +1 -1
readme.txt CHANGED
@@ -1,9 +1,10 @@
1
  === WP-UserOnline ===
2
  Contributors: GamerZ, scribu
 
3
  Tags: useronline, usersonline, wp-useronline, online, users, user, ajax, widget
4
  Requires at least: 3.1
5
- Tested up to: 4.0
6
- Stable tag: 2.84
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -21,6 +22,9 @@ This plugin enables you to display how many users are online on your Wordpress s
21
  = Credits =
22
  * Plugin icon by [Freepik](http://www.freepik.com) from [Flaticon](http://www.flaticon.com)
23
 
 
 
 
24
  == Installation ==
25
  You can either install it automatically from the WordPress admin, or do it manually:
26
 
@@ -53,9 +57,9 @@ If you ARE NOT using nice permalinks, you need to go to `WP-Admin -> Settings ->
53
 
54
  == Screenshots ==
55
 
56
- 1. Right Now text
57
- 2. Admin page
58
- 3. Settings page
59
 
60
  == Frequently Asked Questions ==
61
 
@@ -90,6 +94,9 @@ Make sure your host is running PHP 5. The only foolproof way to do this is to ad
90
  `var_dump(PHP_VERSION);`
91
 
92
  == Changelog ==
 
 
 
93
  = 2.84 =
94
  * NEW: Bump to 4.0
95
 
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: 3.1
6
+ Tested up to: 4.2
7
+ Stable tag: 2.85
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
22
  = Credits =
23
  * Plugin icon by [Freepik](http://www.freepik.com) from [Flaticon](http://www.flaticon.com)
24
 
25
+ = Donations =
26
+ 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.
27
+
28
  == Installation ==
29
  You can either install it automatically from the WordPress admin, or do it manually:
30
 
57
 
58
  == Screenshots ==
59
 
60
+ 1. Admin - Dashboard's Right Now
61
+ 2. UserOnline Page
62
+ 3. Admin - Settings Page
63
 
64
  == Frequently Asked Questions ==
65
 
94
  `var_dump(PHP_VERSION);`
95
 
96
  == Changelog ==
97
+ = 2.85 =
98
+ * NEW: Uses WordPress native uninstall.php
99
+
100
  = 2.84 =
101
  * NEW: Bump to 4.0
102
 
uninstall.php ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Uninstall plugin
4
+ */
5
+ if ( !defined( 'WP_UNINSTALL_PLUGIN' ) )
6
+ exit ();
7
+
8
+ $option_names = array(
9
+ 'useronline'
10
+ , 'useronline_most'
11
+ , 'widget_useronline'
12
+ );
13
+
14
+
15
+ if ( is_multisite() ) {
16
+ $ms_sites = wp_get_sites();
17
+
18
+ if( 0 < sizeof( $ms_sites ) ) {
19
+ foreach ( $ms_sites as $ms_site ) {
20
+ switch_to_blog( $ms_site['blog_id'] );
21
+ if( sizeof( $option_names ) > 0 ) {
22
+ foreach( $option_names as $option_name ) {
23
+ delete_option( $option_name );
24
+ plugin_uninstalled();
25
+ }
26
+ }
27
+ }
28
+ }
29
+
30
+ restore_current_blog();
31
+ } else {
32
+ if( sizeof( $option_names ) > 0 ) {
33
+ foreach( $option_names as $option_name ) {
34
+ delete_option( $option_name );
35
+ plugin_uninstalled();
36
+ }
37
+ }
38
+ }
39
+
40
+ /**
41
+ * Delete plugin table when uninstalled
42
+ *
43
+ * @access public
44
+ * @return void
45
+ */
46
+ function plugin_uninstalled() {
47
+ global $wpdb;
48
+
49
+ $table_names = array( 'useronline' );
50
+ if( sizeof( $table_names ) > 0 ) {
51
+ foreach( $table_names as $table_name ) {
52
+ $table = $wpdb->prefix . $table_name;
53
+ $wpdb->query( "DROP TABLE IF EXISTS $table" );
54
+ }
55
+ }
56
+ }
wp-useronline.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: WP-UserOnline
4
  Plugin URI: http://lesterchan.net/portfolio/programming/php/
5
  Description: Enable you to display how many users are online on your Wordpress site
6
- Version: 2.84
7
  Author: Lester 'GaMerZ' Chan
8
  Author URI: http://lesterchan.net
9
  Text Domain: wp-useronline
3
  Plugin Name: WP-UserOnline
4
  Plugin URI: http://lesterchan.net/portfolio/programming/php/
5
  Description: Enable you to display how many users are online on your Wordpress site
6
+ Version: 2.85
7
  Author: Lester 'GaMerZ' Chan
8
  Author URI: http://lesterchan.net
9
  Text Domain: wp-useronline