Doesn’t handle site migrations well
-
When a developer builds a website, the process is normally:
– create the site in a subfolder on a development server
– migrate the site to the live domain, running a (serialized) search/replace in the database from the old site URL to the new site URL (via a script, WP-CLI, etc).There are two issues with this plugin:
a) The URLs used are root-relative URLs, and do not include the domain. This means replacing https://www.devsite.com/abc with https://www.livesite.com will not update these URLs correctly, making them all return a 404 due to the nonexistent subfolder on the live site. Replacing just the string /abc with an empty string is far riskier as there may be false positives.
All other plugins/core code etc use full absolute URLs including the domain for anything like this, both in the database and output in the HTML (take a look at the HTML in the head tag for any site, for example – this is the only one starting with a slash). Can the plugin be updated to use full URLs as well? I can see no downside in doing so, but plenty of upside.
b) The browserconfig.xml and manifest.json are a bit more complicated since they’re hardcoded in uploads to the server. This isn’t ideal – nowhere else in WordPress are URLs hardcoded into static files – but I’m not sure of a quick fix for making them dynamic. However, what about a simple button in the admin which ‘regenerates’ them? Ideally, this button could automatically appear as a warning prompt at the top of the screen if it the settings don’t match where your site is located.
- The topic ‘Doesn’t handle site migrations well’ is closed to new replies.