So i was putting a WordPress website live the other day and when i did so, it crashed WordPress.
The culprit was file_get_contents()
. I have been using it in a few small places to load my svg inline. See the code for how i was rendering it:
echo file_get_contents( get_bloginfo('template_url') . 'Images/logo.svg');
It worked fine on my local ubuntu apache set up and also worked fine on our staging servers which mimic the live environments.
Using a resource path instead of the web protocol path fixed the issues but isn't file_get_contents()
also able to work with web resources?
Why did it happen only on the live when the staging server is the same?
Second issue (maybe related): The client whom I made the website for got their IT guy to point his A WWW towards our server, when he did and told me he had done it, i visited the site but also bought down my dedicated server and my hosting provider as well as the hosting company of the previous website!
There was a lot of traffic coming from the previous web host ip address to request the logo.svg. Does anybody have a good guess at whats happening here?