Commit Graph

40048 Commits

Author SHA1 Message Date
K. Adam White eb468c4446 REST API: Cache results of get_item_schema on controller instances for performance.
Caches the output of get_item_schema() to avoid redundant recomputation of translatable strings and other computed values. This method is called many times per item in each REST request, and the results of the method should not vary between calls.
Additional schema fields are not cached.

Props kadamwhite, joehoyle, TimothyBlynJacobs.
Fixes #47871.


git-svn-id: https://develop.svn.wordpress.org/trunk@45811 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-15 21:08:05 +00:00
K. Adam White 94b8a122c4 REST API: Clarify arguments passed to rest route get & update callbacks.
Update doc block argument definitions to clarify that the REST API always passes an array to the `get_callback` and always passes an entity object to the `update_callback`.

Props TimothyBlynJacobs, salzano.
Fixes #44432.



git-svn-id: https://develop.svn.wordpress.org/trunk@45810 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-15 20:03:18 +00:00
K. Adam White 80e44e49e2 REST API: Do not send response body if status is 204 or body is null.
Status code 204 should indicate no response body is sent. Previously, a "null" string was sent, which MacOS Safari would try to parse as JSON and thereby fail to complete the request.

Props TimothyBlynJacobs, andizer, matthias.thiel.
Fixes #43691.



git-svn-id: https://develop.svn.wordpress.org/trunk@45809 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-15 19:55:13 +00:00
K. Adam White 22480c035b REST API: Add test class file incorrectly omitted from [45807].
Props @TimothyBlynJacobs.
See #43392.


git-svn-id: https://develop.svn.wordpress.org/trunk@45808 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-15 17:20:02 +00:00
K. Adam White c92ef7c441 REST API: Support 'object' and 'array' types in register_meta() schemas.
Extends meta registration to support complex schema values, mirroring the functionality in the settings controller.
Error when trying to modify a meta key containing schema-nonconformant data.

Props @TimothyBlynJacobs, @birgire, @mnelson4, @flixos90.
Fixes #43392.



git-svn-id: https://develop.svn.wordpress.org/trunk@45807 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-15 17:16:21 +00:00
Sergey Biryukov a636529b7c Users: When deleting users, exclude the current user from the content existence check.
The current user cannot be deleted, so the check is redundant in that context and should only be done for other users.

Props mt8.biz, SergeyBiryukov.
Fixes #47851.

git-svn-id: https://develop.svn.wordpress.org/trunk@45806 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-15 13:05:39 +00:00
Gary Pendergast 9c3fb72719 Schema: Add an index to `wp_options.autoload`.
Most sites will be unaffected by this change, but those with a large number of rows in `wp_options`, only a small number of which have `autoload` set, will see a significant performance improvement.

Sites with a large number of rows in `wp_options`, with many of them having `autoload` set will unfortunately see a performance penalty on top of the already very slow queries they're running, but this should be the minority of cases.

Props DanBUK.
Fixes #24044.


git-svn-id: https://develop.svn.wordpress.org/trunk@45805 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-15 07:12:04 +00:00
Sergey Biryukov e982455e44 Networks and Sites: Trim site domain when creating a new site on Add New Site screen before further validation.
Props dharmin16, jeremyfelt, aubreypwd.
Fixes #44808.

git-svn-id: https://develop.svn.wordpress.org/trunk@45804 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-15 01:20:52 +00:00
Sergey Biryukov 4f86944a09 Docs: Add missing `@since` tag for `WP_Site_Health::has_late_cron()`.
See #47223.

git-svn-id: https://develop.svn.wordpress.org/trunk@45803 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-15 00:41:25 +00:00
Peter Wilson 0d2b94a44a Site Health Check: New tests file missed in [45801].
git-svn-id: https://develop.svn.wordpress.org/trunk@45802 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-15 00:36:38 +00:00
Peter Wilson f29952ab74 Site Health Check: Increase time allowance for cron checks.
Introduces `WP_Site_Health::has_late_cron()` for late wp-cron jobs and extends the time allowance before a job is considered missed.

In a standard configuration using loopback requests, a job is considered late once past due and missed over five minutes past due.

Late and missed time frames are extended if `DISABLE_WP_CRON` is defined as `true` to allow for crontab tasks running less frequently. A job is considered late once it's 15 minutes past due and missed over one hour past due.

A file for site health unit tests has been introduced with tests for cron in critical, late and missed states.

Props rockfire, afragen, peterwilsoncc.
Fixes #47223.


