14 Commits

Author SHA1 Message Date
John Blackbourn
51b5552050 Build/Test Tools: Exclude PHP translation files from phpcs linting.
Translation files in this directory are automatically generated and are not subject to any linting considerations.

See #59647


git-svn-id: https://develop.svn.wordpress.org/trunk@58107 602fd350-edb4-49c9-b593-d223f7449a82
2024-05-06 18:35:46 +00:00
John Blackbourn
d952352987 General: Increase the minimum supported version of PHP to 7.2.24.
Props justlevine, masteradhoc, samiamnot, hellofromTonya, azaozz, jrf, dd32, desrosj, jorbin

Fixes #58719


git-svn-id: https://develop.svn.wordpress.org/trunk@57985 602fd350-edb4-49c9-b593-d223f7449a82
2024-04-11 21:09:49 +00:00
Sergey Biryukov
3dbfc06512 Coding Standards: Remove unnecessary directives in the PHPCompatibility ruleset.
This commit:

* Removes the unnecessary exclusion patterns for the `node_modules` and `vendor` directories. As this ruleset only scans the `src` directory, those directories would never be scanned anyway.
* Removes the selective excludes related to the random_compat package. This package was removed in WP 6.3, so these excludes are no longer necessary.

Follow-up to [46290], [56141].

Props jrf.
See #58831.

git-svn-id: https://develop.svn.wordpress.org/trunk@56667 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-23 11:05:18 +00:00
Sergey Biryukov
d7388b594d Coding Standards: Improve organization of the PHPCompatibility ruleset.
This commit:
* Adds section headers to the ruleset file.
* Organizes all directives in their respective sections.

No functional changes.

Props jrf.
See #58831.

git-svn-id: https://develop.svn.wordpress.org/trunk@56666 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-23 10:56:24 +00:00
John Blackbourn
f71140438b Database: Remove support for the mysql extension.
The `mysql` extension is no longer used in PHP 7 or above. There's a good amount of conditional code in `wpdb` and the health checks that can be removed now that only the `mysqli` functions are used.

Fixes #59118


git-svn-id: https://develop.svn.wordpress.org/trunk@56475 602fd350-edb4-49c9-b593-d223f7449a82
2023-08-26 13:01:05 +00:00
John Blackbourn
f7dbb2462b General: Increase the minimum supported version of PHP to 7.0.0.
This also removes the random compat library which is no longer necessary, and adjusts unit tests and CI workflows that no longer need to take PHP 5.6 into account.

Thank you for your service, PHP 5. Onwards!

Props SergeyBiryukov, mukesh27, dingo_d, audrasjb, jrf, costdev, azaozz, JavierCasares, hellofromTonya, samiamnot, spacedmonkey, masteradhoc, knutsp, garyjones, chanthaboune

Fixes #57345


git-svn-id: https://develop.svn.wordpress.org/trunk@56141 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-05 17:39:55 +00:00
Sergey Biryukov
6048dd6e58 Docs: Use more inclusive language in PHPCS configuration files.
Follow-up to [42346], [43348], [45455], [46290], [46820], [48121], [48477].

See #55646, #55647.

git-svn-id: https://develop.svn.wordpress.org/trunk@53800 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-30 14:08:13 +00:00
Sergey Biryukov
0a9e88bafc Coding Standards: Replace the old wp-db.php filename in phpcompat.xml.dist.
This ensures the correct file is allowlisted for use of `mysql_` extension in PHP < 7.0.

Follow-up to [53749].

See #56268, #55647.

git-svn-id: https://develop.svn.wordpress.org/trunk@53750 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-21 16:07:15 +00:00
Jonathan Desrosiers
ba620225c5 Build/Test Tools: Cache the results of PHP_CodeSniffer across workflow runs.
When the `PHP_CodeSniffer` runs, it produces a cache file. When a cache file is present, only changed files are rescanned, making subsequent scans significantly faster.

This adds the needed steps to the corresponding GitHub Actions workflows to cache these files across runs. The cache keys include the date of the previous Monday to ensure that the cache is flushed at least weekly.

Since GitHub Action caches cannot be updated once created, the scans will take slightly longer as the week progresses and more PHP files are updated. The date within the cache key can be updated to purge twice weekly if the scan time starts to approach the current scan times.

This change also introduces a `.cache` directory for all caching files related to build/test tools.

Props johnbillion, jrf.
Fixes #49783.

git-svn-id: https://develop.svn.wordpress.org/trunk@52179 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-16 14:17:26 +00:00
Jonathan Desrosiers
0c812b536b Build/Test Tools: Exclude plugins and non-bundled themes from PHP compatibility scans.
Fixes #54425.

git-svn-id: https://develop.svn.wordpress.org/trunk@52148 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-12 18:38:54 +00:00
Jonathan Desrosiers
dfccba8d55 General: Continuing to work towards a passing PHP Compatibility scan.
This is a final pass to fix PHP compatibiilty issues in the codebase with code changes or adding `phpcs:ignore` comments.

With this change, all PHP compatibility warnings and errors without specific tickets have been addressed (see #49810 and #41750).

Props desrosj, johnbillion, jrf.
See #49922.

git-svn-id: https://develop.svn.wordpress.org/trunk@47902 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-03 17:38:56 +00:00
Jonathan Desrosiers
8e2de8212b General: Fix various issues flagged by the PHPCompatibilityWP PHPCS ruleset.
As part of the continued effort to improve PHP compatibility, the following improvments are being made:

- Removing deprecated PHP `safe_mode` checks not found in bundled external libraries.
- Change the remaining `while` loops using `each()` to `foreach` loops.
- Prevent false positives from being flagged for the `sodium_compat` library being caused by loading this in a non-standard way.
- Add inline comments to not flag deprecated PHP directives in the getID3 library.

Props desrosj, earnjam, dryanpress.
See #49922.

git-svn-id: https://develop.svn.wordpress.org/trunk@47735 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-01 19:05:04 +00:00
Sergey Biryukov
cfc3b57488 Docs: Improve inline comments per the documentation standards.
Includes minor code layout fixes for better readability.

See #48303.

git-svn-id: https://develop.svn.wordpress.org/trunk@47122 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-29 00:43:23 +00:00
Jonathan Desrosiers
336960897d Build/Test Tools: Introduce automated PHP compatibility checking.
This change introduces a new Composer script, `compat` that will scan the codebase for (detectable) potential PHP compatibility issues using the `PHP_CodeSniffer` and a custom ruleset based off of the `PHPCompayibilityWP` ruleset (`phpcompat.xml.dist`).

The command will be run as a separate job within each Travis build. While many compatibility issues and false positives have already been corrected in this commit and other Trac tickets, there are still some remaining. For that reason, the job is allowed to fail while the remainder of the potential compatibility issues are investigated and addressed. After those are resolved, the job should be set as required to pass to help prevent new compatibility issues from being introduced.

Props desrosj, jrf, all PHPCompatibilityWP and PHPCompatibility contributors.
Fixes #46152.

git-svn-id: https://develop.svn.wordpress.org/trunk@46290 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-25 13:46:55 +00:00