43437 Commits

Author SHA1 Message Date
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
Peter Wilson
db9c95a056 Security: move Content-Security-Policy script loaders.
Move `wp_get_script_tag()`, `wp_print_script_tag()`, `wp_print_inline_script_tag()` and `wp_get_inline_script_tag()` functions from `functions.php` to `script-loader.php`.

Relocate related tests to `dependencies` sub-directory.

Follow up to [50167].
Props adamsilverstein, hellofromTonya, SergeyBiryukov.
Fixes #39941.


git-svn-id: https://develop.svn.wordpress.org/trunk@50409 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-23 01:58:21 +00:00
Peter Wilson
50639dbad6 Script Loader: Prevent wp_localize_script() warnings.
Prevent `wp_localize_script()` (via `WP_Scripts::localize()`) throwing warnings in PHP 8 when the translation data is passed as a string. This maintains backward compatibility with earlier versions of PHP.

Introduce a `_doing_it_wrong()` notice to `WP_Scripts::localize()` if the translation data is not passed as an array.

Props jrf, peterwilsoncc, SergeyBiryukov.
Fixes #52534.


git-svn-id: https://develop.svn.wordpress.org/trunk@50408 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-22 23:21:56 +00:00
Sergey Biryukov
aaf3fc57fc Docs: Document the usage of $pagenow global in a few functions.
See #51800.

git-svn-id: https://develop.svn.wordpress.org/trunk@50407 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-22 19:16:07 +00:00
Sergey Biryukov
cebbabbe21 Media: Explicitly declare the $pagenow global in wp_get_attachment_url().
This avoids an "Undefined index" PHP notice in the function when running the `media` test group separately.

Follow-up to [32342], [50156], [50164], [50393].

Props johnbillion.
Fixes #52606.

git-svn-id: https://develop.svn.wordpress.org/trunk@50406 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-22 18:53:11 +00:00
Sergey Biryukov
6479ea9af8 Embeds: Allow posts with a public custom post status to be embedded.
Previously, only posts with the `publish` status could be embedded.

Props goaroundagain, peterwilsoncc, poena.
Fixes #47574.

git-svn-id: https://develop.svn.wordpress.org/trunk@50401 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-22 13:21:26 +00:00
Robert Anderson
04b26cf226 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 1.

Fixes #52588.


git-svn-id: https://develop.svn.wordpress.org/trunk@50400 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-22 06:02:34 +00:00
Peter Wilson
21ef06aee1 Site Health: Update loopback test to POST to wp-cron.
Replace loopback health check URL with a `POST` request to `wp-cron.php` in the WordPress install directory. This more closely represents how WordPress uses loopback requests.

A `POST` request is used to cause `wp-cron.php` to exit prior to running any cron jobs. This allows the test to indicate success quicker and accounts for sites that set the `DISABLE_WP_CRON` constant to avoid running cron jobs on loopback requests.

Props clorith, peterwilsoncc, TimothyBlynJacobs.
Fixes #52547.



git-svn-id: https://develop.svn.wordpress.org/trunk@50399 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-22 00:49:17 +00:00
Sergey Biryukov
d2bf9ee9c8 I18N: Remove extra spaces from translatable strings in Privacy help tabs.
Follow-up to [50147].

Props tobifjellner.
Fixes #52583.

git-svn-id: https://develop.svn.wordpress.org/trunk@50398 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-21 16:02:47 +00:00
Sergey Biryukov
3d8ea574c5 External Libraries: Upgrade PHPMailer to version 6.3.0.
This is a maintenance release. Changes include:

* Handle early connection errors such as 421 during connection and EHLO states.
* Make the `mail()` and sendmail transports set the envelope sender the same way as SMTP does, i.e. use whatever `From` is set to, only falling back to the `sendmail_from` php.ini setting if `From` is unset. This avoids errors from the `mail()` function if `Sender` is not set explicitly and php.ini is not configured. This is a minor functionality change, so bumps the minor version number.
* Extend `parseAddresses` to decode encoded names.

Release notes: https://github.com/PHPMailer/PHPMailer/releases/tag/v6.3.0

For a full list of changes in this update, see the PHPMailer GitHub:
https://github.com/PHPMailer/PHPMailer/compare/v6.2.0...v6.3.0

Props ayeshrajans.
Fixes #52577.

git-svn-id: https://develop.svn.wordpress.org/trunk@50397 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-21 09:32:41 +00:00
John Blackbourn
66504ce36e Posts, Post Types: Rename the new post parent conditional tag functions for clarity.
* `get_parent_post()` becomes `get_post_parent()`
* `has_parent_post()` becomes `has_post_parent()`

Props johnjamesjacoby, SergeyBiryukov, lukecarbis, peterwilsoncc

Fixes #33045


git-svn-id: https://develop.svn.wordpress.org/trunk@50396 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-20 17:43:55 +00:00
John Blackbourn
9ab39e3363 Docs: Various docblock corrections and improvements.
See #51800


git-svn-id: https://develop.svn.wordpress.org/trunk@50395 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-20 17:08:24 +00:00
John Blackbourn
3f705da1f2 Cron API: Add a missing $wp_error parameter to the pre_reschedule_event filter.
Props tmatsuur, mukesh27

Fixes #52572
See #49961


git-svn-id: https://develop.svn.wordpress.org/trunk@50394 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-20 12:09:45 +00:00
Sergey Biryukov
24f0d03a6c Script Loader: Explicitly declare the $pagenow global in wp_deregister_script().
This avoids an "Undefined index" PHP notice in `wp_resource_hints()` tests when running the full test suite.

Remove the unused global from `get_home_url()`.

Follow-up to [25443], [38100], [38174], [50156], [50164].

Props peterwilsoncc.
Fixes #52566.

git-svn-id: https://develop.svn.wordpress.org/trunk@50393 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-20 09:53:48 +00:00
Sergey Biryukov
77a7160821 Tests: Fix typo in one of wp_resource_hints() test method names.
Add `@ticket` reference.

Follow-up to [38100].

See #51802.

git-svn-id: https://develop.svn.wordpress.org/trunk@50392 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-20 09:52:14 +00:00
Felix Arntz
c8bbd79d2d Security: Fix bug in wp_is_local_html_output().
Prior to this changeset, the check for the correct RSD link output was relying on a specific protocol, although it needs to accept both the HTTP and HTTPS version of the URL.

Props TimothyBlynJacobs.
Fixes #52542. See #47577.


git-svn-id: https://develop.svn.wordpress.org/trunk@50391 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-19 21:11:02 +00:00
Sergey Biryukov
d77042872c Users: Correctly display an error message after clicking the "Send Reset Link" button.
The `addInlineNotice()` function expects a single string as a success or error message, not an array of strings.

Follow-up to [50129].

Props audrasjb.
Fixes #52573.

git-svn-id: https://develop.svn.wordpress.org/trunk@50390 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-19 17:22:37 +00:00
Sergey Biryukov
d1c40e9a3d Taxonomy: Optimize wp_delete_term() for large object counts without a default term.
When deleting a term, it has to be removed individually from each object it's connected to, which can take some significant time when there are a lot of objects.

By calling `wp_remove_object_terms()` when no default term is required, we can skip the terms fetch/diff step and significantly speed up the deletion process.

Props dd32.
Fixes #52549.

git-svn-id: https://develop.svn.wordpress.org/trunk@50389 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-19 14:29:29 +00:00
Kelly Choyce-Dwan
ccbfdd1485 Twenty Twenty-One: Add the px unit to the admin bar height custom property.
The admin bar height custom property is used in `calc` functions, which require consistent unit use, even when the value is zero. A unitless value returns an invalid value for the "height" property, where this variable is used. This also changes the stylelint rule in the theme to allow zero values with a unit, just in custom properties.

Props nico23.
Fixes #52564.



git-svn-id: https://develop.svn.wordpress.org/trunk@50388 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-18 20:44:24 +00:00
Jonathan Desrosiers
4935d34e84 Build/Test Tools: Update actions within test workflows to the latest versions.
This updates two published GitHub actions to their latest versions:

- `actions/setup-node` from `v1` to `v2`.
- `styfle/cancel-workflow-action` from `0.5.0` to `0.8.0`.

See #50401.

git-svn-id: https://develop.svn.wordpress.org/trunk@50387 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-18 18:45:23 +00:00
Kelly Choyce-Dwan
bc1b41341b Customizer: Bring admin color schemes back into the customizer.
In #50547, the admin color schemes were added to the customizer UI, but at some point specificity changed and the colors were overridden by the defaults. This brings the color schemes back into the customizer, using the button color as a highlight, with the link color for text to keep things readable.

Follow up to [48371].
Props audrasjb, peterwilsoncc.
Fixes #52230.



git-svn-id: https://develop.svn.wordpress.org/trunk@50386 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-18 16:49:02 +00:00
Kelly Choyce-Dwan
d6dfdfdac7 Administration: Apply background color to updated message in plugin list table.
Follow-up to [50025].
Props afragen.
Fixes #52452.



git-svn-id: https://develop.svn.wordpress.org/trunk@50385 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-18 15:14:07 +00:00
Sergey Biryukov
d8da8a3619 Tests: Rename stick_post() and unstick_post() tests for a bit more clarity.
Add missing DocBlock for `test_unstick_post_updates_option()`.

Follow-up to [50380].

See #52007.

git-svn-id: https://develop.svn.wordpress.org/trunk@50384 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-18 12:02:42 +00:00
Sergey Biryukov
59f2df8ed1 External Libraries: Revert the change to the tb_click() function in the Thickbox library.
The `blur()` method there is not the jQuery method, but is an HTML DOM method instead.

This makes the Close button on the "View details" modal on Plugins screen functional again.

Follow-up to [50367].

Props afragen.
See #51812.

git-svn-id: https://develop.svn.wordpress.org/trunk@50383 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-18 11:26:05 +00:00
Peter Wilson
d79722b09f Editor: Additional tests for reusable blocks.
Ensure that subsequent renders of a reusable block will render correctly and that recursively inserting a reusable block into itself does not cause an internal server (500) error.

Props bernhard-reiter, SergeyBiryukov.
Fixes #52364.



git-svn-id: https://develop.svn.wordpress.org/trunk@50382 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-18 01:11:18 +00:00
Peter Wilson
e686cb1b0e Site Health: Use home page for loopback test.
Use `home_url()` for asynchronous loopback test to ensure correct results on sites with WordPress installed elsewhere, for example WordPress in a sub-directory.

Props Levdbas.
Fixes #52547.



git-svn-id: https://develop.svn.wordpress.org/trunk@50381 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-17 23:08:14 +00:00
Peter Wilson
50af962653 Posts/Post Types: Prevent duplicates in sticky posts option.
In `unstick_post()` if a post ID is duplicated in the `sticky_posts` option remove all instances.

In both `stick_post()` and `unstick_post()` check for duplicate IDs already stored in the `sticky_post` option and remove them if the option is updated.

Props rahmohn, archon810.
Fixes #52007.


git-svn-id: https://develop.svn.wordpress.org/trunk@50380 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-17 22:56:34 +00:00
John Blackbourn
4f25e74baa Build/Test Tools: Split the single site and Multisite PHPUnit test runs on CI into separate jobs so they run in parallel.
This reduces the total duration of the test suite from ~26 minutes to ~16 minutes. Hurrah!

Fixes #52548


git-svn-id: https://develop.svn.wordpress.org/trunk@50379 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-17 19:31:25 +00:00
John Blackbourn
910c2db68a Comments: Revert the introduction of the opt-in comment approval notification feature.
This reverts the following commits: [50113], [50112], [50109].

See #33717


git-svn-id: https://develop.svn.wordpress.org/trunk@50375 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-17 13:06:43 +00:00
Sergey Biryukov
2c43a12ef6 Privacy: Suggest wp_add_privacy_policy_content() as an alternative for the deprecated wp_get_default_privacy_policy_content hook.
Follow-up to [50161].

See #49264.

git-svn-id: https://develop.svn.wordpress.org/trunk@50374 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-17 12:43:26 +00:00
Sergey Biryukov
622ab73fe6 Docs: Correct the alternative hook name for the deprecated whitelist_options hook.
Follow-up to [48121].

