Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement - Global _wp_attached_file protocol option #1

Closed
devfreddy opened this issue Mar 18, 2016 · 2 comments
Closed

Enhancement - Global _wp_attached_file protocol option #1

devfreddy opened this issue Mar 18, 2016 · 2 comments
Assignees
Labels

Comments

@devfreddy
Copy link

I see there is a way on a per upload basis to set the protocol that is stored with the image url in _wp_attached_file.

Unfortunately this is per upload, and it defaults to HTTP.

I've written a little snippet to jump in on update_attached_file and modify the file url, so that even if user's don't make the HTTPS selection, it changes it anyways.

add_action( 'update_attached_file', function ($file) {
    if(stripos($file, 'http://res.cloudinary.com') !== FALSE){
        $file = str_replace('http://res.cloudinary.com', 'https://res.cloudinary.com', $file);
    }
    return $file;
});

It wouldn't surprise me if there is a need for some organizations to want to define the Protocol on each upload, but I also think it would be really nice to have an 'on every upload' option.

For those of us who would prefer a global setting for this, I have a proposition.

Add a Protocol setting, on the Wordpress side, under the main Cloudinary Settings screen

Image Protocol

  1. Define on each upload
  2. Always HTTPS
  3. Always HTTP

Based on these settings, we can either leave the functionality as it is, or optionally jump in and toggle it, using something similar to the above, regardless of what user's select when uploading.

After we hammer out any thoughts/details, I'd be happy to work on this and contribute it back.

@taragano
Copy link
Collaborator

taragano commented Jul 5, 2016

Hi @mdfrederick,

Thank you for your feedback and suggestion.

Note that the protocol option is relevant only to the delivery of the file, and not at the upload phase.
Regarding your question - Please have a look at the following thread which may answer your requirements:
https://wordpress.org/support/topic/ssl-updating-existing-cloudinary-images-to-be-served-via-ssl#post-8587789

@taragano taragano self-assigned this Jul 5, 2016
@taragano
Copy link
Collaborator

Closing this issue due to the time elapsed. Please feel free to either re-open the issue, contact our support http://support.cloudinary.com or create a new ticket if you have any additional issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants