The plugin folder structure is separated from the root folder structure to avoid flooding the documentation. Additionally folders/files marked with a prefixed 💡 are important for getting started (that means, learn more about them).
All files and folders written in italics are not saved in Git, but automatically arranged when you develop or deploy your plugin.
- 📁
plugins/your-pluginFolder you created withcreate-wp-react-app create-plugin- 📁
coverageCoverage reports, see this - 📁
devopsFiles related to CI/CD, Docker and so on for this specific plugin- 📁
.gitlab- 📄 💡
.gitlab-ci.tsCI/CD similar root file, included in root.gitlab-ci.yml - 📄
stage-build-production.tsPredefined job to build production plugin when merged tomaster - 📄
stage-build.tsPredefined job to build plugin - 📄
stage-deploy.tsPredefined job for wordpress.org deployment - 📄
stage-test.tsPredefined test jobs - 📄
stage-validate.tsJobs for Docker garbage collection, semantic versioning and license scanner
- 📄 💡
- 📁
docker-composeCompose files are consumed automatically- 📄
docker-compose.e2e.ymlUsed in Cypress E2E tests - 📄
docker-compose.local.ymlUsed locally with port expose - 📄
docker-compose.traefik.ymlUsed for Review applications - 📄
docker-compose.ymlThis file is automatically merged withdevops/docker-compose/docker-compose.yml, see here
- 📄
- 📁
scriptsAdditional scripts used in Docker containers (mounted) for this specific plugin- 📄 💡
wordpress-startup.shSimilar todevops/scripts/wordpress-startup.sh
- 📄 💡
- 📁
- 📁
buildRunyarn buildto create an installable plugin into this folder - 📁
docsRunyarn docsto create all technical docs into this folder - 📁
node_modulesNode dependencies - 📁
scriptsScripts related to development- 📄 💡
Gruntfile.tsGruntfile for this plugin, extendscommon/Gruntfile.base.ts - 📄 💡
webpack.config.tsWebpack configuration file for this plugin, consumescommon/webpack.factory.ts, see here
- 📄 💡
- 📁
srcYour plugin coding, here we go!- 📁
incServer-side coding in PHP- 📁
baseBase classes and functions- 📁
others- 📄
cachebuster-lib.phpCachebuster file for library files - 📄
cachebuster.phpCachebuster file for entrypoint files - 📄
fallback-php-version.phpShow admin notice when PHP version not reached - 📄
fallback-rest-api.phpShow admin notice when WP REST API is not available - 📄
fallback-wp-version.phpShow admin notice when WP version is not reachable - 📄
index.phpEmpty index.php file to prevent directory browsing - 📄
start.phpInitializes the plugins Core class and shows notices if requirements are not met (e. g. WP version)
- 📄
- 📄 💡
Core.phpAbstract core class for main initialization of namespacing and so on, similar to the well-knownfunctions.php - 📄
index.phpEmpty index.php file to prevent directory browsing - 📄 💡
UtilsProvider.phpMake plugin relevant data available to composer packages, used in all your classes!
- 📁
- 📁 💡
restExample WP REST API endpoint implementation- 📄
index.phpEmpty index.php file to prevent directory browsing - 📄
HelloWorld.phpExamplewp-json/your-plugin/hello-worldendpoint
- 📄
- 📁 💡
viewView relevant coding like initialization of Widgets and admin pages- 📁
menuExample admin page implementation- 📄
index.phpEmpty index.php file to prevent directory browsing - 📄
Page.phpExample "Your plugin" admin page
- 📄
- 📁
widgetExample widget implementation- 📄
index.phpEmpty index.php file to prevent directory browsing - 📄
Widget.phpReact example widget implementation
- 📄
- 📄
index.phpEmpty index.php file to prevent directory browsing
- 📁
- 📄 💡
Activator.phpClass for activate, deactivate and install actions, extends./base/Activator.php - 📄 💡
Assets.phpClass for assets management, extends./base/Assets.php - 📄 💡
Core.phpCore class, put your hook and filter registrations here; extends./base/Core.php - 📄
index.phpEmpty index.php file to prevent directory browsing - 📄 💡
Localization.phpAllows to override used language, extends./base/Localization.php
- 📁
- 📁
languagesServer-side language files- 📄
wp-reactjs-starter.potLanguage file can be translated with Poedit
- 📄
- 📁
publicClient-side coding in React (TypeScript)- 📁
devRunyarn build:js:developmentto compile TypeScript to consumable JS files - 📁
distRunyarn build:js:productionto compile TypeScript to minified consumable JS files - 📁
libRunyarn grunt libs:copyto copy external library files to this folder - 📁
languagesClient-side language files- 📄
wp-reactjs-starter.potLanguage file can be translated with Poedit
- 📄
- 📁 💡
tsYour frontend TypeScript entrypoints and coding- 📁
componentsReact components- 📄
index.tsxExport all members from this folder - 📄
page.tsxPage component used insrc/inc/view/menu/Page.php - 📄
todo.tsxExample todo component consuming the store from../store/todo.tsx, used in./page.tsx - 📄
todoItem.tsxExample todo item component, used in./todo.tsx
- 📄
- 📁
modelsModel definitions for your stores- 📄
index.tsxExport all members from this folder - 📄
todoModel.tsxExample todo item implementation, see../store/todo.ts
- 📄
- 📁
storeMobX stores- 📄
index.tsxExport all members from this folder - 📄
option.tsxOption store, seesrc/inc/base/Assets.php - 📄
stores.tsxCombine all available stores (see this) - 📄
todo.tsxExample Todo store implementation
- 📄
- 📁
styleCSS styles as SCSS files- 📄
admin.scssConsumed in../admin.tsx, enqueued inAssets.php - 📄
widget.scssConsumed in../widget.tsx, enqueued inAssets.php
- 📄
- 📁
typesAdditional declaration files- 📄
global.d.tsAvoid errors of plain JS packages (see this)
- 📄
- 📁
utilsUtils and helpers- 📄
index.tsxCreate utils frompackages/utils/lib/factorylike i18n and AJAX handler
- 📄
- 📁
widgetExample widget implementation, seesrc/inc/view/widget/Widget.php- 📄
index.tsxReact component for the widget container
- 📄
- 📁
wp-apiWP REST API types- 📄
hello.get.tsxTypes forwp-json/your-plugin/hello-world, seesrc/inc/rest/HelloWorld.php - 📄
index.tsxExport all members from this folder
- 📄
- 📄
admin.tsxAdmin frontend coding (entrypoint), enqueued inAssets.php - 📄
widget.tsxWidget frontend coding (entrypoint), enqueued inAssets.php
- 📁
- 📁
- 📄 💡
index.phpMain plugin file making your plugin to a real WordPress plugin - 📄
uninstall.phpUninstall file
- 📁
- 📁
testTest files and specs- 📁 💡
cypressPut your E2E test files here - 📁
jestPut all your Jest tests here - 📁
phpunitPut all your PHPUnit tests here - 📄
jest.config.jsJest configuration file - 📄
jest.setup.jsJest setup file - 📄
patchwork.jsonPatchwork configuration file - 📄
phpunit.bootstrap.phpPHPUnit bootstrap file - 📄
phpunit.xdebug.phpPHPUnit + XDebug filtering for faster code coverage analysis - 📄
phpunit.xmlPHPUnit configuration file
- 📁 💡
- 📁
vendorComposer vendor-dir - 📁
wordpress.orgwordpress.org related files for release in the plugin directory, see here- 📁
assetsAssets like banner and icons (see this) - 📄 💡
README.wporg.txtPlugin readme
- 📁
- 📄
CHANGELOG.mdConventional changelog output - 📄
composer.jsonComposer configuration file - 📄
composer.lockComposer lock file - 📄
cypress.jsonCypress configuration file - 📄
LICENSEPlugin license file - 📄
LICENSE_3RD_PARTY_JS.mdYarn dependencies disclaimer, see License checker - 📄
LICENSE_3RD_PARTY_PHP.mdComposer dependencies disclaimer, see License checker - 📄
package.jsonPackage definition file - 📄
tsconfig.jsonTypeScript configuration file, extendscommon/tsconfig.json
- 📁