elementor / static-html-output

Static HTML Output Plugin for WordPress

Home Page:https://statichtmloutput.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

edge cases not handled for subfolder installations

joyously opened this issue · comments

https://github.com/leonstafford/static-html-output/blob/10cf1af363a07c90d1bec426f7db99f40cadfff9/src/WPSite.php#L327

When WP is installed in a subfolder, however deep, the count of folders cannot be found just from parse_url. The site could be multisite, with its different structure, or the content folder could be moved.
Especially on localhost, the WP folder could be several folders deep.

A better method would be to get the difference between the home URL and the content URL(shows if content is in subfolder), or between home URL and site URL (shows if WP is in subfolder).

Using parse_url on localhost returns the subfolder as part of the path, so generating crawling URLs is incorrect. My home URL is set to http://localhost/testsite and the crawl list has /testsite/2020/05/05/ whereas the other paths do not start with testsite .
This is after I changed the parse_url call in FilesHelper.php (in getAllWPPostURLs).
Generating a site, I end up with posts at the top level, but duplicated under a testsite folder.