Use wp-cli and command line to accelerate word press management

If WordPress developers don’t like one thing, it’s to do unnecessary manual operations slowly, because these operations are easy to automate. If developers like, they can use the command line function to complete the work by pressing several keys without disturbing the whole process. WordPress has not provided various power tools for developers for many years, but the situation is changing rapidly. Wp-cli is one of the core components of all serious word press developer kits. The wp-cli is the command line interface of word press. Wp-cli is the command line interface of WordPress. Inspired by Drupal’s console site, wp-cli provides a similar convenient way to quickly perform routine tasks. The
This article will introduce some key features of wp-cli in stages and briefly explain why these features should be added to the solution set. Wp-cli overview what wp-cli is, if you are looking for a convenient summary, please refer to the instructions on the project home page. Wp-cli is a command line toolbar that manages word press installations. You do not need to use a web browser to update plug-ins, set up multi site installations, and so on. The project was developed by Andreas creten and cristi burca in 2009 and is currently managed by Daniel bashuber. The
Andreas creten provided an excellent overview of the history of wp-cli in Wordcamp Praha 2015, describing the development path so far. Typical use cases for wp-cli include creating a new site, managing plug-ins, populating the site with test content, and refreshing the cache. Whether in the context of a single local development site or a real-time multi site installation, smart tools and possible automated task types are required. More and more hosting companies are pre installing wp-cli in the current real-time environment, so it is very important to at least check the basic content of the tasks that can be performed. The
Wp-cli provides two types of commands: Internal commands: core list of wp-cli functions. Community commands: commands created by third-party developers. The second set of commands emphasizes the ability to define custom commands, which is one of the most attractive features of wp-cli. Adding your own commands is as simple as creating a PHP class. The GitHub page of the item in the commands cookbook section provides clear instructions for doing this. Even if you quickly scan the community command list, the daily word press usage range that has been processed here will be displayed, such as nginx cache, jetpack, site map creation, cloning, etc. The
From the point of view of wp-cli startup and operation requirements, wp-cli is relatively simple. PHP 5.3.2 or later, partially described unix environment, and word press 3.5.2 or later are required. In addition, if you are already familiar with the basic knowledge of command line and UNIX system navigation, it will be very helpful. Wp-cli can be installed in many ways. ing phar files is the recommended method highlighted by most users on the home page. It is described on the GitHub page of the project through the additional installation options of composer and homebrew. Since everyone’s settings are naturally different, instead of looking at the various options for installation in detail here, it’s better to refer to the appropriate documentation and start from there. The
In my case, the MAC opened the worm related to local ruby in the attempt of initial installation through homebrew, so it finally chose the curl option. To make everything work smoothly on map. You need to further adjust the bash_profile. As with all types of software installations, the long story short is the diversity of settings
Therefore, you may need to ask our old friend Google for help at some stage. This installation profile from kailey Lampert provides a summary of the various steps that are helpful in the process and introduces several possible pitfalls. A convenient video overview is also provided. The
After installation, navigate to the WordPress root folder through the command line and enter WP info WP info. The following must be displayed: If you get here, you can go now. Wp-cli some considerations for help and configuration command line tools with detailed built-in support and documentation. You can enter WP help or simply WP at any time to see a complete list of available commands. To access detailed help for a specific command, such as a database export command, simply enter the name of the command itself after WP help. The
Load the summary midoriberlin\/421 eef4c4090c0fe36b8 to start the familiar UNIX man page type environment, as shown below: When working in a multi site environment, select the desired site by passing a specific URL parameter to the flag. It is worth noting that for convenience, these types of global parameters can also be stored in the yaml configuration file of each site. Well, let’s take a look at some of the features that software usually uses when it buzzes in the background. Update word press with wp-cli word press has been greatly improved over the years, but it is still a management task when maintaining multiple sites. However, wp-cli brings convenience and power to workflow, which is a good starting point. The
In the active installation, we will start by checking the current version of word press. It seems that wordpress4.1.2 is still running when midoriberlin\/485772 de133a323cb2c6 is loaded. It is really time to upgrade. Of course, we want to back up the database before proceeding further, which can only be executed by command. Loading points the midoriberlin\/51a9b8d2f1c0f5fc88e3 terminal appears to have been successfully exported. After quickly moving to the root folder, the exported database will be displayed. The
The name of the host folder will pop up by default because the file name exported through the ○ flag is not specified. Now, performing an upgrade is as simple as entering the following: Load summary midoriberlin\/7e8b75b3198cbb6fae5d will now update the installation with a simple command. Of course, I want to quickly check the website visually before proceeding further, but assuming everything is normal, back it up now. SQL files can be deleted or retained freely. For complete disclosure: at first, in the map installation, some problems occurred because the export command of mysqldump could not be found. Therefore, the above complete sequence is not as cumbersome as shown. The
When you begin to explore the functions of wp-cli, you may encounter your own technical difficulties, which is worth considering. Be patient and remember that Google and stack overflow are friends! By exporting the database and updating the core file, wp-cli shows that fairly important changes can be made with just a few key entries. Let’s briefly introduce how to create a site from scratch. To create a new WordPress site, we create a folder to store the new WordPress site, and then navigate to the folder to start the process of creating a new WordPress site locally. Load essentials midoriberlin\/97cc8c4818ef441c 8659 new folder
Now, the latest version of word press from. In the example of loading summary midoriberlin\/35d9670472e007635e4c, if the version flag is omitted, the latest version will be automatically ed. Now, some information about the database is WP config. The PHP file must be set. Load the summary midoriberlin\/99e2995d365a3c8c7d46. Finally, run WP core install, pass relevant parameters, and perform the actual installation. Load the key site midoriberlin\/e462d0e31eda76af907b and use it to install our website. As you can see from the screenshot above, you actually forgot to create the database. Although some conflicts were encountered, they were quickly resolved. You can see the result with the least effort by slightly modifying the local host file. The wp-cli test website is running. It may seem a bit complicated at first, but once you dial the workflow, you will see potential geometric improvements in speed for many regular tasks. In addition, the newly created site, imported data and primary users can be quickly populated through the command line. Before we finish, let’s take a brief look at plug-ins and topics. Plug in and theme management after a new site is installed, you can fully control plug-ins and themes with just a few keystrokes. We will review the current active topic and begin. When the new installation loads the summary midoriberlin\/af2cf9f60a9e 57222520, it can be expected that the only item listed is the default word press theme, and the currently active theme will be highlighted. Although I am satisfied with the new twenty fifth theme, if necessary, I can use a variety of additional theme control functions through wp-cli. The last thing to check is the condition of the plug-in. As before, you can simply and wonderfully see what is currently installed. Loading key points midoriberlin\/8117676 c398b6f44e637 of course, in the standard installation, so far, not much will happen, but please select the installation we can see and the one that needs to be updated. Through the complete plug-in command set of wp-cli, you can fully control the installation of new plug-ins, the overall update and the deletion of items that are no longer needed. Other resources wp-cli shows all the signs that will exist for quite a long time to come, only scratching the surface of the options available in this overview. For more information, see the following resources: Wp-cli home page: the first call port must be the project home page with a complete list of core information, configuration options, and community commands. Tim Nash video tutorial: British developer Tim Nash (go England!) Write a comprehensive wp-cli tutorial series on your own site. This is a good starting point to start using advanced software. Other articles on wpmu dev: We explored wp-cli on the website here in the past. Daniel Pataki’s WordPress developer tool analysis is a good starting point, and his guidance on vagrant and WordPress is going to a higher level there. Conclusion with the continuous growth of WordPress performance and flexibility, it is increasingly important for developers to make use of all available tools in order to manage workload and keep workflow smooth. Wp-cli has a comprehensive range of functions and important functions that can be expanded as needed. It is a tool that has occupied a place in many word press developer toolkits. I would like to know if you are already using wp-cli, or if you would like to learn more about its functions on this website in the future. Contact the following comments to share ideas
Please. Labels: command line WP cli

Author:

Leave a Reply

Your email address will not be published. Required fields are marked *