git-svn-id: https://develop.svn.wordpress.org/trunk@45801 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-15 00:34:53 +00:00
Gary Pendergast f756d801d8 Build Tools: Change the PHPUnit Docker image's working directory to match the other images.
Also, pass the `WP_MULTISITE` environment variable along to the container.

See #47767.



git-svn-id: https://develop.svn.wordpress.org/trunk@45800 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-15 00:33:32 +00:00
Gary Pendergast da411cd17a Build Tools: Run `composer` commands in a Docker container on Travis.
This tidies up the `.travis.yml` file a little more.

See #47767.



git-svn-id: https://develop.svn.wordpress.org/trunk@45799 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-14 23:11:39 +00:00
Sergey Biryukov a2a28e4608 Widgets: Allow for short-circuiting widget output in `the_widget()` using the `widget_display_callback` filter, for consistency with output via a registered sidebar.
Props MarcGuay, donmhico.
Fixes #34226.

git-svn-id: https://develop.svn.wordpress.org/trunk@45798 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-14 23:02:25 +00:00
Sergey Biryukov 1177e1212f Docs: Correct type for `query_var` argument of `register_taxonomy()`.
Props juiiee8487, audrasjb.
Fixes #47877.

git-svn-id: https://develop.svn.wordpress.org/trunk@45797 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-14 17:46:20 +00:00
Sergey Biryukov a58eb86d5e Posts, Post Types: In `wp_trim_words()` make sure the `$num_words` parameter is always an integer, as documented, to avoid a PHP warning.
Props donmhico, pikamander2.
Fixes #47867.

git-svn-id: https://develop.svn.wordpress.org/trunk@45796 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-14 17:17:51 +00:00
Sergey Biryukov d4a305292f Users: Make `wp_list_authors()` unit tests more readable.
See #23498.

git-svn-id: https://develop.svn.wordpress.org/trunk@45795 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-14 15:35:19 +00:00
Sergey Biryukov 5bcd25ac0a Networks and Sites: Improve documentation and variable naming in `switch_to_blog()` and `restore_current_blog()`.
In `switch_to_blog()`:

* Rename `$blog_id` to `$prev_blog_id` for clarity.
* Rename `$new_blog` to `$new_blog_id` for consistency.
* Pass `$prev_blog_id` as a second parameter to `switch_blog` action, instead of the duplicated `$new_blog_id`. This only clarifies documentation and does not affect functionality, since the values are equal in the context where the DocBlock is located.

In `restore_current_blog()`:

* Rename `$blog` to `$new_blog_id` for clarity.
* Rename `$blog_id` to `$prev_blog_id` for clarity.

Props ChriCo, jeremyfelt, SergeyBiryukov.
Fixes #45594.

git-svn-id: https://develop.svn.wordpress.org/trunk@45794 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-14 14:28:52 +00:00
Sergey Biryukov 94f4dcd15a Plugins: Adjust the pause before running plugin search AJAX request on "Add Plugins" screen to allow more time for using browser's autocomplete.
Props donmhico, apermo.
Fixes #46021.

git-svn-id: https://develop.svn.wordpress.org/trunk@45793 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-14 02:01:26 +00:00
Sergey Biryukov e196360f8c Coding Standards: Fix JSHint error in [45790].
See #41545.

git-svn-id: https://develop.svn.wordpress.org/trunk@45792 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-14 00:01:40 +00:00
Sergey Biryukov ee1159c4fe Site Health: Simplify the language in Status Health Info page introduction, add a link to Status page.
Props birgire, mukesh27, subrataemfluence, leogermani.
Fixes #46946.

git-svn-id: https://develop.svn.wordpress.org/trunk@45791 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-13 23:34:53 +00:00
Adam Silverstein 98255d4720 Comments: enable typing cmd/ctrl-enter to submit comment forms.
Add a key handler on the comment form that detects the cmd/ctrl-enter key press and submits the comment form. 

Props xyfi, Lindstromer, helen, splitti.
Fixes #41545.



git-svn-id: https://develop.svn.wordpress.org/trunk@45790 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-13 21:25:57 +00:00
Andrew Ozz 9a20a07304 Remove trailing white space in upgrade.php.
See #46349.

git-svn-id: https://develop.svn.wordpress.org/trunk@45789 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-13 19:52:50 +00:00
Andrew Ozz 6dad32d2ae Admin email verification:
- Add the `admin_email_lifespan` option when installing. Fixes a bug where the verification screen is shown right after installation.
- Reset the same option when upgrading and the user doing the DB upgrade is not an admin. This will ensure the email verification is shown next time an admin logs in.
- Use `site_url()` instead of `network_site_url()` for the form action. The latter seems needed only for password reset.

