register_filter( 'wp_smush_media_item_size', array( $this, 'only_handle_full_size' ), 10, 2 ); $this->register_action( 'smush_setting_column_right_outside', array( $this, 'render_site_accelerator_notice' ), 20, 2 ); } public function is_photon_active() { return has_filter( 'wp_image_editors', 'photon_subsizes_override_image_editors' ); } public function only_handle_full_size( $size, $key ) { if ( ! $this->is_photon_active() ) { return $size; } return $key === Media_Item::SIZE_KEY_FULL ? $size : false; } public function render_site_accelerator_notice( $name ) { if ( ! $this->is_photon_active() || 'bulk' !== $name ) { return; } $text = sprintf( /* translators: %1$s - , %2$s - */ esc_html__( "We noticed that your site is configured to completely offload intermediate thumbnail sizes (they don't exist in your Media Library), so Smush can't optimize those images. You can still optimize your %1\$sOriginal Images%2\$s if you want to.", 'wp-smushit' ), '', '' ); ?>