Project

General

Profile

Actions

Bug #25398

closed

Update PHPCS / PHPCompatibility dependencies and fix CI

Added by Jeremy Felt 9 days ago. Updated 6 days ago.

Status:
Resolved
Priority name:
Normal
Assignee:
Category name:
-
Target version:
-
Start date:
2026-08-14
Due date:
% Done:

0%

Estimated time:
Deployment actions:

Description

Not long after we updated the PHPCS house of cards in #24295, by pinning the PHPCompatibility library to a specific commit because of its decision to drop support for the version of PHPCS we were on, etc, etc... it broke.

It seems that since the end of March our PHPCS jobs have been reporting green while only outputting errors like the following and not actually scanning the files:

ERROR: Referenced sniff "PHPCompatibility" does not exist.
ERROR: Referenced sniff "PHPCompatibility" does not exist.
ERROR: Referenced sniff "PHPCompatibility.IniDirectives.RemovedIniDirectives.mbstring_func_overloadDeprecated" does not exist.
ERROR: Referenced sniff "PHPCompatibility.FunctionUse.NewFunctions.stream_set_chunk_sizeFound" does not exist.
ERROR: Referenced sniff "PHPCompatibility.Constants.RemovedConstants.mcrypt_dev_urandomDeprecatedRemoved" does not exist.
ERROR: Referenced sniff "PHPCompatibility.Extensions.RemovedExtensions.mcryptDeprecatedRemoved" does not exist.
ERROR: Referenced sniff "PHPCompatibility.FunctionUse.RemovedFunctions.mcrypt_create_ivDeprecatedRemoved" does not exist.
ERROR: Referenced sniff "PHPCompatibility.LanguageConstructs.NewLanguageConstructs.t_ns_separatorFound" does not exist.
......

Since then, the PHPCompatibility package has a 10.0-alpha release that is actually pinnable in composer.json, so we can update and make everything more official. I've pushed up a branch commit that updates all of these related dependencies: https://github.com/cuny-academic-commons/cac/commit/9cc8f31cf6bd7a7dad0204600ff782fed3b2d113

There are 49 new PHPCS errors, all PHPCompatibility related, that I'm going to work through. I don't think anything is critical. Once I have them passing, I'll merge to the 2.7.x branch and describe the findings and fixes here.

Actions #1

Updated by Jeremy Felt 9 days ago

Boone - 41 of the errors are from bp-groupblog. I submitted a pull request to fix one that seemed worth fixing: https://github.com/boonebgorges/bp-groupblog/pull/57

The others from bp-groupblog are all for lines like this: https://github.com/boonebgorges/bp-groupblog/blob/fa5508484de8ad50e75fa7fa0f4d15c647431442/themes/p2/inc/JSON.php#L287 in JSON.php, because "Curly brace syntax for accessing array elements" is removed in PHP 8.0+. I'm marking these as ignored in our phpcs.xml.

I doubt this file is used anywhere because which I doubt is loaded anywhere because Services_JSON appears to be generally available and is included with WordPress if not.

Actions #2

Updated by Jeremy Felt 9 days ago

There are two failures for our CACCS.Database.RequirePrimaryKey.MissingPrimaryKey sniff:

- Better Search fixes theirs in the 4.4.0 release from 2 weeks ago https://github.com/WebberZone/better-search/commit/e173cdcb627152fa24234a5b8845d62b04756afe
- Litespeed Cache does create tables with primary keys, but in a way our sniff does not see https://github.com/cuny-academic-commons/cac/tree/master/wp-content/plugins/litespeed-cache/src/data_structure

I'm going to ignore both via phpcs.xml for now.

Actions #3

Updated by Jeremy Felt 9 days ago

Reported issues upstream in:

- https://github.com/dev-xiligroup/xili-language-plugin/pull/9 (also hotfixed because they have not merged Ray's PR from last year, https://github.com/cuny-academic-commons/cac/commit/8e4b6ddeeb71feb171c5e62288559e6be6ab8c34)
- https://wordpress.org/support/topic/php-8-x-compatibility-issue-with-ob_implicit_flush/ (temporarily ignored in phpcs.xml)

And:

- Ignored a test file in wordpress-importer https://github.com/cuny-academic-commons/cac/commit/ebd960d495b49314ef4f9986be26abb152453751
- Temporarily commented out an unlikely to fire backtrace in Make https://github.com/cuny-academic-commons/cac/commit/609746489eb04482ba4665a7ab46d01fc31ded01

Boone - Make doesn't seem to monitor their support forums on wp.org. Do we have the paid version or another route to report a bug?

This is all in the 2.7.x branch now and the PHPCS results are looking good so far. I'll check in on them later to make sure they passed.

Actions #4

Updated by Boone Gorges 6 days ago

Thanks, Jeremy!

$ git log wp-content/themes/make
commit 609746489eb04482ba4665a7ab46d01fc31ded01
Author: jeremyfelt <jeremy.felt@gmail.com>
Date:   Fri Aug 14 14:55:07 2026 -0700

    Hotfix: avoid `$this` outside of an object

    Not yet reported upstream

commit dc36f93bec5f475940cdb7e148b26456e1fff795
Author: Boone B Gorges <boonebgorges@gmail.com>
Date:   Mon Jul 13 10:03:52 2026 -0400

    Update theme: make.

    Name: Make
    New version: 1.10.10
    Previous version: 1.10.9

commit b43c6a08da3ed0121d94eb8116a1ab63ca8852c7
Author: Boone B Gorges <boonebgorges@gmail.com>
Date:   Mon Jan 27 13:47:24 2025 -0600

    Update theme: make.

    Name: Make
    New version: 1.10.9
    Previous version: 1.10.8

commit 42a1b1a9ed28aff6cc726747da3b8c6d4da81b22
Author: Jeremy Felt <jeremy.felt@gmail.com>
Date:   Tue Jan 10 16:32:01 2023 -0800

    Hotfix Make theme to address PHP 7.x PHPCS issue

    Remove a call to `$this` outside of an object context, which I
    doubt ever really worked?

    This has been reported to Theme Foundry via email.

I don't have a way to get in touch with Make but it looks like you did the same thing about three years ago. Given how rarely they update, I think it's probably acceptable to simply let the PHPCS action fail after an upstream update, and then manually apply the patch.

Actions #5

Updated by Jeremy Felt 6 days ago

  • Status changed from New to Resolved

I don't have a way to get in touch with Make but it looks like you did the same thing about three years ago.

I forgot about this! I did email them in 2023 and they replied saying they would patch in the next release. I think you're right, we can just deal with the failure when it comes up.

Others:

- xili-language-plugin merged my PR (but still not Ray's), we'll see if/when it hits a release
- chatbot acknowledged my support request and said they'd address in the next update

The latest runs look good, so I'm going to mark this as resolved.

Actions

Also available in: Atom PDF