Skip to content

fix(webhooks): resolve Plugin Check errors in the shipped plugin - #840

Open
josephfusco wants to merge 4 commits into
mainfrom
fix/webhooks-plugin-check
Open

josephfusco wants to merge 4 commits into
mainfrom
fix/webhooks-plugin-check

Conversation

@josephfusco

Copy link
Copy Markdown
Member

Brings Plugin Check on the wpgraphql-webhooks zip down from 150 errors to 3. The three left need maintainer decisions (below). One commit per fix:

  • Text domain graphql-webhooks → wpgraphql-webhooks (117 errors). WordPress expects the text domain to match the plugin slug. Changed in the header, the WPGRAPHQL_WEBHOOKS_TEXT_DOMAIN constant, load_plugin_textdomain(), every i18n call, and the phpcs text_domain setting. There are no translation files, so nothing breaks. The admin page slug (page=graphql-webhooks) and the REST namespace (graphql-webhooks/v1) are separate identifiers and stay as they are, so existing admin links and REST clients keep working.
  • Requires PHP: 7.4+ → 7.4, matching readme.txt and composer.json.
  • ABSPATH guards in activation.php, deactivation.php, src/Plugin.php, and src/Admin/WebhooksListTable.php.
  • Escaping and translator comments:
    • escapes wp_die() messages (including a raw WP_Error message) and the "N webhooks deleted" notice
    • wraps GraphQL UserError messages in esc_html__(), as WPGraphQL core does
    • adds translators comments to the placeholder strings
    • pluralizes the header count with _n(), so a single header doesn't read "1 headers"

Needs a decision

Testing

  • Built the zip with composer archive and ran wp plugin check wpgraphql-webhooks locally in wp-env, using the same options as the workflow in ci: run Plugin Check on the built plugin archive #830. The only errors left are the two license errors and "Tested up to".
  • php -l passes on every changed file. The code-quality workflow runs the plugin's own phpcs and phpstan.
Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Assisting with running Plugin Check locally and fixing the errors it reported.

WordPress expects the text domain to match the plugin slug, wpgraphql-webhooks. The
admin page slug and the REST namespace keep their graphql-webhooks names.
Plugin Check rejects "7.4+" and flags the mismatch with readme.txt, which says 7.4.
…ator comments

- Escape wp_die() messages, the deleted-count notice, and GraphQL UserError messages,
  the same way WPGraphQL core does.
- Add translators comments for the placeholder strings, and pluralize the header count.
@josephfusco
josephfusco requested review from a team and colinmurphy as code owners October 23, 2026 15:44
@josephfusco josephfusco added [Type] Bug An existing feature is broken [Area] Webhooks Issues for the WPGraphQL Webhooks plugin Security Work relates to vulnerabilities or hardening Needs Decision Blocked on a maintainer call, not on more work labels Oct 23, 2026
@changeset-bot

changeset-bot Bot commented Oct 23, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 53d2d41

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions

Copy link
Copy Markdown
Contributor

📦 Plugin Artifacts Ready!

Download from GitHub Actions run

Available plugins:

  • ✅ wpgraphql-webhooks.zip

See the "Artifacts" section at the bottom of the Actions run page

@github-actions

Copy link
Copy Markdown
Contributor

🔍 WordPress Plugin Check Report

❌ Status: Failed

📊 Report

🎯 Total Issues ❌ Errors ⚠️ Warnings
21 21 0

❌ Errors (21)

📁 examples/webhooks-isr/wp-env/uploads.zip (1 error)
📍 Line 🔖 Check 💬 Message
0 compressed_files Compressed files are not permitted.
📁 .phpcs.xml.dist (2 errors)
📍 Line 🔖 Check 💬 Message
0 hidden_files Hidden files are not permitted.
0 application_detected Application files are not permitted.
📁 examples/webhooks-isr/wp-env/setup/.htaccess (1 error)
📍 Line 🔖 Check 💬 Message
0 hidden_files Hidden files are not permitted.
📁 .env.dist (2 errors)
📍 Line 🔖 Check 💬 Message
0 hidden_files Hidden files are not permitted.
0 application_detected Application files are not permitted.
📁 .editorconfig (1 error)
📍 Line 🔖 Check 💬 Message
0 hidden_files Hidden files are not permitted.
📁 .gitattributes (1 error)
📍 Line 🔖 Check 💬 Message
0 hidden_files Hidden files are not permitted.
📁 phpstan.neon.dist (1 error)
📍 Line 🔖 Check 💬 Message
0 application_detected Application files are not permitted.
📁 bin/build-docker.sh (1 error)
📍 Line 🔖 Check 💬 Message
0 application_detected Application files are not permitted.
📁 bin/_lib.sh (1 error)
📍 Line 🔖 Check 💬 Message
0 application_detected Application files are not permitted.
📁 bin/sync-package-version.sh (1 error)
📍 Line 🔖 Check 💬 Message
0 application_detected Application files are not permitted.
📁 bin/run-codeception.sh (1 error)
📍 Line 🔖 Check 💬 Message
0 application_detected Application files are not permitted.
📁 bin/install-plugins.sh (1 error)
📍 Line 🔖 Check 💬 Message
0 application_detected Application files are not permitted.
📁 bin/install-test-env.sh (1 error)
📍 Line 🔖 Check 💬 Message
0 application_detected Application files are not permitted.
📁 examples/webhooks-isr/example-app/src/pages/[...uri].js (1 error)
📍 Line 🔖 Check 💬 Message
0 badly_named_files File and folder names must not contain spaces or special characters.
📁 wpgraphql-webhooks.php (2 errors)
📍 Line 🔖 Check 💬 Message
0 plugin_header_invalid_license Invalid License: BSD-0-Clause. Please update your Plugin Header with a valid GPLv2 (or later) compatible license.
0 plugin_updater_detected Including An Update Checker / Changing Updates functionality. Plugin Updater detected. Use of the Update URI header is not allowed in plugins hosted on WordPress.org.
📁 readme.txt (2 errors)
📍 Line 🔖 Check 💬 Message
0 outdated_tested_upto_header Tested up to: 6.9 < 7.1. The "Tested up to" value in your plugin is not set to the current version of WordPress. This means your plugin will not show up in searches, as we require plugins to be compatible and documented as tested up to the most recent version of WordPress.
0 license_mismatch Your plugin has a different license declared in the readme file and plugin header. Please update your readme with a valid GPL license identifier.
📁 phpstan/constants.php (1 error)
📍 Line 🔖 Check 💬 Message
0 missing_direct_file_access_protection PHP file should prevent direct access. Add a check like: if ( ! defined( 'ABSPATH' ) ) exit;

🤖 Generated by WordPress Plugin Check Action • Learn more about Plugin Check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Area] Webhooks Issues for the WPGraphQL Webhooks plugin Needs Decision Blocked on a maintainer call, not on more work Security Work relates to vulnerabilities or hardening [Type] Bug An existing feature is broken

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant