Skip to content

Conversation

@justlevine
Copy link
Contributor

@justlevine justlevine commented Aug 24, 2025

What

This PR adds the required scaffolding to use MCP Adapter as a WordPress Plugin

Important

This PR is based on #16 which should be merged first.
Relevant diff: d5b9157

What's Included

  • Create plugin entrypoint files.
  • Remove Jetpack Autoloader dependency (in favor of Composer's built-in)
  • Add wp-env.json and use it for linting/ PHPUnit testing
  • Add a release.yml to add the built plugin as a GitHub Release artifact
  • Update README.md and CONTRIBUTING.md with new commands

Not Included

  • An internal review of src (a wholly separate task)
  • Rename src to includes (follow-up PR)
  • Fix failing tests/remediations (follow-up PR)

To Test

Follow the updated CONTRIBUTING.md#installation steps:

## If you're using NVM, make sure to use the correct Node.js version:
nvm use

## Then install the NPM dependencies:
npm install

## If you are using Composer locally, also run:
composer install

## Start the test environment
npm run wp-env start

## Run the tests
npm run test:php
image image

(Assumedly the failing tests are because the API is not compatible with Abilities API. #13 will lint for that)

Copilot AI review requested due to automatic review settings August 24, 2025 17:06

This comment was marked as outdated.

@justlevine
Copy link
Contributor Author

Note: Copilot is useless here because it's picking up both #16 and #14

Copy link
Contributor

@galatanovidiu galatanovidiu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is too big to go through each line of code, but even if there are issues, we can address them later

@justlevine justlevine requested a review from Copilot August 25, 2025 18:57
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR transforms the MCP Adapter from a standalone library into a canonical WordPress plugin, adding essential plugin infrastructure and updating the development workflow to use wp-env.

  • Scaffolds WordPress plugin wrapper with main plugin file and autoloader
  • Removes Jetpack Autoloader dependency in favor of standard Composer autoloading
  • Updates development environment to use wp-env for local testing and linting

Reviewed Changes

Copilot reviewed 11 out of 12 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
mcp-adapter.php Main plugin entry point with constants and initialization
src/Plugin.php Plugin wrapper class implementing singleton pattern
src/Autoloader.php Custom PSR-4 autoloader with fallback and admin notices
tests/bootstrap.php Simplified test bootstrap for wp-env integration
.wp-env.json WordPress development environment configuration
composer.json Updated dependencies removing Jetpack Autoloader
package.json Added wp-env scripts and build commands
.github/workflows/release.yml GitHub Actions workflow for plugin release automation
phpcs.xml.dist Added main plugin file to PHPCS scanning
README.md Updated installation and usage documentation
CONTRIBUTING.md Added wp-env development workflow instructions

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

justlevine and others added 6 commits August 25, 2025 21:59
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@justlevine
Copy link
Contributor Author

Synced with trunk, to have the CI - including PHPUnit (also made the diff smaller).

Follow up PRs:

  • Rename src => to includes
  • Audit/review and remediate lints (including syncing w. latest WP_Ability)
  • Deduplicating/updating readme and docs

@justlevine justlevine merged commit 8e328cf into WordPress:trunk Aug 25, 2025
0 of 15 checks passed
@justlevine justlevine deleted the dev/plugin-wrapper branch August 25, 2025 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants