Skip to content

Conversation

@peterwilsoncc
Copy link
Collaborator

@peterwilsoncc peterwilsoncc commented Oct 9, 2025

All Submissions:

  • Does your code follow the WooCommerce Sniffs variant of WordPress coding standards?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully run tests with your changes locally?
  • Will this change require new documentation or changes to existing documentation?

Changes proposed in this Pull Request:

  • Updates code as required to ensure PHP 8.4 compatibility
  • Modifies the PHP Compat sniffs to run against all files in the production release, including vendor files
  • Removes a few test files from the production release zip file -- these were causing errors in the compat sniffs but we never run the code in question (also tests shouldn't be in production files)
  • E2E tests passing in the GitHub actions, so I haven't checked locally
  • As notes below, QIT is failing PHP Stan tests but I think they can be followed up in another issue: they mostly appear to be false positives.

Closes https://linear.app/a8c/issue/SQUARE-197/project-ensure-php-84-compatibility

Steps to test the changes in this Pull Request:

  • Configure an environment running PHP 8.4
  • Enable logging of debug messages to a log file.
  • Per PT document, run through all the critical flows for the plugin.
  • Review log file for deprecation notices, error messages, etc.

Changelog entry

Fix - Update for PHP 8.4 compatibility

@peterwilsoncc peterwilsoncc force-pushed the fix/SQUARE-197-php84-compat branch from c8db08b to 1ccfd5a Compare October 9, 2025 03:08
@peterwilsoncc peterwilsoncc force-pushed the fix/SQUARE-197-php84-compat branch from 6ba5f38 to 9f6da32 Compare October 9, 2025 03:51
@github-actions
Copy link

github-actions bot commented Oct 9, 2025

Downloading plugins and themes...
No test tag "activation" found for extension "woocommerce".
No test tag "pre-activation" found for extension "woocommerce-square".
Starting Docker Environment...
Installing WordPress...
Environment ready.

[ERROR] No tests found for the given plugins.

Shutting down environment...

Comment on lines +31 to +35
"/vendor/apimatic/*/tests/**",
"/vendor/apimatic/*/.*",
"/vendor/square/square/tests/**",
"/vendor/square/square/doc/**",
"/vendor/square/square/.*"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Various unit tests and dot files that have no place in production.

A couple of them were throwing errors in the php-compat sniffs but I figured we could remove them as they never run in our code base.

@github-actions
Copy link

github-actions bot commented Oct 9, 2025

Uploading zip...

Running test...
Test run completed.
Test Run Id 4896822
Test Type Display PHPStan
Wordpress Version 6.8.3
Woocommerce Version 10.2.2
Php Version 7.4
Status failed
Is Development Yes
Woo Extension Square
Test Summary Errors: 0, File Errors: 754
Version 5.1.0
Phpstan Level 2
Iterations 3
Result Url https://qit.woo.com?qit_results=4896822.bEEGNverbWV62PX4RNwBmwHTgfMc0WgbFUAJh3e5arAP8ROcD6h0Bl80DGXRMMZV

@peterwilsoncc
Copy link
Collaborator Author

QIT is failing the PHPStan tests, reviewing them it looks like there are a lot of false positives in the report so I think this can be covered in a follow up ticket.

@peterwilsoncc peterwilsoncc requested a review from dkotter October 9, 2025 22:11
@peterwilsoncc peterwilsoncc self-assigned this Oct 9, 2025
@dkotter
Copy link
Collaborator

dkotter commented Oct 13, 2025

@peterwilsoncc One thing I missed that we'll want to update in this PR and all other PHP 8.4 PRs is bumping the PHP tested up to value in the main plugin file: https://github.com/woocommerce/woocommerce-square/blob/trunk/woocommerce-square.php#L10. This isn't a standard header that WordPress supports but we've been using this to track which versions we support

@peterwilsoncc
Copy link
Collaborator Author

One thing I missed that we'll want to update in this PR and all other PHP 8.4 PRs is bumping the PHP tested up to value in the main plugin file

Done in 8f3fafe and added to the other PRs for the compatibility project.

@qasumitbagthariya
Copy link
Collaborator

Regression / Smoke Test Report ✅

Tested with the smoke-testing branch, it works as expected, similar to the fix-specific branch.

Testing Environment

  • WordPress: 6.8.3
  • Theme: Twenty Twenty-Four 1.3
  • WooCommerce - 10.3.3
  • PHP: 8.4.10
  • Web Server: Nginx 1.20.2
  • Browser: Chrome
  • OS: macOS 15.2
  • Branch: smoke-testing

Next Step- Ready to Merge 🚀

cc @vikrampm1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants