Skip to content

sboisvert/vip-go-mu-plugins

This branch is 1 commit ahead of, 1834 commits behind Automattic/vip-go-mu-plugins:develop.

Folders and files

NameName
Last commit message
Last commit date
Jan 5, 2023
Nov 13, 2021
Jan 3, 2023
Sep 23, 2022
Nov 3, 2022
Jan 5, 2023
Dec 16, 2022
Sep 2, 2022
May 26, 2022
Nov 21, 2022
Nov 1, 2022
Aug 2, 2022
Jan 3, 2023
Dec 12, 2022
Jan 25, 2022
Dec 13, 2021
Apr 28, 2022
May 25, 2022
Dec 20, 2022
Aug 31, 2022
Nov 8, 2022
Jul 15, 2022
Nov 14, 2022
Nov 10, 2022
Jan 6, 2023
Dec 15, 2022
Aug 11, 2022
Oct 18, 2022
Nov 3, 2022
Nov 17, 2022
Dec 13, 2022
Sep 13, 2022
May 12, 2022
May 19, 2021
Jan 6, 2023
Sep 30, 2022
Sep 30, 2022
Jan 6, 2023
Feb 28, 2022
Jul 7, 2022
Aug 17, 2022
Oct 28, 2022
Mar 21, 2024
Oct 7, 2022
Nov 11, 2021
Jun 29, 2022
Nov 11, 2022
Nov 29, 2022
Feb 2, 2018
Nov 17, 2020
Aug 27, 2022
Mar 29, 2022
Apr 1, 2022
May 16, 2022
Sep 28, 2022
Oct 20, 2022
Dec 5, 2018
Aug 9, 2022
Nov 14, 2022
Dec 20, 2022
Nov 7, 2022
Jun 29, 2022
Oct 5, 2022
Jan 3, 2023
Oct 15, 2021
Jan 25, 2022
Nov 10, 2016
Mar 7, 2020
Dec 12, 2020
Nov 3, 2022
Nov 26, 2020
Oct 27, 2022
Sep 8, 2021
May 23, 2022
May 26, 2022
Jan 11, 2022
Jan 11, 2022
Nov 29, 2019
Oct 15, 2021
Apr 26, 2022
Jan 5, 2023
Jun 16, 2022
Jan 5, 2023
Dec 16, 2022
Oct 15, 2021
Dec 8, 2022
Jan 2, 2023
Jan 5, 2023
Jan 3, 2023
Oct 15, 2021
Jul 14, 2022
Jan 24, 2022
Sep 6, 2022
Jun 29, 2022
Aug 16, 2022
Dec 6, 2022
May 16, 2022
Oct 15, 2021
Oct 15, 2021
May 30, 2022
Apr 26, 2022
May 23, 2022
May 22, 2022
May 23, 2022
Oct 12, 2021
Mar 26, 2022
May 23, 2022
Sep 22, 2022
Nov 12, 2020
Oct 13, 2021
May 22, 2022
Oct 19, 2021
May 23, 2022
Jan 11, 2022
Sep 21, 2022
Nov 21, 2022

Repository files navigation

VIP Go mu-plugins

This is the development repo for mu-plugins on VIP Go.

Documentation

Enterprise Search

Please, visit our Enterprise Search documentation to learn more.

Development

Local Dev

We recommend using the VIP local development environment for local development: https://docs.wpvip.com/technical-references/vip-local-development-environment/

We also have to ensure that we have our dependencies installed - so first, run the following:

git submodule update --init --recursive
composer install
npm install

To use mu-plugins code in a "hot-reload" fashion you need to specify the local folder to which this repository is cloned. For example:

vip dev-env create --mu-plugins $(pwd)

You will be prompted to configure other options of the environment. When the environment is created you can start it with:

vip dev-env start

Tests

PHP Lint
npm run phplint
PHPCS

We use eslines to incrementally scan changed code. It will automatically run on pre-push (see .huskyrc.json).

This is also run on Circle CI for all PRs.

If you want to scan the entire codebase:

npm run phpcs
PHPUnit

If you don't have the Lando-based environment running (e.g. in a CI context), we have a script that runs unit tests in a self-contained Docker environment. To run these tests, execute the following from the project root:

./bin/test.sh

You can also filter by test name.

./bin/test.sh --filter test__rate_limit_ep_query_integration__clears_start_correctly

See ./bin/test.sh for more options.

CI

PHP Linting and PHPUnit tests are run by Circle CI as part of PRs and merges. See .circleci/config.yml for more.

Core tests

We run core tests as part of the CI pipeline. There are many failures when running with mu-plugins so we had to ignore several tests. To add another test there check bin/utils.sh.

To investigate failing test locally you can do following (buckle up as this is not so easy:()):

  1. While in your mu-plugins folder do MU_PLUGINS_DIR=$(pwd)

  2. Switch to where you want to checkout core code e.g. cd ~/svn/wp

  3. Checkout the core code (pick the latest version): svn co --quiet --ignore-externals https://develop.svn.wordpress.org/tags/5.5.3 .

  4. Create test config: cp wp-tests-config-sample.php wp-tests-config.php && sed -i 's/youremptytestdbnamehere/wordpress_test/; s/yourusernamehere/root/; s/yourpasswordhere//; s/localhost/127.0.0.1/' wp-tests-config.php

  5. Build core npm ci && npm run build

  6. Export env variable export WP_TESTS_DIR="$(pwd)/tests/phpunit"

  7. Start local DB: docker run -d -p 3306:3306 circleci/mariadb:10.2

  8. Create empty DB mysqladmin create wordpress_test --user="root" --password="" --host="127.0.0.1" --protocol=tcp

  9. Copy over MU-plugins cp -r $MU_PLUGINS_DIR build/wp-content/mu-plugins

  10. Run the test you want (in this case test_allowed_anon_comments) $MU_PLUGINS_DIR/vendor/bin/phpunit --filter test_allowed_anon_comments

Deployment

Release

A new release of the plugin consists of all those pull requests that have been merged since the last release and have been deployed to Staging (i.e. have the [Status] Deployed to staging label. Releases are named after the day they are released plus a minor version:

YYYYMMDD.x

e.g: 20210917.0

Releases are created using GitHub's releases and are effectively a tag in the GitHub repository. Previous releases can be found here.

To create a new release, please use the create-release script. The script requires the GitHub CLI to be installed in the computer. It will create the new release, properly tagged and with the expected description.

cd vip-go-mu-plugins

bin/create-release.sh

Production

For Automattic Use: Instructions are in the FG :)

vip-go-mu-plugins-built

This is a repo primarily meant for local non-development use.

Every commit merged into develop is automatically pushed to the public copy at Automattic/vip-go-mu-plugins-built. This is handled via CI by the deploy action, which pushes a copy of this repo and expanded submodules.

About

The 'must use' plugins on the VIP Go platform.

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 86.3%
  • HTML 4.4%
  • JavaScript 4.1%
  • CSS 2.6%
  • TypeScript 1.7%
  • Shell 0.6%
  • Other 0.3%