Add WP CLI Commands for Image Optimization #95
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proposed changes
This PR introduces WP-CLI commands for managing Image Optimization settings, giving us more control over toggling features via the CLI.
It also adds a new NFD_WPCLI class, which serves as a centralized way to register commands under the nfd namespace. This will act as Newfold’s standardized layer for adding commands to WP-CLI programmatically.
Might be worth discussing how we can standardize NFD_WPCLI across other modules.
Available Commands
Structure
Bulk Optimization
Enable or disable bulk optimization for media images.
Lazy Loading
Control lazy loading for images.
Auto-Optimize Uploaded Images
Automatically optimize images upon upload.
Auto-Delete Original Images
Remove the original image after optimization.
WebP Preference
Prioritize WebP images when an optimized version is available.
Toggle All Settings
Enable or disable all image optimization settings at once.
Type of Change
Production
Development
Video
Checklist
Further comments