43087 Commits

Author SHA1 Message Date
Jonathan Desrosiers
1c09a2daf6 Build/Test Tools: Change the patch version used for testing the 5.6 branch of PHP.
This unpins the version of PHP 5.6.20 used when testing the 5.6 branch of PHP.

Using 5.6.20 was an intentional decision in [49162], as that patch version is the oldest version of PHP 5.6 still supported by WordPress. However, as of September 30, 2021, the `5.6.20` image contains a version of OpenSSL with an expired certificate, sometimes resulting in an expired trust chain.

Props Clorith, hellofromTonya, SergeyBiryukov, desrosj.
Merges [51890] to the 5.6 branch.
See #54223.

git-svn-id: https://develop.svn.wordpress.org/branches/5.6@51933 602fd350-edb4-49c9-b593-d223f7449a82
2021-10-25 19:16:32 +00:00
Tonya Mork
2283fe0cbf Build/Test Tools: Fix test forward-compatibility layer.
In [51840], the test wrapper methods were not being called due to the names not being recognized as supported PHPUnit "hook" names for fixtures.

This commit:
- Fixes the problem by adding extra camelCase wrappers to the `WP_UnitTestCase` to call the methods in the right order.
- Adds wrappers for the `assertPreConditions()` and `assertPostConditions()` fixture methods to make the backport feature complete for the fixture wrappers.

Test wrapper methods call fix:

By adding method overloads for the PHPUnit native camelCase fixture methods and letting those call the (camelCase) parent method first and only calling the snake_case fixture methods after, the snake_case methods can be supported and the typical run order safeguarded.

As not all test classes will have declared snake_case fixture methods, the snake_case fixture methods are also declared in the `WP_UnitTestCase`. Why? This prevents having to wrap these method calls in `method_exists()` conditions checking for the existence of the snake_case methods in an unknown Test child class. And with the normal inheritance rules in combination with calling the method using `static`, the right method will be called anyway without fatal "calling undeclared method" errors.

Note: While it will be rare, there ''may'' be cases where a test class does not adhere to the normal execution order for fixtures, i.e. for the setup methods, parent first, own code second; and for the teardown methods, own code first, parent second. For example a test class which has "some code - `parent::setUp()` call - some more code" in their `setUp()` method. In those (rare) cases, the execution order of the code will now be changed, which may have side-effects. This rare case will be identified in the dev note.

Follow-up to [51840].

Props bjorsch, swissspidy, jrf, hellofromTonya.
See #53911.

git-svn-id: https://develop.svn.wordpress.org/branches/5.6@51863 602fd350-edb4-49c9-b593-d223f7449a82
2021-09-24 13:54:12 +00:00
Jonathan Desrosiers
279d36ebf3 Build/Test Tools: Introduce the PHPUnit Polyfills package for easier cross branch testing.
This backports the PHPUnit Polyfills package and related test infrastructure changes to make it easier for developers to continue testing on multiple versions WordPress while adding tests for newer versions of PHP, which require more modern PHPUnit practices.

One of the changes included is the addition of wrappers for the new snake_case fixture methods in PHPUnit. This allows the native camelCase standard in PHPUnit to be used, but allows for developers to transition to the new naming conventions.

Props hellofromTonya, jrf, SergeyBiryukov, johnbillion, netweb, schlessera, jeherve, lucatume, desrosj.
Merges [51559,51560,51810-51813,51828] to the 5.6 branch.
See #53911.

git-svn-id: https://develop.svn.wordpress.org/branches/5.6@51840 602fd350-edb4-49c9-b593-d223f7449a82
2021-09-21 19:29:38 +00:00
Jonathan Desrosiers
5f95aa0b8b WordPress 5.6.5.
git-svn-id: https://develop.svn.wordpress.org/branches/5.6@51760 602fd350-edb4-49c9-b593-d223f7449a82
2021-09-08 21:28:12 +00:00
Jonathan Desrosiers
58173c32e0 Grouped merges for 5.6.5.
- Update `lodash` to the latest version `4.17.21`.
- Disable some attributes for rich text.
- Use hashed/deterministic moduleIDs in webpack config.

Props ellatrix, peterwilsoncc, get_dave, mcsf, talldanwp, youknowriad, desrosj, nerrad, gziolo.
Merges [50940-50941,50984-50985,51426] to the 5.6 branch.

git-svn-id: https://develop.svn.wordpress.org/branches/5.6@51751 602fd350-edb4-49c9-b593-d223f7449a82
2021-09-08 21:11:10 +00:00
Sergey Biryukov
c8b23748d4 General: Only use _jsonp_wp_die_handler() for JSONP REST API requests.
Props mdawaffe, peterwilsoncc.
Merges [51740] to the 5.6 branch.

git-svn-id: https://develop.svn.wordpress.org/branches/5.6@51743 602fd350-edb4-49c9-b593-d223f7449a82
2021-09-08 17:22:27 +00:00
Peter Wilson
8724f61f99 WordPress 5.6.4.
git-svn-id: https://develop.svn.wordpress.org/branches/5.6@50870 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-12 23:11:26 +00:00
Peter Wilson
cea3c9887d External libraries: Improve attachment handling in PHPMailer
Props: audrasjb, ayeshrajans, desrosj, peterwilsoncc, xknown.
Partially merges [50799] to the 5.6 branch.



git-svn-id: https://develop.svn.wordpress.org/branches/5.6@50848 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-12 22:24:16 +00:00
Peter Wilson
9ec7be02d1 Version bump for 5.6.3.
git-svn-id: https://develop.svn.wordpress.org/branches/5.6@50737 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-15 01:31:29 +00:00
Jonathan Desrosiers
a9f2b0fa8f Grouped merges for 5.6.3.
* REST API: Allow authors to read their own password protected posts.
* About page update.

Merges [50717] to the 5.6 branch.


git-svn-id: https://develop.svn.wordpress.org/branches/5.6@50726 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-15 01:06:00 +00:00
Peter Wilson
63d1e69a61 Editor: Update of @wordpress npm packages for 5.6.3.
git-svn-id: https://develop.svn.wordpress.org/branches/5.6@50721 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-15 00:03:15 +00:00
Jonathan Desrosiers
fbb2f41d2a External libraries: Include upstream GetID3 fix for PHP 8.
Merges [50714] to the 5.6 branch.
Props jrf, xknown.

git-svn-id: https://develop.svn.wordpress.org/branches/5.6@50716 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-14 23:15:09 +00:00
Jonathan Desrosiers
f42d07e74d Build/Test Tools: Prevent PHPUnit tests on push for forks/private mirrors.
The reorganization of the PHPUnit workflow in [50441] unintentionally caused the tests to be run for every `push` event, even for forks and private mirrors.

Previously, the second job required the first one to pass, and the conditional check on the first prevented both from running. Because the first job is no longer required for the second, both jobs must have the appropriate conditional check.

Merges [50670] to the 5.6 branch.
Fixes #52983.

git-svn-id: https://develop.svn.wordpress.org/branches/5.6@50672 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-06 15:25:28 +00:00
Jonathan Desrosiers
8aeb41e2bc Build/Test Tools: Backport GitHub Action and build improvements to the 5.6 branch.
This backports several build and test tool improvements to the 5.6 branch. Most notably, this includes:

- The changes required to allow each workflow to be triggered by the `workflow_dispatch` event so that tests can be run on a schedule [50590].
- The ability to run PHPUnit tests from `src` instead of `build` [50441-50443].
- Splitting single site and multisite tests into parallel jobs [50379].
- Split slow tests into separate, parallel jobs for PHP 5.6 [50444].
- Better branch and path scoping for GitHub Action workflows when running on `pull_request` [50432,50479].
- Several `devDependency` updates.

Merges [50267,50299,50379,50387,50413,50416,50432,50435-50436,50441-50444,50446,50473-50474,50476,50479,50485-50487,50545,50579,50590,50592,50598] to the 5.6 branch.
See #50401, #51734, #51801, #51802, #52548, #52608, #52612, #52623, #52624, #52625, #52645, #52653, #52658, #52660, #52667, #52786.

git-svn-id: https://develop.svn.wordpress.org/branches/5.6@50602 602fd350-edb4-49c9-b593-d223f7449a82
2021-03-26 17:21:35 +00:00
Sergey Biryukov
fab2d55c29 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.
Merges [50445] to the 5.6 branch.
Fixes #52647.

git-svn-id: https://develop.svn.wordpress.org/branches/5.6@50459 602fd350-edb4-49c9-b593-d223f7449a82
2021-03-01 08:27:03 +00:00
Jonathan Desrosiers
0aac78cfce Post WordPress 5.6.2 version bump.
The 5.6 branch is now 5.6.3 alpha.

git-svn-id: https://develop.svn.wordpress.org/branches/5.6@50405 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-22 15:41:35 +00:00
Jonathan Desrosiers
3fc677afe0 WordPress 5.6.2.
git-svn-id: https://develop.svn.wordpress.org/branches/5.6@50403 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-22 15:06:44 +00:00
Sergey Biryukov
f8bf8b5ee0 Help/About: Update the About page for 5.6.2.
Props audrasjb, desrosj, mukesh27.
Reviewed by desrosj, SergeyBiryukov.
Fixes #52557.

git-svn-id: https://develop.svn.wordpress.org/branches/5.6@50402 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-22 14:13:12 +00:00
Jonathan Desrosiers
97e995e13f Post WordPress 5.6.2 RC1 version bump.
git-svn-id: https://develop.svn.wordpress.org/branches/5.6@50378 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-17 15:33:01 +00:00
Jonathan Desrosiers
2f464a25d5 WordPress 5.6.2 RC1.
git-svn-id: https://develop.svn.wordpress.org/branches/5.6@50377 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-17 15:05:26 +00:00
Jonathan Desrosiers
8658894bd3 Editor: Update block editor dependencies for 5.6.2.
This updates several packages to their latest patch versions to fix bugs discovered in the 5.6 branch.

`@wordpress/block-directory` to `1.17.8`
`@wordpress/block-editor` to `5.1.7`
`@wordpress/block-library` to `2.26.8`
`@wordpress/components` to `11.1.5`
`@wordpress/core-data` to `2.24.4`
`@wordpress/edit-post` to `3.25.8`
`@wordpress/editor` to `9.24.7`
`@wordpress/format-library` to `1.25.7`
`@wordpress/list-reusable-blocks` to `1.24.5`
`@wordpress/media-utils` to `1.18.1`
`@wordpress/nux` to `3.23.5`
`@wordpress/reusable-blocks` to `1.0.7`
`@wordpress/server-side-render` to `1.19.5`

Props isabel_brison, talldanwp, youknowriad, freewebmentor, sterndata, inc2734, itsjonq, jorgefilipecosta, aristath, nosolosw, mattwiebe, addiestavlo, kevin940726, noisysocks, aaronrobertshaw, glendaviesnz, gwwar, bernhard-reiter, paaljoachim.
Fixes #52396, #52449, #52553.

git-svn-id: https://develop.svn.wordpress.org/branches/5.6@50376 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-17 14:14:44 +00:00
Jonathan Desrosiers
172d96147b Editor: Correct the check for unsaved content in wp.autosave.server.postChanged().
This fixes improper triggering of the "Are you sure?" prompt when navigating away from the old, "classic" Edit Post screen and there are no changes.

The previous check did not account for Pages or any custom post types that don't have a Title, Content, or Excerpt field.

Follow-up to [50031].

Props hwk-fr, mukesh27, audrasjb, archon810, Clorith, ibiza69, tonysandwich, roger995, bartosz777, viablethought, dbtedg, worldedu, hmabpera, magnuswebdesign.
Merges [50232] to the 5.6 branch.
Fixes #52440.

git-svn-id: https://develop.svn.wordpress.org/branches/5.6@50366 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-16 20:22:36 +00:00
Sergey Biryukov
1b0e240d3d Filesystem API: Make sure to only call fread() on non-empty files in the PclZip library.
This avoids a fatal error on PHP 8 caused by passing a zero value to `fread()` as the `$length` argument, which must be greater than zero.

Props yakimun, fierevere, jrf, DavidAnderson, SergeyBiryukov.
Merges [50355] to the 5.6 branch.
Fixes #52018.

git-svn-id: https://develop.svn.wordpress.org/branches/5.6@50356 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-16 18:46:21 +00:00
Jonathan Desrosiers
0c66714b84 Build/Test Tools: Run automated testing when tags are created.
This expands the list of events that triggers automated testing to include tags.

It also refines the matched version ranges for several workflows.

Merges [50298] to the 5.6 branch.
See #50401.

git-svn-id: https://develop.svn.wordpress.org/branches/5.6@50301 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-12 17:30:18 +00:00
Jonathan Desrosiers
7881f918b0 Build/Test Tools: Merge several automated testing improvements to the 5.6 branch.
This merges several refinements to GitHub Action workflow files to the 5.6 branch.

