Skip to content

Display PHP memory limit in wp cli info output#6180

Open
Copilot wants to merge 10 commits intomainfrom
copilot/display-memory-limit-wp-cli
Open

Display PHP memory limit in wp cli info output#6180
Copilot wants to merge 10 commits intomainfrom
copilot/display-memory-limit-wp-cli

Conversation

Copy link
Contributor

Copilot AI commented Dec 28, 2025

  • Explore repository structure and understand wp cli info command
  • Review existing tests in cli-info.feature
  • Identify where to add memory limit display
  • Add memory limit to CLI_Command::info() method for both list and JSON formats
  • Add tests to verify memory limit is displayed correctly
  • Test the implementation manually
  • Run linter, phpcs, and phpstan - all passing
  • Add warning for low memory limit (< 512M) as bonus feature
  • Add tests for the warning functionality
  • Verify warning is displayed correctly for low limits and hidden for high limits
  • Fix edge cases in convert_to_bytes (empty string handling, preserve numeric precision)
  • Run code review and address all feedback
  • Replace magic number with MEMORY_LIMIT_WARNING_THRESHOLD constant
  • Add comprehensive test coverage:
    • JSON format includes php_memory_limit field
    • Unlimited memory limit (-1) does not trigger warning
    • K format memory limit handling
    • 512M boundary test (exactly at threshold should not warn)
  • Run security checker (CodeQL) - no issues found
  • Final validation complete - all features working as expected
Original prompt

This section details on the original issue you should resolve

<issue_title>Display memory limit in wp cli info</issue_title>
<issue_description>This would make dealing with support requests a biteasier.

Bonus: could emit a warning when we think the limit is too low (criteria TBD)</issue_description>

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


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@github-actions github-actions bot added command:cli Related to 'cli' command command:cli-info Related to 'cli info' command labels Dec 28, 2025
@codecov
Copy link

codecov bot commented Dec 28, 2025

Codecov Report

❌ Patch coverage is 18.75000% with 26 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
php/commands/src/CLI_Command.php 18.75% 26 Missing ⚠️

📢 Thoughts on this report? Let us know!

Copilot AI and others added 3 commits December 28, 2025 11:23
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Copilot AI changed the title [WIP] Add memory limit display in wp cli info Display PHP memory limit in wp cli info output Dec 28, 2025
Copilot AI requested a review from swissspidy December 28, 2025 11:31
@swissspidy swissspidy marked this pull request as ready for review January 5, 2026 09:28
@swissspidy swissspidy requested a review from a team as a code owner January 5, 2026 09:28
@swissspidy swissspidy requested a review from Copilot January 20, 2026 13:16

This comment was marked as resolved.

Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

command:cli Related to 'cli' command command:cli-info Related to 'cli info' command

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Display memory limit in wp cli info

2 participants