Make WordPress Core

Opened 3 weeks ago

Last modified 5 days ago

#54425 reopened task (blessed)

Exclude plugins and themes from PHP Compatibility scans

Reported by: desrosj Owned by: desrosj
Milestone: 5.9 Priority: normal
Severity: normal Version: 5.5
Component: Build/Test Tools Keywords: has-patch dev-feedback
Focuses: Cc:


Currently, the wp-content/plugins, wp-content/themes, and wp-content/mu-plugins directories are not excluded in the PHP compatibility check ruleset in trunk.

These are excluded for PHPCS scans, and should also be excluded for compatibility scans.

Attachments (1)

54425.diff (725 bytes) - added by desrosj 3 weeks ago.

Download all attachments as: .zip

Change History (11)

3 weeks ago

#1 @desrosj
3 weeks ago

  • Owner set to desrosj
  • Resolution set to fixed
  • Status changed from new to closed

In 52148:

Build/Test Tools: Exclude plugins and non-bundled themes from PHP compatibility scans.

Fixes #54425.

#2 @jrf
3 weeks ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Eh.. @desrosj This was originally set up like that by design as, while those files do not have to comply with the WP coding standards, we do want to make sure they are PHP cross-version compatible and won't crash sites.

The PHPCompatibility scan has a different remit than the WPCS scan, so IMO, this commit should be reverted.

#3 @ocean90
3 weeks ago

I think the only file which is now not checked anymore is wp-content/plugins/hello.php. Everything else that's bundled with WordPress is still checked.

#4 @desrosj
3 weeks ago

I came across this when I had several plugins from WordPress.org installed and the scan was displaying a lot of errors. The plugins are not a part of Core, so I figured the Core ruleset could exclude them.

Plugins don't need to support the same PHP versions as WordPress since they can define their own lower limit (WooCommerce only supports PHP 7.0+, for example), so this could result in some very noisy scan results when trying to verify WordPress Core is compatible with the current ruleset.

Happy to revert if there's consensus, but as far as I know, the thinking has always been to only run scans on files included in the final WordPress package.

This ticket was mentioned in Slack in #core by sergey. View the logs.

3 weeks ago

This ticket was mentioned in PR #1919 on WordPress/wordpress-develop by desrosj.

2 weeks ago

…CS workflows.

This ensures that the cache is reset when changes are made to the rulesets and not the composer.json file.

Trac ticket:

#7 @desrosj
2 weeks ago

In 52220:

Build/Test Tools: Add the ruleset file to the cache key for PHPCS and PHP compatibility scans.

This ensures that the cache is busted properly when the ruleset is adjusted but the composer.json file is not.

See #54425.

This ticket was mentioned in Slack in #core by audrasjb. View the logs.

10 days ago

#10 @hellofromTonya
5 days ago

  • Keywords dev-feedback added
  • Type changed from defect (bug) to task (blessed)

Reclassifying to task to let it stay in the beta cycle. Will review after Beta 1 ships.

Note: See TracTickets for help on using tickets.