We'll create fresh WordPress site with Absolute-to-Relative URLs installed. You have 20 minutes to test the plugin after that site we'll be deleted.
If you were to use this on a website like http;//example.com/test/testing/, you would get results like these:
$output_type=1
): ../../#anchorAll string parsing. No directory browsing.
If you’re looking for a plugin that will automatically convert all URLs on your WordPress site, instead check out my other plugin, WP-HTML-Compression.
Before you copy this code and add it into your own, keep in mind that there will probably be future updates. Keeping the code within an installed plugin will make sure that you’re notified.