VIP-Coding-Standards icon indicating copy to clipboard operation
VIP-Coding-Standards copied to clipboard

Report on code attempting to set image quality for VIP Go File service to 100

Open david-binda opened this issue 8 years ago • 3 comments

We might want to start with something simple, prone to false positives. Eg.: reporting a Warning on every $var['quality'] = 100; or $var['quality'] = '100'.

david-binda avatar Mar 10 '17 10:03 david-binda

I would strongly encourage that they go with 95 or below

was mentioned here so perhaps we should have this catch anything above 95 rather than just 100?

philipjohn avatar Mar 21 '17 12:03 philipjohn

Or would it be better to flag for the filter vip_go_image_resize_pre_args and do a manual inspection for quality > 95?

add_filter( 'vip_go_image_resize_pre_args', 'image_quality_filter' );
function image_quality_filter( $args ) {
  $args['quality'] = 100;
}

rebeccahum avatar Oct 24 '18 17:10 rebeccahum

Adding jetpack_photon_pre_args to the list of hooks to flag for...

rebeccahum avatar Nov 28 '18 18:11 rebeccahum