Skip to content

Fix plugin-check CLI path error caused by wp-env folder naming - #491

Merged
swissspidy merged 2 commits into
mainfrom
copilot/fix-cli-php-not-found-error
Jan 16, 2026
Merged

Fix plugin-check CLI path error caused by wp-env folder naming#491
swissspidy merged 2 commits into
mainfrom
copilot/fix-cli-php-not-found-error

Conversation

Copilot AI commented Jan 16, 2026

Copy link
Copy Markdown
Contributor

wp-env now names plugin folders after the zip filename. Using plugin-check.latest-stable.zip creates a plugin-check.latest-stable/ folder, but the action expects plugin-check/cli.php.

Changes

  • Updated plugin download URL in action.yml from plugin-check.latest-stable.zip to plugin-check.zip

This ensures wp-env creates the folder as plugin-check/, matching the hardcoded CLI path at line 177.

Original prompt

This section details on the original issue you should resolve

<issue_title>cli.php not found when using plugin-check.latest-stable.zip URL</issue_title>
<issue_description>## Description

The action started failing around January 16, 2026 with the error:

Error: Required file 'cli.php' doesn't exist (from runtime argument).

Root Cause

The issue is that wp-env now names plugin folders after the zip filename. When downloading plugin-check.latest-stable.zip, the folder is created as plugin-check.latest-stable instead of plugin-check.

The action then looks for cli.php at:

./wp-content/plugins/plugin-check/cli.php

But the actual path is:

./wp-content/plugins/plugin-check.latest-stable/cli.php

Evidence

Working run (Jan 15, 2026):

plugin-check    active    none    1.8.0

Failing run (Jan 16, 2026):

plugin-check.latest-stable    active    none    1.8.0

Workaround

Using plugin-check.zip instead of plugin-check.latest-stable.zip in the wp-env config creates the correct folder name:

{
  "plugins": [
    "https://downloads.wordpress.org/plugin/plugin-check.zip"
  ]
}

Suggested Fix

Update the action to use plugin-check.zip URL or dynamically determine the actual plugin folder name before running the check command.

Environment

  • Action version: v1 (SHA: ec9b3fe)
  • WordPress: latest
  • @wordpress/env: latest</issue_description>

Comments on the Issue (you are @copilot in this section)

@westonruter I'm also [seeing this](https://github.com/WordPress/performance/actions/runs/21077379098/job/60622787395?pr=2332#step:3:245) in the `plugin-check` action: https://github.com/WordPress/performance/pull/2332
Starting 'wp plugin check auto-sizes --format=json --ignore-codes=readme_reserved_contributors,WordPress.WP.I18n.TextDomainMismatch --exclude-files=.wp-env.json --slug=auto-sizes --require=./wp-content/plugins/plugin-check/cli.php' on the cli container.
Error: Required file 'cli.php' doesn't exist (from runtime argument).
✖ Command failed with exit code 1
```</body></comment_new>
</comments>


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix cli.php not found error due to folder naming Fix plugin-check CLI path error caused by wp-env folder naming Jan 16, 2026
Copilot AI requested a review from swissspidy January 16, 2026 19:26
@github-actions

github-actions Bot commented Jan 16, 2026

Copy link
Copy Markdown

🔍 WordPress Plugin Check Report

❌ Status: Failed

📊 Report

🎯 Total Issues ❌ Errors ⚠️ Warnings
9 8 1

❌ Errors (8)

📁 hello.php (7 errors)
📍 Line 🔖 Check 💬 Message
0 plugin_header_no_license Missing "License" in Plugin Header. Please update your Plugin Header with a valid GPLv2 (or later) compatible license.
0 missing_direct_file_access_protection PHP file should prevent direct access. Add a check like: if ( ! defined( 'ABSPATH' ) ) exit;
49 WordPress.WP.AlternativeFunctions.rand_mt_rand mt_rand() is discouraged. Use the far less predictable wp_rand() instead.
62 WordPress.Security.EscapeOutput.OutputNotEscaped All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '__'.
62 WordPress.WP.I18n.TextDomainMismatch Mismatched text domain. Expected 'hello-dolly-copy' but got 'hello-dolly'.
63 WordPress.Security.EscapeOutput.OutputNotEscaped All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '$lang'.
64 WordPress.Security.EscapeOutput.OutputNotEscaped All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '$chosen'.
📁 readme.txt (1 error)
📍 Line 🔖 Check 💬 Message
0 no_plugin_readme The plugin readme.txt does not exist.

⚠️ Warnings (1)

📁 hello.php (1 warning)
📍 Line 🔖 Check 💬 Message
72 WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedFunctionFound Functions declared in the global namespace by a theme/plugin should start with the theme/plugin prefix. Found: "dolly_css".

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

@swissspidy
swissspidy marked this pull request as ready for review January 16, 2026 20:04
@swissspidy
swissspidy merged commit 6f5a57e into main Jan 16, 2026
2 checks passed
@swissspidy
swissspidy deleted the copilot/fix-cli-php-not-found-error branch January 16, 2026 20:04
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.

cli.php not found when using plugin-check.latest-stable.zip URL

2 participants