wp-rocket icon indicating copy to clipboard operation
wp-rocket copied to clipboard

Apply missing dimensions to images on the query string version that will be visited by SaaS

Open remyperona opened this issue 1 year ago • 1 comments

Scope a solution ✅

Engine\Media\ImageDimensions\Subscriber

  • Add a new callback method start_buffer() on template_redirect action (priority 3)
  • The start_buffer() method will perform checks to validate if the buffering should start. This includes is_admin(), is_preview(), REST_REQUEST, and the presence of the query string wpr_imagedimensions. If everything pass, we can start the buffer with the following ob_start( [ $this, 'specify_image_dimensions' ] );. It will fall back to the existing method callback.
  • Add tests

Estimate the effort ✅

Effort [S]

remyperona avatar Feb 08 '24 22:02 remyperona

Seems okay to me.

Miraeld avatar Feb 12 '24 14:02 Miraeld

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.

MathieuLamiot avatar Mar 07 '24 20:03 MathieuLamiot