Plugin

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.

Folder structure

  • πŸ“ plugins/your-plugin Folder you created with create-wp-react-app create-plugin

    • πŸ“ coverage Coverage reports, see this

    • πŸ“ devops Files related to CI/CD, Docker and so on for this specific plugin

      • πŸ“ .gitlab

        • πŸ“„ πŸ’‘ .gitlab-ci.yml CI/CD similar root file, included in root .gitlab-ci.yml

        • πŸ“„ stage-build-production.yml Predefined job to build production plugin when merged to master

        • πŸ“„ stage-build.yml Predefined job to build plugin

        • πŸ“„ stage-deploy.yml Predefined job for wordpress.org deployment

        • πŸ“„ stage-test.yml Predefined test jobs

        • πŸ“„ stage-validate.yml Jobs for Docker garbage collection, semantic versioning and license scanner

      • πŸ“ docker-compose Compose filesarrow-up-right are consumed automatically

        • πŸ“„ docker-compose.e2e.yml Used in Cypress E2E tests

        • πŸ“„ docker-compose.local.yml Used locally with port expose

        • πŸ“„ docker-compose.traefik.yml Used for Review applications

        • πŸ“„ docker-compose.yml This file is automatically merged with devops/docker-compose/docker-compose.yml, see here

      • πŸ“ scripts Additional scripts used in Docker containers (mountedarrow-up-right) for this specific plugin

        • πŸ“„ πŸ’‘ wordpress-startup.sh Similar to devops/scripts/wordpress-startup.sh

    • πŸ“ build Run yarn build to create an installable plugin into this folder

    • πŸ“ docs Run yarn docs to create all technical docs into this folder

    • πŸ“ node_modules Node dependenciesarrow-up-right

    • πŸ“ scripts Scripts related to development

    • πŸ“ src Your plugin coding, here we go!

      • πŸ“ inc Server-side coding in PHP

      • πŸ“ languages Server-side language files

      • πŸ“ public Client-side coding in React (TypeScript)

        • πŸ“ dev Run yarn build:js:development to compile TypeScript to consumable JS files

        • πŸ“ dist Run yarn build:js:production to compile TypeScript to minified consumable JS files

        • πŸ“ lib Run yarn grunt libs:copy to copy external library files to this folder

        • πŸ“ languages Client-side language files

        • πŸ“ πŸ’‘ ts Your frontend TypeScript entrypoints and coding

          • πŸ“ components React components

            • πŸ“„ index.tsx Export all members from this folder

            • πŸ“„ page.tsx Page component used in src/inc/view/menu/Page.php

            • πŸ“„ todo.tsx Example todo component consuming the store from ../store/todo.tsx, used in ./page.tsx

            • πŸ“„ todoItem.tsx Example todo item component, used in ./todo.tsx

          • πŸ“ models Model definitions for your stores

            • πŸ“„ index.tsx Export all members from this folder

            • πŸ“„ todoModel.tsx Example todo item implementation, see ../store/todo.ts

          • πŸ“ store MobXarrow-up-right stores

            • πŸ“„ index.tsx Export all members from this folder

            • πŸ“„ option.tsx Option store, see src/inc/base/Assets.php

            • πŸ“„ stores.tsx Combine all available stores (see thisarrow-up-right)

            • πŸ“„ todo.tsx Example Todo store implementation

          • πŸ“ style CSS styles as SCSSarrow-up-right files

            • πŸ“„ admin.scss Consumed in ../admin.tsx, enqueued in Assets.php

            • πŸ“„ widget.scss Consumed in ../widget.tsx, enqueued in Assets.php

          • πŸ“ types Additional declaration filesarrow-up-right

          • πŸ“ utils Utils and helpers

            • πŸ“„ index.tsx Create utils from packages/utils/lib/factory like i18n and AJAX handler

          • πŸ“ widget Example widget implementation, see src/inc/view/widget/Widget.php

            • πŸ“„ index.tsx React component for the widget container

          • πŸ“ wp-api WP REST API types

            • πŸ“„ hello.get.tsx Types for wp-json/your-plugin/hello-world, see src/inc/rest/HelloWorld.php

            • πŸ“„ index.tsx Export all members from this folder

          • πŸ“„ admin.tsx Admin frontend coding (entrypoint), enqueued in Assets.php

          • πŸ“„ widget.tsx Widget frontend coding (entrypoint), enqueued in Assets.php

      • πŸ“„ πŸ’‘ index.php Main plugin file making your plugin to a real WordPress plugin

      • πŸ“„ uninstall.php Uninstall filearrow-up-right

    • πŸ“ test Test files and specs

    • πŸ“ vendor Composer vendor-dirarrow-up-right

    • πŸ“ wordpress.org wordpress.org related files for release in the plugin directory, see here

    • πŸ“„ CHANGELOG.md Conventionalarrow-up-right changelog output

    • πŸ“„ composer.json Composer configuration filearrow-up-right

    • πŸ“„ composer.lock Composer lock filearrow-up-right

    • πŸ“„ cypress.json Cypress configuration filearrow-up-right

    • πŸ“„ LICENSE Plugin license file

    • πŸ“„ LICENSE_3RD_PARTY_JS.md Yarn dependencies disclaimer, see License checker

    • πŸ“„ LICENSE_3RD_PARTY_PHP.md Composer dependencies disclaimer, see License checker

    • πŸ“„ package.json Package definition filearrow-up-right

    • πŸ“„ tsconfig.json TypeScript configuration filearrow-up-right, extends common/tsconfig.json

Last updated