One of our jobs is to build quality code that is reusable again and again without changing the codebase. Ideally, we’d like to configure what’s different and have the codebase the same for all of our projects. In Part 3, you will convert the Collapsible Content plugin into the ModularConfiguration design pattern by moving all runtime configurable parameters into configuration files then the codebase will be made reusable. The actual implementation then is determined by the configuration file that’s loaded. This approach will save you time.
Why? Why should you care about making your code reusable? It’s all about rapid web development, meaning you can more quickly complete your projects, delight your clients, and get paid. Reusable code does this for your projects (and you):
Increases your marketability
Reduces your project time
Reduces your project costs
Reduces your support time
Reduces your frustrations
Are you interested in building code faster and for less cost? Come learn about how to build using the ModularConfiguration design pattern to make your code reusable.
Our Goal – Make it Reusable
In this hands-on coding lab, you and I are going to work together, step-by-step. I’ll teach you what reusability is and how to make it more reusable. I’ll introduce you to my ModularConfiguration design pattern. Then together, you and I will refactor our plugin.
Our goal is to make the plugin reusable. But in the bigger picture, my goal is to propel your web development skills forward by teaching you techniques that will reduce your code building and support efforts.
Want to cheat and see what you’ll be building with me? Okay, here’s a link to the GitHub repository.
What You Will Learn
In this hands-on lab, you are going to learn:
This lab requires you to complete:
You get WET when you swim. Stay DRY when you code.
Total Lab Runtime: 06:04:21
- 1 Lab Introductionfree 07:43
- 2 What is Reusable?free 18:07
- 3 Modular in ModularConfiguration Architecturepro 15:12
- 4 Configuration in ModularConfiguration Architecturepro 12:31
- 5 Creating Configuration Repositorypro 05:14
- 6 Planning it Outpro 12:26
- 7 Build the FAQ Custom Post Type Configpro 09:10
- 8 Loading the Config Filepro 04:29
- 9 Building Custom Post Type Generatorpro 12:24
- 10 Generate Post Type Supported Featurespro 16:41
- 11 Generate Post Type Labelspro 14:45
- 12 Test it Outpro 16:26
- 13 Custom Post Type Generator - Registrationpro 13:33
- 14 Rewrite Rulespro 14:05
- 15 Reusable Rewrite Rules Handlerpro 08:15
- 16 Custom Module - Embed or Standalone?pro 07:22
- 17 Build the Topic Taxonomy Configpro 06:58
- 18 Reusable Taxonomy Generatorpro 10:19
- 19 Auditing the Custom Labelspro 18:10
- 20 Refactoring the Label Generatorpro 09:32
- 21 Specify Certain Labels Optionpro 10:10
- 22 Link the FAQ into the Taxonomy Generatorpro 10:28
- 23 Move Config to FAQ Modulepro 04:58
- 24 Test the Taxonomypro 13:30
- 25 Plan out the Shortcodespro 09:25
- 26 Starting the Shortcode Boilerplatepro 14:53
- 27 Build the Shortcodes Configurationspro 15:30
- 28 Registering Shortcode with Custom Modulepro 18:54
- 29 Shortcode Configuration Storepro 08:25
- 30 Test the Shortcodespro 11:32
- 31 Wrap it Up, Review, and Commit Changespro 13:14
The best way to learn OOP is to build convert something that you already know from procedural to OOP. That will make the thought processes and methodologies more relatable for you. In Part 4, you will convert the Collapsible Content Plugin from procedural to Object Oriented Programming (OOP).
Check out the Plugin Development Library for more hands-on labs, insights, Docx, and more.
Check out the series page for more labs: Collapsible Content Plugin Series – WordPress Plugin Development A-Z