wp-rocket
wp-rocket copied to clipboard
Apply missing dimensions to images on the query string version that will be visited by SaaS
Scope a solution ✅
Engine\Media\ImageDimensions\Subscriber
- Add a new callback method
start_buffer()ontemplate_redirectaction (priority 3) - The
start_buffer()method will perform checks to validate if the buffering should start. This includesis_admin(),is_preview(),REST_REQUEST, and the presence of the query stringwpr_imagedimensions. If everything pass, we can start the buffer with the followingob_start( [ $this, 'specify_image_dimensions' ] );. It will fall back to the existing method callback. - Add tests
Estimate the effort ✅
Effort [S]
Seems okay to me.
Discussed here: https://wp-media.slack.com/archives/CUT7FLHF1/p1709822793531749 Bringing back to grooming for now to investigate if the PHP approach will cover all cases for the SaaS or not.