PHPackages                             wearenolte/wp-ci-template - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [CLI &amp; Console](/categories/cli)
4. /
5. wearenolte/wp-ci-template

ActiveProject[CLI &amp; Console](/categories/cli)

wearenolte/wp-ci-template
=========================

61033[3 PRs](https://github.com/wearenolte/wp-ci-template/pulls)Shell

Since Oct 4Pushed 1y ago9 watchersCompare

[ Source](https://github.com/wearenolte/wp-ci-template)[ Packagist](https://packagist.org/packages/wearenolte/wp-ci-template)[ RSS](/packages/wearenolte-wp-ci-template/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (20)Used By (0)

WordPress + Composer + CI Template
==================================

[](#wordpress--composer--ci-template)

This repository is a reference implementation and start state for a modern WordPress workflow utilizing [Composer](https://getcomposer.org/), Continuous Integration (CI), Automated Testing, and Pantheon.

This repository is meant to be copied one-time by the the [Terminus Build Tools Plugin](https://github.com/pantheon-systems/terminus-build-tools-plugin) but can also be used as a template.

The Terminus Build Tools plugin will scaffold a new project, including:

- A Git repository
- A Pantheon sandbox site
- Continuous Integration configuration/credential set up

For more details and instructions on creating a new project, see the [Terminus Build Tools Plugin](https://github.com/pantheon-systems/terminus-build-tools-plugin/).

Important files and directories
-------------------------------

[](#important-files-and-directories)

### `/web`

[](#web)

Pantheon will serve the site from the `/web` subdirectory due to the configuration in `pantheon.yml`. This is necessary for a Composer based workflow. Having your website in this subdirectory also allows for tests, scripts, and other files related to your project to be stored in your repo without polluting your web document root or being web accessible from Pantheon. They may still be accessible from your version control project if it is public. See [the `pantheon.yml`](https://pantheon.io/docs/pantheon-yml/#nested-docroot) documentation for details.

### `/web/wp`

[](#webwp)

Even within the `/web` directory you may notice that other directories and files are in different places compared to a default WordPress installation. [WordPress allows installing WordPress core in its own directory](https://codex.wordpress.org/Giving_WordPress_Its_Own_Directory), which is necessary when installing WordPress with Composer.

See `/web/wp-config.php` for key settings, such as `WP_SITEURL`, which must be updated so that WordPress core functions properly in the relocated `/web/wp` directory. The overall layout of directories in the repo is inspired by, but doesn't exactly mirror, [Bedrock](https://github.com/roots/bedrock).

### `composer.json`

[](#composerjson)

This project uses Composer to manage third-party PHP dependencies.

The `require` section of `composer.json` should be used for any dependencies your web project needs, even those that might only be used on non-Live environments. All dependencies in `require` will be pushed to Pantheon.

The `require-dev` section should be used for dependencies that are not a part of the web application but are necesarry to build or test the project. Some example are `php_codesniffer` and `phpunit`. Dev dependencies will not be deployed to Pantheon.

If you are just browsing this repository on GitHub or Bitbucket, you may not see some of the directories mentioned above, such as `web/wp`. That is because WordPress core and its plugins are installed via Composer and ignored in the `.gitignore` file.

A custom, [Composer version of WordPress for Pantheon](https://github.com/pantheon-systems/wordpress-composer/) is used as the source for WordPress core.

Third party WordPress dependencies, such as plugins and themes, are added to the project via `composer.json`. The `composer.lock` file keeps track of the exact version of dependency. [Composer `installer-paths`](https://getcomposer.org/doc/faqs/how-do-i-install-a-package-to-a-custom-path-for-my-framework.md#how-do-i-install-a-package-to-a-custom-path-for-my-framework-) are used to ensure the WordPress dependencies are downloaded into the appropriate directory.

We do not allow plugin installs from the public wpackagist repository. All plugins must be installed from our [nolte-wpackagist](https://dev-nolte-wpackagist.pantheonsite.io/wp-admin/options-general.php?page=satispress#satispress-packages) instead. This ensures only approved plugins are used.

Non-WordPress dependencies are downloaded to the `/vendor` directory.

### `.ci`

[](#ci)

This `.ci` directory is where all of the scripts that run on Continuous Integration are stored. Provider specific configuration files, such as `.circle/config.yml` and `.gitlab-ci.yml`, make use of these scripts.

The scripts are organized into subdirectories of `.ci` according to their function: `build`, `deploy`, or `test`.

#### Build Scripts `.ci/build`

[](#build-scripts-cibuild)

Steps for building an artifact suitable for deployment. Feel free to add other build scripts here, such as installing Node dependencies, depending on your needs.

- `.ci/build/php` installs PHP dependencies with Composer

#### Build Scripts `.ci/deploy`

[](#build-scripts-cideploy)

Scripts for facilitating code deployment to Pantheon.

- `.ci/deploy/pantheon/create-multidev` creates a new [Pantheon multidev environment](https://pantheon.io/docs/multidev/) for branches other than the default Git branch
    - Note that not all users have multidev access. Please consult [the multidev FAQ doc](https://pantheon.io/docs/multidev-faq/) for details.
- `.ci/deploy/pantheon/dev-multidev` deploys the built artifact to either the Pantheon `dev` or a multidev environment, depending on the Git branch

#### Automated Test Scripts `.ci/tests`

[](#automated-test-scripts-citests)

Scripts that run automated tests. Feel free to add or remove scripts here depending on your testing needs.

**Static Testing** `.ci/test/static` and `tests/unit`Static tests analyze code without executing it. It is good at detecting syntax error but not functionality.

- `.ci/test/static/run` Runs [PHP CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer) with [WordPress coding standards](https://github.com/WordPress/WordPress-Coding-Standards), PHP Unit, and [PHP syntax checking](https://www.php.net/manual/en/function.php-check-syntax.php).
- `tests/unit/bootstrap.php` Bootstraps the Composer autoloader
- `tests/unit/TestAssert.php` An example Unit test. Project specific test files will need to be created in `tests/unit`.

**Visual Regression Testing** `.ci/test/visual-regression`Visual regression testing uses a headless browser to take screenshots of web pages and compare them for visual differences.

- `.ci/test/visual-regression/run` Runs [BackstopJS](https://github.com/garris/BackstopJS) visual regression testing.
- `.ci/test/visual-regression/backstopConfig.js` The [BackstopJS](https://github.com/garris/BackstopJS) configuration file. Setting here will need to be updated for your project. For example, the `pathsToTest` variable determines the URLs to test.

Working locally with Lando
--------------------------

[](#working-locally-with-lando)

To get started using Lando to develop locally complete these one-time steps. Please note than Lando is an independent product and is not supported by Pantheon. For further assistance please refer to the [Lando documentation](https://docs.devwithlando.io/).

- [Install Lando](https://docs.devwithlando.io/installation/system-requirements.html), if not already installed.
- Create a folder to host your project locally.
- Run `lando init` from your project folder and follow the prompts, choosing the Pantheon recipe followed by entering a valid machine token and selecting the Pantheon site created by \[the Terminus build tools plugin\].().
- Run `lando start` to start Lando.
    - Save the local site URL. It should be similar to `https://.lndo.site`.
- Run `lando composer install --no-ansi --no-interaction --optimize-autoloader --no-progress` to download dependencies
- Run `lando pull --code=none` to download the media files and database from Pantheon.
- Visit the local site URL saved from above.

You should now be able to edit your site locally. You can stop Lando with `lando stop` and start it again with `lando start`.

**Warning:** do NOT push/pull code between Lando and Pantheon directly. All code should be pushed to Bitbucket, which will deploy to Pantheon through its continuous integration service, Pipelines.

Composer, Terminus and wp-cli commands should be run in Lando rather than on the host machine. This is done by prefixing the desired command with `lando`. For example, after a change to `composer.json` run `lando composer update` rather than `composer update`.

Testing Locally with Cypress
----------------------------

[](#testing-locally-with-cypress)

Cypress is a JavaScript-based end-to-end testing framework. It is built on top of Mocha and Chai, frameworks that run on the browser, and supports Chai’s BDD and TDD assertion styles. Documentation for Cypress can be found [here](https://docs.cypress.io/guides/overview/why-cypress.html#In-a-nutshell), with API docs [here](https://docs.cypress.io/api/api/table-of-contents.html). These include guides on [best practices](https://docs.cypress.io/guides/references/best-practices.html), commands, assertions, and events.

You can find many examples of tests, including tests with stubs, forms, and network requests, [in Cypress's Github](https://github.com/cypress-io/cypress-example-kitchensink/tree/master/cypress/integration/examples).

### Writing Tests

[](#writing-tests)

New tests can be added to `tests/cypress/integration/`. [Fixture data](https://docs.cypress.io/api/commands/fixture.html) files can be added to `tests/cypress/fixtures/`. The support file `tests/cypress/support/index.js` runs before every spec file and is the place to store reusable behavior (such as navigating to the home page).

To create a new spec file, use the syntax `test-name_test.spec.js`. Use the Mocha function `describe()` to group the tests in each file. Use `it()` to identify individual tests. Avoid the temptation to write an `it()` function for every assertion, as you might when unit testing. Integration tests can include multiple assertions and will run more efficiently this way.

To reference a component, instead of relying on class names or other brittle selectors, check if it already has a custom data attribute assigned to it, or assign one using the following pattern: `data-{type-of-component}="{component-slug}"`

Example: `data-molecule="cards/media"`

For creating the component slug, use the folder path. In this example, the component php file is in `molecules/cards/media.php`

Note that for testing across screen sizes, Cypress offers [viewport presets](https://docs.cypress.io/api/commands/viewport.html) for common devices.

### Running Tests

[](#running-tests)

To run tests headlessly, run the command `composer functional-test`. To run tests within the browser and view step-by-step snapshots, run `composer functional-test-open`. To run both Cypress and PHPunit tests, run `composer test`.

An mp4 of the most recent run of each spec file is stored in `tests/cypress/videos`.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance27

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/4aa05a59deaf5695b3a80e42e2c6b971ab92c171ad13cd7b95ca8175382cda60?d=identicon)[WeAreNolte](/maintainers/WeAreNolte)

---

Top Contributors

[![nelsonamaya82](https://avatars.githubusercontent.com/u/6953921?v=4)](https://github.com/nelsonamaya82 "nelsonamaya82 (25 commits)")[![bethshook](https://avatars.githubusercontent.com/u/24514433?v=4)](https://github.com/bethshook "bethshook (12 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (7 commits)")[![mannuel](https://avatars.githubusercontent.com/u/5023046?v=4)](https://github.com/mannuel "mannuel (7 commits)")[![honekun](https://avatars.githubusercontent.com/u/572652?v=4)](https://github.com/honekun "honekun (3 commits)")[![acastellanos3](https://avatars.githubusercontent.com/u/61747246?v=4)](https://github.com/acastellanos3 "acastellanos3 (3 commits)")[![arzola](https://avatars.githubusercontent.com/u/4997549?v=4)](https://github.com/arzola "arzola (2 commits)")

### Embed Badge

![Health badge](/badges/wearenolte-wp-ci-template/health.svg)

```
[![Health](https://phpackages.com/badges/wearenolte-wp-ci-template/health.svg)](https://phpackages.com/packages/wearenolte-wp-ci-template)
```

###  Alternatives

[wp-cli/wp-cli

WP-CLI framework

5.0k17.2M319](/packages/wp-cli-wp-cli)[consolidation/annotated-command

Initialize Symfony Console commands from annotated command class methods.

22569.8M18](/packages/consolidation-annotated-command)[chi-teck/drupal-code-generator

Drupal code generator

26947.8M5](/packages/chi-teck-drupal-code-generator)[seld/cli-prompt

Allows you to prompt for user input on the command line, and optionally hide the characters they type

24725.8M17](/packages/seld-cli-prompt)[illuminate/console

The Illuminate Console package.

12944.1M5.1k](/packages/illuminate-console)[php-tui/php-tui

Comprehensive TUI library heavily influenced by Ratatui

589747.0k6](/packages/php-tui-php-tui)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
