Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#54425 closed defect (bug) (fixed)

Exclude plugins and themes from PHP Compatibility scans

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

Description

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 years ago.

Download all attachments as: .zip

Change History (13)

@desrosj
3 years ago

#1 @desrosj
3 years 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 years 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 years 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 years 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 years ago

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


3 years ago
#6

…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
3 years 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.


3 years ago

#10 @hellofromTonya
3 years 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.

#11 @hellofromTonya
3 years ago

  • Milestone changed from 5.9 to 6.0

Haven't had time to review this ticket. Moving it to 6.0 as likely won't have time with the focus on 5.9.

#12 @ocean90
3 years ago

  • Keywords dev-feedback removed
  • Milestone changed from 6.0 to 5.9
  • Resolution set to fixed
  • Status changed from reopened to closed
  • Type changed from task (blessed) to defect (bug)

Re-closing as fixed since the commits are already in trunk.

Note: See TracTickets for help on using tickets.