# Quality gates of WooCommerce Multilingual

WCML has no CI files of its own. The root pipeline of `wpml-core` (`.gitlab-ci.yml`) runs every gate for this tree. Until wpmldev-12026, two of them lived in `.gitlab-ci/` here and ran in no pipeline after the fold into the monorepo (wpmldev-8721).

The full list of gates, with the steps to get each one green, is in [docs/testing/linters.md](../../docs/testing/linters.md). This page lists the two that are specific to WCML's files.

## Compiled assets: `assets:wcml`

WCML commits compiled files and ships them as they are:

- the css in `res/css` and `templates/currency-switchers/<name>/style.css`,
- the minified js in `res/js` and `compatibility/res/js`.

The job compiles each file again from its source and fails when the bytes differ. It runs on a merge request that changes `woocommerce-multilingual/`, on Node 20.

- Edit the source, never the compiled file.
- Run the npm script the failure names (`npm run assets:css`, `npm run assets:templates:css`, `npm run assets:js`).
- Commit the compiled file with its source.
- Check locally with `make assets-check` (Node 20).

`build/quality/assets-baseline.json` lists the files that no pinned toolchain reproduces today. It stores the hash of the committed bytes and of the rebuilt bytes, so a hand edit of one of these files fails too. The scripts are `build/quality/assets-check.sh` and `build/quality/assets-check.js`.

## Security ratchet: inside `wpcs`

The root security ratchet runs the security sniffs over every shipped PHP file of WCML. It fails when a count per file and per sniff rises above the floor. The floor is `build/quality/security-baseline-woocommerce-multilingual.json` at the monorepo root, and it may only go down.

- Fix the sink: `esc_html`, `esc_attr` or `esc_url` for HTML, `$wpdb->prepare` for SQL, `sanitize_*` and a nonce for input.
- A suppression needs a `-- reason` on the same line. A suppression without one fails.
- After you fix sinks, record the lower floor with `make security-ratchet-update` and commit it in the same merge request.
- Check locally with `make security-ratchet`.

The script is the root `build/quality/phpcs-security-ratchet.sh`. It uses the root ruleset `build/quality/phpcs.xml`.
