inboundnow / inbound-mailer-retired

0 stars 1 forks source link

When adding template assets remove unneeded images #64

Closed DavidWells closed 8 years ago

DavidWells commented 8 years ago

The photographer template adds over half a MB to the overall filesize of this plugin.

https://github.com/inboundnow/inbound-mailer/blob/develop/templates/photographer/assets/images/thumb11.jpg etc.

When adding templates, use smaller size placeholder images or use an external service like https://placehold.it/ to reduce overall file size. Or only use one of each image size cc @atwellpub

daprela commented 8 years ago

Done. I've used lorempixels.com to have some real images. There are still 75kb of images that cannot be eliminated. This is the only email template where I use default images so far

atwellpub commented 8 years ago

Did you go with the https:// url or a //: url to account for landing pages running on https?

... I think a :// with no http or https will use whatever the parent protocol is. Not positive though.

daprela commented 8 years ago

you are right, I didn't think about it. The problem is that the service probably serves only http images, not sure how to verify that though, do we have an https url where we can make some tests? The protocol neutral url starts with // I've used it many times

daprela commented 8 years ago

On the other hand, I was thinking that the placeholder images in the mailer shouldn't be a problem as they aren't used in the final version. You get a warning from your browser if you use http elements in an https page but they show up, so it's still good for a first test.

On the other hand, what you've said makes me a bit worried about CTAs and landing pages. We calculate the $urlpath variable, and use it to get the address of all the images, not just the placeholders. Does that give always the right protocol? Is there a way to make sure that the image is loaded with the right protocol, or at least with a protocol agnostic url?

@DavidWells I'm asking for your opinion too, what do you think?

atwellpub commented 8 years ago

I believe the protocols used for the variable builds will return a https if WordPress is setup correctly. For example to build our asset's url/path variables we usually use constants like LANDINGPAGES_PATH and LANDINGPAGES_URLPATH , which are built using WordPress + PHP functions that should pull the right http protocol.

daprela commented 8 years ago

And what about sites that have mixed protocols, use https in some pages and http in other pages? This is used especially in ecommerce websites to force https only in the checkout page but I wouldn't exclude that someone could do the same in other applications

atwellpub commented 8 years ago

I'm not sure. I do not think our assets would have any mixed protocols, and if they did it would be to call a https from an http, which I think is ok if it's to call image assets.