Download latest release | Test the plugin in your browser using Playground.
| Question | Yes → Directory | ServiceProvider behaviour |
|---|---|---|
| Extends an external package (functional)? | Adapters/ |
— no own provider |
| Extends an external package (core infra like implement interface)? | Integrations/ |
— no own provider |
| Has WordPress hooks that must fire on boot? | Features/ |
register() + boot() |
| No hooks — resolved on demand? | Services/ |
register() only |
| Is an individual service provider? | ServiceProviders/ |
— is the provider |
| Orchestrates all service providers? | Core/ |
— boots ServiceProviders/ |
| Shared utility across classes? | Traits/ |
— no provider |
Why the difference matters:
boot() is what triggers hook registration — it resolves the class from the container, which runs its constructor and fires add_action/add_filter. A Feature must be booted eagerly so its hooks are live before WordPress needs them.get_settings() or $container->get(Settings::class). Calling boot() on a hookless class is unnecessary work.git clone https://github.com/EmranAhmed/storepress-base-plugin.gitnpm inpm run packages-update - Update WordPress packagescomposer update && composer dump-autoload - Update WordPress packagesbash bin/install-wp-tests.sh storepress_base_plugin_test root 'PASSWORD' localhost latestbash bin/install-wp-tests-with-wc.sh storepress_base_plugin_test root 'PASSWORD' localhost latestincludes directory and change namespace from namespace StorePress\Base; to namespace Your_Company\Your_Plugin;.storepress-base-plugin.php and change plugin header, text-domain, namespace, defined Constant STOREPRESS_BASE_PLUGIN_FILE, function name.includes/Plugin.php and change STOREPRESS_BASE_PLUGIN_FILE on function get_plugin_file() function.storepress-base-plugin.php to your plugin file name.storepress-base-plugin.php to your plugin file name.eslint.config.js and change allowedTextDomain: ['storepress-base-plugin'],composer.json and change name, description, autoloadpackage.json and change name as plugin file name, description, repository.phpcs.xml and change <rule ref="WordPress.NamingConventions.PrefixAllGlobals">, <property name="text_domain" value="storepress-base-plugin"/>package.json and change files for package files.npm startnpm run create-dynamic-block [block name] - To add dynamic blocknpm run create-static-block [block name] - To add static blocknpm run lint:js - Lint Javascriptnpm run lint:js:report - Lint Javascript and will generate lint-report.html. From terminal open lint-report.htmlnpm run lint:css - Lint CSSnpm run lint:css:report - Lint CSS and will generate scss-report.txt file.npm run lint:php - PHP Lint.npm run lint:php:report - PHP Lint report generate on phpcs-report.txt.npm run stan:php - PHP Stan.npm run stan:php:report - PHP Stan report on phpstan-report.txt file.npm run lint:js:fix - Fix Javascript Lint Issue.npm run lint:css:fix - Fix SCSS Lint Issue.npm run lint:php:fix - Fix PHP Lint Issue.npm run format:js - Format Javascriptnpm run format:css - Format SCSSnpm run format:php - Format PHPnpm run format - Format ./srcnpm run test:unit - JS Unit testnpm run test:e2e - E2E testnpm run test:php - PHP Unit testnpm run plugin-zip - make zip based on package.json files list.npm run package - make directory based on package.json files list.git tag $(node -p "require('./package.json').version") && git push origin "$_" Publish Taggit tag -d $(node -p "require('./package.json').version") && git push origin --delete "$_" - Delete Tagnpm run language - Make POT File