-
Notifications
You must be signed in to change notification settings - Fork 143
Create Background Processing Infrastructure: Create wp_ajax request handler for perflab_start_background_job function #481
Copy link
Copy link
Closed as not planned
Closed as not planned
Copy link
Labels
[Plugin] Performance LabIssue relates to work in the Performance Lab Plugin onlyIssue relates to work in the Performance Lab Plugin only[Plugin] Regenerate Existing ImagesIssues for the Regenerate Existing Images moduleIssues for the Regenerate Existing Images module
Description
Create a new function and action that handles the HTTP request sent from the perflab_start_background_job.
Acceptance Criteria
- Create a custom function and register to the action
wp_ajax_background_process_handle_request- The function accepts no parameters and takes data from the request
- The function will process the request as follows
- Verify the request by checking the nonce passed with
check_ajax_refererfunction- If the verification fails, the action will return early
- Verify the job is not currently running
- Take the
$job_idfrom the HTTP request data - Using the job ID, check the
job_lockterm meta for this specific job - If the
job_lockterm meta is set, the job is running and the action will return early
- Take the
- If both checks above past, the job is run by calling the
perflab_background_process_runfunction- The
perflab_background_process_runis called passing the$job_idas it's only parameter - The
perflab_background_process_rundoes not return anything (void)
- The
- Verify the request by checking the nonce passed with
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
[Plugin] Performance LabIssue relates to work in the Performance Lab Plugin onlyIssue relates to work in the Performance Lab Plugin only[Plugin] Regenerate Existing ImagesIssues for the Regenerate Existing Images moduleIssues for the Regenerate Existing Images module
Type
Fields
Give feedbackNo fields configured for issues without a type.