43479 Commits

Author SHA1 Message Date
Sergey Biryukov
fe875e424a Security, Site Health: Do not store HTTPS request error messages in an option.
This changes the logic in `update_https_detection_errors()` to never store error messages from the actual request since they could use a different encoding, which would make storing them in an option potentially fail, leading WordPress to then falsely assume that HTTPS is supported.

While this doesn't actually fix the encoding issue, it is not crucial to do so anyway, since these messages are not used anywhere. A simple differentiation between whether the overall HTTPS request or only the SSL verification failed should be sufficient for the purpose of this function.

Props flixos90, tmatsuur, lukecarbis.
Fixes #52484.

git-svn-id: https://develop.svn.wordpress.org/trunk@50471 602fd350-edb4-49c9-b593-d223f7449a82
2021-03-02 15:06:34 +00:00
Kelly Choyce-Dwan
7d0cb86544 Twenty Twenty-One: Correct inner container background color for Cover Blocks.
Adjust the background color palette rules so they don't show up on inner containers when they're not supposed to:
- When an inner container block is present, it only applies them to direct children of the block with the background color assigned.
- Since the background color should only be applied to the Cover block's overlay, not to the inner container, it opts that specific block out of this rule.

Props dianeco, kjellr, paaljoachim.
Fixes #52676.



git-svn-id: https://develop.svn.wordpress.org/trunk@50466 602fd350-edb4-49c9-b593-d223f7449a82
2021-03-01 23:24:13 +00:00
Kelly Choyce-Dwan
95e79ab35a Twenty Fifteen & Twenty Sixteen: Remove extra space around post editor.
The editor uses the full height of its container, so the added margins cause the visual editor to break out of the container. This removes the top & bottom margins, and makes the left & right margins consistent with the meta box area.

Props antonlukin, paaljoachim, felipeelia.
Fixes #52646.



git-svn-id: https://develop.svn.wordpress.org/trunk@50465 602fd350-edb4-49c9-b593-d223f7449a82
2021-03-01 21:56:06 +00:00
John Blackbourn
2ef42cb78c Build/Test Tools: Remove redundant teardown functionality from individual tests which is already covered in the base teardown method.
See #52625


git-svn-id: https://develop.svn.wordpress.org/trunk@50463 602fd350-edb4-49c9-b593-d223f7449a82
2021-03-01 18:42:49 +00:00
Aaron Jorbin
51548e1bf8 Disable comments from codecov.
Docs explaining this https://docs.codecov.io/docs/pull-request-comments#disable-comment

Putting inside .github to not litter the root. Docs explaining why this is possible https://docs.codecov.io/docs/codecov-yaml#can-i-name-the-file-codecovyml

Fixes #52684.



git-svn-id: https://develop.svn.wordpress.org/trunk@50462 602fd350-edb4-49c9-b593-d223f7449a82
2021-03-01 16:56:08 +00:00
Timothy Jacobs
30b82c6bee REST API: Correct error code for the maxItems keyword.
See [50007]. 


git-svn-id: https://develop.svn.wordpress.org/trunk@50461 602fd350-edb4-49c9-b593-d223f7449a82
2021-03-01 16:30:41 +00:00
Sergey Biryukov
f2367e643b Docs: Clarify a comment about wp_opcache_invalidate() in _copy_dir().
Follow-up to [48160].

See #52628.

git-svn-id: https://develop.svn.wordpress.org/trunk@50460 602fd350-edb4-49c9-b593-d223f7449a82
2021-03-01 10:36:29 +00:00
Robert Anderson
9ca0ce7275 Editor: Update @wordpress npm packages
Update @wordpress npm packages to the latest published versions. This includes
block editor bug fixes for WordPress 5.7 RC 2.

Fixes #52680.


git-svn-id: https://develop.svn.wordpress.org/trunk@50458 602fd350-edb4-49c9-b593-d223f7449a82
2021-03-01 08:23:25 +00:00
Sergey Biryukov
f0ba66d324 Tests: Rename classes in phpunit/tests/l10n/ per the naming conventions.
https://make.wordpress.org/core/handbook/testing/automated-testing/writing-phpunit-tests/#naming-and-organization

Follow-up to [47780], [48911], [49327], [50291], [50292], [50342], [50452], [50453].

See #52625.