See #51800.

git-svn-id: https://develop.svn.wordpress.org/trunk@50373 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-17 12:40:10 +00:00
Sergey Biryukov
e49c3c7f18 Docs: Correct the type of $widget_id argument in is_active_widget().
See #51800.

git-svn-id: https://develop.svn.wordpress.org/trunk@50372 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-17 11:46:35 +00:00
Sergey Biryukov
135d567399 Robots: Rename wp_embed_no_robots to wp_robots_noindex_embeds().
This brings the naming in line with `wp_robots_noindex_search()`.

Follow-up to [49992], [50370].

See #51511, #52457.

git-svn-id: https://develop.svn.wordpress.org/trunk@50371 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-17 10:49:13 +00:00
Peter Wilson
f400eb5ab9 General: Add noindex robots meta tag to search results.
Prevent search engines indexing internal search results to protect against reflected web spam attacks.

Props abagtcs, audrasjb, ayeshrajans, burtrw, johnbillion, jonoaldersonwp, peterwilsoncc, poena, sabernhardt, xkon.
Fixes #52457


git-svn-id: https://develop.svn.wordpress.org/trunk@50370 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-16 23:36:44 +00:00
John Blackbourn
6299c30506 Post WordPress 5.7 Beta 3 version bump.
git-svn-id: https://develop.svn.wordpress.org/trunk@50369 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-16 21:18:06 +00:00
John Blackbourn
21c5666fce WordPress 5.7 beta 3.
git-svn-id: https://develop.svn.wordpress.org/trunk@50368 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-16 20:55:10 +00:00
Sergey Biryukov
9bac3d3401 External Libraries: Further fix jQuery deprecations in WordPress core.
This addresses `JQMIGRATE` warnings in some admin files and the Thickbox library.

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

Props bordoni, poena.
See #51812.

git-svn-id: https://develop.svn.wordpress.org/trunk@50367 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-16 20:23:19 +00:00
Sergey Biryukov
e23d442cd9 Twenty Nineteen: Add some space between the cookies checkbox and label in comment form.
Props sabernhardt, garrett-eclipse, mukesh27, monikarao, Boniu91.
Fixes #46601.

git-svn-id: https://develop.svn.wordpress.org/trunk@50365 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-16 20:13:48 +00:00
Kelly Choyce-Dwan
55f2f3f67b Twenty Twenty-One: Remove background color from Social Links the dark gray style.
This block variation doesn't support custom colors, so allowing a background color leads to a mismatch between frontend and editor styles.

Props poena, paaljoachim, audrasjb.
Fixes #52499.



git-svn-id: https://develop.svn.wordpress.org/trunk@50364 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-16 20:10:19 +00:00
Sergey Biryukov
944830428d Accessibility: Taxonomy: Correct keyboard navigation for the Tags meta box in classic editor.
Props sabernhardt, almendron, jose64, alexstine, joedolson, ryokuhi.
Fixes #52408.

git-svn-id: https://develop.svn.wordpress.org/trunk@50363 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-16 20:02:35 +00:00
Sergey Biryukov
729873ddda Administration: Apply the months_dropdown_results filter separately from pre_months_dropdown_query.
Follow-up to [50163].

Props hellofromTonya.
Fixes #51660.

git-svn-id: https://develop.svn.wordpress.org/trunk@50362 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-16 19:56:13 +00:00
Sergey Biryukov
0ff408d563 Twenty Ten: Correct the fallback to the default header if the featured image width is narrower than the twentyten_header_image_width setting.
Follow-up to [45581].

Props sabernhardt, macmanx, audrasjb.
Fixes #52516.

git-svn-id: https://develop.svn.wordpress.org/trunk@50361 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-16 19:25:26 +00:00
Sergey Biryukov
0337b93b01 Twenty Eleven: Correct the fallback to the default header if the featured image width is narrower than the twentyeleven_header_image_width setting.
Follow-up to [45581].

Props sabernhardt, macmanx, audrasjb.
See #52516.

git-svn-id: https://develop.svn.wordpress.org/trunk@50360 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-16 19:24:40 +00:00