PluginProbe
Stream – Activity Log & Audit Trail / trunk
Stream – Activity Log & Audit Trail vtrunk
4.4.0 4.3.0 4.2.2 4.2.1 trunk 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.1 3.1.1 3.10.0 3.2.0 3.2.1 3.2.2 3.2.3 All 50 releases
stream / contributing.md

contributing.md in Stream – Activity Log & Audit Trail trunk, at contributing.md

275 lines 14.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 # Contribute to Stream
2
3
4 ## Development Environment
5
6 Stream uses [](https://npmjs.comnpm](https://npmjs.com](https://npmjs.com) for javascript dependencies, [](https://getcomposer.orgComposer](https://getcomposer.org](https://getcomposer.org) for PHP dependencies and the [](https://gruntjs.comGrunt](https://gruntjs.com](https://gruntjs.com) task runner to minimize and compile scripts and styles and to deploy to the WordPress.org plugin repository.
7
8 Included is a local development environment built with [](https://www.docker.comDocker](https://www.docker.com](https://www.docker.com).
9
10 ### Requirements
11
12 - [](https://nodejs.orgNode.js](https://nodejs.org](https://nodejs.org)
13 - [](https://getcomposer.orgComposer](https://getcomposer.org](https://getcomposer.org)
14
15 We suggest using the [](https://brew.shHomebrew package manager](https://brew.sh](https://brew.sh) on macOS to install the dependencies:
16
17 brew install node@20 composer
18 brew install --cask docker
19
20 ### Environment Setup
21
22 1. See the [](#git-flowGit Flow](#git-flow](#git-flow) section below for how to fork the repository.
23 2. Run `npm install` and `composer install` to setup all project dependencies.
24 3. Run `npm build` to build the assets.
25 3. Run `npm start` to start the development environment.
26 4. Run `npm run install-wordpress` to set up the WordPress multisite network.
27 5. Visit [](https://stream.wpenv.netstream.wpenv.net](https://stream.wpenv.net](https://stream.wpenv.net) and login using `admin` / `password`. The dev environment forces HTTPS; if you haven't run `mkcert -install` on your host yet (see the HTTPS section below), your browser will show a "not secure" warning that you can dismiss.
28 6. Activate the Stream plugin.
29
30 ### HTTPS for the dev environment
31
32 The development environment also serves the site over HTTPS at https://stream.wpenv.net. HTTPS is required for testing WordPress Application Passwords and the Abilities API + MCP integration.
33
34 Cert generation runs in a dedicated `mkcert` Docker service (defined in `docker-compose.yml`), so no host-side mkcert install is needed to **generate** the cert. The `mkcert` container runs once at `npm start`, writes `local/certs/cert.pem` and `local/certs/key.pem` (gitignored), and exits. The WordPress container picks them up via the SSL Apache vhost.
35
36 To make the browser **trust** the locally-issued cert without a security warning, install the mkcert local CA in your host trust store once (this part still happens on the host because it needs access to the keychain / NSS DB):
37
38 - macOS: `brew install mkcert nss && mkcert -install`
39 - Linux: install mkcert via your package manager, then `mkcert -install`
40 - Windows: `choco install mkcert && mkcert -install`
41
42 If you skip the trust-store step, HTTPS still works; the browser just shows a "not secure" warning you can dismiss. Tools that don't perform cert validation (curl with `-k`, Playwright with `ignoreHTTPSErrors: true`, most MCP clients via app-password auth) are unaffected.
43
44 Once the cert is generated and (optionally) trusted, visit https://stream.wpenv.net.
45
46 **Existing environments** (set up before HTTPS was forced) still have `http://stream.wpenv.net` in their database. Upgrade with:
47
48 ```sh
49 docker compose run --rm --user $(id -u) wordpress -- \
50 wp search-replace 'http://stream.wpenv.net' 'https://stream.wpenv.net' \
51 --network --skip-columns=guid --report-changed-only
52 ```
53
54 New `npm run install-wordpress` runs use the HTTPS URL from `local/public/wp-cli.yml` and don't need this step.
55
56 ### MCP (Model Context Protocol) integration
57
58 Stream exposes its abilities as MCP-discoverable tools by tagging each registered ability with `meta.mcp.public = true`. The [](https://github.com/WordPress/mcp-adapterWordPress MCP Adapter](https://github.com/WordPress/mcp-adapter](https://github.com/WordPress/mcp-adapter) does the actual MCP server work; Stream does not load or initialize the adapter itself.
59
60 The MCP Adapter is a `require-dev` Composer dependency declared as `"type": "wordpress-plugin"`, so `composer install` automatically drops it into `local/public/wp-content/plugins/mcp-adapter/`. You just need to activate it:
61
62 ```sh
63 docker compose run --rm --user $(id -u) wordpress -- wp plugin activate mcp-adapter --network
64 ```
65
66 Then enable the "Enable Abilities API and MCP" toggle in Stream → Settings → Advanced (network admin on network-activated multisite). Verify the MCP default server route responds:
67
68 ```sh
69 curl -sk https://stream.wpenv.net/wp-json/mcp/mcp-adapter-default-server
70 ```
71
72 To use MCP from Claude Desktop or another MCP client, follow the [](https://github.com/WordPress/mcp-adapter#mcp-client-configurationmcp-adapter README's MCP client configuration section](https://github.com/WordPress/mcp-adapter#mcp-client-configuration](https://github.com/WordPress/mcp-adapter#mcp-client-configuration). The HTTP transport requires the HTTPS setup above plus a WordPress Application Password.
73
74 ### PHP Xdebug
75
76 The WordPress container includes the [](https://xdebug.orgXdebug PHP extension](https://xdebug.org](https://xdebug.org). It is configured in the [](./local/docker/wordpress/php.ini`php.ini`](./local/docker/wordpress/php.ini](./local/docker/wordpress/php.ini) file to work in the [](https://xdebug.org/docs/step_debug#modedevelop, debug and coverage modes](https://xdebug.org/docs/step_debug#mode](https://xdebug.org/docs/step_debug#mode).
77
78 [](https://xdebug.org/docs/step_debugStep Debugging](https://xdebug.org/docs/step_debug](https://xdebug.org/docs/step_debug) should work out of the box in VSCode thanks to the configuration file, [](.vscode/launch.json`.vscode/launch.json`](.vscode/launch.json](.vscode/launch.json). It contains the directory mapping from the WordPress container to the project directory in your code editor.
79
80 In order to set up Step Debugging in PhpStorm, follow the [](https://www.jetbrains.com/help/phpstorm/configuring-xdebug.htmlofficial guide](https://www.jetbrains.com/help/phpstorm/configuring-xdebug.html](https://www.jetbrains.com/help/phpstorm/configuring-xdebug.html). Make sure to set up the same directory mappings as defined for VSCode in [](.vscode/launch.json`.vscode/launch.json`](.vscode/launch.json](.vscode/launch.json), e.g.:
81 - `${workspaceRoot}` -> `/var/www/html/wp-content/plugins/stream-src`,
82 - `${workspaceRoot}/build` -> `/var/www/html/wp-content/plugins/stream`,
83 - `${workspaceRoot}/local/public` -> `/var/www/html`
84
85 ### Mail Catcher
86
87 We use a [](https://github.com/mailhog/MailHogMailHog](https://github.com/mailhog/MailHog](https://github.com/mailhog/MailHog) container to capture all emails sent by the WordPress container, available at [](https://stream.wpenv.net:8025stream.wpenv.net:8025](https://stream.wpenv.net:8025](https://stream.wpenv.net:8025).
88
89 ### phpMyAdmin
90
91 [](https://www.phpmyadmin.net/phpMyAdmin ](https://www.phpmyadmin.net/](https://www.phpmyadmin.net/) is available at [](http://stream.wpenv.net:8080/stream.wpenv.net:8080](http://stream.wpenv.net:8080/](http://stream.wpenv.net:8080/).
92
93 ### Scripts and Commands
94
95 We use npm as the canonical task runner for the project. The following commands are available:
96
97 - `npm run start` to start the project's Docker containers.
98 - `npm run stop` to stop the project's Docker containers.
99 - `npm run stop-all` to stop _all_ Docker containers.
100 - `npm run build` to build the plugin JS and CSS files.
101 - `npm run dev` to watch and build the plugin assets continuously.
102 - `npm run lint` to check JS and PHP files for syntax and style issues.
103 - `npm run deploy` to deploy the plugin to the WordPress.org repository.
104 - `npm run cli -- wp info` where `wp info` is the CLI command to run inside the WordPress container. For example, use `npm run cli -- ls -lah` to list all files in the root of the WordPress installation.
105 - `npm run test` to run PHPunit tests inside the WordPress container.
106 - `npm run test-xdebug` will run the PHPunit tests with Xdebug enabled.
107 - `npm run test-e2e` will run the Playwright E2E tests.
108 - `npm run test-e2e-debug` will run the Playwright E2E tests in a debug mode (with Chromium browser and dev tools open).
109 - `npm run switch-to:php7.4` and `npm run switch-to:php8.2` will switch you to either PHP 7.4 or PHP 8.2
110 - `npm run document:connectors` generates [](connectors.mdconnectors.md](connectors.md](connectors.md). This runs via your local php.
111 - `npm run large-records-generate` inserts ~1.6M rows to `wp_stream` and ~8.4M rows to `wp_streammeta` for testing
112 - `npm run large-records-remove` removes the test data only
113 - `npm run large-records-show` shows how much test data is in the tables, this does not include non-test entries
114
115 By default, tests have `WP_DEBUG` as false. You can override this if necessary by setting `WP_STREAM_TEST_DEBUG` to "yes".
116
117 ### Docker issues
118
119 If you are having issues with incorrect versions of Xdebug or other Docker issues, first try rebuilding with no cache and up to date images using the command `docker compose build --no-cache --pull`. Then run `npm run start` as normal.
120
121 ## Issues Tracker
122
123 Support issues or usage questions should be posted on the [](https://wordpress.org/support/plugin/streamPlugin Support Forum](https://wordpress.org/support/plugin/stream](https://wordpress.org/support/plugin/stream).
124
125 The [](https://github.com/xwp/stream/issuesissue tracker on GitHub](https://github.com/xwp/stream/issues](https://github.com/xwp/stream/issues) is the preferred channel for [](#bugsbug reports](#bugs](#bugs), [](#featuresfeatures requests](#features](#features) and [](#pull-requestssubmitting pull requests](#pull-requests](#pull-requests).
126
127
128 <a name="bugs"></a>
129
130 ## Reporting Bugs
131
132 A bug is a _demonstrable problem_ that is caused by the code in the repository. Good bug reports with complete error messages, environment details and screenshots are extremely helpful &mdash; thank you!
133
134 Guidelines for bug reports:
135
136 1. **Check if the bug has already been fixed** &mdash; Someone may already be on top of it, so try to reproduce it using the latest from the `master` branch.
137
138 2. **Use the [](https://github.com/xwp/stream/search?type=IssuesGitHub issue search](https://github.com/xwp/stream/search?type=Issues](https://github.com/xwp/stream/search?type=Issues)** &mdash; Someone might already know about it, so please check if the issue has already been reported.
139
140 3. **Isolate the problem** &mdash; The better you can determine exactly what behavior(s) cause the issue, the faster and more effectively it can be resolved. “I’m getting an error message.” is not a good bug report. A good bug report shouldn't leave others needing to contact you for more information.
141
142 Please try to be as detailed as possible in your report. What is your environment? What steps will reproduce the issue? What browser(s) experience the problem? What outcome did you expect, and how did it differ from what you actually saw? All these details will help people to fix any potential bugs.
143
144 Example:
145
146 > Short and descriptive example bug report title
147 >
148 > A summary of the issue and the environment/browser in which it occurs. If
149 > suitable, include the steps required to reproduce the bug.
150 >
151 > 1. This is the first step
152 > 2. This is the second step
153 > 3. Further steps, etc.
154 >
155 > Any other information you want to share that is relevant to the issue being reported. This might include the lines of code that you have identified as causing the bug, and potential solutions (and your opinions on their merits).
156
157 **Note:** In an effort to keep open issues to a manageable number, we will close any issues that do not provide enough information for us to be able to work on a solution. You will be encouraged to provide the necessary details, after which we will reopen the issue.
158
159
160 <a name="features"></a>
161
162 ## Feature Requests
163
164 Feature requests are very welcome! But take a moment to find out whether your idea fits with the scope and aims of the project. It's up to *you* to make a strong case to convince the project's developers of the merits of this feature. Please provide as much detail and context as possible.
165
166 Building something great means choosing features carefully especially because it is much, much easier to add features than it is to take them away. Additions to Stream will be evaluated on a combination of scope (how well it fits into the project), maintenance burden and general usefulness to users.
167
168
169 <a name="pull-requests"></a>
170
171 ## Pull Requests
172
173 Good pull requests &mdash; patches, improvements, new features &mdash; are a fantastic help.
174 They should remain focused in scope and avoid containing unrelated commits.
175
176 **Please ask first** before embarking on any significant pull request (e.g. implementing features, refactoring code), otherwise you risk spending a lot of time working on something that the project's developers might not want to merge into the project. You can solicit feedback and opinions in an open enhancement issue, or [](https://github.com/xwp/stream/issues/newcreate a new one](https://github.com/xwp/stream/issues/new](https://github.com/xwp/stream/issues/new).
177
178 Please use the [](#git-flowgit flow for pull requests](#git-flow](#git-flow) and follow [](https://make.wordpress.org/core/handbook/coding-standards/WordPress Coding Standards](https://make.wordpress.org/core/handbook/coding-standards/](https://make.wordpress.org/core/handbook/coding-standards/) before submitting your work.
179
180
181 <a name="git-flow"></a>
182
183 ### Git Flow for Pull Requests
184
185 1. [](https://help.github.com/fork-a-repo/Fork](https://help.github.com/fork-a-repo/](https://help.github.com/fork-a-repo/) the project, clone your fork, and configure the remotes:
186
187 ```bash
188 # Clone your fork of the repo into the current directory
189 git clone git@github.com:<YOUR_USERNAME>/stream.git
190 # Navigate to the newly cloned directory
191 cd stream
192 # Assign the original repo to a remote called "upstream"
193 git remote add upstream https://github.com/xwp/stream
194 ```
195
196 2. If you cloned a while ago, get the latest changes from upstream:
197
198 ```bash
199 git checkout master
200 git pull upstream master
201 ```
202
203 3. Create a new topic branch (off the `master` branch) to contain your feature, change, or fix:
204
205 ```bash
206 git checkout -b <topic-branch-name>
207 ```
208
209 4. Commit your changes in logical chunks. Please adhere to these [](https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.htmlgit commit message guidelines](https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html](https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html). Use Git's [](https://help.github.com/articles/interactive-rebaseinteractive rebase](https://help.github.com/articles/interactive-rebase](https://help.github.com/articles/interactive-rebase) feature to tidy up your commits before making them public.
210
211 5. Locally merge (or rebase) the upstream development branch into your topic branch:
212
213 ```bash
214 git pull [--rebase] upstream master
215 ```
216
217 6. Push your topic branch up to your fork:
218
219 ```bash
220 git push origin <topic-branch-name>
221 ```
222
223 7. [](https://help.github.com/articles/using-pull-requests/Open a Pull Request](https://help.github.com/articles/using-pull-requests/](https://help.github.com/articles/using-pull-requests/) (with a clear title and description) to the `develop` branch.
224
225 **IMPORTANT**: By submitting a patch, you agree to allow the project owner to license your work under the [](https://www.gnu.org/licenses/gpl-2.0.htmlGPL v2 license](https://www.gnu.org/licenses/gpl-2.0.html](https://www.gnu.org/licenses/gpl-2.0.html).
226
227 ## Release Cycle
228
229 The plugin versioning follows [](https://semver.orgsemantic versioning](https://semver.org](https://semver.org).
230
231 ### Pre-release
232
233 Features, bug fixes, and other changes are assigned to a milestone. Once all issues in a milestone are closed:
234
235 1. **Create Release Branch:**
236 - Branch off from `develop`.
237 - Name it `release/vX.Y.Z`, where `X.Y.Z` is the version number.
238
239 2. **Update Metadata:**
240 - Update the plugin version, changelog and other relevant information.
241
242 3. **Create Pre-release in GitHub:**
243 - Name the release like `X.Y.Z-rc.N`, e.g. `4.0.1-rc.1`.
244 - The tag name should be prefixed with `v`, e.g. `v4.0.1-rc.1`.
245
246 4. **Review and Test:**
247 - Publishing a pre-release will trigger a GitHub action.
248 - A dry-run of WP.org deployment will occur (no files are committed).
249 - Review the SVN changes log in the action output.
250 - A ZIP archive with the plugin is created and uploaded as a release asset.
251 - Use that ZIP file for final testing.
252
253 5. **Fix Issues:**
254 - If any issues are found, fix them in the release branch.
255 - Repeat the process from step 3.
256
257 ### Release
258
259 Once ready, follow these steps:
260
261 1. **Create Release in GitHub:**
262 - Name the release like `X.Y.Z`, e.g. `4.0.1`.
263 - The tag name should be prefixed with `v`, e.g. `v4.0.1`.
264
265 2. **Confirm Deployment:**
266 - The GitHub action deploys the plugin to WP.org.
267 - Confirm the changes have been deployed to SVN in the [](https://plugins.trac.wordpress.org/browser/stream/plugin trac](https://plugins.trac.wordpress.org/browser/stream/](https://plugins.trac.wordpress.org/browser/stream/).
268 - A ZIP archive is created and uploaded to GitHub release assets.
269
270 3. **Merge Branches:**
271 - Merge the release branch into `master`.
272 - Merge `master` into `develop`.
273
274 By following this process, you ensure a smooth and consistent release cycle.
275