It also includes [49836], which added the ability to replace `mysql` with `mariadb` when using the local Docker environment to ensure consistency of the tools across branches.

Props johnbillion.
Merges [49781-49784,49786,49836,49938,50268,50285] to the 5.6 branch.
See #50401.

git-svn-id: https://develop.svn.wordpress.org/branches/5.6@50296 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-12 14:53:59 +00:00
Jonathan Desrosiers
c96850536a Build/Test Tools: Change the version of NodeJS tested on Windows to 14.
Merges [49782] to the 5.6 branch.
See #50401.

git-svn-id: https://develop.svn.wordpress.org/branches/5.6@50198 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-05 03:49:58 +00:00
Jonathan Desrosiers
8aa4153d3b Build/Test Tools: Fix tests after [50186].
This removes a test assertion defending against version ranges in the `node` value in `package.json` files. This is now supported.

Props peterwilsoncc.
Merges [50192] to the 5.6 branch.
See #52341.

git-svn-id: https://develop.svn.wordpress.org/branches/5.6@50193 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-05 03:38:58 +00:00
Jonathan Desrosiers
490ddf0635 Build/Test Tools: Pin NodeJS 14.x in the .nvmrc file for the 5.6 branch.
See #52341.

git-svn-id: https://develop.svn.wordpress.org/branches/5.6@50187 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-05 02:57:39 +00:00
Jonathan Desrosiers
8a509c8cec Build/Test Tools: Specify a version range within engines for node and npm.
This makes it more clear what versions of `node` and `npm` will successfully build WordPress.

Props dd32, mkaz.
Merges [50185] to the 5.6 branch.
Fixes #52455. See #51749.

git-svn-id: https://develop.svn.wordpress.org/branches/5.6@50186 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-05 02:49:10 +00:00
Jonathan Desrosiers
719dc6436a Build/Test Tools: Replace node-sass with Dart Sass
Switch the Sass implementation used by Grunt to sass (the Dart version), since LibSass & node-sass have been deprecated.

Additionally, this updates the `uglify-js` dependency.

Merges [50126] and [50176] to the 5.6 branch.
See #51763, #51801.

git-svn-id: https://develop.svn.wordpress.org/branches/5.6@50184 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-05 02:21:53 +00:00
Jonathan Desrosiers
6eb87d7c5c Post WordPress 5.6.1 version bump.
The 5.6 branch is now 5.6.2 alpha.

git-svn-id: https://develop.svn.wordpress.org/branches/5.6@50180 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-03 21:32:47 +00:00
Jonathan Desrosiers
98ca7a488e WordPress 5.6.1.
git-svn-id: https://develop.svn.wordpress.org/branches/5.6@50178 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-03 21:08:48 +00:00
Jake Spurlock
da3578381c Help/About: About page changes for 5.6.1.
Props ryelle, audrasjb.

Fixes #52346.


git-svn-id: https://develop.svn.wordpress.org/branches/5.6@50177 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-03 17:18:36 +00:00
Peter Wilson
1b188f1190 Build/Test Tools: Update built files committed to src following [50023].
See #51801, #52341.



git-svn-id: https://develop.svn.wordpress.org/branches/5.6@50173 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-03 01:53:57 +00:00
Sergey Biryukov
829d7880c3 Tests: Set up the plugin download in multisite plugin tests to come locally.
This brings consistency between single site and multisite in REST API plugin installation tests.

Previously, multisite tests were unnecessarily downloading the plugin from WordPress.org on each test run, causing external HTTP requests and leading to failures in case of a timeout.

Follow-up to [48242], [49491], [49913].

Merges [49951] to the 5.6 branch.
See #51669.

git-svn-id: https://develop.svn.wordpress.org/branches/5.6@50085 602fd350-edb4-49c9-b593-d223f7449a82
2021-01-30 10:39:20 +00:00
Sergey Biryukov
2aa72a9f78 Tests: Disable update checks while running REST API plugin installation tests.
This prevents external HTTP requests that are not required for the tests in question and may interfere with the results in case of a timeout.

Follow-up to [48242], [49491].

Merges [49913] to the 5.6 branch.
See #51669.

