Code contributions, bug reports, and feedback are very welcome.
For this fork (dknauss/authorship), development happens on fork develop, and pull requests should be made against this fork.
Upstream (humanmade/authorship) pull requests are optional and created only at explicit packaging checkpoints. See Fork-First Policy.
- Branch from fork
develop. - Implement and verify changes locally.
- Open a PR to fork
develop. - Merge through PR workflow only.
Do not open one upstream PR per build slice. Upstream PRs are curated packaging submissions only, per docs/fork-first-policy.md.
You can clone this repo and activate it like a normal WordPress plugin, but you'll need to install the developer dependencies in order to build the assets and to run the tests.
-
Install the PHP dependencies:
composer install -
Install the Node dependencies:
npm install -
If you want to run the tests locally, check the MySQL database credentials in the
tests/.envfile and amend them as necessary.
To compile the JS and CSS:
npm run build
To start the file watcher which will watch for changes and automatically build the JS and CSS:
npm run start
- Standards tooling is maintained to run on both PHP
7.4and modern PHP (8.4+), matching the CI standards matrix. composer test:phpcssuppresses runtime deprecation notices from third-party sniffs on modern PHP so standards checks stay runnable.composer test:phpstanruns with an explicit memory limit (1G) for consistent local and CI execution.- Existing PHPStan technical debt is tracked in
phpstan-baseline.neon. Do not add new baseline entries for newly introduced issues.
To run the whole test suite which includes unit tests and linting:
composer test
To run just the PHPUnit tests:
composer test:ut
To run PHPUnit with coverage and enforce the baseline threshold:
composer test:coverage
To run just the code sniffer:
composer test:phpcs
To run just the PHP Static Analysis tool:
composer test:phpstan
To lint the JS and CSS:
npm run lint
Lint command behavior notes:
npm run lint:cssintentionally targets stylesheet sources (src/**/*.scss) rather than all files undersrc/.- This avoids Stylelint parsing
.ts/.tsxfiles during CI while keeping stylesheet lint coverage intact.
composer test:coverageusesphpdbgas the coverage driver, so no Xdebug/PCOV extension is required.- The current gate enforces statement coverage from
tests/cache/coverage/clover.xmlagainst the baseline threshold defined incomposer.json. - Coverage threshold ratcheting policy:
- Raise only after at least 3 consecutive green coverage-gate runs in CI and at least 1 green local confirmation run.
- Raise in small increments (normally 1-2 percentage points) and keep the floor at least 1 point below the most recent measured statement coverage.
- Do not lower the threshold for feature work. A rollback is allowed only for measurement drift, test-environment changes, or confirmed flaky external factors, and must be a 1-point maximum with follow-up issue tracking.
- Current threshold is
63%(ratcheted from60%after stable64.03%coverage signal).
These are the steps to take to release a new version of Authorship (for contributors who have push access to the GitHub repo).
For this fork, release packaging to upstream is optional and not required for fork delivery.
- Check the milestone on GitHub for open issues or PRs. Fix or reassign as necessary.
- If this is a non-patch release, check issues and PRs assigned to the patch or minor milestones that will get skipped. Reassign as necessary.
- Ensure you're on the
developbranch and all the changes for this release have been merged in. - Ensure
README.mdcontains an up to date description, "Tested up to" version, FAQs, screenshots, etc.- Note: The double spaces at the end of the lines in the plugin header section at the top of README.md must be kept, to ensure line breaks are created.
- Run
composer testand ensure everything passes. - Prepare a changelog for the Releases page on GitHub.
- The
git changelog -xcommand from Git Extras is handy for this.
- The
- Bump and commit the plugin version number using
npm run bump:{INCREMENTOR}, eg:npm run bump:patch,npm run bump:minor, ornpm run bump:major - Push to a new release branch, eg:
git checkout -b release-vxxxand thengit push - Create a new pull-request from that branch, eg:
hub pull-request - Wait until (and ensure that) the build passes
- Get the PR reviewed and merged
git checkout maingit merge developgit push origin maingit push origin main:release- Wait for the Build Release action to complete
- Enter the changelog into the release on GitHub and publish it.