Support » Plugin: Cloudflare » 4.4 https rewritte aint working with images

Viewing 15 replies - 1 through 15 (of 18 total)
  • Having the same issue. Hopefully the plugin will be upgraded.

    I had the same issue on a couple of sites, but only if the ‘siteurl’ and ‘homeurl’ fields in wp_options did not begin with ‘https://’.

    Seeing the same issue.

    I started digging into this issue. Been adding improvements and fixes on my github.
    https://github.com/bhubbard/cloudflare

    For the broken images issue, I am still looking into it. The issue is the code around this line:
    https://github.com/bhubbard/cloudflare/blob/master/cloudflare.php#L600

    Simply updating that line to include srcset will fix the first images in the srcset but the rest remain with http://

    For now, anyone wanting a workaround can use the following code.

    function ssl_srcset( $sources ) {
      foreach ( $sources as &$source ) {
        $source['url'] = set_url_scheme( $source['url'], 'https' );
      }
    
      return $sources;
    }
    add_filter( 'wp_calculate_image_srcset', 'ssl_srcset' );

    a++ Joe McGill

    edit: Actually I don’t think you need to specify https in the set_url_scheme(). That would force everything to https. If you have your site setup to be dynamic simply remove the ‘https’ in the second argument.

    so–

    //wordpress 4.4 srcset ssl fix
    function ssl_srcset( $sources ) {
    	foreach ( $sources as &$source ) {
    		$source['url'] = set_url_scheme( $source['url'] );
    	}
    
    	return $sources;
    }
    add_filter( 'wp_calculate_image_srcset', 'ssl_srcset' );

    Thanks Joe and Matt,

    I actually updated it a bit for an if statement for if protocol rewriting is enabled.

    //wordpress 4.4 srcset ssl fix
    function cloudflare_ssl_srcset( $sources ) {
    
    	$cloudflare_protocol_rewrite = load_protocol_rewrite();
    
    	if ($cloudflare_protocol_rewrite == 1) {
    
    	foreach ( $sources as &$source ) {
    		$source['url'] = set_url_scheme( $source['url'] );
    	}
    
    	return $sources;
    
    	} else {
    
    		foreach ( $sources as &$source ) {
    			$sources;
    		}
    
    		return $sources;
    
    	}
    }
    add_filter( 'wp_calculate_image_srcset', 'cloudflare_ssl_srcset' );

    Thank you very much for these codes. We hope that the plugin will be updated soon.

    Can anyone from @cloudflare address this current issue? Who is responsible for updating the plugin? How long until we can expect an update?

    I attempted to provide some improvements with a pull-request on github: https://github.com/cloudflare/CloudFlare-Tools/pull/16

    It’s disappointing to see no one from CloudFlare even acknowledging these issues. Especially since you’ve already done most of their work for them.

    I´ve opened a support ticket and they replied they know about the bug and were working on it, but still its bad they dont reply here anything

    So, can Brandon’s code be modified somehow to also fix the oEmbed issue.

    It’s unnacceptable how Cloudflare are just ignoring the issues.

    Latest response I received from CloudFlare:

    “Thanks, our engineering team is aware of the fix and is integrating it with our latest updates. This should come out within the next couple of weeks or shortly into the new year. Please let me know if you have any other questions.”

    [edited] Sorry, should have read first, written later.

    Has anyone received an official confirmation of any updates being worked on or coming?

Viewing 15 replies - 1 through 15 (of 18 total)
  • The topic ‘4.4 https rewritte aint working with images’ is closed to new replies.