If you’ve set up a website using a content management system like WordPress, Drupal, MODX or Joomla or have built a site from scratch you’ll probably want to update some of the features or functionality of the site from time to time. You may want to try out a new plugin or include a new piece of PHP or javascript you’ve found on the net to enhance the user experience.
So you simply install the plugin, activate it and away you go, happy days. But what if things don’t go so smoothly? What if the plugin you installed is not compatible with some other feature of your site? And what if you find that after adding the plugin, your site becomes totally ballsed up? You’ll wish you never installed that damn plugin in the first place. So after hours of cleaning up the mess you’ve or the plugin has made you’re back to square one but with no handy dandy plugin to make your site better, a bunch of site visitors or potential customers who are now thinking, “this site is shi!ti” and you with a fear of ever installing another plugin or script ever again.
I have a better solution. Rather than just simply not installing plugins or new scripts to the live site, you can actually try them out safely on a local test site on your home PC before running them on the live server for the whole world to see whether it crashes the site or not. To do this you need to follow these proceeding steps.
Set up your PC as a server with a web server, a PHP server and a database server.
Make a zipped copy of the Live site’s files onto your PC.
Export the Live site’s database to a script file on your PC
Create a database and user on your PC
Extract the site zip file to a directory on your PC.
Run the database script against the database on your PC
Change any configurations required
Once you’ve done the above and restarted all the servers on your PC you’ll have your site running locally, well out of harm’s way. If you make any changes to the local copy of your site on your PC and it fucks up, only you will know and it will be business as usual for your lovely visitors.
To rectify any damage done to the local site you can spend time finding and fixing the root cause of the problem or you can simply delete all of the site files and the database on the PC and repeat the steps of re-extracting the site zip files and running the database script and voila, you’ve got your local site up and running once again, still with no interference to your live site.
Once you’re happy with the changes you’ve made on your PC, you can either just go ahead on the Live site and install the plugin, add any new files or repeat any modifications you’ve made to your code or carry out the process in reverse whereby you backup what you have on local and copy onto Live.
Good luck!