Skip to content

Conversation

Copy link

Copilot AI commented Oct 22, 2025

Problem

The plugin had a discrepancy between the actual PHP version check and the error message displayed to users:

  • The code was checking for PHP >= 7.1
  • But the error message incorrectly stated "requires PHP version 5.5.0 or higher"
  • This caused confusion when users with PHP versions between 5.5 and 7.1 (like PHP 7.0.33) encountered the error

Additionally, per the agent instructions, the required version needed to be updated from 7.1 to 7.4 to align with the documented requirements in README.md.

Solution

Updated the PHP version requirement from 7.1 to 7.4 in inc/namespace.php:

  1. Updated version check (line 56): Changed version_compare(PHP_VERSION, '7.1', '<') to version_compare(PHP_VERSION, '7.4', '<')
  2. Fixed error message (line 90): Changed the misleading "5.5.0 or higher" to accurately state "7.4 or higher"

Testing

  • ✅ PHP syntax validation passed
  • ✅ Version comparison logic verified for multiple PHP versions (7.3.x blocked, 7.4+ allowed)
  • ✅ CodeQL security scan completed with no issues
  • ✅ README.md already correctly documents PHP >= 7.4 requirement

Impact

Users will now see an accurate error message that matches the actual PHP version requirement, eliminating confusion when their environment doesn't meet the minimum PHP 7.4 requirement.

Closes #[issue_number]

Original prompt

This section details on the original issue you should resolve

<issue_title>Wrong required version (bug?)</issue_title>
<issue_description>Hi guys, just migrate my site from dev to a stage environment, i already installed your plugin in 20 other sites without having a single problem, but also i havent' touched composer updates since a while...
With the last multisite, i cloned your repo, composer installed deps, activated the plugin and got the error:

The S3 Uploads plugin requires PHP version 5.5.0 or higher. Your server is running PHP version 7.0.33-11+ubuntu18.04.1+deb.sury.org+1.

As the message... it seems a plugin bug... could you check?
Thanks!</issue_description>

<agent_instructions>Updat the required version in namespace.php to 7.4 from 7.1</agent_instructions>

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

@joehoyle @teolaz ahh there's an error in the message, S3 Uploads in the latest beta requires PHP 7.1+

Fixes #421


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: joehoyle <161683+joehoyle@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix required PHP version for S3 Uploads plugin Oct 22, 2025
Copilot finished work on behalf of joehoyle October 22, 2025 15:31
Copilot AI requested a review from joehoyle October 22, 2025 15:31
@joehoyle joehoyle marked this pull request as ready for review October 22, 2025 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants