Poor theme performance due to calling Sensei `get_courses_average_grade()`.
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 333
- Forks
- 127
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 11
Description
The learn theme makes uncached calls to get_courses_average_grade() in the Course sidebar that causes a rather slow SQL query on certain pages.
This is mostly visible with courses that have been attempted by a lot of users.
We should ideally:
- Cache the value on the post type (Either as postmeta, or in object cache)
- Either calculate the average on a cron (postmeta), or update it upon course completion (postmeta, object cache + ondemand)
- Switch to a stored Sensei meta value if one exists
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Learn theme's Course sidebar and the linked Sensei reports service at lines 84-108 to trace the uncached average-grade call. Determine whether Sensei already exposes a stored meta value, then choose and implement a caching or precomputation approach that removes the slow query on affected course pages. Done means the sidebar no longer makes the uncached call while still showing the course average.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php, wordpress
- Domain
- backend, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100