Skip to content

Conversation

@m1r0
Copy link
Member

@m1r0 m1r0 commented Dec 12, 2025

Resolves p1765271554391509/1764356489.827829-slack-C07418EJ0
Related to 10527031-zd-a8c

Proposed Changes

  • This adds a WP CLI command for recalculating course enrolment - wp sensei enrolment calculate-course [course_id]

Some users reported timeouts on larger sites when the course enrolment calculation is triggered. Having this CLI command offers an alternative to solving the issue.

Testing Instructions

  1. Run wp sensei enrolment calculate-course [course_id] and verify that the Sensei_Enrolment_Course_Calculation_Job is triggered as expected.

Pre-Merge Checklist

  • PR title and description contain sufficient detail and accurately describe the changes
  • Adheres to coding standards (PHP, JavaScript, CSS, HTML)
  • All strings are translatable (without concatenation, handles plurals)
  • Follows our naming conventions (P6rkRX-4oA-p2)
  • Hooks (p6rkRX-1uS-p2) and functions are documented
  • New UIs are responsive and use a mobile-first approach
  • Code is tested on the minimum supported PHP and WordPress versions

@m1r0 m1r0 self-assigned this Dec 12, 2025
Copilot AI review requested due to automatic review settings December 12, 2025 11:59
@m1r0 m1r0 added this to the 4.25.2 milestone Dec 12, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a WP-CLI command (wp sensei enrolment calculate-course) to manually trigger course enrollment recalculation. This addresses timeout issues on larger sites by providing a CLI alternative to web-based enrollment calculation.

Key Changes:

  • New CLI command class for triggering course enrollment calculation jobs
  • Integration with existing enrollment job scheduler infrastructure
  • Support for resuming existing jobs or forcing a restart

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
includes/cli/class-sensei-enrolment-course-calculation-command.php New CLI command that validates course ID, checks job availability, and runs the enrollment calculation job synchronously
includes/class-sensei-cli.php Registers the new sensei enrolment calculate-course command
changelog/update-add-command-for-course-enrolment-recalculation Documents the addition as a patch-level development change

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@m1r0 m1r0 merged commit 1c7218d into trunk Dec 12, 2025
20 of 21 checks passed
@m1r0 m1r0 deleted the update/add-command-for-course-enrolment-recalculation branch December 12, 2025 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants