I had to work these days on a Woocommerce store that had change its hosting provider and I noticed that some downloadable products kept failing after being moved to the new infrastructure. I did check the admin, and the problem was that the files were pointing to an older domain, one that doesn’t exist anymore for a long time. Additionally, there were some files that were served over HTTP instead of HTTPS and those threw bonus errors. Therefore, I tried to make a simple script that updates the Woocommerce downloadable products URL. Be careful! Don’t blindly trust code posted by strangers on the internet, especially when dealing with live data! Make sure you understand the code that you’re running. Also fuck using ChatGPT. I also need to mention that while I could use Wordpress’ best practices, I just wanted something fast that works, even if it’s a bit hacky, so I added this piece of code that triggers only when there’s a page loaded from my IP address and having some get very obscure…
No comments yet. Log in to reply on the Fediverse. Comments will appear here.