See #46349.

git-svn-id: https://develop.svn.wordpress.org/trunk@45788 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-13 17:39:06 +00:00
Peter Wilson feb0830c79 Comments: Include post permalink in comment reply link.
Include the post's permalink when generating reply links in `get_comment_reply_link()` to account for comments displayed on index and archive pages.

This reapplies [32786] which was inadvertently reverted in [42360].

Props justinahinon, donmhico.
See #33383.
Fixes #47174.


git-svn-id: https://develop.svn.wordpress.org/trunk@45787 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-13 05:08:14 +00:00
K. Adam White 3d53fdba73 Docs: Clarify custom-fields support requirement for viewing custom post meta in REST API.
Fixes #47866.


git-svn-id: https://develop.svn.wordpress.org/trunk@45786 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-13 01:51:00 +00:00
Gary Pendergast 457a57af83 Build Tools: Remove the old `docker-compose.yml` file, now no longer used.
See #47767.



git-svn-id: https://develop.svn.wordpress.org/trunk@45785 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-12 09:22:00 +00:00
Gary Pendergast 4311bac7e4 Build Tools: Add the `docker-compose.yml` file, missed in [45783].
See #47767.



git-svn-id: https://develop.svn.wordpress.org/trunk@45784 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-12 09:20:06 +00:00
Gary Pendergast 13d356691b Build Tools: Miscellaneous `local-env` improvements.
- Move the functionality for controlling `local-env` out of `package.json`, into JS scripts.
- Merge the `docker-compose` config files, and move it to the root directory. This allows `docker-compose.override.yml` to work for local overrides.
- Fix nginx redirecting to port 80 under some circumstances.
- `npm run env:install` now creates `wp-tests.config.php` for you.
- Cleaned up a bunch of cruft in `.travis.yml`.

See #47767.



git-svn-id: https://develop.svn.wordpress.org/trunk@45783 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-12 08:28:33 +00:00
Sergey Biryukov 83eb411e27 Site Health: Add database charset and collation information to debug info.
Props sharaz, Clorith, SergeyBiryukov.
Fixes #47828.

git-svn-id: https://develop.svn.wordpress.org/trunk@45782 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-12 01:53:17 +00:00
Sergey Biryukov c76271c49a Docs: Improve documentation for various feed link functions and filters.
Props atachibana, SergeyBiryukov.
Fixes #47862.

git-svn-id: https://develop.svn.wordpress.org/trunk@45781 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-11 17:20:51 +00:00
Sergey Biryukov 64eeedee46 Docs: Improve documentation for `get_last_updated()`.
Props atachibana.
Fixes #47861.

git-svn-id: https://develop.svn.wordpress.org/trunk@45780 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-11 16:17:16 +00:00
Sergey Biryukov 26592196e0 Docs: Improve documentation for `get_page_by_title()`.
Props atachibana.
Fixes #47860.

git-svn-id: https://develop.svn.wordpress.org/trunk@45779 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-11 12:41:34 +00:00
Sergey Biryukov 6ca6c447b9 Docs: Document the `show_split_view` argument for `wp_text_diff()`.
Convert `$args` array documentation to hash notation.

Props riddhiehta02, jeremyfelt, SergeyBiryukov.
Fixes #47224.

git-svn-id: https://develop.svn.wordpress.org/trunk@45778 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-10 22:27:02 +00:00
Jake Spurlock f88cc8aaa7 Widgets: Replace http with https in the link placeholder widget image
The existing placeholder can make the user think that they must use http. We should encourage the use of https. 
Also, the block editor uses https for its placeholders. Let's add some consistency.

Props Chaton666, audrasjb, mukesh27.
Fixes #46320.


git-svn-id: https://develop.svn.wordpress.org/trunk@45777 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-09 17:05:13 +00:00
Sergey Biryukov 4513c3f009 Twenty Sixteen: Correct HelpHub URL in `readme.txt`.
See #47771.

git-svn-id: https://develop.svn.wordpress.org/trunk@45776 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-09 13:52:49 +00:00
Sergey Biryukov 5b2c4b5a53 Twenty Nineteen: Add missing `Installation` section to `readme.txt`, for consistency with other themes.
See #47857.

git-svn-id: https://develop.svn.wordpress.org/trunk@45775 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-09 13:41:38 +00:00
Sergey Biryukov 570cadf0d9 Twenty Nineteen: Add missing copyright information.
Props poena, kjellr.
Fixes #47857.

