Repository navigation
Use progress storage for course completion report values - #8341
Conversation
59f00c0 to
820e55c
Compare
|
@claude Please review. |
Code ReviewReviewed the diff for PR #8341 (base 1. (Medium) New "sort by Completions" path adds extra full-catalog queries and a linearly-growing
|
|
Thanks for the review. The sorting concern is addressed in 2f3d032: the Completions column is no longer sortable, and the full-catalog lookup and growing We left the deprecation notice as-is. With sorting removed, a normal Courses page or CSV export calls the count method twice, regardless of the number of rows. It emits a notice only when a callback is registered on the deprecated filter, and WordPress logs it only when deprecation logging is enabled. Two notices per request are minor log noise, so we did not add state solely to suppress the second one. |
Proposed Changes
The Courses overview previously read per-course completions through the comments-era activity helper, so its Completions and Completion Rate values could disagree with HPPS progress. Read these values from the selected progress backend and resolve translated course IDs to their stored progress IDs. The overview header and CSV now agree with the rows. Remove Completions sorting because the previous sort used a different count and sorting by the new count required an expensive query across all courses.
Testing Instructions
Deprecated Code
sensei_analysis_course_completionsis deprecated. UseSensei_Reports_Overview_Service_Courses::get_completion_counts_by_course()for report-ready completion counts.Related to SEN-83.