Commit Graph

40307 Commits

Author SHA1 Message Date
K. Adam White
4bb45c674a Add @ticket annotations for [45812].
Props birgire.
See #43709.



git-svn-id: https://develop.svn.wordpress.org/trunk@45820 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-16 03:32:23 +00:00
Gary Pendergast
a100d0cf52 Build Tools: Improve local-env start behaviour under Docker Toolbox.
Docker Toolbox requires port forwarding to be configured, but generates error when trying to forward a port that's already been taken.

This change removes clashing port forwarding rules before adding our own.

See #47767.



git-svn-id: https://develop.svn.wordpress.org/trunk@45819 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-16 01:39:59 +00:00
Sergey Biryukov
f3241f4883 Administration: Replace legacy updated message type in add_settings_error() calls with success.
See #44640.

git-svn-id: https://develop.svn.wordpress.org/trunk@45818 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-16 00:38:42 +00:00
Sergey Biryukov
e961891e1b Taxonomy: In feed_links_extra() and get_the_archive_title(), make sure the queried taxonomy term exists before accessing its properties.
Props donmhico, truchot, zaantar.
Fixes #46420.

git-svn-id: https://develop.svn.wordpress.org/trunk@45817 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-16 00:23:40 +00:00
Sergey Biryukov
beb1d3a7b5 Coding Standards: In wlwmanifest_link(), use concatenation instead of commas for echo, for consistency with rsd_link() and the rest of core.
See #47632.

git-svn-id: https://develop.svn.wordpress.org/trunk@45816 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-16 00:20:58 +00:00
K. Adam White
5a98103567 REST API: Add @ticket annotation to test from [45813].
Props birgire.
See #42209.


git-svn-id: https://develop.svn.wordpress.org/trunk@45815 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-15 23:08:31 +00:00
Sergey Biryukov
7113ab1f51 Administration: In add_settings_error(), add warning and info as possible values for message type.
Account for these new values in `settings_errors()`, resulting in `notice-warning` and `notice-info` CSS classes.

Map legacy `error` and `updated` CSS classes to `notice-error` and `notice-success`.

Props donmhico, toddhalfpenny, flixos90, desrosj, javorszky, SergeyBiryukov.
Fixes #44640, #44941.

git-svn-id: https://develop.svn.wordpress.org/trunk@45814 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-15 23:00:38 +00:00
K. Adam White
d65b89c5e4 REST API: Always return post types list in taxonomies endpoint response as an array.
Prevents a non-sequential post type array such as [ 0 => 'post', 2 => 'page' ] from being improperly converted to an object in the taxonomy endpoint's response JSON.

Props TimothyBlynJacobs, birgire, spectacula.
Fixes #42209.


git-svn-id: https://develop.svn.wordpress.org/trunk@45813 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-15 22:11:07 +00:00
K. Adam White
8f100777e8 REST API: Prevent deletion of post revisions.
Allowing the client to delete revisions breaks the "audit trail" functionality. This is not allowed in WordPress and shouldn't be allowed through the API.
While not recommended, a plugin may opt-in to the previous behavior by setting a custom 'delete_post' capability for the revisions post type.

Props dlh, danielbachhuber, TimothyBlynJacobs, azaozz, kadamwhite.
Fixes #43709.



git-svn-id: https://develop.svn.wordpress.org/trunk@45812 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-15 22:00:49 +00:00
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