45% of programmatic user registrations not recorded in database
-
Title: ~45% of programmatic user registrations not recorded in database
Post:
We’re experiencing a significant issue where approximately 45% of new user registrations are not being recorded by WP Activity Log at all — not hidden from the viewer, but completely absent from the
wp_wsal_occurrencesdatabase table.Setup:
- WordPress 6.9.4
- PHP 8.3.30
- WP Activity Log 5.6.1 (free version)
- Hello Elementor theme 3.4.6
- Custom authentication plugin handling signup/login via OTP
The numbers:
- Total WordPress users: 103
- Distinct users with any activity in
wp_wsal_occurrences: 56 - Missing users: ~47 (45%)
- All event IDs (1000, 4000, 2101, 6061) are enabled
- No user exclusions configured
How we confirmed data is missing:
SELECT * FROM wp_wsal_occurrences WHERE username = '[email protected]' ORDER BY created_on DESC;Returns zero rows. This user exists in WordPress with a
last_loginuser meta timestamp confirming our plugin code executed successfully. WP Activity Log simply never recorded anything.How account creation works in our plugin:
$user_id = wp_insert_user([...]); wp_set_current_user($user_id); $sessions = WP_Session_Tokens::get_instance($user_id); $sessions->destroy_all(); wp_set_auth_cookie($user_id, true); update_user_meta($user_id, 'last_login', current_time('mysql')); // redirect followsWe do NOT fire
do_action('wp_login')because it triggers WooCommerce hooks that interfere with our redirect flow.Pattern observed:
- The missing users are random — not based on time of day, browser, or IP
- For users that ARE tracked, the full flow appears correctly: Passcode sent (6061) → User Created (4000) → User Login (1000) → Page Viewed (2101)
- For missing users, there is zero trace — no events of any kind
- The
wp_set_auth_cookie()call should trigger theset_logged_in_cookieaction which WP Activity Log hooks into, but it’s clearly not catching it ~45% of the time
What we’ve tried:
- Verified all relevant event IDs are enabled
- Confirmed no user or IP exclusions
- Confirmed data is missing from the database, not just the viewer
- Verified our plugin code runs successfully (user meta timestamps exist)
Questions:
- Does WP Activity Log rely on
do_action('wp_login')specifically, or does it also hook intoset_logged_in_cookie/set_auth_cookie? - Is there a known issue with intermittent logging failures for users created via
wp_insert_user()+wp_set_auth_cookie()without an explicitdo_action('wp_login')? - Is there a write buffer, queue, or deduplication mechanism that could silently drop events?
- Any debugging steps we can take to identify why specific users are not being recorded?
Thank you.
The page I need help with: [log in to see the link]
You must be logged in to reply to this topic.