43046 Commits

Author SHA1 Message Date
Jonathan Desrosiers
f228a4bc6f Build/Test Tools: Save changes resulting from npm install.
See #51801.

git-svn-id: https://develop.svn.wordpress.org/trunk@49822 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-17 13:57:18 +00:00
Felix Arntz
8505c99a1b Media: Enable lazy-loading of iframes by adding the loading="lazy" attribute to iframe tags on the front-end.
* Expands the capabilities of `wp_filter_content_tags()` to add the attribute to iframe tags if enabled.
* Modifies the default behavior of `wp_lazy_loading_enabled()` so that it returns `true` for `iframe` tags.
* Introduces a `wp_iframe_tag_add_loading_attr()` function.
* Introduces a `wp_iframe_tag_add_loading_attr` filter.

Like for images, the attribute is only added to iframes which have both `width` and `height` specified (see related #50367).

Props azaozz, flixos90, westonruter.
Fixes #50756.


git-svn-id: https://develop.svn.wordpress.org/trunk@49808 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-16 21:17:24 +00:00
Andrew Ozz
3f12f0e77c Editor: Fix improper triggering of the "Are you sure" prompt when navigating away from the old, "classic" Edit Post screen and there are no changes. Was triggered when there is an instance of TinyMCE in the Excerpt postbox.
Props rodrigosprimo, jonathanstegall, kevin940726, azaozz.
Fixes #52038.

git-svn-id: https://develop.svn.wordpress.org/trunk@49807 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-16 15:23:35 +00:00
Ian Dunn
2ea3033c0d Feed: Replace join() with implode() for safety.
Canonical functions should be used instead of aliases, because aliases can be deprecated or removed withough much notice. See r49193.

Props SergeyBiryukov.
See #51056.


git-svn-id: https://develop.svn.wordpress.org/trunk@49805 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-16 14:03:56 +00:00
Andrew Ozz
55c1f81e49 Media: Fix the template for the "Align" and "Link To" fields in the media modal when inserting an image from URL.
Props noisysocks, mukesh27.
Fixes #52065.

git-svn-id: https://develop.svn.wordpress.org/trunk@49804 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-16 12:43:44 +00:00
Ian Dunn
4595dcf7f9 Feed: Merge multiple header values to avoid fatal error.
When SimplePie parses HTTP headers, it combines multiple values for the same header into a comma-separated string. `WP_SimplePie_File` overrides the parsing, but was leaving them as an array instead.

That lead to a fatal error in PHP 8, because other parts of the codebase ended up passing an array to a function that expected a string.

Props david.binda, litemotiv, inc2734, NicolasKulka, hellofromTonya, mbabker, skithund, SergeyBiryukov, desrosj, timothyblynjacobs.
Fixes #51056. See #51956.



git-svn-id: https://develop.svn.wordpress.org/trunk@49803 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-16 00:49:32 +00:00
John Blackbourn
378c2058a0 Docs: Correct the documentation for the map_meta_cap() function and its filter.
See #51800


git-svn-id: https://develop.svn.wordpress.org/trunk@49802 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-15 22:16:03 +00:00
Sergey Biryukov
34dff0e768 Twenty Twenty-One: Fix typos in some inline comments.
Props manzurahammed, mukesh27.
Fixes #52071.

git-svn-id: https://develop.svn.wordpress.org/trunk@49801 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-15 13:26:07 +00:00
Kelly Choyce-Dwan
8eda4984e1 Twenty Twenty-One: Bring back PostCSS config.
Twenty Twenty-One uses PostCSS to convert the custom properties for Internet Explorer. Without a config file, the postcss command does nothing, causing issues in IE. This brings back the config from GitHub, which replaces all custom properties with the default values.

Props t-p, poena.
Fixes #52040.



git-svn-id: https://develop.svn.wordpress.org/trunk@49800 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-14 16:47:37 +00:00
Sergey Biryukov
6bd675869c Twenty Twenty-One: Correct the DocBlock for map-deep-set() Sass function.
Props mukesh27.
Fixes #52064.

git-svn-id: https://develop.svn.wordpress.org/trunk@49799 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-14 15:20:33 +00:00
Sergey Biryukov
ce8da7e6e3 Twenty Twenty-One: Use a more specific link for Dark Mode instructions.
Make both instances of the link translatable, for consistency.

Props engahmeds3ed, justinahinon.
Fixes #52010.

git-svn-id: https://develop.svn.wordpress.org/trunk@49798 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-13 18:38:25 +00:00
Jonathan Desrosiers
707d5df176 Build/Test Tools: Allow code coverage reports to be generated when running tests as a multisite.
This adds the information needed to generate a code coverage report to the multisite ruleset.

Fixes #52034.

git-svn-id: https://develop.svn.wordpress.org/trunk@49797 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-12 20:07:55 +00:00
Jonathan Desrosiers
f2c287aaee Build/Test Tools: Remove PHPUnit 3.6.x specific settings from the multisite configuration.
In PHPUnit 3.6.x, `exclude` and `file` paths were required to be relative to the checkout root. This changed in PHPUnit 4 when the path requirements were changed require them to be relative to the configuration file.

Since PHPUnit 3.6.x is only used to test on PHP 5.2 in older branches and is no longer supported, these can be safely removed from the configuration file.

See #51802.

git-svn-id: https://develop.svn.wordpress.org/trunk@49796 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-12 18:06:45 +00:00
Sergey Biryukov
11e82a441b Twenty Twenty-One: Fix typos in some inline comments.
Props tanvirul, mukesh27.
Fixes #52042.

git-svn-id: https://develop.svn.wordpress.org/trunk@49795 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-12 15:01:52 +00:00
Sergey Biryukov
5928678ab9 Twenty Twenty-One: Correct version in file-header.scss.
Fixes #52044.

git-svn-id: https://develop.svn.wordpress.org/trunk@49794 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-12 14:55:27 +00:00
Kelly Choyce-Dwan
f4f7afb65a Twenty Nineteen: Add images for use in block patterns.
The block patterns were added in #51099, but the images were not included in the commit. This adds the images to the expected folder.

Props transl8or, mukesh27.
Fixes #51996.



git-svn-id: https://develop.svn.wordpress.org/trunk@49793 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-11 16:53:12 +00:00
Sergey Biryukov
c167a9425c Docs: Document the usage of $wpdb global in WP_Query::get_posts() and ::set_found_posts().
Props jontyravi.
Fixes #52027.

git-svn-id: https://develop.svn.wordpress.org/trunk@49792 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-11 16:51:15 +00:00
Jonathan Desrosiers
24f6120e90 Build/Test Tools: Update several NPM packages.
These were updated using `npm audit fix`.

See #51801.

git-svn-id: https://develop.svn.wordpress.org/trunk@49791 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-11 14:03:50 +00:00
John Blackbourn
37f8276a18 Docs: Various docblock improvements.
See #51800


git-svn-id: https://develop.svn.wordpress.org/trunk@49790 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-10 23:57:29 +00:00
John Blackbourn
81b89682c3 Docs: Various docblock corrections.
See #51800


git-svn-id: https://develop.svn.wordpress.org/trunk@49789 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-10 23:51:52 +00:00
John Blackbourn
6267e412f1 Upgrade/Install: Remove a duplicate description for the upgrader_overwrote_package action.
See #51800, #9757


git-svn-id: https://develop.svn.wordpress.org/trunk@49788 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-10 23:36:11 +00:00
John Blackbourn
f92fdb1f78 Docs: Fix some docblock issues introduced in 5.6.
See #51800


git-svn-id: https://develop.svn.wordpress.org/trunk@49787 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-10 23:25:26 +00:00
Jonathan Desrosiers
14cda0388b Build/Test Tools: Reestablish the codebase as a Git repo before reporting test results.
The test reporter uses the hidden `.svn` or `.git` directories to determine which changeset to send to WordPress.org along with the test report.

Because the GitHub Action workflow builds and prepares WordPress in a preceding job to share with each test job, the `.git` directory is missing (it is purposefully not included to limit artifact size).

This re-establishes the directory as a checkout of the `wordpress-develop` repository so that test results can be reported correctly.

See #50401.

git-svn-id: https://develop.svn.wordpress.org/trunk@49786 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-10 19:17:28 +00:00
Sergey Biryukov
fe1a25f89f Docs: Fix typo in some DocBlocks.
See #51800.

git-svn-id: https://develop.svn.wordpress.org/trunk@49785 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-10 18:10:12 +00:00
Jonathan Desrosiers
668581d0f3 Build/Test Tools: Inline documentation updates for the PHPUnit workflow.
See #50401.

git-svn-id: https://develop.svn.wordpress.org/trunk@49784 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-10 15:28:09 +00:00
Jonathan Desrosiers
e86d912e3c Build/Test Tools: Enable reporting of results to WordPress.org.
This configures reporting of the test results to the WordPress.org Host Test Results in the new GitHub Actions workflow for PHPUnit testing.

See https://make.wordpress.org/hosting/test-results/

Props mikeschroder, dd32.
See #50401.

git-svn-id: https://develop.svn.wordpress.org/trunk@49783 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-10 14:18:12 +00:00
Jonathan Desrosiers
2a46c3987f Build/Test Tools: Use NodeJS 14 in GitHub Action workflows.
14.x is the current LTS release, and is what `trunk` currently runs.

See #50401.

git-svn-id: https://develop.svn.wordpress.org/trunk@49782 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-09 20:55:42 +00:00
Jonathan Desrosiers
cf909e11d3 Build/Test Tools: Disable GitHub Action workflow runs triggered on push for forks and mirrors.
In the current state, the workflows run regardless of the repository context. This results many needless workflow runs that waste resources.

Workflow runs for private repositories are not free (accounts have a finite allotment of minutes for private repositories). This becomes problematic in private repositories that also mirror the WordPress develop repository, as any workflow runs will draw from a user’s or organization’s allotted action minutes.

Without blanket disabling the workflow manually for all event triggers, or modifying the workflow files in the forked/mirrored repository, there is no way to tune when the workflows run.

This change introduces a conditional statement into all GitHub Action workflows that prevents them from running on forked/mirrored repositories that are not `wordpress-develop`, except when a pull request is being submitted to that repository.

The exception to this is the Welcome workflow that posts a helpful message to first time contributors to `wordpress-develop`. This message is specific to this repository, so should only run when a PR is submitted to that repository.

See #50401.

git-svn-id: https://develop.svn.wordpress.org/trunk@49781 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-09 20:05:01 +00:00
Jonathan Desrosiers
6e2ba3bca7 Build/Test Tools: Update package-lock.json file with several package updates.
These updates result from running `npm install`.

Also, update the version of `grunt-patch-wordpress` in the lock file from `3.0.0` to `3.0.1`.

See #51801.

git-svn-id: https://develop.svn.wordpress.org/trunk@49780 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-09 19:31:26 +00:00
Jonathan Desrosiers
7460614634 Build/Test Tools: Remove the Appveyor configuration file.
Appveyor was added to Core in [44594] to ensure that NPM and the WordPress build tools continue to work correctly on Windows systems as changes are made. Using an additional service for this was required at the time, TravisCI did not support testing on Windows.

[49162] introduced a GitHub Action workflow that performed the same testing. Since all automated testing is moving to GitHub Actions, using Appveyor is no longer necessary, and it’s preferable to have all automated testing in one location as much as possible.

Props ayeshrajans.
Fixes #51968.

git-svn-id: https://develop.svn.wordpress.org/trunk@49779 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-09 13:33:11 +00:00
Helen Hou-Sandi
83d9b86dc6 Update $_old_files for 5.6.
See #39943.


git-svn-id: https://develop.svn.wordpress.org/trunk@49774 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-08 21:48:22 +00:00
Timothy Jacobs
ee7ba3a9f0 App Passwords: Ensure redirection description is shown on mobile devices.
Props #core.
Fixes #51970.


git-svn-id: https://develop.svn.wordpress.org/trunk@49772 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-08 20:26:12 +00:00
Kelly Choyce-Dwan
804db75453 Help/About: Use CDN URLs for About page images.
See #51415.



git-svn-id: https://develop.svn.wordpress.org/trunk@49770 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-08 17:00:37 +00:00
Sergey Biryukov
e328e26de3 Docs: Fix typo in references to WP_Error in some DocBlocks.
See #51800.

git-svn-id: https://develop.svn.wordpress.org/trunk@49769 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-08 11:49:23 +00:00
Timothy Jacobs
34e25034dd App Passwords: Store the "in use" option in the main network options.
Whether App Passwords are being used is a global featurel, not a per-network feature. This fixes issues on Multi Network installs if App Passwords are used on a different network from where they were created.

Props spacedmonkey.
Fixes #51939.
See [49752].


git-svn-id: https://develop.svn.wordpress.org/trunk@49764 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-07 15:57:03 +00:00
Sergey Biryukov
ae9911c355 Bundled Themes: Bump theme versions ahead of WordPress 5.6.
The following theme versions will be released in coordination with WordPress 5.6:

* Twenty Ten: 3.2
* Twenty Eleven: 3.6
* Twenty Twelve: 3.3
* Twenty Thirteen: 3.2
* Twenty Fourteen: 3.0
* Twenty Fifteen: 2.8
* Twenty Sixteen: 2.3
* Twenty Seventeen: 2.5
* Twenty Nineteen: 1.8
* Twenty Twenty: 1.6
* Twenty Twenty-One: 1.0

Props peterwilsoncc, hareesh-pillai, dkarfa, sabernhardt, poena, aristath, SergeyBiryukov.
Fixes #51919.

git-svn-id: https://develop.svn.wordpress.org/trunk@49763 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-07 15:53:19 +00:00
Sergey Biryukov
175b23e00a Twenty Twenty-One: Use esc_url() for the WordPress.org link in footer.php.
Props mukesh27, poena.
Fixes #51954.

git-svn-id: https://develop.svn.wordpress.org/trunk@49762 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-07 14:15:24 +00:00
Sergey Biryukov
92f14987fb Twenty Twenty-One: Use consistent HTML comments after closing HTML tags.
Follow-up to [45209] for other bundled themes.

Props arcangelini, audrasjb.
Fixes #51950.

git-svn-id: https://develop.svn.wordpress.org/trunk@49761 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-07 14:05:44 +00:00
Sergey Biryukov
f51bcff2f1 Twenty Twenty-One: Fix the nesting of the main element.
The `main` element must not appear as a descendant of the `section` element. Correct markup is the first requirement to make user agents and assistive technologies work properly.

Changes the `<section>` element that was wrapping the `<main>` element to a `<div>`.

Follow-up to [45942] for Twenty Nineteen.

Props albertomake, poena.
Fixes #51944.
}}}