git-svn-id: https://develop.svn.wordpress.org/trunk@50456 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-28 17:22:27 +00:00
Sergey Biryukov
49e76f4793 Tests: Add missing @covers tags for files in phpunit/tests/load/.
Props sephsekla, jrf.
See #39265.

git-svn-id: https://develop.svn.wordpress.org/trunk@50455 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-28 17:12:03 +00:00
Sergey Biryukov
9fd3f595b1 Tests: Add missing @covers tags for files in phpunit/tests/link/.
Props sephsekla, jrf.
See #39265.

git-svn-id: https://develop.svn.wordpress.org/trunk@50454 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-28 17:09:39 +00:00
Sergey Biryukov
ca49eb764b Tests: Rename classes in phpunit/tests/load/ per the naming conventions.
https://make.wordpress.org/core/handbook/testing/automated-testing/writing-phpunit-tests/#naming-and-organization

Follow-up to [47780], [48911], [49327], [50291], [50292], [50342], [50452].

See #52625.

git-svn-id: https://develop.svn.wordpress.org/trunk@50453 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-28 13:42:01 +00:00
Sergey Biryukov
29fef12e78 Tests: Rename some classes in phpunit/tests/link/ per the naming conventions.
https://make.wordpress.org/core/handbook/testing/automated-testing/writing-phpunit-tests/#naming-and-organization

Follow-up to [47780], [48911], [49327], [50291], [50292], [50342].

See #52625.

git-svn-id: https://develop.svn.wordpress.org/trunk@50452 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-28 13:39:07 +00:00
Sergey Biryukov
bd65b50096 Docs: Use correct variable in the style_loader_tag filter DocBlock.
Follow-up to [46088].

Props rima1889.
Fixes #52673.

git-svn-id: https://develop.svn.wordpress.org/trunk@50451 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-27 17:57:03 +00:00
John Blackbourn
055deeabff Build/Test Tools: Fix and standardise calls to the tearDown() method in the test suite.
The parent method should be called after any test-specific teardown.

See #52625


git-svn-id: https://develop.svn.wordpress.org/trunk@50450 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-27 17:08:26 +00:00
John Blackbourn
3542c3b4c0 Build/Test Tools: Fix and standardise calls to the setUp() and setUpBeforeClass() methods in the test suite.
The parent methods should always be called before any test-specific functionality is set up, unless there is a specific and documented reason.

See #52625


git-svn-id: https://develop.svn.wordpress.org/trunk@50449 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-27 16:54:52 +00:00
John Blackbourn
22e72cbdf2 Build/Test Tools: Add some more tests that perform HTTP requests to the external-http test group.
See #52625


git-svn-id: https://develop.svn.wordpress.org/trunk@50448 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-27 14:36:22 +00:00
Sergey Biryukov
5b2b525169 Bootstrap/Load: Check if the error_reporting() function exists in wp-load.php.
This avoids a fatal error on PHP 8 if `error_reporting()` is disabled in `php.ini`.

On systems with this function disabled, it's best to add a dummy function to the `wp-config.php` file, as there are multiple other calls in core or plugins.

However, as this call to the function is run prior to `wp-config.php` loading, it is now wrapped in a `function_exists()` check.

Props peterwilsoncc, fijisunshine, ayeshrajans.
Fixes #52226.

git-svn-id: https://develop.svn.wordpress.org/trunk@50447 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-27 11:07:29 +00:00
John Blackbourn
6f89bd0064 Build/Test Tools: Switch away from npx install-changed in GitHub Actions to increase the cache performance.
Using `npm ci` makes better use of the npm cache that's in use, speeding up the test runs by around 30 seconds.

See #52660


git-svn-id: https://develop.svn.wordpress.org/trunk@50446 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-26 22:47:33 +00:00
Sergey Biryukov
9ba7875fc8 External Libraries: Install jQuery via NPM.
Previously, jQuery 1.12.4 was added to the WordPress SVN repo in order to backport an upstream security patch from jQuery 3.4.0.

Now that WordPress includes an unmodified version of jQuery 3.5.1 and no longer needs to maintain a fork, it can be removed from the SVN repo and installed via NPM again as part of the build.

Follow-up to [45342], [49101].

Props peterwilsoncc, SergeyBiryukov.
Fixes #52647.

git-svn-id: https://develop.svn.wordpress.org/trunk@50445 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-26 17:49:58 +00:00
John Blackbourn
d59c227764 Build/Test Tools: Split the PHPUnit tests for PHP versions below 7.0 in half, allowing them to run in parallel and reduce the overall test run duration on GitHub Actions.
The `external-http`, `media`, and `restapi` groups combined take roughly the same time as all the other tests combined. Splitting the test run in two speeds up the PHP 5.6 test runs which are the slowest by quite a margin. The net reduction in duration is only seen on PHP versions older than 7.0 where the reduction is greater than the time taken for the job to be set up.

Props peterwilsoncc, desrosj, johnbillion

Special shout out to manzoorwanijk whose article about running steps in parallel started me down this path.

Fixes #52645


git-svn-id: https://develop.svn.wordpress.org/trunk@50444 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-26 15:07:03 +00:00
John Blackbourn
7fa70bcb02 Build/Test Tools: Increase the reliability of backing up the mu-plugins directory during tests.
Fixes #51735


git-svn-id: https://develop.svn.wordpress.org/trunk@50443 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-26 14:37:47 +00:00
John Blackbourn
58b33ec47c Build/Test Tools: Avoid attempting to redeclare the origin remote prior to sending the test results to the test reporting API.
Props desroj
See #51734


git-svn-id: https://develop.svn.wordpress.org/trunk@50442 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-26 14:28:02 +00:00
John Blackbourn
4ab922d224 Build/Test Tools: Switch back to running the PHPUnit test suite against the src directory instead of build.
Some PHPUnit tests were concerned with the state of files in the `build` directory. In order to allow the tests to run without requiring a build to be run first, these have been moved into assertions that run after the build step (and therefore cause it to fail if they do not pass), or into QUnit tests as necessary.

Various other PHPUnit tests implictly depend on built JavaScript files being present. These files are now touched during the test setup to avoid PHP warnings if the `build` files are not present.

The `wp-tests-config-sample.php` file and the GitHub Actions configuration have also been changed so `ABSPATH` uses `src` instead of `build`, therefore allowing the PHPUnit tests to be run without a build having to be run first. This means all new local installations of WordPress will use `src` for PHPUnit testing. If you would like to switch your existing installation over then change the location of `ABSPATH` in `wp-tests-config.php` to point to `src` instead of `build`.

Props peterwilsoncc, iandunn, gziolo, desroj, johnbillion

Fixes #51734
See #45863


git-svn-id: https://develop.svn.wordpress.org/trunk@50441 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-26 14:07:53 +00:00
Peter Wilson
a280d5704b Users: Use localized site title for password reset emails.
When sending password reset emails, switch to the user's locale prior to obtaining the site title to allow for plugins filtering based on locale.

Follow up to [50129,50139-50141,50152,50415].

Props chouby.
Fixes #52605. See #34281.



git-svn-id: https://develop.svn.wordpress.org/trunk@50439 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-26 00:50:46 +00:00
Jonathan Desrosiers
33af39335e Build/Test Tools: Prevent the NPM/Composer caches in GitHub Actions from snowballing.
The `actions/cache` GitHub action uses a `key` input to find the desired cache in storage. Currently, this is defined as a combination of the operating system being used, the software being cached (NPM or Composer), PHP version (Composer only), and a hash of the relevant lock file.

The `cache` action also supports a `restore-keys` input, which is an ordered list of keys to use for restoring a cache if no cache hit occurred for the specified key.

However, this means that every time a lock file is updated, the cache is being recreated by first restoring a previous one (when available), and then installing new versions of dependencies on top of that. This results in old, unused versions of dependencies never being removed from the cache.

In this change, the `restore-keys` are removed. This will force a new, fresh cache to be generated when the desired `key` is not matched. In testing, this results in a ~40% reduction in cache size when compared to the latest successful workflow runs. Since there is no way to manually flush the cache in GHA, the benefits of this change will not be seen until the `package-lock.json` and `composer.lock` files are updated, or the cache at the desired key is evicted.

Props johbillion.
See #52660.

git-svn-id: https://develop.svn.wordpress.org/trunk@50436 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-25 20:47:28 +00:00
Jonathan Desrosiers
f2b56883f0 Build/Test Tools: Disable fail-fast for PHPUnit testing.
In GitHub Actions, there is a `fail-fast` option that will cancel all incomplete jobs within a workflow as soon as one failure is encountered. This defaults to `true`.

