WP-UserOnline 4.0.0
-
WP-UserOnline 4.0.0 is a total rewrite of the plugin with Claude Code to make it more modern and testable. There will be breaking changes. Please do test it https://github.com/lesterchan/wp-useronline/archive/refs/heads/master.zip
WP-UserOnline 4.0.0 requires WordPress 6.8 and PHP 8.2. A site on an older stack is simply not offered the update, so if WP-UserOnline has stopped appearing in your updates list, that is why.
Every filter is renamed, with no deprecation shims. Code hooking an old name stops running, silently: useronline_bots is now wp_useronline_bots; useronline_buckets is now wp_useronline_buckets; useronline_custom_template is now wp_useronline_custom_template; useronline_page is now wp_useronline_page; useronline_display_user is now wp_useronline_display_user; and useronline_trust_proxy is now wp_useronline_trust_proxy.
USERONLINE_TRUST_PROXY is now WP_USERONLINE_TRUST_PROXY. Left unrenamed in wp-config.php, the plugin stops trusting the proxy and every visitor reports the same IP address. See the FAQ.
One screen, three tabs, under a WP-UserOnline menu of its own. index.php?page=useronline and options-general.php?page=useronline-settings are both gone. Everything is at admin.php?page=wp-useronline, which opens on Users Online; the settings are at &tab=settings and the templates at &tab=templates. Bookmarks and any code linking to the old addresses need updating.
Every tab now requires manage_options. Users Online previously needed only list_users, which included editors on many sites. To restore that:
add_filter( 'wp_useronline_capability', function ( $capability, $context ) {return 'useronline' === $context ? 'list_users' : $capability;}, 10, 2 );Settings migrate on the first admin page load. useronline becomes wp_useronline_options, useronline_most becomes wp_useronline_most, and the two upgrade markers move into wp_useronline_version. Code reading the old rows directly will find them gone. wp_useronline_most is no longer autoloaded.
Update all seven WP-Stats plugins together. WP-Stats, WP-UserOnline, WP-Polls, WP-PostRatings, WP-EMail, WP-PostViews and WP-DownloadManager shared one unprefixed stats_display row. Each now keeps its own copy and deletes the shared row once it has read it, so whichever you update first takes it from the rest. A missing row means “show”, so a block you had switched off may reappear — switch it off again under WP-UserOnline -> Settings -> WP-Stats, on the Settings tab.
Classes are renamed to WP_UserOnline_*: UserOnline is WP_UserOnline, UserOnline_Template is WP_UserOnline_Template, and so on. The template tags — users_online(), get_users_online(), get_users_browsing_site(), get_most_users_online() and the rest — the [page_useronline] shortcode, and the useronline-count, useronline-browsing-site, useronline-browsing-page and useronline-details element ids are unchanged.
Custom JavaScript. useronline.js is now js/wp-useronline.js, its localised object is wpUserOnlineL10n rather than useronlineL10n, and the admin-ajax action is wp_useronline rather than useronline.
The page I need help with: [log in to see the link]
You must be logged in to reply to this topic.