Replace manual temp path construction with Utils\make_temp_file() - #346
Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Co-authored-by: schlessera <83631+schlessera@users.noreply.github.com>
Utils\make_temp_file()
There was a problem hiding this comment.
🟢 Approval recommended
No unresolved issues were identified, and existing cleanup behavior is preserved.
Pull request overview
Replaces manual temporary-path construction with Utils\make_temp_file() for core downloads and updates while preserving cleanup behavior.
Changes:
- Updated download and skip-content temporary files.
- Updated core upgrader package temporary files.
- Preserved existing cleanup handlers.
File summaries
| File | Description |
|---|---|
src/WP_CLI/Core/CoreUpgrader.php |
Uses Utils\make_temp_file() for downloaded packages. |
src/Core_Command.php |
Uses the helper for downloads and ZIP processing. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This updates core-command to use WP-CLI’s new temp-file helper instead of hand-built
get_temp_dir() . uniqid()paths. The goal is to align with the newer API that creates temp files safely up front while keeping existing cleanup behavior unchanged.src/Core_Command.php(download temp.tmp)src/Core_Command.php(skip-content working.zip)src/WP_CLI/Core/CoreUpgrader.php(downloaded package extension)