This is great for alerting you of a failure faster, but does not give you the full picture of what is failing. For example, it’s possible that there is a failing test on 2 versions of PHP, but not others. If `fail-fast` is enabled, it’s impossible to know this.

Even with `fail-fast` disabled, the workflow will still report a failure if one or more jobs produce a failing result.

Props johbillion, jorbin.
Fixes #52612.

git-svn-id: https://develop.svn.wordpress.org/trunk@50435 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-25 14:03:16 +00:00
Sergey Biryukov
dae8858b4a Docs: Correct function name in add_settings_field() DocBlock.
See #52628.

git-svn-id: https://develop.svn.wordpress.org/trunk@50434 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-25 12:01:00 +00:00
Sergey Biryukov
274bc8b0ec Tests: Reset current screen after setting it to dashboard in add_submenu_page() tests.
This avoids polluting other tests and allows the `ms-excluded` test group to successfully run on its own.

Props johnbillion, SergeyBiryukov.
See #52607.

git-svn-id: https://develop.svn.wordpress.org/trunk@50433 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-25 11:10:46 +00:00
Jonathan Desrosiers
4a09e7d877 Build/Test Tools: Limit when GitHub Action workflows run on pull_request.
Different branches have support for different types of testing based on the tooling that was in place at the time each version was branched. The workflows currently in place have patterns configured to match the relevant `branches` and `tags` for each workflow, but only for `push` events.

This copies the patterns for matching supported `branches` over to the `pull_request` event to prevent workflows from running for a pull request to a branch that does not support that workflow.

Fixes #52643.

git-svn-id: https://develop.svn.wordpress.org/trunk@50432 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-24 19:34:41 +00:00
Jonathan Desrosiers
4ae21ee7e0 Help/About: Remove extra space in the 5.7 About page copy.
Props tobifjellner, audrasjb.
Fixes #52632.

git-svn-id: https://develop.svn.wordpress.org/trunk@50430 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-24 15:50:00 +00:00
Sergey Biryukov
85f1636132 Administration: Revert the change to click event handler for fly-out submenus.
The `click()` method there is not the jQuery method, but is an HTML DOM method instead.

This makes the fly-out submenu header clickable again when the menu is folded.

Follow-up to [50420].

Props peterwilsoncc.
Fixes #52638. See #51812.

git-svn-id: https://develop.svn.wordpress.org/trunk@50429 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-24 12:20:08 +00:00
Sergey Biryukov
facb9c7c33 Security: Update the Security Policy to include WordPress 5.7.
Fixes #52633.

git-svn-id: https://develop.svn.wordpress.org/trunk@50428 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-23 21:36:58 +00:00
Jonathan Desrosiers
f2ca1e00d8 trunk is now 5.8 alpha.
git-svn-id: https://develop.svn.wordpress.org/trunk@50427 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-23 21:04:02 +00:00
Jonathan Desrosiers
e2e0ff05c2 Post WordPress 5.7 RC1 version bump.
git-svn-id: https://develop.svn.wordpress.org/trunk@50425 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-23 20:52:59 +00:00
Jonathan Desrosiers
886d9fe6e0 WordPress 5.7 RC1.
git-svn-id: https://develop.svn.wordpress.org/trunk@50424 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-23 20:38:08 +00:00
adamsilverstein
e4ce30bfca Twenty Twenty-One: Improve transparent PNG logo visible on focus.
This ensures a transparent logo remains visible while focused. Also cleans up dark mode CSS, consolidating styles and removing overrides that are no longer needed.

Follow up to [50154].

Props poena, sabernhardt, ryelle.
Fixes #52257.



git-svn-id: https://develop.svn.wordpress.org/trunk@50423 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-23 20:15:02 +00:00
Sergey Biryukov
1926a14489 Users: Only include the IP address in password reset email if the user is not logged in.
This avoids unnecessarily disclosing the IP address when sending a password reset link to another user from the admin.

Follow-up to [49255], [50129].

Props carike, audrasjb, gmariani405, Ipstenu.
See #34281.

git-svn-id: https://develop.svn.wordpress.org/trunk@50422 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-23 20:06:40 +00:00
Jonathan Desrosiers
1b2ec3ecc7 Build/Test Tools: Add a missing word to the CONTRIBUTING.md file.
Follow up to [50417].