git-svn-id: https://develop.svn.wordpress.org/trunk@49759 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-06 16:20:10 +00:00
Peter Wilson
a6e1d392f2 Docs, Tests: Correctly capitalize JavaScript.
Correct Javascript to JavaScript within Wordpress core ;)

See #51800, #51802.



git-svn-id: https://develop.svn.wordpress.org/trunk@49758 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-06 02:19:56 +00:00
Sergey Biryukov
85bc0628b4 Tests: Correct @ticket references in some test files.
See #51802.

git-svn-id: https://develop.svn.wordpress.org/trunk@49757 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-05 15:49:25 +00:00
Timothy Jacobs
38361be8e6 App Passwords: Prevent conflicts when Basic Auth is already used by the site.
Application Passwords uses Basic Authentication to transfer authentication details. If the site is already using Basic Auth, for instance to implement a private staging environment, then the REST API will treat this as an authentication attempt and would end up generating an error for any REST API request.

Now, Application Password authentication will only be attempted if Application Passwords is in use by a site. This is flagged by setting an option whenever an Application Password is created. An upgrade routine is added to set this option if any App Passwords already exist.

Lastly, creating an Application Password will be prevented if the site appears to already be using Basic Authentication.

Props chexwarrior, georgestephanis, adamsilverstein, helen, Clorith, marybaum, TimothyBlynJacobs.
Fixes #51939.



