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

Super plugin, but question #338

Closed
pkiula opened this issue Aug 28, 2019 · 1 comment
Closed

Super plugin, but question #338

pkiula opened this issue Aug 28, 2019 · 1 comment

Comments

@pkiula
Copy link

pkiula commented Aug 28, 2019

Hello. This looks very promising, but I have a question. We don't need plugins etc. I can even put this in our functions.php if needed. But it's important for us to have the following:

  1. Before saving, have the media optimised by "EWWW" plugin which also automates the generation of the corresponding WebP for all media auto-sizes.

  2. Have the media saved in the permalink structure of our site. With over 15K photos, this becomes paramount to search easily in the future. So instead of the usual year/month URLs, we'd like /post_type/category/postname/media1.jpg etc. The "Custom Uploads Dir" plugin already does this.

  3. Third, have these files COPIED (not only saved on S3, but have a copy saved there), with the appropriate cache-control headers etc.

  4. Auto-generate a CDN URL from the S3 version. Anything that gets saved inside the Wordpress DB as content should use our CDN URL, or if the original media path is used, then we'd like our the_content() etc to auto-flilter the URLs and publish the CDN URLs.

At the moment we have #3 and #4 being performed by S3 Offload plugin, but it's intrusive and takes over URL generation too (#2 above). Will ditching the Offload plugin and using this simpler script allow us to achieve the above?

Many thanks! (Btw, very thorough and patient explanation of the code!)

@joehoyle
Copy link
Member

joehoyle commented Jun 8, 2020

1 & 2 are not specific to S3 Uploads, and look to be general WordPress media problems. (Note on webp). Those approaches should work fine with S3 Uploads.

3: This use-case is not supported by this plugin, S3-Uploads is to replace your local uploads directory with one on s3.

  1. This can be done in S3 uploads by setting the S3_UPLOADS_BUCKET_URL to your CDN's URL. All file urls will then use this value instead of the S3 URL.

@joehoyle joehoyle closed this as completed Jun 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants