Commit Graph

322 Commits

Author SHA1 Message Date
Adam Silverstein ae33c9414c REST API: JS Client - improve collection route construction for empty parents.
Fix an issue where the constructed path for hierarchical collections could contain a double slash ("//") when items contained empty parents, causing an error.

Props nicomollet.
Fixes #44745.


git-svn-id: https://develop.svn.wordpress.org/trunk@49390 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-29 18:30:41 +00:00
Jonathan Desrosiers cbcc595974 Themes: Ensure that only privileged users can set a background image when a theme is using the deprecated custom background page.
Props xknown, zieladam, peterwilsoncc, whyisjake.
Merges [49379] to trunk.

git-svn-id: https://develop.svn.wordpress.org/trunk@49388 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-29 18:06:18 +00:00
Sergey Biryukov 7e4debe75c Customize: Update parameter name in `api.Class.extend()`.
This makes the name consistent with the documentation and the `inherits()` function signature.

Props ribaricplusplus, davidbaumwald.
Fixes #51652.

git-svn-id: https://develop.svn.wordpress.org/trunk@49353 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-28 00:43:16 +00:00
Helen Hou-Sandi c36874264b External Libraries: Update jQuery Migrate to 3.3.2-pre.
This is a prerelease version to avoid some errors in 5.6 beta 2. We need to be sure that we ship with a released version by 5.6 RC.

Props mweichert.
Fixes #51621. See #50564.


git-svn-id: https://develop.svn.wordpress.org/trunk@49338 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-27 18:57:03 +00:00
Helen Hou-Sandi f293ae18b2 Login: Avoid AJAX error on login screen.
This has to do with the password generator, which does not need to generate and cache passwords in JS as that's already done in PHP.

Props adamsilverstein, sarahricker.
Fixes #51613.


git-svn-id: https://develop.svn.wordpress.org/trunk@49337 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-27 18:41:32 +00:00
Timothy Jacobs 0187bbdd7e Site Health, App Passwords: Test if the Authorization header is populated correctly.
App Passwords rely on the Authorization header to transport the Basic Auth credentials. For Apache web servers, WordPress automatically includes a RewriteRule to populate the value for servers running in CGI or FastCGI that wouldn't ordinarily populate the value. 

This tests if the header is being filled with the expected values. For Apache users, we direct the user to visit the Permalinks settings to flush their permalinks. For all other users, we direct them to a help document on developer.wordpress.org.

Props Clorith, marybaum, TimothyBlynJacobs.
Fixes #51638.


git-svn-id: https://develop.svn.wordpress.org/trunk@49334 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-27 18:30:03 +00:00
Andrew Ozz 1a0a55df8c Revert the improvenents to arranging of postboxes/metaboxes, [49179]. The current patch fixes about half a dozen problems, but seems more general improvements are needed to how Screen Options work.
See #50699.

git-svn-id: https://develop.svn.wordpress.org/trunk@49325 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-27 10:45:36 +00:00
Sergey Biryukov 89e10133e3 Customize: Ensure the New Menu section is properly rendered.
Follow-up to [30102], [49101].

Props david.binda, boldgrid, dlh, azaozz, Clorith, westonruter, hellofromTonya.
Fixes #51592.

git-svn-id: https://develop.svn.wordpress.org/trunk@49323 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-27 02:46:27 +00:00
Sergey Biryukov f13776cd8d General: Use correct value for the `speak` property in various CSS files.
Follow-up to [49263].

Props hareesh-pillai.
Fixes #51622.

git-svn-id: https://develop.svn.wordpress.org/trunk@49309 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-26 02:23:24 +00:00
Timothy Jacobs 5e31ccfee2 App Passwords: Improve accessibility.
- Make form inputs stacked instead of inline.
- Provide a visible label for the app name.
- Add screen reader text to dismiss button.
- Make "Revoke" button label more descriptive.
- Use aria-disabled instead of disabled to avoid focus loss.
- Display password in a readonly input to assist copy and paste.
- Remove large sections of italic text.
- Use `.form-wrap` and `.form-field` to give consistent form styling.
- Improve labeling and placeholder text.

Props alexstine, georgestephanis, afercia, TimothyBlynJacobs.
Fixes #51580.


git-svn-id: https://develop.svn.wordpress.org/trunk@49294 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-24 03:32:46 +00:00
Timothy Jacobs 1e85024fb4 App Passwords: Include site_url in the success redirect payload.
Props georgestephanis.
Fixes #51602.


git-svn-id: https://develop.svn.wordpress.org/trunk@49291 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-24 00:05:15 +00:00
Sergey Biryukov c7cd21f153 Privacy: Use more appropriate verbiage when downloading personal data export file from a row action.
Props garrett-eclipse, bridgetwillard.
Fixes #49319.

git-svn-id: https://develop.svn.wordpress.org/trunk@49289 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-23 19:32:01 +00:00
Helen Hou-Sandi e515d61ec0 Administration: Unify search results message on list tables.
This wraps the search string in a `<strong>` tag, which makes easier to parse visually especially when your search string also contains double quotes.

Props Mista-Flo, mapk, sergeybiryukov.
Fixes #37353.


git-svn-id: https://develop.svn.wordpress.org/trunk@49284 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-23 15:59:34 +00:00
Timothy Jacobs fe2053f2c1 App Passwords: Support an app_id to uniquely identify instances of an app.
Apps may now optionally include an `app_id` parameter when directing the user to the Authorize Application screen. This allows for instances of an application to be identified and potentially revoked or blocked.

Props TimothyBlynJacobs, georgestephanis.
Fixes #51583.


git-svn-id: https://develop.svn.wordpress.org/trunk@49276 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-22 15:04:23 +00:00
Adam Silverstein b07e0b2cfa Users: improve password generation feature.
On the user edit screen improve handling and clarify language: rename the "Generate Password" and "Show password" buttons to "Set New Password". Clicking it always generates a password. Also: improve inline code comments and descriptions.

Props afercia, bookdude13, michaelarestad, pento.
Fixes #42852.



git-svn-id: https://develop.svn.wordpress.org/trunk@49248 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-20 18:24:40 +00:00
Sergey Biryukov d86bda1180 Administration: Remove obsolete `.ac_results` class references.
Core does not use the jQuery.suggest plugin since [38797].

Props afercia, hareesh-pillai, garrett-eclipse.
Fixes #40260.

git-svn-id: https://develop.svn.wordpress.org/trunk@49213 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-19 22:31:08 +00:00
Sergey Biryukov 1ca7bc6718 Embeds: Only catch clicks from the primary mouse button in the click handler, without any modifier keys.
This ensures that Ctrl/Cmd + click to open a link in the embed iframe in a new tab works as expected.

Props timhavinga, garrett-eclipse, smerriman, swissspidy, johnbillion, Mte90, iandunn, azaozz, afercia, audrasjb, SergeyBiryukov.
Fixes #39097.

git-svn-id: https://develop.svn.wordpress.org/trunk@49202 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-19 13:34:03 +00:00
John Blackbourn d51fc4b06c Media: Add an audio and video player to the media manager modal.
This introduces a means of playing existing audio and video files while browsing them prior to selecting them for use.

Props antpb, Mista-Flo, garrett-eclipse, mapk

Fixes #43640


git-svn-id: https://develop.svn.wordpress.org/trunk@49195 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-18 17:37:19 +00:00
Sergey Biryukov 7164e4b4c8 Comments: Hide the link to the initial parent comment in the reply heading when replying to another comment.
This ensures that the reply heading is updated correctly on single post URLs with the `?replytocom` query argument.

Follow-up to [47506], [48876], [48904].

Props mailnew2ster, wpamitkumar, audrasjb, desrosj, SergeyBiryukov.
Fixes #51175.

git-svn-id: https://develop.svn.wordpress.org/trunk@49187 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-18 06:39:21 +00:00
John Blackbourn b1833128fe Administration: Fix a coding standards issue after [49179].
See #50699


git-svn-id: https://develop.svn.wordpress.org/trunk@49180 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-17 12:32:45 +00:00
Andrew Ozz 6a2ef2d5b2 Fix and improve arranging of postboxes/metaboxes:
- Enable arranging only when the Screen Options tab is open.
- Prevent accidental/unintended dragging. Seen it happen mostly on laptops when using the mousepad/trackpad.
- Improve discoverability and usefulness by always showing the "drop zones" outline when postboxes are draggable/arrangeable.
- Add some (brief) explanation to the Screen Options tab helping the user understand what options are available and how to change them. This is especially helpful for screen reader users to give an idea how to use the screen options and what to expect.
- Fix/enhance some of the code in `postbox.js` and make it coding standards compliant.

