WordPress.org

Ready to get started?Download WordPress

Forums

Jetpack by WordPress.com
[resolved] enable jetpack photon https (9 posts)

  1. jason102178
    Member
    Posted 10 months ago #

    Hi,

    I was wondering if someone could help me or point me in the right direction, in the past when the feature photon came out i was told that photon currently does not support https site since it can serve the images via https or something on the order of that..

    Then just today i upgraded jetpack and noticed that you guys added this enhancement
    Enhancement: Photon: New filter to let site admins/owners enable photon for HTTPS urls.

    I enabled photon then reloaded my page with the images but the url its serving is still my domain

    I am trying to enable it to work so that it works as its intended and the url should look something like this
    https://i0.wp.com/

    am i doing something wrong or is their something else i have too do.

    Thanks

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

  2. Jeremy Herve
    Happiness Engineer
    Plugin Author

    Posted 10 months ago #

    Photon is still disabled for HTTPS URLs by default. You can, however, overwrite the default behaviour thanks to the jetpack_photon_reject_https filter (#). The filter is set to true by default, but if you set it to false your images served via HTTPS will start being served by Photon.

    I hope this helps.

  3. jason102178
    Member
    Posted 10 months ago #

    Thank you for your reply Jeremy, that did the trick, i was wondering if this was going to ever be set to enabled by default....

    Cause as of right now everytime i upgrade the jetpack plugin i will have to remember to re enable and set it to false each time.

  4. Jeremy Herve
    Happiness Engineer
    Plugin Author

    Posted 10 months ago #

    This won't be enabled by default, but you don't need to make any changes to the plugin itself to change the filter value.

    You can change the output of the filter in another plugin, or in your theme's functions.php file, by creating your own function and hook into jetpack_photon_reject_https.

    If you're not familiar with WordPress filters, you can read more about it here:
    http://codex.wordpress.org/Function_Reference/add_filter

  5. jason102178
    Member
    Posted 10 months ago #

    Thanks for that information

    so would something like this work

    add_filter('jetpack_photon_reject_https ');

    the easiest way for me is to add it to my themes function.php

    or am i doing it wrong, i read the codex you provided, its a bit confuesing

  6. jason102178
    Member
    Posted 10 months ago #

    I also tried using this one
    add_filter( 'jetpack_photon_reject_https', false );

    but all i get is an error
    Warning: call_user_func_array() expects parameter 1 to be a valid callback, no array or string given

  7. Jeremy Herve
    Happiness Engineer
    Plugin Author

    Posted 10 months ago #

    Try to add the following code to your theme's functions.php file:

    add_filter( 'jetpack_photon_reject_https', '__return_false' );

    It's worth noting that this will enable photon to read HTTPS content, but it'll still return HTTP urls, like so: http://i0.wp.com

  8. jason102178
    Member
    Posted 10 months ago #

    Hi Jeremy.

    Thanks for that code, that seemed to do the trick......

    also what do you mean its worth nothing to read https content, i thought that it would work the same weather it was http or https...

    By it reading https urls, my content is now being served through the wordpress content delivery network therefor increasing site performance, unless i am missing somthing....

    Does this not work like that for https enabled sites

  9. jason102178
    Member
    Posted 10 months ago #

    i felt it was worth enabling https because in the past the content would not be served through wordpress content delivery network, it still gave me my website address url for images and not http://i0.wp.com

    so by enabling the https, all the images are now being served

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.