Event 5031 logs previous theme version after WordPress automatic theme update
-
WP Activity Log appeared to record the previous Divi version (5.12.1) as the “new version” after WordPress successfully auto-updated the theme to 5.13. I’ve attached screenshots showing the incorrect activity-log entry and the actual installed theme version.
Steps to Reproduce
- Install and activate a theme with an available update. In my case, I was on Divi 5.12.1, and then Divi 5.13 became available.
- Enable WordPress automatic updates for the theme.
- Allow WordPress to perform its normal scheduled automatic update.
- After the update completes, check WP Activity Log Event 5031 — “User updated a theme.”
- Compare the version reported by Event 5031 with the version actually installed.
Expected Result: New version in the text shows the new version, 5.13 in my case
Actual Result: New version shows the OLD version, 5.12.1 in my case
I also verified the installed version independently with WP-CLI:
wp theme get Divi --field=versionwhich returns:
5.13The Event 5031 “More details” data contains:
Theme: Name: Divi Version: 5.12.1 ThemeStatus: Active Object: theme EventType: updated UserAgent: WordPress/6.9.7; [site URL] Username: Unknown User- WordPress: 6.9.7
- WP Activity Log: 5.6.6
- Theme: Updated to Divi 5.13
- Theme auto-updates: Enabled in WordPress
Additional context / possible cause — AI generated
I investigated this with AI assistance, and it may be related to theme metadata caching during automatic updates.
Event 5031 reads the updated theme version using
wp_get_theme()duringupgrader_process_complete. WordPress automatic theme updates useclear_update_cache => false, so it seems possible that WP Activity Log may be reading the cached pre-update theme version before WordPress refreshes the theme cache.That could explain why Event 5031 recorded 5.12.1, while the installed theme and subsequent checks report 5.13.
Are you able to take a look and advise?
You must be logged in to reply to this topic.