Tag Archives: php script

Moving WordPress: Database Search and Replace Script Software & Sites 28 MAY 2014

If you’ve ever moved a WordPress site to a different domain then you know it is somewhat of a headache. First you copy over all of the files, then you create a database sql dump of your existing database and import it into the new location, make the necessary changes to the configuration file, and then probably curse when you realize that not all your plugins and themes are working correctly any more.

The problem is that obviously one has to do search and replace operations on the database to ensure that all references to the old domain is switched to the new domain, but given the different serialization storage formats used by various third party bits of code, well simply put, it is easier said than done.

Enter this fantastic database search and replace script written in PHP by the guys over at interconnect/it.

You simply download the zipped script, extract the folder to an area in your WordPress location, and then directly access the newly created folder via the browser – the slick AJAX-driven user interface asks you for the search and replace terms, gives you already filled in database connection information (it’s pretty good at picking this up from your WordPress install), and then lets you run off with either a dry run or live execution. Slick, painless and very effective.

Delete the folder when you’re done, though the script even offers to try and do it on your behalf as well! Well written, user friendly, and highly recommended for whenever you find yourself having to change domains for your WordPress site.


Related Link: Database Search and Replacement Script

Image Resize: TimThumb PHP Script CodeUnit 17 DEC 2009

PHP-logoTimThumb, created and maintained by Tim McDaniels, Ben Gillbanks and Darren Hoyt, is a rather popular open source, image resizing PHP script, mostly used for generating thumbnails for blogging purposes on the fly. The script is fairly powerful, executes quickly and needs almost nothing from a developer in order to get it up and running on their own project.

The script makes use of the GD library to resize images based on the parameters used when calling the script. Thumbnails maintain aspect ratio and the script deals with jpg, gif and png files pretty well. It also has a caching system built in which helps keeps things fast.

In terms of parameters, the script allows you to set any of these for an image to be resized: