Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regenerate Existing Images Job: Create main settings screen #486

Open
Tracked by #24
bethanylang opened this issue Aug 16, 2022 · 0 comments
Open
Tracked by #24

Regenerate Existing Images Job: Create main settings screen #486

bethanylang opened this issue Aug 16, 2022 · 0 comments
Labels
[Module] Regenerate Existing Images Issues for the Regenerate Existing Images module [Plugin] Performance Lab Issue relates to work in the Performance Lab Plugin only

Comments

@bethanylang
Copy link
Contributor

bethanylang commented Aug 16, 2022

Create a admin settings screen to start the Regenerate Existing Images background job. This will be a new screen available under the 'Tools' menu and display basic settings to start the Regenerate Existing Images background job.

Acceptance Criteria

  • Create a new admin settings screen under “Tools > Regenerate Images”
  • This screen is only accessible to users with the upload_files and manage_options capabilities.
  • The screen will display the following on the page
    • The title "Regenerate Existing Images"
    • A brief description explaining the feature
    • A basic form containing the following controls:
      • A "Regenerate Images" button that will start the Regenerate Existing Images background job.
      • A delete_images checkbox to delete old images. By default the checkbox is unchecked.
  • When the form is submitted, the POST request is handled by doing the following:
    • Validate the form submission with wp_verify_nonce
    • Check the delete_images checkbox value
    • Create a new background job with the perflab_create_background_job function passing the following
      • regenerate_images as the job name
      • array( 'delete_images' => $delete_images ) as the job data, passing the value of the delete_images checkbox as part of the data
    • Using the $job_id returned by perflab_start_background_job function
      • Passing the newly created $job_id returned by the perflab_create_background_job function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Module] Regenerate Existing Images Issues for the Regenerate Existing Images module [Plugin] Performance Lab Issue relates to work in the Performance Lab Plugin only
Projects
No open projects
Development

No branches or pull requests

3 participants