Fix camptix-invoices/wcpt-meetup warnings; bump mcp-adapter to 0.6.1 - #1889
Merged
Conversation
The prior fix (#1887) fell back to copy()+unlink() only after an @-suppressed rename() attempt failed, but the sites error-monitoring bot still logs the warning regardless of @ suppression. rename() always fails here because the PDF is generated into a /tmp mount thats a different filesystem from the uploads volume, so drop the doomed rename() attempt entirely. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
get_group_details() and get_group_members() can return false or an array containing null entries on a malformed/failed Meetup API response, which was triggering "Trying to access array offset on null/false" warnings on every wcpt_meetup_api_sync cron run. Bail with a WP_Error when the response isnt an array, and skip non-array entries in the leads loop. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
v0.5.0s RequestRouter.php calls McpObservabilityHelperTrait::is_sensitive_key()
statically, which is deprecated in PHP 8.3 ("should only be called on a class
using the trait") and fires on every request to the wcpt-vetting MCP server.
Fixed upstream in v0.6.0 (github.com/WordPress/mcp-adapter@7cc42a0), which
routes the call through ErrorLogMcpObservabilityHandler instead.
^0.5.0 only allows patch releases (Composers caret rule on a 0.x version),
so the constraint has to move to ^0.6.0 to pick this up. Checked v0.6.0s
breaking changes against this repo: WP 6.9+ requirement is already met,
the removed McpValidator MIME helpers arent used here, and the only
WP\MCP classes referenced (McpAdapter, HttpTransport,
ErrorLogMcpErrorHandler, NullMcpObservabilityHandler) are unaffected.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
wordpress/mcp-adapter 0.6.0 added a transitive dependency on automattic/jetpack-autoloader (used to make WP\MCP class-loading resolve to the newest version when the standalone adapter and another plugin each bundle their own copy). It ships a Composer plugin, so composer install/update now aborts with "contains a Composer plugin which is blocked by your allow-plugins config" -- this broke CI on the mcp-adapter bump commit. Allowlisting it since its an Automattic package already used elsewhere in this codebase via Jetpack. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Updates warning-prone invoice and Meetup flows and upgrades the MCP adapter.
Changes:
- Replaces cross-filesystem invoice renaming with copy-and-delete.
- Validates malformed Meetup API responses.
- Bumps
wordpress/mcp-adapterto 0.6.0.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
class-meetup-admin.php |
Adds Meetup response guards. |
class-camptix-addon-invoices.php |
Changes temporary PDF transfer behavior. |
composer.json |
Upgrades the MCP adapter dependency. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
copy() can fail (disk full, permissions, directory creation failure), and the prior code unconditionally deleted the only generated PDF and recorded post meta pointing at a file that was never created. Only unlink the tmp file and update the post meta once the copy actually succeeds. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@rename()before falling back tocopy()+unlink(), but the sites error-monitoring bot logs warnings even when suppressed with@(it does not checkerror_reporting() === 0).rename()always fails here (the PDF is generated into a/tmpmount that is a different filesystem from the uploads volume), so this drops the doomedrename()attempt entirely and always copies + removes the source.Meetup_Admin::update_meetup_data()was throwing "Trying to access array offset on null/false" on everywcpt_meetup_api_synccron run.get_group_details()can returnfalse(not justWP_Error/array) andget_group_members()can return entries that arenull/non-array on a malformed Meetup API response. Addedis_array()guards before indexing into either response.wordpress/mcp-adapterfrom^0.5.0to^0.6.0. v0.5.0'sRequestRouter.phpcallsMcpObservabilityHelperTrait::is_sensitive_key()statically, which PHP 8.3 deprecates ("should only be called on a class using the trait"), firing on every request to this repo'swcpt-vettingMCP server. Fixed upstream in v0.6.0 (github.com/WordPress/mcp-adapter, commit 7cc42a0), which routes the call throughErrorLogMcpObservabilityHandlerinstead. Composer's caret rule on a 0.x version only allows patch bumps, so^0.5.0never picks up0.6.0on its own -- the constraint has to move explicitly. Checked v0.6.0's breaking changes against this repo: the WP 6.9+ requirement is already met, the removedMcpValidatorMIME helpers are not used here, and the onlyWP\MCPclasses referenced (McpAdapter,HttpTransport,ErrorLogMcpErrorHandler,NullMcpObservabilityHandler) are unaffected.Test plan
php -lon all changed PHP filescomposer.jsonvalidated as well-formed JSONwcpt_meetup_api_synccron no longer logs array-offset warnings, and still updates meetup postmeta on a valid API responsewcpt-vettingMCP server still responds correctly after the mcp-adapter bump, and the trait-deprecation notice is goneGenerated with Claude Code