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

FaustWP: Image URLs in post content are sometimes relative instead of absolute #1694

Closed
ChrisWiegman opened this issue Dec 29, 2023 · 1 comment
Assignees
Labels
wontfix This will not be worked on

Comments

@ChrisWiegman
Copy link
Contributor

ChrisWiegman commented Dec 29, 2023

Description

It’s possible under certain conditions for FaustWP to rewrite image URLs in post_content to be relative URLs instead of absolute URLs. When these are URLs to images stored in WP, it results in broken images on the JS site.

Reported here: https://wpengine.slack.com/archives/C01MQH51L14/p1702321472868279

Steps to Reproduce

  • Configure Faust to NOT have a Front-end Site URL value
  • Disable “Use the WordPress domain for media URLs in post content”
  • Create a post, link to an image in the post content.
  • Query the post in GraphiQL and notice the src URL is a relative URL like //wp-content/uploads/2023/12/file.jpg

Expected Behavior

@ChrisWiegman ChrisWiegman added the type: bug Issue that causes incorrect or unexpected behavior label Dec 29, 2023
@mindctrl mindctrl self-assigned this Mar 15, 2024
@mindctrl
Copy link
Contributor

The team discussed this and here are our thoughts:

  • Configure Faust to NOT have a Front-end Site URL value
  • Disable “Use the WordPress domain for media URLs in post content”

When Faust is configured this way, we cannot magically fix the situation. The user has the plugin configured to NOT use the WP domain, so we strip the WP domain from the media URLs. However, we have no front-end URL to replace it with, so it remains a relative URL. This should probably be considered a "misconfiguration", as it's basically an invalid state for the intended use cases for Faust.

We've only seen 1-2 reports of this type of configuration, and at this time we don't want to complicate things to cover every single edge case. It's also worth noting that when Faust is configured to not have a front-end URL, we show a warning on the settings page:

Front-end site URL is required to utilize url rewrites and previews.

It is highly recommended that you update it below to avoid unexpected behavior.

We're closing this as wontfix, but we're also considering enabling “Use the WordPress domain for media URLs in post content” by default, to improve the experience in general. See #1849. At some point in the future, we may consider ways to prevent "invalid" configurations like this, but it's not a big enough issue at this time.

@mindctrl mindctrl added wontfix This will not be worked on and removed type: bug Issue that causes incorrect or unexpected behavior labels Mar 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants