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.
Labs
Labs are hands-on coding projects that you build along with Tonya as she explains the code, concepts, and thought processes behind it. You can use the labs to further your code knowledge or to use right in your projects. Each lab ties into the Docx to ensure you have the information you need.
Each lab is designed to further your understanding and mastery of code. You learn more about how to think about its construction, quality, maintainability, programmatic and logical thought, and problem-solving. While you may be building a specific thing, Tonya presents the why of it to make it adaptable far beyond that specific implementation, thereby giving you the means to make it your own, in any context.
Run and Review WPCS
Let’s walk through the PHPCS and WPCS code sniffers and then run them.
Run and Review the Starter Test Suite
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.
Install Composer Packages
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.
Setup Local by Flywheel’s Server
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.
Fork and Clone Starter Plugin
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.
Setup the Local Environment
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.
Data Store – Project Setup
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.
Simulate Store and Get
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.
Feature: Empty the Data Store
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.