gocodebox / gocodebox/lifterlms

Client-side events tracking breaks when using "plain" permalinks

Open
#950 0 comments 0 reactions 0 assignees View on GitHub
good first issue hacktoberfest help wanted Type: Bug
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.