gocodebox / gocodebox/lifterlms
Client-side events tracking breaks when using "plain" permalinks
- Dominant language
- PHP
- Stars
- 212
- Forks
- 140
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 19
Description
### Reproduction Steps
+ Enable "plain" permalinks on a site
+ Log in and visit a course
+ leave the course and enter a section
### Expected Behavior
+ `page.load` and `page.exit` events should be stored in the DB for the user.
### Actual Behavior
+ No events are stored.
### Error Messages / Logs
The events fail silently and don't record any errors.
Temporarily adding a log to the event validation return will surface the error
https://github.com/gocodebox/lifterlms/blob/master/includes/class-llms-events.php#L422
The source is https://github.com/gocodebox/lifterlms/blob/master/includes/class-llms-events.php#L152
`url_to_post_id()` requires rewrite rules to be enabled (eg no "plain" permalinks).
We should be able to pull the post id from plain permalinks to still support this structure instead of saying tracking doesn't work when plain permalinks are enabled.
### System Information
LifterLMS 3.36.0 or later.
Contributor guide
Research direction
Start in includes/class-llms-events.php at the event source near line 152 and validation near line 422, then trace how url_to_post_id() handles plain permalinks. Reproduce the listed course and section navigation with plain permalinks and verify that page.load and page.exit events are stored for the user.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php, wordpress
- Domain
- analytics, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100