DWS WP Framework
  • Welcome
  • Primary goals
    • Modular design
    • No 3rd-party dependencies
  • Key concepts and dev tools
    • PHP and WP requirements
    • Object-Oriented Programming
    • Semantic Versioning
    • Version Control (git / GitHub)
    • Dependency Management (Composer)
    • Automated Testing (Codeception + Github Actions)
    • Dependency Injection (PHP-DI)
    • Coding Standards (PHPCS and PHPMD)
    • Dependencies Scoping (PHP-Scoper)
    • TypeScript and Sass
    • Task Runners (Grunt)
  • Setting up your dev environment
    • Windows
  • Your first plugin
    • Multiple plugins using the framework on the same site
  • Frequently Asked Questions
  • Bootstrapper Module
    • Motivation
    • How it works
    • How to use
    • White Labeling
  • Helpers Module
    • Motivation
    • How to use
  • Foundations Module
    • Motivation and How to use
    • Actions
      • Local action traits
      • Extension action traits
      • Integration action traits
    • States
    • Utilities
      • Stores
      • Handlers and Services
        • Logging Service
  • Plugin
    • Main Plugin Instance
    • Plugin Components
  • Hierarchies
  • Helpers
  • Utilities Module
    • Motivation and How to use
    • Hooks Service
      • Scoped Handler
    • Shortcodes Service
    • Templating Service
    • Assets Service
      • Scripts Handler
      • Styles Handler
    • CRON Events Service
      • Action Scheduler Handler
    • Admin Notices Service
    • Dependencies Service
    • Validation Service
  • Core Module
    • Motivation and How to use
    • Plugin Tree
      • Plugin Root
      • Plugin Functionality
    • Plugin Components
      • Internationalization
      • Installation / Upgrade / Uninstallation
  • Settings Module
    • Motivation and How to use
    • Settings Service
      • WordPress Handler
      • MetaBox Handler
      • ACF Handler
    • Validated Settings
  • WooCommerce Module
    • Motivation and How to use
    • Extended WC Logger
    • WC Settings Handler
Powered by GitBook
On this page

Was this helpful?

Your first plugin

PreviousWindowsNextMultiple plugins using the framework on the same site

Last updated 4 years ago

Was this helpful?

As mentioned on the , using our framework usually makes sense when you use at least the first 3 modules (Bootstrapper, Helpers, and Foundations). Those are as general as we can humanly think of and they try to set literally no expectations on your project while simultaneously offering you all the abstractions you need (in the form of Interfaces, Traits, and Abstract Classes) to build your plugin the way you see fit.

If you only use only these 3 modules, there is a good chance there will be some unused files, but that shouldn't have any performance impact if you use the (which for the rest of this documentation, we will definitely assume that you are).

If you haven't already, check out our dedicated section for on your machine.

There is an on GitHub that only uses the first 5 modules. It's meant as a sort-of starter project for adding custom code to client websites (basically a replacement for the classical functions.php), but it can be easily used as a starter plugin as well.

We recommend that you download this plugin and use it as your starting base. This is a checklist of things you probably want to do after downloading the example plugin:

  1. Rename the folder from wordpress-plugins-utility to the slug of your plugin.

  2. Do a search for DWS WordPress Utility Plugin and replace it with your plugin's name.

  3. Similarly, make sure to update the plugin header in bootstrap.php and README.md and optionally change the minimum PHP and WP versions.

  4. Change the Deep Web Solutions references in composer.json and package.json.

  5. Update the composer.json file to reflect the modules you really want to use. By default, the example plugin also installs php-di/php-di for and monolog/monolog for logging but you are free to use your preferred packages.

  6. Do a search for DWS_Deps and replace it with a unique name for your plugin. For example, we're using DWS_LPM_Deps for our .

  7. Run composer update --ignore-platform-reqs and npm update in the plugin directory.

Congratulations! You are now ready to use start building a WordPress plugin using the DWS Framework. Continue reading the documentation of each module in order to understand how to use the framework effectively.

modular design page
Composer autoloader
setting up a development environment
example plugin
dependency injection
Locked Payment Methods plugin