Skip to content

Project local installation hangs / never finishes (vendor/bin/phpcs -ps . --standard=WordPress stuck at 44%) #2785

Closed as not planned

Description

@francoisjacquet

Bug Description

Project local installation hangs / never finishes.

What did you expect to happen? What actually happened?
Project local installation finishes without any errors.

Minimal Code Snippet

The issue happens when running this command:

composer config allow-plugins.dealerdirect/phpcodesniffer-composer-installer true
composer require wp-coding-standards/wpcs --with-dependencies
# Project local install (very long)
vendor/bin/phpcs -ps . --standard=WordPress

Error Code

vendor/bin/phpcs -ps . --standard=WordPress
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE   60 / 1779 (3%)
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE  120 / 1779 (7%)
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE  180 / 1779 (10%)
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE  240 / 1779 (13%)
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE  300 / 1779 (17%)
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE  360 / 1779 (20%)
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE.EEEEEEEEEEEEEEEEEEEEEEE  420 / 1779 (24%)
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE  480 / 1779 (27%)
EEEEEEEEEEWEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE  540 / 1779 (30%)
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE  600 / 1779 (34%)
EEEEEEEEEEEEEEEEEEEEEEEEEE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EEEEEEEEEEEEEEEEEEEEEEEEEEE  660 / 1779 (37%)
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE  720 / 1779 (40%)
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE  780 / 1779 (44%)
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE^C

Environment

PHP 8.5, also tested with PHP 8.1, fails equally.

composer require wp-coding-standards/wpcs --with-dependencies
The package you required is recommended to be placed in require-dev (because it is tagged as "static analysis") but you did not use --dev.
Do you want to re-run the command with --dev? [yes]? n
./composer.json has been updated
Running composer update wp-coding-standards/wpcs --with-dependencies
Loading composer repositories with package information
Updating dependencies
Lock file operations: 5 installs, 0 updates, 0 removals
  - Locking dealerdirect/phpcodesniffer-composer-installer (v1.2.1)
  - Locking phpcsstandards/phpcsextra (1.5.1)
  - Locking phpcsstandards/phpcsutils (1.2.3)
  - Locking squizlabs/php_codesniffer (3.13.6)
  - Locking wp-coding-standards/wpcs (3.4.1)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 5 installs, 0 updates, 0 removals
  - Downloading wp-coding-standards/wpcs (3.4.1)
  - Installing squizlabs/php_codesniffer (3.13.6): Extracting archive
  - Installing dealerdirect/phpcodesniffer-composer-installer (v1.2.1): Extracting archive
  - Installing phpcsstandards/phpcsutils (1.2.3): Extracting archive
  - Installing phpcsstandards/phpcsextra (1.5.1): Extracting archive
  - Installing wp-coding-standards/wpcs (3.4.1): Extracting archive
Generating autoload files
5 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
PHP CodeSniffer Config installed_paths set to ../../phpcsstandards/phpcsextra,../../phpcsstandards/phpcsutils,../../wp-coding-standards/wpcs
No security vulnerability advisories found.
Using version ^3.4 for wp-coding-standards/wpcs

Additional Context (optional)

When PHP is stuck with the phpcs command, it consumes about 8% CPU and memory just rises slowly but infinitely.

Is there any CLI argument I could add to the command to help debug?

Activity

  1. changed the title [-]Project local installation hangs / never finishes (vendor/bin/phpcs -ps . --standard=WordPress sutck at 44%)[/-] [+]Project local installation hangs / never finishes (vendor/bin/phpcs -ps . --standard=WordPress stuck at 44%)[/+] on Oct 19, 2026
  2. francoisjacquet commented on Oct 19, 2026

    @francoisjacquet
    Author

    The following PHP extensions are activated:

    • filter
    • libxml
    • tokenizer
    • xmlreader
    • iconv
    • mbstring

    If this is of any use, I am running Debian 13.

  3. jrfnl commented on Oct 19, 2026

    @jrfnl
    Member

    @francoisjacquet This sounds like it's not a WPCS problem, but a PHPCS problem, so you might want to report it upstream instead.

    Either way, you will first need to identify what PHPCS gets stuck on, as the information provided now does not allow for debugging by maintainers as we a) don't have access to your machine and b) don't have access to the project you are running PHPCS on.

    So, to isolate the problem, I suggest you:

    1. Run the same command with -v (debug level 1) added to identify the file PHPCS gets stuck on.
      vendor/bin/phpcs -ps . --standard=WordPress -v
    2. Then run the same command, but only against the problem file (by providing the filename in the CLI command) and then add -vv (debug level 2).
      vendor/bin/phpcs -ps ./path/to/problem/file.php --standard=WordPress -vv
      You might want to pipe the results of that command to a file, as the output can be quite large (depending on the size of the file being scanned).
      You should be able to identify where PHPCS runs into trouble from the output towards the end, which should show which sniff is the last one being called (before the program hangs). If the sniff name starts with WordPress, the problem belongs in this repository, otherwise, identify the repository the sniff originates from and please report the problem there.
  4. francoisjacquet commented on Oct 20, 2026

    @francoisjacquet
    Author

    Hello @jrfnl

    Thank you for your reply.

    Actually, one doesn't need to perform this so called "Project local install" step mentioned in the README. Labeling this as such was misleading to me.

    The composer require command is enough to have the WordPress coding standards.

    Closing.

  5. jrfnl commented on Oct 20, 2026

    @jrfnl
    Member

    @francoisjacquet I have no clue what you mean. Without installing the project - either locally or globally -, you cannot run it and the running is what you say ran into problems. You might be confusing terminology ? Either way, glad to hear your problem is solved.

  6. francoisjacquet commented on Oct 20, 2026

    @francoisjacquet
    Author

    I meant the

    composer require wp-coding-standards/wpcs --with-dependencies

    command is enough to install the WPCS.

    The README mentions this command:

    # Project local install
    vendor/bin/phpcs -ps . --standard=WordPress

    This command does not actually install anything, the comment above it is misleading.

    Hoping this is more clear.

    Thank you.

  7. jrfnl commented on Oct 20, 2026

    @jrfnl
    Member

    @francoisjacquet Eh... that command example is in a section called "Using your WordPressCS install". Not sure how we can make it clearer that that's not part of "installing", but showing you how to use the installed packages....
    Nothing misleading about it.

  8. francoisjacquet commented on Oct 20, 2026

    @francoisjacquet
    Author

    Well, let's just say I am reading too fast and just read "install" in the comment so I ran the command without thinking twice about it 😄

    But I am surely not the only one. People don't read anymore, they scan for keywords.

    And technically, the "Using your WordPressCS install" section is under the "Installation" section.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions