WP-Stats 3.0.0
-
WP-Stats 3.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-stats/archive/refs/heads/master.zip
WP-Stats 3.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-Stats has stopped appearing in your updates list, that is why.
Both admin screens moved, and they are now one screen. The statistics were at Dashboard -> WP-Stats and the settings at Settings -> Stats; there is one WP-Stats menu now opening one page with two tabs, Statistics and Settings. Bookmarks to either old screen stop working: the page is wp-admin/admin.php?page=wp-stats, and the settings are wp-admin/admin.php?page=wp-stats&tab=settings. The menu has no submenu entries any more. Nothing else about the screens changed.
wp_stats_capability still tells the two apart. It is filtered per tab rather than per screen, with the same statistics and settings contexts. A tab the current user cannot open is not drawn, and the page itself is registered with whichever of the two capabilities that user holds — so handing out the statistics tab alone works exactly as it did when it was its own menu entry.
Update all seven WP-Stats plugins together. WP-Stats, WP-EMail, WP-Polls, WP-PostRatings, WP-PostViews, WP-UserOnline and WP-DownloadManager put their own blocks on the statistics page, and all seven shared one unprefixed stats_display row between them. Each plugin keeps that setting in its own settings now, and the shared row is deleted during the upgrade. An older copy of any of the six simply stops appearing on the statistics page until you update it; if a block does not come back, switch it on again in that plugin’s own settings.
Everything WP-Stats stores is renamed and migrated for you. stats_url, stats_mostlimit and stats_display become one wp_stats_options row, and the upgrade marker becomes wp_stats_version. The old rows are read once and then deleted, so code calling get_option( ‘stats_url’ ) or get_option( ‘stats_display’ ) now gets false.
Hook names changed. stats_page is now wp_stats_page. The wp_stats_page_general, wp_stats_page_plugins, wp_stats_page_recent, wp_stats_page_most, wp_stats_page_authors, wp_stats_page_comments_members, wp_stats_page_misc, wp_stats_paging_start and wp_stats_paging_end filters, the seven wp_stats_page_admin_* filters, and the stats_display_defaults() function are all removed. The replacement is one filter, wp_stats_sections — see “For Plugin Authors” in the plugin description. Every template tag a theme calls (get_totalposts(), get_recentcomments(), stats_page(), snippet_text() and the rest) keeps its name and its arguments.
Two smaller changes. The “Plugins Stats” heading no longer appears when no plugin has contributed a block to it, and the front-end stylesheet is scoped to WP-Stats’ own markup, so it no longer restyles WP-PageNavi — which also means WP-Stats no longer switches its own styles off when WP-PageNavi is active.
The page I need help with: [log in to see the link]
You must be logged in to reply to this topic.