git-svn-id: https://develop.svn.wordpress.org/trunk@49752 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-04 21:42:52 +00:00
Ian Dunn
8724f546c9 Media: Return WP_Error when cropping with bad input to avoid fatal.
This avoids an error on PHP 8 caused by calling `wp_imagecreatetruecolor()` with inputs that aren't numeric, or are less than 0.

Props hellofromtonya, Boniu91, metalandcoffee, SergeyBiryukov.
Fixes #51937.


git-svn-id: https://develop.svn.wordpress.org/trunk@49751 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-04 21:39:30 +00:00
Sergey Biryukov
2b0e2d62a2 Database: Check the correct value for displaying the "Successfully repaired table" or "Failed to repair" messages on Database Repair screen.
Additionally, rename the variables holding the results of `ANALYZE TABLE` and `OPTIMIZE TABLE` requests, for clarity.

Props mehrshaddarzi.
Fixes #51932.

git-svn-id: https://develop.svn.wordpress.org/trunk@49750 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-04 15:48:15 +00:00
Timothy Jacobs
babba89dd8 App Passwords: Ensure the Created At and Last Used dates are properly translated.
The `date_i18n` function is now used when formatting the dates in PHP instead of `gmdate` which doesn't handle localization properly.

Additionally, we now use a translation to get the date format to use instead of pulling from the `date_format` option which is only supposed to affect the front-end.

