WordPress.org

Ready to get started?Download WordPress

Forums

Jetpack by WordPress.com
[resolved] photon and https URLs (13 posts)

  1. Will Norris
    Member
    Posted 1 year ago #

    Any particular reason Photon is limited to http URLs on port 80? I redirect all traffic to https. When I manually remove the port and scheme checks from the jetpack plugin, photon works just fine. So why have the seemingly artificial limitation? Is it just because the photon API, as currently designed, doesn't have a place to specify the scheme or port?

    http://wordpress.org/extend/plugins/jetpack/

  2. Jeremy Herve
    Happiness Engineer
    Plugin Author

    Posted 1 year ago #

    You're correct, at the moment Photon is only able to resize and serve images from servers that listen on port 80. That may change in the future as we work on improving the service, but we currently cannot serve images if you use HTTPS on your site.

    You can read more about Photon here:
    http://jetpack.me/support/photon/

  3. Will Norris
    Member
    Posted 1 year ago #

    But that's actually my point... you *can* serve images even if my site uses HTTPS. I'm doing it today. I guess it only works because I redirect http traffic to https, and photon is simply following that redirect. If someone didn't have such a redirect in place, then you're absolutely right that it wouldn't work.

    So allow me to rephrase in the form of a question... would it be possible to add a filter that allows site owners to turn off the strict https checking?

  4. Jeremy Herve
    Happiness Engineer
    Plugin Author

    Posted 1 year ago #

    Sorry for the misunderstanding. You're absolutely right, Photon will serve images over HTTPS, but it can't resize images unless they're available over HTTP. If you were to configure your server to only allow images over HTTPS, Photon wouldn't work.

    But as long as you set your site to use HTTPS, and if your images are available over HTTP as well, everything will work properly. Photon checks for is_ssl(), and will write its URLs to use HTTPS if you want to.

    You can have a look at the code here for more information:
    http://code.trac.wordpress.org/browser/photon

  5. Will Norris
    Member
    Posted 1 year ago #

    actually photon will resize photos from https URLs. to wit:

    original photo: http://willnorris.com/content/uploads/2012/12/pocket-share-to-google.png (this will redirect to the same URL with https)
    photo photo: https://i0.wp.com/willnorris.com/content/uploads/2012/12/pocket-share-to-google.png?resize=100,100

    I've opened a trac ticket with a patch that shows exactly what I'm proposing: http://plugins.trac.wordpress.org/ticket/1653

    Thanks.

  6. Will Norris
    Member
    Posted 1 year ago #

    I hadn't heard anything more on this thread or on the trac ticket, so just wanted to ping this and see what you thought of the patch.

  7. Jeremy Herve
    Happiness Engineer
    Plugin Author

    Posted 1 year ago #

    We didn't forget you! We will have a look at the patch, and we'll reply there.

  8. Raphael Suzuki
    Member
    Posted 1 year ago #

    Any news on this feature?

    Would really be helpful with ecommerce websites.

  9. Jeremy Herve
    Happiness Engineer
    Plugin Author

    Posted 10 months ago #

    We've just committed Will's patch, and the fix will be included in the next Jetpack release.
    http://plugins.trac.wordpress.org/changeset/757167

    You will then be able to use the jetpack_photon_bail_on_https filter to enable Photon for HTTPS URLs.

  10. Will Norris
    Member
    Posted 10 months ago #

    Thanks Jeremy, glad to see this in! One comment though is that the name of the filter implies the opposite of what it is doing. It says "bail on https", implying that setting this to true would make it bail on https. That would be a wrong assumption though, since setting it to true actually means that it *won't* bail on https.

    And technically, it's not bailing or not bailing based on whether the link is "https", it's bailing or not based on whether it is anything other than "http". In practice, that distinction is probably not important, but just pointing it out.

    So maybe a filter name along the lines of "jetpack_photo_allow_https" or something similar would be clearer?

    In any event, thanks for putting this in. :)

  11. Jeremy Herve
    Happiness Engineer
    Plugin Author

    Posted 10 months ago #

    Oh yes indeed. We'll change that. I'll post a link to the changeset once it's done.

  12. Jeremy Herve
    Happiness Engineer
    Plugin Author

    Posted 10 months ago #

    We just committed r759289-plugins.

    The filter is now jetpack_photon_reject_https.

  13. Will Norris
    Member
    Posted 10 months ago #

    looks great, thanks!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags