Skip to content

fix: extract WordPress core without truncated file names - #78

Merged
mrrobot47 merged 2 commits into
rtCamp:masterfrom
iamimmanuelraj:fix/wp-core-truncated-files
Oct 5, 2026
Merged

mrrobot47 merged 2 commits into
rtCamp:masterfrom
iamimmanuelraj:fix/wp-core-truncated-files

Conversation

@iamimmanuelraj

Copy link
Copy Markdown
Member

Problem

WordPress 7.x .tar.gz packages store paths longer than 100 bytes in PAX headers. WP-CLI <= 2.12 extracts them with PHP's PharData, which truncates the names (wp-cli/wp-cli#6320). setup_wordpress_files() runs a plain wp core download, so deployed sites get a broken core (25 files under wp-includes/php-ai-client/) and fail wp core verify-checksums. This is what triggers the false-positive 'WordPress Core Checksum Failed' ED alerts on CI/CD sites.

Fix

New download_wordpress_core() in main.sh, same approach as EasyEngine/site-command#504 and EasyEngine/site-type-wp#241:

  • wp core download --no-extract only downloads and md5-checks the package.
  • Extract with tar (or unzip for the .zip WP-CLI 3.0 saves).
  • Run wp core verify-checksums. Fail on missing or modified core files; warn only if WordPress.org checksums can't be fetched.
  • nightly/trunk keep WP-CLI's own .zip extraction and skip verification (no published checksums).

Testing

In wordpress:cli (WP-CLI 2.12.0): WP 7.1.2 downloads, extracts and passes wp core verify-checksums; nightly still extracts. Not tested: the .zip branch and a full action run on a real site.

WordPress 7.x .tar.gz packages store paths longer than 100 bytes in PAX
headers. WP-CLI <= 2.12 extracts with PharData, which truncates them
(wp-cli/wp-cli#6320), so deployed sites fail `wp core verify-checksums`.

Let WP-CLI only download and md5-check the package (--no-extract), extract
it with tar/unzip, then gate on wp core verify-checksums. Mirrors
EasyEngine/site-command#504 and EasyEngine/site-type-wp#241.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Checksum verification currently suppresses unexpected failures, allowing unverified deployments.

Review effort: Balanced
Findings: 1 High severity

Open (1)
What changed in this PR

Adds reliable WordPress core extraction to prevent truncated filenames.

Changes:

  • Downloads archives without WP-CLI extraction.
  • Extracts via tar/unzip.
  • Verifies core checksums after extraction.
File Description
main.sh Adds core download, extraction, and verification logic.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread main.sh Outdated
Any other verify-checksums failure (PHP/WP-CLI runtime errors etc.) now
fails the deploy instead of continuing unverified. Matches the fetch-error
handling in EasyEngine/site-command#504.
@rtBot
rtBot requested a balanced review from Copilot October 5, 2026 06:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The extraction and verification flow correctly addresses the WP-CLI truncation issue without introducing unresolved defects.

Review effort: Balanced
Findings: None

Resolved since last review (1)

@mrrobot47
mrrobot47 merged commit 89e5737 into rtCamp:master Oct 5, 2026
1 check passed
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.

3 participants