git-svn-id: https://develop.svn.wordpress.org/trunk@45774 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-09 13:35:57 +00:00
Sergey Biryukov 18632fbf8d Twenty Nineteen: Correct license URI.
Props munyagu, shital-patel.
Fixes #47850.

git-svn-id: https://develop.svn.wordpress.org/trunk@45773 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-09 02:56:40 +00:00
Gary Pendergast 72529b3deb Feeds: Introduce the `get_self_link()` function.
Corresponds to the `self_link()` template function.

This matches other feed template functions, using one function to get the value, and a different function to echo it.

Props jojotjebaby, mobeen-abdullah, donmhico, audrasjb, dshanske.
Fixes #44838.



git-svn-id: https://develop.svn.wordpress.org/trunk@45772 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-09 01:30:32 +00:00
Sergey Biryukov 739bc58d13 REST API: In `get_rest_url()`, check if `$_SERVER['SERVER_NAME']` is set to avoid a PHP warning in CLI context.
Props paulschreiber.
Fixes #47854.

git-svn-id: https://develop.svn.wordpress.org/trunk@45771 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-08 20:19:48 +00:00
Sergey Biryukov 3008781746 Bootstrap/Load: Change "Insufficient Requirements" `wp_die()` heading to "Requirements Not Met", which is more appropriate for the context it's used in.
Props yoavf.
Fixes #47575.

git-svn-id: https://develop.svn.wordpress.org/trunk@45770 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-08 12:53:21 +00:00
Gary Pendergast c645936163 Emoji: Upgrade Twemoji to 12.1.2.
This upgrade adds support for the transgender flag: 🏳️‍⚧️

There's some additional housekeeping in this commit:

- Twemoji recently rearranged their repository and package, so `Gruntfile.js` needed tweaking to allow for that.
- As only new files were added in this Twemoji release, the CDN version didn't need updating.

Fixes #47852.



git-svn-id: https://develop.svn.wordpress.org/trunk@45769 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-08 04:04:15 +00:00
Sergey Biryukov 0d9ec05d2c Bundled Themes: Audit and update version numbers passed to `wp_enqueue_script()` to ensure proper cache busting.
Props dswebsme, ianbelanger, justinahinon.
Fixes #46981.

git-svn-id: https://develop.svn.wordpress.org/trunk@45768 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-08 01:28:26 +00:00
Sergey Biryukov e58b5f1c7f Bundled Themes: Audit and update version numbers passed to `wp_enqueue_style()` to ensure proper cache busting.
Props dswebsme, ianbelanger, desrosj.
Fixes #46979.

git-svn-id: https://develop.svn.wordpress.org/trunk@45767 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-08 01:24:32 +00:00
Sergey Biryukov 98642e4893 Administration: Show a warning in Reading Settings when a Privacy Policy page is accidentally set as a Homepage or Posts page.
Props garrett-eclipse, subrataemfluence.
Fixes #46831.

git-svn-id: https://develop.svn.wordpress.org/trunk@45766 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-07 23:02:43 +00:00
Aaron Jorbin 72d2ed8113 Bump grunt-patch-wordpress to 2.0.0
Fixes #47845
Props pento, kadamwhite, netweb, jorbin


git-svn-id: https://develop.svn.wordpress.org/trunk@45765 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-07 15:08:04 +00:00
Sergey Biryukov f57620a8d6 Twenty Seventeen: Correct height for a Button block without text.
Props ianbelanger, laurelfulford, nayana123.
Fixes #47414.

git-svn-id: https://develop.svn.wordpress.org/trunk@45764 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-07 11:56:04 +00:00
Sergey Biryukov e7c67d49c0 Twenty Eleven: Correct height for a Button block without text.
Props ianbelanger, laurelfulford, nayana123.
See #47414.

git-svn-id: https://develop.svn.wordpress.org/trunk@45763 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-07 11:55:46 +00:00
Gary Pendergast 4271f1aeca Build Tools: Switch all Travis PHPUnit jobs over to Docker-based PHP.
Additionally, there are a handful of related minor changes in this commit:
- `.travis.yml` has been tidied up a little.
- [45745] was incorrectly marking Travis jobs as passed when some PHPUnit runs failed.
- Add the `LOCAL_PHP_MEMCACHED` environment variable, for enabling Memcached.
- Add the `env:pull` NPM script, for refreshing Docker images.

See #47767.


git-svn-id: https://develop.svn.wordpress.org/trunk@45762 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-07 11:54:22 +00:00