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

Add a way of setting what the production URL is #18

Open
vaccinemedia opened this issue Mar 26, 2024 · 2 comments
Open

Add a way of setting what the production URL is #18

vaccinemedia opened this issue Mar 26, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@vaccinemedia
Copy link

vaccinemedia commented Mar 26, 2024

Description

I'm assuming that because of the name "Stage File Proxy" that this plugin is supposed to work the same as the Drupal module by the same name?

The way that the Drupal module works is that you enter what the production / live URL is in the settings. You can also add what the files folder is in case the production server has them in a different location for whatever reason.

Then whenever you browse to a page on the locally hosted version of the website (on a VM for example with website-name.local as the URL) and an image is missing from the local files directory, it downloads the source file from the live website based on what you have the production / live URL set as. It does not download the generated images such as thumbnails and other image sizes as they can be generate on the local server. It only downloads the main image file.

The setting for what the production URL is is so that the website knows what the URL is of the production website, otherwise, how would the module know where to pull the images from?

Currently, because I can't find where the production URL is set, no images are downloaded from the production website and they all show as missing images.

The URL of all of these images is of course:
http://website-name.local/wp-content/uploads/YEAR/MONTH/name-of-image.jpg

Use Case

When a user browses to a page on a locally hosted version of the website, any missing images are pulled from the production website based on what the URL is of the production website.

Based off the description, a missing image with the URL:
http://website-name.local/wp-content/uploads/YEAR/MONTH/name-of-image.jpg

Will make the website look for the image at:
https://live-website-address.com/wp-content/uploads/YEAR/MONTH/name-of-image.jpg

Where https://live-website-address.com is the value of "Production URL" in the settings.

And if it finds it, download it and store it in the local files directory. Now the image is no longer missing.

@vaccinemedia vaccinemedia added the enhancement New feature or request label Mar 26, 2024
@mogmarsh
Copy link

@vaccinemedia currently settings are set using the WordPress CLI.
So in your example above you would run
wp option set sfp_url https://live-website-address.com/wp-content/uploads/

@vaccinemedia
Copy link
Author

That's great! Thanks for the reply. I'll try this out asap.

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

No branches or pull requests

2 participants