Everything is installed on your local machine. Let’s walk through the plugin’s code together. You’ll also commit the updated composer.lockfile and fix the root namespace too. Then you’ll push those changes to your repo on GitHub.
Let’s walk through the PHPCS and WPCS code sniffers and then run them.
Let’s run the starter test suite to ensure everything is setup and ready to go. Then we’ll walk through the test suite basics.
Let’s SSH into your local server and install the Composer packages. If you are running in a PHP 5 environment, you’ll get a composer error. Don’t worry. We’ll review why and I’ll show you have to resolve it. Then we’ll walk through the composer.jsonfile together.
If you are using Local by Flywheel, you need to install and setup PHPUnit before you can get to work. SSH into your project’s server Download this script Then you’ll follow the instructions to finish the installation and setup.
You need a copy of the starter plugin. In this episode, you’ll Fork the plugin to your personal GitHub account Clone your copy of the plugin into your local project, i.e. onto your computer Test out that it’s wired to GitHub with git statusand git remote -v At this point, make sure you have the git aliases setup on your machine. If you haven’t already done Git Productive lab, you can grab the aliases for your .gitconfig file in this gist.
Let’s setup a local environment on your development machine. Creating a local project within your favorite localhost tool, e.g. Local by Flywheel, VVV, DesktopServer, etc. Open the project in your favorite editor Launch the site, switch to https, and set the permalinks Install and activate Debug Toolkit plugin Add the debug constants to the project’s config.php file. You can find the code here in the Help Center or in this gist.
Before we start the project, you need to setup the project’s environment. You’ll use this environment and workflow throughout the series to plan, build, test, and validate the data store. You’ll fork the starter plugin, clone it to your local machine, run the starter test suite, and walk through the plugin’s architecture and setup.
It’s very helpful to visualize what it is that you will be building in order to see (in your mind) how it will work and how you interact with it. Visualization is a very handy tool to help you plan out what to build. In this episode, you’ll walk through a visual simulation to see store and get in action and to better understand the relationship of items in the store to a unique identifier.
There are times when you want to empty all of the items from the Data Store. For example: When testing, you want to clean up after a test case. Another example is when the data has been used and is no longer needed. In this case, you are releasing the memory for better performance, i.e. optimization.