General
- Tom McFarlin.
- Beginner Tips for Getting Started with WordPress Development. Tuts+, 2014.
- (1) Start Small, (2) Study Existing Code, (3) Understand the Coding Standards, (4) Participate in Meetups and WordCamps, (5) Read Blogs.
- A Simple Guide for Organizing WordPress-centric Classes. 2018.
- Suggests that we place WordPress centric code within a WordPress directory to separate it from problem domain code.
- Writing Better Code for WordPress-Based Projects. 2017.
- Adapts Joel’s Test for software development projects to WP specifically.
- We Need Better Abstraction in WordPress Projects. 2013.
- Provides an example of code pre-abstraction and post-abstraction.
- Multiple Objects Writing Data: How to Avoid This. 2017.
- Recommends using a single object to handle writing to / reading from the data store to avoid side effects from multiple objects/functions attempting to perform simultaneous reads or writes.
- Beginner Tips for Getting Started with WordPress Development. Tuts+, 2014.
- Rachel McCollins. DRY WordPress Theme Development. Tuts+, 2015.
- Damien Logghe. Tips for Best Practices in WordPress Development. Tuts+, 2014.
- Covers use of WP coding standards, avoiding function name collisions, commenting code, and security basics such as data sanitization and nonces.
- John Hughes. How to Become a WordPress Developer: Tips to Get You Started. themeisle, 2018.
Best Practices
- WordPress Best Practices for Developers. wpengine, 2019.
- WordPress Plugin Development – Best Practices. wooninjas, 2017.
- Tom McFarlin.
Object Oriented Programming (OOP)
- Josh Pollock. Advanced OOP for WordPress Series. Torque, 2018.
- Part 1: Customizing REST API Endpoints To Improve WordPress Search
- Part 2: Setting Up Automated Testing Of WordPress REST API Plugins
- Part 3: Unit Testing For WordPress REST API Plugins
- Part 4: Setting Up With WordPress Test Suite For Integration Testing
- Part 5: Using The WordPress Test Suite For Integration Testing
- Part 6: Continuous Integration For WordPress Plugins
- Part 7: Refactoring Is An Opportunity To Adopt Test-Driven Development
- Part 8: Developing New Features For Extensible WordPress Plugins Using Test-Driven Development
- Part 9: Extensible Plugins Using the Plugins API
- Customizing REST API Endpoints To Improve WordPress Search
- Daniel Pataki.
- An Introduction to Object-Oriented Code for WordPress Plugins. wpmudev, 2016.
- Advanced WordPress Development: Writing Object-Oriented Plugins. wpmudev, 2016.
- Creating WordPress Plugins in an Object Oriented Way. wpmudev, 2015.
- David Hayes.
- Introduction to Object-Oriented PHP for WordPress Developers, wpshout, 2018.
- Great introduction. Covers classes, objects, properties, methods, procedural programming, instances, instantiation, arrows, $this, private/public.
- Is WordPress Object-Oriented? A Thorough Exploration. wpshout, 2019.
- Introduction to Object-Oriented PHP for WordPress Developers, wpshout, 2018.
- Tom McFarlin.
- Object-Oriented Programming in WordPress. envatotuts+, 2014.
- 1. An Introduction.
- 2. Classes.
- 3. Types.
- 4. Control Structures I.
- 5. Control Structures II.
- 6. Functions and Attributes.
- 7. Scope.
- 8. Building the Plugin I.
- 9. Building the Plugin II.
- 10. Document the Plugin I.
- 11. Document the Plugin II.
- 12. Inheritance I.
- 13. Inheritance II.
- 14. A Summary.
- Object-Oriented Programming in WordPress. 2017.
- Object-Oriented WordPress Plugin Development. 2013.
- Properly Writing WordPress Plugin Constructors. 2016.
- Object-Oriented Programming in WordPress. envatotuts+, 2014.
- Carl Alexander.
- Tom McFarlin. WordPress Widgets: An Object Oriented Approach. 2017-2018.
- An Object-Oriented Approach.
- How to Detect Object-Oriented Programming.
- Starting with Standards.
- Refactoring (Part 1).
- Refactoring (Part 3).
- Two Pillars of Object-Oriented Programming (Part 1).
- Two Pillers of Object-Oriented Programming (Part 2).
- Understanding Interfaces.
- Abstract Classes
- Looking at Polymorphism In-Depth.
- Tom McFarlin. WordPress Widgets Refactoring. 2019.
- Simon Codrington. Object Orientated Development with WordPress. sitepoint, 2015.
- Josh Pollock. Demystifying Object-Oriented PHP for WordPress Developers. torque, 2014.
Namespaces and Autoloading
You may also want to look at our separate pages on Package Management and Autoloading as well as on Composer.
- Justin Tadlock.
- Steve Grunwell. A Crash-course in PHP Namespaces for WordPress Developers. 2018.
- Josh Pollock.
- Tom McFarlin.
- Namespaces and Autoloading in WordPress. 2017.
- Lengthy article that introduces using namespaces and autoloading with WP, the autoloading is vanilla, not Composer, etc.
- Namespaces and Autoloading in WordPress. 2017.
- David Hayes. What “Namespaces” Mean for WordPress Developers. wpshout, 2015.
- Alain Schlesser. Adding a Central Autoloader to WordPress. 2016.
- Nico Amarilla. How to Use Autoloading and a Plugin Container in WordPress Plugins. smashing magazine, 2015.
- Ben Martinez-Bateman. Namespacing and Autloading. roots, 2019.
Coding Standards
- Tom McFarlin.
- Coding Standards and Guidelines (“When in Rome, Program Like the Romans”). 2014.
- While Tom’s stance may have changed some (see above articles) since writing this piece it is still a helpful stance on holding our particular methods loosely and adapting to different developer cultures.
- Basic Coding Standards via PSR-1. 2017.
- A sequel of sorts to Using the PSRs, Tom covers some of the ways in which using the PSRs can be difficult for WP developer’s legacy code.
- Using the PSRs (Versus the WordPress Coding Standards). 2017.
- Tom, who for a long time recommended using WP standards over PSR’s explains why he has now prioritized PSR over WP standards.
- Two Ways to Develop WordPress Plugins: Object-Oriented Programming. tutsplus, 2012.
- Coding Standards and Guidelines (“When in Rome, Program Like the Romans”). 2014.
- Josh Pollock.
- How to Enforce Code Standards in WordPress Development Using Composer. torque, 2018.
- Don’t Follow WordPress Coding Standards. Torque, 2018.
- A good read on why one may not always want to follow WordPress’ coding standards over PHP standards.
- John Hughes. The Newbie Developer’s Guide to WordPress’ PHP Coding Standards. torque, 2017.
Design Patterns
- See our separate page on Design Patterns.