git-svn-id: https://develop.svn.wordpress.org/branches/5.6@50083 602fd350-edb4-49c9-b593-d223f7449a82
2021-01-30 10:36:38 +00:00
Jonathan Desrosiers
4e5d786ab1 Post WordPress 5.6.1 RC1 version bump.
git-svn-id: https://develop.svn.wordpress.org/branches/5.6@50064 602fd350-edb4-49c9-b593-d223f7449a82
2021-01-28 19:42:39 +00:00
Jonathan Desrosiers
997e04048b WordPress 5.6.1 RC1.
git-svn-id: https://develop.svn.wordpress.org/branches/5.6@50063 602fd350-edb4-49c9-b593-d223f7449a82
2021-01-28 19:30:00 +00:00
Jonathan Desrosiers
aaa47324c8 Twenty Twenty-One: Revert [50043] from the 5.6 branch.
Since a new version of Twenty Twenty-One will not be published in coordination with 5.6.1, this will prevent slight differences between the version of the theme that ships with 5.6.1 and the one users received when updating the theme to version `1.1`.

See #52212.

git-svn-id: https://develop.svn.wordpress.org/branches/5.6@50062 602fd350-edb4-49c9-b593-d223f7449a82
2021-01-28 18:55:58 +00:00
Jake Spurlock
d7900932a9 Editor: Update WordPress editor npm packages.
These are backports coming for the 5.6.1 release.

Summary of the following issues: 