Props kraftbj.
See #33043.

git-svn-id: https://develop.svn.wordpress.org/trunk@50421 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-23 19:59:20 +00:00
Sergey Biryukov
69751046d6 External Libraries: Further fix jQuery deprecations in WordPress core.
This includes many minor adjustments to a wide array of core files to replace shorthands with full declarations.

Follow-up to [50001], [50270], [50367].

Props Clorith, hellofromTonya, peterwilsoncc, adamsilverstein, aristath.
See #51812.

git-svn-id: https://develop.svn.wordpress.org/trunk@50420 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-23 19:43:23 +00:00
Sergey Biryukov
0a2ba7cb29 Docs: Improve documentation for WP_Block_Type properties.
Add a reference to `WP_Block_Type::__construct()` for information on accepted arguments in `register_block_type()`.

Synchronize the documentation between several places, use `WP_Block_Type::__construct()` as the canonical source.

Props ediamin, audrasjb, peterwilsoncc.
Fixes #48640.

git-svn-id: https://develop.svn.wordpress.org/trunk@50419 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-23 19:16:26 +00:00
Kelly Choyce-Dwan
666bdbb011 Help/About: WordPress 5.7 About Page.
This is the start of the WordPress 5.7 about page.

Props audrasjb, metalandcoffee, melchoyce, hedgefield, francina, webcommsat, lukecarbis, meher, sarahricker, marybaum.
See #52347.



git-svn-id: https://develop.svn.wordpress.org/trunk@50418 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-23 18:39:13 +00:00
Jonathan Desrosiers
765bf1f6cc Build/Test Tools: Introduce a CONTRIBUTING.md file.
This file is used on GitHub to communicate important details about the best way to contribute to a project.

Props ad7six, boonebgorges, netweb, noisysocks, kraftbj.
Fixes #33043.

git-svn-id: https://develop.svn.wordpress.org/trunk@50417 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-23 16:50:05 +00:00
Jonathan Desrosiers
06cae965b9 Build/Test Tools: Update NPM dependencies.
This updates two `devDependencies`:

- `uglify-js` from `3.12.7` to `3.12.8`.
- `sassn` from `1.32.6` to `1.32.8`.

See #51801.

git-svn-id: https://develop.svn.wordpress.org/trunk@50416 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-23 16:43:03 +00:00
Jonathan Desrosiers
9b160263da Users: Ensure reset password emails are in the receiving user’s locale.
This ensures that reset password emails initiated by an administrator are sent to the user in their preferred locale.

Follow up to [50129,50139-50141,50152].

Props chouby, davidbaumwald, audrasjb, johnbillion.
Fixes #52605. See #34281.

git-svn-id: https://develop.svn.wordpress.org/trunk@50415 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-23 16:37:01 +00:00
Jonathan Desrosiers
4c046a1bfd Build/Test Tools: Update the package lock file.
This commits a change that results from running `npm install`.

See #51801.

git-svn-id: https://develop.svn.wordpress.org/trunk@50414 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-23 16:29:21 +00:00
Jonathan Desrosiers
da710d81e5 Build/Test Tools: Stop running the restapi-jsclient tests separately.
This group is not specified in the list of excluded groups within the test configuration file, so they already run as part of the main test suite.

Props johnbillion.
Fixes #52608.

git-svn-id: https://develop.svn.wordpress.org/trunk@50413 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-23 15:45:45 +00:00
Sergey Biryukov
63fd7102eb Users: Give the Password Reset table row its own wrapper class.
Previously, the class of the Sessions table row was duplicated.

Follow-up to [50129], [50411].

See #52597.

git-svn-id: https://develop.svn.wordpress.org/trunk@50412 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-23 14:33:07 +00:00
Sergey Biryukov
3bf334edaa Users: Relocate the Password Reset feature to the Account Management section.
Follow-up to [50129].

Props mukesh27, audrasjb, hellofromTonya.
Fixes #52597.

git-svn-id: https://develop.svn.wordpress.org/trunk@50411 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-23 14:20:01 +00:00
Sergey Biryukov
d7ddc7a81e External Libraries: Correct click event handling in the Thickbox library.
Follow-up to [50367], [50383].

Props peterwilsoncc.
Fixes #52618. See #51812.

git-svn-id: https://develop.svn.wordpress.org/trunk@50410 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-23 10:52:12 +00:00