See #50699.

git-svn-id: https://develop.svn.wordpress.org/trunk@49179 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-17 09:58:34 +00:00
Timothy Jacobs efe06cdcea Site Health, REST API: Move async tests to REST API endpoints.
This provides more flexibility when writing tests and benefits from running in a front-end context which is necessary for some tests like checking that updates are supported. Additionally, this provides a more robust interface for developers who want to integrate with Site Health tests.

Because the `wp/v2` endpoint is reserved for modeling core entities, site health is registered in its own `wp-site-health/v1` namespace.

The existing ajax actions have been maintained for backward compatibility.

Props Clorith, chrisvanpatten, afragen, pokhriyal, TimothyBlynJacobs.
Fixes #48105.


git-svn-id: https://develop.svn.wordpress.org/trunk@49154 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-15 01:58:28 +00:00
Ian Dunn 52f2d0db81 Community Events: Update timezone-related `@since` tags to `5.5.2`.
r49145 and r49146 were originally planned for 5.6 when they were committed, but are now planned for 5.5.2.

See #51130.


git-svn-id: https://develop.svn.wordpress.org/trunk@49152 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-14 21:33:10 +00:00
Dominik Schilling d0ec93f293 I18N: Use `wp.i18n` for translatable strings in `wp-admin/js/dashboard.js`.
* Deprecate the `l10n` property on `communityEventsData`.
* Introduce `version` parameter for `deprecateL10nObject` and backfill the version for deprecated objects in 5.5.0.
* Add a noop version of `deprecateL10nObject` for QUnit testing.

Fixes #51498.

git-svn-id: https://develop.svn.wordpress.org/trunk@49151 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-14 21:11:09 +00:00
Ian Dunn 92aa799e89 Community Events: Display dates and times in the user's time zone.
Fixes #51130
Props sippis, hlashbrooke, audrasjb, Rarst, iandunn


git-svn-id: https://develop.svn.wordpress.org/trunk@49146 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-14 18:19:43 +00:00
Sergey Biryukov de89e7292e Administration: Make sure list table row actions in Extended view stay visible when a single row gets focus.
Follow-up to [48398], [48423], [48424], [48450], [48670].

Props ryelle.
Fixes #51516. See #49715.

git-svn-id: https://develop.svn.wordpress.org/trunk@49142 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-14 02:01:00 +00:00
Timothy Jacobs 9f502abafd REST API: Add HTTP/1.0 emulation to wp.apiRequest().
This allows for making REST API calls with the PUT and DELETE HTTP methods that may be blocked or unsupported by some server configurations.

Props yakimun.
Fixes #43605.


git-svn-id: https://develop.svn.wordpress.org/trunk@49133 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-12 20:09:14 +00:00
Adam Silverstein 4f3c9c1f30 Users: prevent saving empty passwords, trim space from password ends on save.
Fix an issue where users could save a password with only spaces, or spaces at the beginning or end of their password, preventing them from logging in.

Props ronakganatra, 1naveengiri, ajensen, oolleegg55, bookdude13, nrqsnchz, aristath.
Fixes #42766.



git-svn-id: https://develop.svn.wordpress.org/trunk@49118 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-10 16:49:35 +00:00
TimothyBlynJacobs 1856d0fe2a REST API: Introduce Application Passwords for API authentication.
In WordPress 4.4 the REST API was first introduced. A few releases later in WordPress 4.7, the Content API endpoints were added, paving the way for Gutenberg and countless in-site experiences. In the intervening years, numerous plugins have built on top of the REST API. Many developers shared a common frustration, the lack of external authentication to the REST API.

This commit introduces Application Passwords to allow users to connect to external applications to their WordPress website. Users can generate individual passwords for each application, allowing for easy revocation and activity monitoring. An authorization flow is introduced to make the connection flow simple for users and application developers.

Application Passwords uses Basic Authentication, and by default is only available over an SSL connection.

Props georgestephanis, kasparsd, timothyblynjacobs, afercia, akkspro, andraganescu, arippberger, aristath, austyfrosty, ayesh, batmoo, bradyvercher, brianhenryie, helen, ipstenu, jeffmatson, jeffpaul, joostdevalk, joshlevinson, kadamwhite, kjbenk, koke, michael-arestad, Otto42, pekz0r, salzano, spacedmonkey, valendesigns.
Fixes #42790.


git-svn-id: https://develop.svn.wordpress.org/trunk@49109 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-08 22:12:02 +00:00
Andrew Ozz 9c50d3dda5 Update jQuery step two:
- Add jquery-migrate.js v.3.3.1 to core and load it in debug mode when `SCRIPT_DEBUG` is true.
- Add jquery.min.js, update jquery.js to 3.5.1 non-minified. This should help when debugging.
- Rebuild jQuery UI 1.12.1 and add it to core.
- Fix/adjust tests to match the above changes.

See #50564.

git-svn-id: https://develop.svn.wordpress.org/trunk@49101 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-07 16:31:53 +00:00
Sergey Biryukov 39a2ad729a Coding Standards: Add missing space in `js/_enqueues/lib/comment-reply.js`.
Props saqibameen, hareesh-pillai, imath, davidbaumwald.
Fixes #43907.

git-svn-id: https://develop.svn.wordpress.org/trunk@49097 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-07 10:36:11 +00:00
Adam Silverstein 540b331096 Media: clear inputs after cropping on attachment details screen.
Clear the crop selection input fields after the crop action is complete. 
Fixes unexpected re-cropping behavior if the crop button was clicked more than once.

Props davidbinda.
Fixes #30155.



git-svn-id: https://develop.svn.wordpress.org/trunk@49087 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-02 15:09:46 +00:00
Sergey Biryukov 8e3636b0d6 Docs: Fix typos in some DocBlocks in `js/_enqueues/wp/api.js`.
Additionally, rename a variable for clarity.

Props mukesh27.
Fixes #51420.

git-svn-id: https://develop.svn.wordpress.org/trunk@49075 602fd350-edb4-49c9-b593-d223f7449a82
2020-09-30 13:52:24 +00:00
Jonathan Desrosiers 6d786bb311 External Libraries: Update MediaElementJS to version 4.2.16.
This change brings a handful of bug fixes made since the previous update in [46436]. For a full list of changes included, see https://github.com/mediaelement/mediaelement/compare/4.2.13...4.2.16.

Props mukesh27, hareesh-pillai, SergeyBiryukov.
Fixes #51315.

git-svn-id: https://develop.svn.wordpress.org/trunk@49070 602fd350-edb4-49c9-b593-d223f7449a82
2020-09-29 15:51:48 +00:00
Sergey Biryukov 0432229195 Docs: Correct formatting for the `autosave()` function return value in `js/_enqueues/wp/autosave.js`.
Props dilipbheda, mukesh27.
Fixes #51401.

git-svn-id: https://develop.svn.wordpress.org/trunk@49065 602fd350-edb4-49c9-b593-d223f7449a82
2020-09-28 10:45:01 +00:00
Sergey Biryukov 7b64dc237a Media: Check if the item is defined before setting the `skipHistory` property in media frame router.
This avoids a JS error when refreshing the "Attachment details" modal for an item that is not currently queried.

Follow-up to [41021].

Props Mista-Flo, mukesh27.
Fixes #51395.

git-svn-id: https://develop.svn.wordpress.org/trunk@49062 602fd350-edb4-49c9-b593-d223f7449a82
2020-09-27 08:48:05 +00:00
SergeyBiryukov c729e4d732 Docs: Fix typo in a comment in `js/media/routers/manage.js`.
Props mukesh27, garrett-eclipse.
Fixes #51397.

git-svn-id: https://develop.svn.wordpress.org/trunk@49058 602fd350-edb4-49c9-b593-d223f7449a82
2020-09-27 07:36:02 +00:00
Anthony Burchell 7da52b8eae Media: Allow contextually generated images to show in Media Library grid view.
In grid view, contextually generated or cropped media is filtered out causing page numbering to be offset and incorrect. This also impacted any media utilizing `media-models.js`.
Props webmandesign, audrasjb, afercia, pbiron, mista-flo.
Fixes #46127, #50410, #47215.



git-svn-id: https://develop.svn.wordpress.org/trunk@48989 602fd350-edb4-49c9-b593-d223f7449a82
2020-09-17 14:40:47 +00:00
Sergey Biryukov 23528d419a Script Loader: Add backward compatibility for JavaScript i18n globals and properties deprecated in WordPress 5.5.
The recommended approach for any plugins using these globals or properties is to switch to the newer `wp.i18n` functions.

In the meantime, this ensures that accessing any of these globals does not break the rest of the code on the page, and an appropriate warning message is logged to the JavaScript console.

Follow-up to: https://core.trac.wordpress.org/query?summary=~wp.i18n&milestone=5.5

Props omarreiss, peterwilsoncc, kbjohnson90, johnbillion, TimothyBlynJacobs, joostdevalk, ocean90, desrosj, SergeyBiryukov.
Fixes #51123.

git-svn-id: https://develop.svn.wordpress.org/trunk@48923 602fd350-edb4-49c9-b593-d223f7449a82
2020-08-31 20:28:41 +00:00
Sergey Biryukov 673fcd7927 Comments: Check if reply heading text node exists before accessing its property in `comment-reply.js`.
Follow-up to [47506], [48876].

Props johannadevos, mailnew2ster.
Fixes #38009.

git-svn-id: https://develop.svn.wordpress.org/trunk@48904 602fd350-edb4-49c9-b593-d223f7449a82
2020-08-28 13:10:29 +00:00
Sergey Biryukov 3066546426 Comments: Correct the check for reply element existence in `comment-reply.js`.
`document.getElementById()` returns `null` if no matching element was found, so the previous comparison didn't work as expected.

Follow-up to [47506].

Props mailnew2ster, sarahricker.
Fixes #38009.

git-svn-id: https://develop.svn.wordpress.org/trunk@48876 602fd350-edb4-49c9-b593-d223f7449a82
2020-08-27 01:56:39 +00:00
Andrea Fercia 48837a340d Accessibility: Administration: Address backward compatibility concerns for the sortable postboxes areas after [48340].
Fixes #49288.


git-svn-id: https://develop.svn.wordpress.org/trunk@48717 602fd350-edb4-49c9-b593-d223f7449a82
2020-08-04 13:15:52 +00:00
Jake Spurlock 20ac5dd62d Upgrade/Install: Only show auto-update for themes that support the feature.
Similar to the changes for plugins in [48669], let's only show the UI for themes when updates are supported for that theme.

See #50280.
Props dd32.


git-svn-id: https://develop.svn.wordpress.org/trunk@48688 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-29 19:59:30 +00:00
Sergey Biryukov 72dfc468c5 Docs: Correct alignment for some parameters in JS documentation.
Follow-up to [48650].

See #43828.

git-svn-id: https://develop.svn.wordpress.org/trunk@48651 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-28 00:05:59 +00:00
Jake Spurlock 9ed92faaca Build/Test Tools: Enable JSDocs to be linted with ESLint.
As part of the [Javascript Inline Docs Initiative](https://make.wordpress.org/core/handbook/docs/inline/js/) this add some tooling to lint Javascript docblocks. Two new commands:

* `npm run lint:jsdoc`
* `npm run lint:jsdoc:fix`

The latter will run the linter and try to fix an possible issues automatically.

Fixes #43828.
Props netweb, atimmer, kamataryo, whyisjake.



git-svn-id: https://develop.svn.wordpress.org/trunk@48650 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-27 23:33:51 +00:00
Sergey Biryukov 1120269124 I18N: Further adjust some update/install strings for consistency.
Follow-up to [48568], [48569].

See #50708, #50714.

git-svn-id: https://develop.svn.wordpress.org/trunk@48589 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-23 21:06:26 +00:00
Jake Spurlock f976a73997 i18n: Merge similar translation strings to "Update failed".
Fixes #50714.
Props ramiy, ocean90.


git-svn-id: https://develop.svn.wordpress.org/trunk@48569 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-22 22:08:25 +00:00
Jake Spurlock 2c617a48f5 I18N: Merge similar "Installation failed" strings
Fixes #50708.

Props ramiy, ocean90, audrasjb.


git-svn-id: https://develop.svn.wordpress.org/trunk@48568 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-22 21:57:19 +00:00
Jake Spurlock 00f4e4f6e9 I18N: Update some strings to have periods.
Fixes #50707.
Props ramiy, afercia, audrasjb.


git-svn-id: https://develop.svn.wordpress.org/trunk@48567 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-22 21:53:22 +00:00
Sergey Biryukov 5674e7e085 I18N: Add context to some plugin and theme strings for consistency.
Props ramiy, audrasjb.
Fixes #50710.

git-svn-id: https://develop.svn.wordpress.org/trunk@48520 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-20 23:12:33 +00:00