Lastly, when passing the date format to the Backbone JS template, we now use `wp_json_encode()` to format the value for JavaScript. This ensures that backslashes are properly preserved which are used by some locales to escape date formatting control characters.

Props pedromendonca, TimothyBlynJacobs, ocean90, hellofromtonya, SergeyBiryukov, antpb.
Fixes #51918.
See [35811].


git-svn-id: https://develop.svn.wordpress.org/trunk@49746 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-03 21:04:05 +00:00
Ian Dunn
cac678f807 Multisite: Cache absolute dirsize paths to avoid PHP 8 fatal.
r49212 greatly improved the performance of `get_dirsize()`, but also changed the structure of the data stored in the `dirsize_cache` transient. It stored relative paths instead of absolute ones, and also removed the unnecessary `size` array.

That difference in data structures led to a fatal error in the following environment:

* PHP 8
* Multisite
* A custom `WP_CONTENT_DIR` which is not a child of WP's `ABSPATH` folder (e.g., [https://roots.io/bedrock/ Bedrock])
* The `upload_space_check_disabled` option set to `0`

After upgrading to WP 5.6, the `dirsize_cache` transient still had data in the old format. When `wp-admin.php/index.php` was visited, `get_space_used()` received an `array` instead of an `int`, and tried to divide it by another `int`. PHP 7 would silently cast the arguments to match data types, but [https://wiki.php.net/rfc/arithmetic_operator_type_checks PHP 8 throws a fatal error]: 

`Uncaught TypeError: Unsupported operand types: array / int`

`recurse_dirsize()` was using `ABSPATH` to convert the absolute paths to relative ones, but some upload locations are not located under `ABSPATH`. In those cases, `$directory` and `$cache_path` were identical, and that triggered the early return of the old `array`, instead of the expected `int`. 

In order to avoid that, this commit restores the absolute paths, but without the `size` array. It also adds a type check when returning cached values. Using absolute paths without `size` has the result of overwriting the old data, so that it matches the new format. The type check and upgrade routine are additional safety measures.

Props peterwilsoncc, janthiel, helen, hellofromtonya, francina, pbiron.
Fixes #51913. See #19879.



git-svn-id: https://develop.svn.wordpress.org/trunk@49744 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-03 20:37:43 +00:00
Sergey Biryukov
3cd0c58e3d Upgrade/Install: Update sodium_compat to v1.14.0.
This includes improved PHP 8 support and more inclusive language.

A full list of changes in this update can be found on GitHub:
https://github.com/paragonie/sodium_compat/compare/v1.13.0...v1.14.0

Follow-up to [48121], [49056], [49057].

Props jrf.
Fixes #51925.

git-svn-id: https://develop.svn.wordpress.org/trunk@49741 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-03 17:39:03 +00:00
Timothy Jacobs
59b018ff86 App Passwords: Return true when rate limiting a password's last used time.
Previously we returned a `WP_Error` instance saying that the password was not found which is inaccurate.

Props dlh.
Fixes #51922.


git-svn-id: https://develop.svn.wordpress.org/trunk@49739 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-03 16:28:08 +00:00
Sergey Biryukov
a9064e9d19 Editor: Update components package for WordPress 5.6 RC3.
@wordpress/components: 11.1.2 -> 11.1.3

This fixes an accessibility regression with VoiceOver not announcing the input label or an existing selection in the parent page dropdown under "Page Attributes" in the sidebar.

See https://github.com/WordPress/gutenberg/pull/27431 for more details.

Props isabel_brison, sarahricker, alexstine, kevin940726, talldanwp.
Fixes #51923.

git-svn-id: https://develop.svn.wordpress.org/trunk@49737 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-03 14:41:37 +00:00
Sergey Biryukov
96b67833fe Upgrade/Install: Check $wp_version global for displaying "You are using a development version" message in the admin footer.
This brings some consistency with the same check in `core_upgrade_preamble()` and avoids a PHP warning if `$cur->version` is not set.

Additionally, remove the check for `$cur->url` property, unused since [8595].

Follow-up to [49708], [49709].

Props pbiron, afragen, audrasjb.
Fixes #51892.

git-svn-id: https://develop.svn.wordpress.org/trunk@49736 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-03 14:04:32 +00:00