The Easy Way to Mass Find & Replace WordPress Databases

The Easy Way to Mass Find & Replace WordPress Databases

Web developers who have an experience with changing WordPress url address would know that after migrating the database, URLs inside of it will still refer to the old site. However, WordPress is widely known as a web platform that has a ton of plugins and therefore there are many tools that can assist you to import database easily. But, a tricky method is necessary for requiring the shortcut of changing every URL instance inside the database.

As it is described in the picture below that the old URL in the wp_options table, set as the value of the siteurl and home options, and it’s probably also embedded throughout several other rows and tables in the database. If you find this kind of old URLs may eventually prevent your site from running properly, then you need to change to the new URL, such as below:

yourweb1

In the image above, you will find that the site acme.dev will simply lead to a blank page. Below is given a technique to change all these URLs in the database.

Leveraging WP-CLI

Leveraging WP-CLI is not the only way to change the URLs in the database, you can run an SQL query to replace it, but I find that leveraging WP-CLI is a handier alternative compare to SQL query which is a workable solution, yet at the same time, is not convenient to do. Assuming you have installed WP-CLI and have the wp command accessible as the alias, navigate to the directory where your WordPress site files reside.

Then, run the following command:

wp search-replace ‘http://acme.com’ ‘http://acme.dev

The first parameter, ‘http://acme.com’, is the old entry to be replaced with the second one, ‘http://acme.dev’.

yourweb2

Not only the post_content column and wp_options table but also all the tables within the database will be searched by the command line. Then, it will replace every instance of the entry passed through the parameters of the command, like it is explained by the above screenshot that a total of 225 have been made through a simple line of command.

Moreover, we can use the wp search-replace command, not only for replacing URLs, but also any piece of value stored in the database. The operation can also be limited into a certain table by passing the table name as the fourth parameter, as follows:

wp search-replace ‘.jpg’ ‘.webp’ wp_posts

Bear in mind that taking this action means you have to install the WP-CLI first and it will replace the image extension from .jpg to .webp.

3 Hottest eCommerce Design Trends to Embrace in 2016

9 eCommerce design trends toembrace in 2016

Since digital world is a fast changing world, it becomes difficult to predict the future. If you are a web designer who is currently working for eCommerce, you better catch up with this hottest design trends that are going to dominate 2016, so that you can stay up to date with the current trends.
1.) Rich Animations
If you are looking for something that can engage with and connect to users better, animation is the answer. In fact, this can be a good solution for making your designs more playable and enjoyable, especially for online shopping experiences. Moreover, animations which are used in the right time will make your customers feel that you really care about their interactions with your site.
Therefore, in order to leave a memorable impact on their customers many eCommerce websites creatively using animation, like button spins, icon rotation and loading bars.
2.) StoryTelling
Who doesn’t love story? Anyone loves it right. Therefore, using story to sell your brand will make your selling stands out from the crowd. But, be careful with your story, a salable story is the one who can establish an emotional connection between your brand and your customers but also increases loyalty and sales. Nowadays, there are many businesses which practice storytelling as their business strategies, two of the most successful ones that you can follow their footsteps are Bonobos and Greats.
3.) Dynamic Search
Another most recent and prominent design trend that caught a lot of attention is Dynamic Search. In fact, many eCommerce sites will be using JavaScript and Ajax-powered search to display products dynamically in 2016. Besides, when you have a very large inventory, this method is a very suitable to be used. You can take a look on JadoPado as the most compelling example of the eCommerce sites using this amazing feature.

5 PHP Techniques that will Make Web Developer’s Works More Efficient

PHP Tips Every Web Developer Should Know

Like any programming languages, PHP is one of programming languages that need to be understood through its basic details before you get familiar with deeper code. Those basic details include variable declaration, data type, operators, statements controlling the flow of the code and others. If you want to do a better web development, you need to disclosure these 5 tips.

  1. Use Comment to Help You Work As a Team

Like the old saying, two heads are bigger than one, therefore using comment can be a good tip to communicate with your team whenever it comes to do coding. It makes you a good team player when it comes to updating, debugging, analysis, and other post-programming activities which are really easy and efficient since you make the other team players understand your idea of the code.

  1. The Smaller, the better

If you think that creating a long code will make you a great developer, well I am afraid you might get it wrong since it is not about how long your code is but it is all about the output. Therefore, bear in mind for not repeating code and use programming tools, such as functions, objects and array to good effect.

  1. Use isset() instead of strlen()

When dealing with string array, isset() is a better option than strlen() since isset() is more cost efficient in terms of time of the two entities.

  1. Forget $_REQUEST

Forget your old days with $_REQUEST since it is terribly amateur and unsafe to get values for variable. Besides, your POST and GET variables will be opened up and the security concern will be such a big issue once public can access your POST variables.

1

2

$action = $_GET(‘action’);

$name = $_POST(‘name’);

  1. Object Oriented Programming (OOP) is the way forward

If you want to create a data that is more structured in your code, OOP is the best suggestion when it is compared to traditional procedural approach. In a deeper definition, OOP is a language program which orientate to objects. Each data and function in this paradigm is bundled up in classes or objects. It is different from structure programming logic, each object will receive messages, process data, and send message to other objects.