* [#27970](https://github.com/WordPress/gutenberg/pull/27970) - Fix editor crash when registering a block pattern without `categories`  Backport to WP Minor Release [Feature] Inserter [Feature] Patterns [Type] Bug
* [#27733](https://github.com/WordPress/gutenberg/pull/27733) - [Embed block]: Add html and reusable support back  Backport to WP Minor Release [Block] Embed [Type] Regression
* [#27727](https://github.com/WordPress/gutenberg/pull/27727) - Add aria labels to box control component inputs/button  Backport to WP Minor Release [Feature] UI Components [Package] Components [Type] Bug [a11y] Labelling
* [#27627](https://github.com/WordPress/gutenberg/pull/27627) - HTML Block: Fix editor styles  Backport to WP Minor Release [Block] HTML [Type] Regression
* [#27526](https://github.com/WordPress/gutenberg/pull/27526) - Core Data: Normalize `_fields` value for use in `stableKey`  Backport to WP Minor Release [Package] Core data [Type] Bug
* [#26705](https://github.com/WordPress/gutenberg/pull/26705) - Fix: Font size picker does not correctly handles big font sizes.  Backport to WP Minor Release [Type] Bug
* [#26432](https://github.com/WordPress/gutenberg/pull/26432) - Edit Site: prevent inserter overscroll  Backport to WP Minor Release First-time Contributor [Feature] Full Site Editing [Type] Bug


Packages updated:

@wordpress/block-directory@1.17.7
@wordpress/block-editor@5.1.6
@wordpress/block-library@2.26.7
@wordpress/components@11.1.4
@wordpress/core-data@2.24.3
@wordpress/edit-post@3.25.7
@wordpress/edit-site@1.15.7
@wordpress/edit-widgets@1.1.7
@wordpress/editor@9.24.6
@wordpress/format-library@1.25.6
@wordpress/interface@0.10.7
@wordpress/list-reusable-blocks@1.24.4
@wordpress/nux@3.23.4
@wordpress/reusable-blocks@1.0.6
@wordpress/server-side-render@1.19.4

Fixes #52391.

Props gziolo, whyisjake.


git-svn-id: https://develop.svn.wordpress.org/branches/5.6@50061 602fd350-edb4-49c9-b593-d223f7449a82
2021-01-28 18:20:27 +00:00
Jake Spurlock
80a12dcf3a Site Health: Update the language around how PHP should be updated.
Follow-up to [50042].

This is a backport of [50058] to the 5.6 branch.

Props SergeyBiryukov.

See #52327.


git-svn-id: https://develop.svn.wordpress.org/branches/5.6@50059 602fd350-edb4-49c9-b593-d223f7449a82
2021-01-28 17:23:18 +00:00
Sergey Biryukov
f843120254 Privacy: Add newlines to the index.php file in wp-personal-data-exports directory, for consistency with other similar files.
Follow-up to [50037].

Merges [50055] to the 5.6 branch.
See #52299.

git-svn-id: https://develop.svn.wordpress.org/branches/5.6@50056 602fd350-edb4-49c9-b593-d223f7449a82
2021-01-28 12:59:37 +00:00
Sergey Biryukov
cf52c346a1 Docs: Update documentation for wp_is_site_protected_by_basic_auth() per the documentation standards.
Follow-up to [49752], [50006].

Merges [50053] to the 5.6 branch.
See #52066.

git-svn-id: https://develop.svn.wordpress.org/branches/5.6@50054 602fd350-edb4-49c9-b593-d223f7449a82
2021-01-28 11:05:23 +00:00
Sergey Biryukov
2cdfbbe50f Docs: Revert documentation change for wp_get_attachment_metadata().
This more accurately describes the behavior of the function, and is more consistent with the documentation for other post and attachment functions.

Follow-up to [50039].

Props Mista-Flo.
Merges [50051] to the 5.6 branch.
See #52196.

git-svn-id: https://develop.svn.wordpress.org/branches/5.6@50052 602fd350-edb4-49c9-b593-d223f7449a82
2021-01-28 10:41:52 +00:00
Sergey Biryukov
df535aed39 Coding Standards: Simplify a long condition in WP_Site_Health_Auto_Updates::test_wp_version_check_attached() for better readability.
Follow-up to [50035].

Merges [50049] to the 5.6 branch.
See #52135.

git-svn-id: https://develop.svn.wordpress.org/branches/5.6@50050 602fd350-edb4-49c9-b593-d223f7449a82
2021-01-28 10:36:45 +00:00
Jake Spurlock
3bf49fdece REST API: Only include the controller's own taxonomy in it's schema.
Previously, all taxonomies were incorrectly exposed as possible values.

This commit brings the changes from [49922] to the 5.6 branch.

Props johnbillion, TimothyBlynJacobs.

Fixes #51940.


git-svn-id: https://develop.svn.wordpress.org/branches/5.6@50047 602fd350-edb4-49c9-b593-d223f7449a82
2021-01-28 00:52:01 +00:00
Jake Spurlock
95634ef0f4 REST API: Fix fatal error on multisite when calling the single item plugin routes.
The `is_network_only_plugin` and `is_plugin_active` functions are not available in a front-end context and must be specifically loaded.

This commit brings the changes from [49952] to the 5.6 branch.

Props oakesjosh, johnbillion, TimothyBlynJacobs.

Fixes #52205.


git-svn-id: https://develop.svn.wordpress.org/branches/5.6@50046 602fd350-edb4-49c9-b593-d223f7449a82
2021-01-28 00:33:28 +00:00
Jake Spurlock
858410ad79 App Passwords: Only attempt auth if the username and password are set.
Previously, only the username was checked which caused a PHP warning in some server setups, for instance Shibboleth SSO, where the server only populates the PHP_AUTH_USER field.

This brings the changes from [49919] to the 5.6 branch.

Props MadtownLems, johnbillion, richard.tape, engahmeds3ed, TimothyBlynJacobs.

Fixes #52003.


git-svn-id: https://develop.svn.wordpress.org/branches/5.6@50045 602fd350-edb4-49c9-b593-d223f7449a82
2021-01-28 00:31:10 +00:00
Jake Spurlock
6e93d1059f App Passwords: Extract Basic Auth check into a reusable filterable function.
In [49752] a check was added to prevent creating new Application Passwords if Basic Auth credentials were detected to prevent conflicts. This check takes place in WP-Admin, though a conflict would only arise if Basic Auth was used on the website's front-end.

This commit extracts the Basic Auth check into a reusable function, wp_is_site_protected_by_basic_auth(), which can be adjusted using a filter of the same name. This way, a site that uses Basic Auth to protect WP-Admin can still use the Application Passwords feature.

In the future, instead of requiring the use of a filter, WordPress could make a loopback request and check for a WWW-Authenticate header to make this detection more robust out of the box.

This brings the changes from [50006] to the 5.6 branch.

Props SeBsZ, archon810, aaroncampbell, ocean90, SergeyBiryukov, TimothyBlynJacobs.

Fixes #52066.


git-svn-id: https://develop.svn.wordpress.org/branches/5.6@50044 602fd350-edb4-49c9-b593-d223f7449a82
2021-01-28 00:27:13 +00:00
Jake Spurlock
ff93d64727 Twenty Twenty-One: Make sure filtering attachment image attributes only affects front end and not the admin area.
This brings the changes from [49930] to the 5.6 branch.

Props denisco, SergeyBiryukov.

Fixes #52212.


git-svn-id: https://develop.svn.wordpress.org/branches/5.6@50043 602fd350-edb4-49c9-b593-d223f7449a82
2021-01-28 00:21:41 +00:00