Closed ottok closed 4 years ago
Feed readers are already handled in: https://github.com/Seravo/wp-palvelu-plugin/blob/master/modules/relative-urls.php#L42-L44 this was done in commit: 66d6bd271a2513978398e2cb8d5a26140df89a49
Cool! I guess it is then just a question of getting this into production. As a pilot, can you install this for Foxland and check if it solves customers issues?
This solves feed reader but I'm not sure if it solves other issues like jetpack integration.
I think otherwise this is working fine but when using xmlrcp or json-api we should make all of the links absolute.
Only way to be absolutely sure about absolute urls would be to only use relative urls in database and then return them with regex in this hook:
<?php add_filter( 'the_content', 'filter_function_name' ) ?>
Otherwise we can only achieve something like 95% of possible use cases.
On the otherhand this seems like a big overkill. But then again WordPress still parses all of the content anyhow because that's how shortcodes work. I don't think regex src="/" and href="/" would make a big difference.
opinions @anttiviljami, @ottok?
Once everybody has https we should remove relativize_content_all and use absolute URLs as way too many WordPress plugins are incompatible with relative URLs (links in MailPoet, RSS feeds etc).
Override filter available:
add_filter( 'wpp_use_relative_urls', '__return_false' ); // disable relative url's feature
The file modules/relative-urls.php
should perhaps not be part of this plugin, but instead a part of HTTPS Domain Alias plugin: https://github.com/Seravo/wp-https-domain-alias/issues/18
HTTP Domain Alias is now officially deprecated from new installs. The relative-urls.php should be moved to the HTTPS Domain Alias as it originally was, since it is not needed elsewhere.
I don't agree we should move to remove relative-urls just yet. Relative URLs is used on sites without https domain alias too for development purposes.
Since HTTPS Domain Alias is now deprecated, let's gradually phase it out and see if we run into any issues, and later get rid of relative urls so we can better monitor if either of them cause any issues with our customer's sites.
If URLs are made absolute again (to avoid all regressions non-standard relative urls introduce), then we should also update the line https://github.com/Seravo/wordpress/blob/master/htdocs/wp-config.php#L45 to be absolute and not relative.
E.g. in http://foxland.fi/feed/ the image src attributes have relative url. That will not work when in a feed reader for example. When exporting $post->contents out from the site (feed, email) relative links need to be made absolute.
Check that implementation here and in https-domain-alias is in line with each other.