Commit Graph

38873 Commits

Author SHA1 Message Date
Felix Arntz
1e4088fc98 Bootstrap/Load: Introduce fatal error recovery mechanism allowing users to still log in to their admin dashboard.
This changeset introduces a `WP_Shutdown_Handler` class that detects fatal errors and which extension (plugin or theme) causes them. Such an error is then recorded, and an error message is displayed. Subsequently, in certain protected areas, for example the admin, the broken extension will be paused, ensuring that the website is still usable in the respective area. The major benefit is that this mechanism allows site owners to still log in to their website, to fix the problem by either disabling the extension or solving the bug and then resuming the extension.

Extensions are only paused in certain designated areas. The frontend for example stays unaffected, as it is impossible to know what pausing the extension would cause to be missing, so it might be preferrable to clearly see that the website is temporarily not accessible instead.

The fatal error recovery is especially important in scope of encouraging the switch to a maintained PHP version, as not necessarily every WordPress extension is compatible with all PHP versions. If problems occur now, non-technical site owners that do not have immediate access to the codebase are not locked out of their site and can at least temporarily solve the problem quickly.

Websites that have custom requirements in that regard can implement their own shutdown handler by adding a `shutdown-handler.php` drop-in that returns the handler instance to use, which must be based on a class that inherits `WP_Shutdown_Handler`. That handler will then be used in place of the default one.

Websites that would like to modify specifically the error template displayed in the frontend can add a `php-error.php` drop-in that works similarly to the existing `db-error.php` drop-in.

Props afragen, bradleyt, flixos90, ocean90, schlessera, SergeyBiryukov, spacedmonkey.
Fixes #44458.

Built from https://develop.svn.wordpress.org/trunk@44524


git-svn-id: http://core.svn.wordpress.org/trunk@44355 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-09 20:05:49 +00:00
Boone Gorges
811be4779e Taxonomy: Update @since annotations for meta_box_sanitize_cb arg.
Introduced in [42211].

Fixes #36514.
Built from https://develop.svn.wordpress.org/trunk@44519


git-svn-id: http://core.svn.wordpress.org/trunk@44350 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-09 15:11:48 +00:00
desrosj
04dff0e2a9 Docs: Update since annotations for adding LIKE comparisons with meta keys.
Previously introduced in [42768].

Fixes #42409.
Built from https://develop.svn.wordpress.org/trunk@44518


git-svn-id: http://core.svn.wordpress.org/trunk@44349 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-09 14:55:49 +00:00
Pascal Birchler
1224ebd0ac Build/Test Tools: Update .gitignore to exclude twentynineteen and twentysixteen.
Brings the list of bundled themes in `.gitignore` up to date.

Fixes #45474.

Built from https://develop.svn.wordpress.org/trunk@44517


git-svn-id: http://core.svn.wordpress.org/trunk@44348 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-09 13:45:49 +00:00
Pascal Birchler
9bcdc25145 Build/Test Tools: Fix coding standards issues after [44515] and [44514].
See #44494, #43743.

Built from https://develop.svn.wordpress.org/trunk@44516


git-svn-id: http://core.svn.wordpress.org/trunk@44347 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-09 12:37:49 +00:00
Pascal Birchler
8f5e0ae06c Taxonomy: Display term list table in full width if there is no edit form.
Makes sure there is no empty space when a user can manage terms but lacks the capability to edit terms.

Props mathieuhays, marcwieland95.
Fixes #43743.

Built from https://develop.svn.wordpress.org/trunk@44515


git-svn-id: http://core.svn.wordpress.org/trunk@44346 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-09 12:05:50 +00:00
Pascal Birchler
a595f8a525 I18N: Add option to hide en_US locale in wp_dropdown_languages().
Props danieltj for initial patch.
Fixes #44494.

Built from https://develop.svn.wordpress.org/trunk@44514


git-svn-id: http://core.svn.wordpress.org/trunk@44345 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-09 11:46:50 +00:00
Pascal Birchler
d32d061a5e Upgrade/Install: Prevent possible JavaScript error when updating translations.
Props Presskopp.
Fixes #39189.

Built from https://develop.svn.wordpress.org/trunk@44513


git-svn-id: http://core.svn.wordpress.org/trunk@44344 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-09 11:26:50 +00:00
Gary Pendergast
f57b25f447 Tests: Revert [44509].
This commit causes Travis to fail.

See #45863.

Built from https://develop.svn.wordpress.org/trunk@44512


git-svn-id: http://core.svn.wordpress.org/trunk@44343 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-09 11:14:51 +00:00
Pascal Birchler
3b0b49f900 Embeds: Fix typo introduced in [44484].
Props JustinSainton.
Fixes #45036.

Built from https://develop.svn.wordpress.org/trunk@44511


git-svn-id: http://core.svn.wordpress.org/trunk@44342 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-09 10:54:51 +00:00
Gary Pendergast
f9208ac14e Tests: Improve REST API tests for categories and tags.
Props birgire, SergeyBiryukov.
See #39122.
Fixes #45077.


Built from https://develop.svn.wordpress.org/trunk@44510


git-svn-id: http://core.svn.wordpress.org/trunk@44341 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-09 10:31:51 +00:00
Gary Pendergast
0062616aa7 Build/Tests: Default to running unit tests from src.
This is the actual commit, unlike [44508], which was not.

Props atimmer.
See #44492.
Fixes #45863.

Built from https://develop.svn.wordpress.org/trunk@44509


git-svn-id: http://core.svn.wordpress.org/trunk@44340 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-09 10:14:55 +00:00
Gary Pendergast
e0caaf7628 Build/Tests: Default to running unit tests from src.
This commit also defaults WP-CLI commands to running against `src`, too.


Props atimmer, pento.
See #44492.
Fixes #45863.


Built from https://develop.svn.wordpress.org/trunk@44508


git-svn-id: http://core.svn.wordpress.org/trunk@44339 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-09 10:10:51 +00:00
Dominik Schilling
6503f77539 Build/Tools: Fix typo in phpcs.xml.dist.
See #44366.
Built from https://develop.svn.wordpress.org/trunk@44507


git-svn-id: http://core.svn.wordpress.org/trunk@44338 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-09 10:02:53 +00:00
Gary Pendergast
9f25ea37c7 Filesystem: Improve wp_is_stream() performance.
Instead of turning the return value of `stream_get_wrappers()` into a regex to match the scheme, we can instead extract the scheme and search the return value of `stream_get_wrappers()`.

Props schlessera, swissspidy.
Fixes #45553.


Built from https://develop.svn.wordpress.org/trunk@44506


git-svn-id: http://core.svn.wordpress.org/trunk@44337 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-09 09:51:54 +00:00
Peter Wilson
184c501d5c Cron: Fix undefined variable notice.
Restore `$gmt_time` variable removed in error from [44483].

Props afragen.
Fixes #45870.


Built from https://develop.svn.wordpress.org/trunk@44505


git-svn-id: http://core.svn.wordpress.org/trunk@44336 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-09 08:37:51 +00:00
Gary Pendergast
f88769fc3b Block Editor: Obey the AUTOSAVE_INTERVAL constant.
Props youknowriad.
Fixes #45262.


Built from https://develop.svn.wordpress.org/trunk@44504


git-svn-id: http://core.svn.wordpress.org/trunk@44335 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-09 06:54:49 +00:00
Gary Pendergast
68f2d8f0af Docs: Correct the documentation for wp_list_authors().
The `exclude_admin` argument defaults to `true`, not `false`.

Props haruharuharuby.
Fixes #45120.


Built from https://develop.svn.wordpress.org/trunk@44503


git-svn-id: http://core.svn.wordpress.org/trunk@44334 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-09 06:52:50 +00:00
Gary Pendergast
21ff86cf43 Comments: Add new tests missed in [44499].
Props dshanske, birgire.
Fixes #44033.

Built from https://develop.svn.wordpress.org/trunk@44502


git-svn-id: http://core.svn.wordpress.org/trunk@44333 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-09 06:20:50 +00:00
Gary Pendergast
f9d879905d Docs: Document the $page_hook action.
Props johnbillion.
Fixes #43643.


Built from https://develop.svn.wordpress.org/trunk@44501


git-svn-id: http://core.svn.wordpress.org/trunk@44332 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-09 06:14:51 +00:00
Gary Pendergast
be127956e0 Bundled Themes: Run the pingback_url through esc_url().
Twenties Ten through Seventeen have been updated to properly escape the pingback URL. Twenty Nineteen is already escaping the URL.

Props soulseekah, sharaz.
Fixes #43717.


Built from https://develop.svn.wordpress.org/trunk@44500


git-svn-id: http://core.svn.wordpress.org/trunk@44331 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-09 06:11:51 +00:00
Gary Pendergast
eeac928d3b Comments: Add a new is_avatar_comment_type() function.
This function splits the `get_avatar_comment_types` filter out of `get_avatar_data()`.

Props dshanske, birgire.
Fixes #44033.


Built from https://develop.svn.wordpress.org/trunk@44499


git-svn-id: http://core.svn.wordpress.org/trunk@44330 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-09 06:00:51 +00:00
Gary Pendergast
05c1030151 Docs: Add docblocks to the members of WP_Widget_Form_Customize_Control.
Props subrataemfluence.
Fixes #44420.


Built from https://develop.svn.wordpress.org/trunk@44498


git-svn-id: http://core.svn.wordpress.org/trunk@44329 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-09 05:49:49 +00:00
Gary Pendergast
61dce1d422 Docs: Add docblocks for the PHPUnit factory objects.
Props andizer.
Fixes #44521.

Built from https://develop.svn.wordpress.org/trunk@44497


git-svn-id: http://core.svn.wordpress.org/trunk@44328 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-09 05:44:49 +00:00
Gary Pendergast
a583725622 Docs: Update Codex references to the Template_Hierarchy page.
https://codex.wordpress.org/Template_Hierarchy redirects to https://developer.wordpress.org/themes/basics/template-hierarchy/, so we should link to the correct page.

Props kmeze, pento.
Fixes #45222.


Built from https://develop.svn.wordpress.org/trunk@44496


git-svn-id: http://core.svn.wordpress.org/trunk@44327 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-09 05:09:51 +00:00
Gary Pendergast
e357f68667 Docs: Add @see WP_Session_Tokens to the WP_User_Meta_Session_Tokens docblock.
Props utsav72640.
Fixes #45499.


Built from https://develop.svn.wordpress.org/trunk@44495


git-svn-id: http://core.svn.wordpress.org/trunk@44326 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-09 05:04:50 +00:00
Gary Pendergast
0b44fae46b Privacy: Fix a code formatting error introduced in [44491].
See #44908.


Built from https://develop.svn.wordpress.org/trunk@44494


git-svn-id: http://core.svn.wordpress.org/trunk@44325 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-09 04:33:50 +00:00
Gary Pendergast
47e29ccba9 Privacy: Tweak the wording of the success notice when updating the privacy policy page setting.
Props garrett-eclipse.
Fixes #44129.


Built from https://develop.svn.wordpress.org/trunk@44493


git-svn-id: http://core.svn.wordpress.org/trunk@44324 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-09 04:19:49 +00:00
Gary Pendergast
099238e3a3 Privacy: Always show the privacy policy guide.
Previously, the link to the privacy policy guide would only be displayed when a privacy policy page had been selected, but the guide is generally useful without that.

Props mukesh27, birgire.
Fixes #44871.


Built from https://develop.svn.wordpress.org/trunk@44492


git-svn-id: http://core.svn.wordpress.org/trunk@44323 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-09 04:01:50 +00:00
Gary Pendergast
53e40b7fda Privacy: Remove some unnecessary parameters being passed to wp_update_post() by wp_generate_user_request_key().
Props garrett-eclipse.
Fixes #44908.


Built from https://develop.svn.wordpress.org/trunk@44491


git-svn-id: http://core.svn.wordpress.org/trunk@44322 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-09 03:51:48 +00:00
Gary Pendergast
f7d21862e8 Help/About: Add a lang attribute to the <html> tag in readme.html
Props audrasjb.
Fixes #44955.


Built from https://develop.svn.wordpress.org/trunk@44490


git-svn-id: http://core.svn.wordpress.org/trunk@44321 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-09 02:56:51 +00:00
Gary Pendergast
19f9dd29e9 Login: Improve the error message when retrieving a lost password.
When an invalid username or email address is entered, the form now displays a better error message.

Props mrtortai, iamfriendly, TomHarrigan, afercia, pento.
Fixes #31788.


Built from https://develop.svn.wordpress.org/trunk@44489


git-svn-id: http://core.svn.wordpress.org/trunk@44320 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-09 02:06:50 +00:00
tellyworth
942f35446f Cron API: Make wp-cron.php non-blocking where possible.
This should make cron spawning faster by ensuring requests to wp-cron.php return immediately regardless of transport method. It is enabled only on recent PHP versions with fastcgi, due to historical bugs and availability of `fastcgi_finish_request()`. This needs testing on a range of platforms, to help determine if it's safe to use in other contexts also.

Props vnsavage, johnbillion, jnylen0.
See #18738, #41358

Built from https://develop.svn.wordpress.org/trunk@44488


git-svn-id: http://core.svn.wordpress.org/trunk@44319 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-09 01:07:39 +00:00
Gary Pendergast
fd7086bcdc Docs: Update the @since tag for the comment_status_links filter.
Fixes #42379.


Built from https://develop.svn.wordpress.org/trunk@44487


git-svn-id: http://core.svn.wordpress.org/trunk@44318 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-09 01:06:48 +00:00
Gary Pendergast
c6dea4c784 Embeds: Add Instagram TV support.
Props dannydehaan.
Fixes #44557.


Built from https://develop.svn.wordpress.org/trunk@44486


git-svn-id: http://core.svn.wordpress.org/trunk@44317 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-09 00:24:50 +00:00
Gary Pendergast
0888007275 Admin: Add a "Set up your homepage" link to the Welcome panel.
As many WordPress sites use a static homepage rather than a blog, this link gives a natural next step for new sites owners wanting to configure their site in this manner.

Props professor44, joyously, nielslange, mukesh27, melchoyce.
Fixes #45019.


Built from https://develop.svn.wordpress.org/trunk@44485


git-svn-id: http://core.svn.wordpress.org/trunk@44316 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-09 00:12:49 +00:00
Gary Pendergast
64d846c7c2 Embeds: Polldaddy is now called Crowdsignal.
Crowdsignal adds an additional embed URL, survey.fm.

Props donncha.
Fixes #45036.


Built from https://develop.svn.wordpress.org/trunk@44484


git-svn-id: http://core.svn.wordpress.org/trunk@44315 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-08 23:52:50 +00:00
Peter Wilson
bf3c97de77 Cron API: Add function and filter to return ready cron jobs.
Add the function `wp_get_ready_cron_jobs()` to return a modified version of the cron array limited to jobs ready to be run, ie with a timestamp of `time()` or earlier.

The new function includes the filter `pre_get_ready_cron_jobs` to allow for custom cron storage systems. This rounds out the functionality added in #32656.

Props Pento for code review.
Fixes #45797.


Built from https://develop.svn.wordpress.org/trunk@44483


git-svn-id: http://core.svn.wordpress.org/trunk@44314 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-08 21:49:49 +00:00
desrosj
cd7b916d55 REST API: Introduce rest_post_search_query filter.
This filter allows the query arguments to be manipulated for a post search query in the REST API.

Props Chouby, swissspidy.
Fixes #45454.
Built from https://develop.svn.wordpress.org/trunk@44482


git-svn-id: http://core.svn.wordpress.org/trunk@44313 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-08 21:45:48 +00:00
Adam Silverstein
f510ab9e94 Media: improve the human_readable_duration function and tests.
Improve the `human_readable_duration` added in #39667:
* Remove upper limit.
* More resilient handling: remove negative prefix, trim.
* Correct @since to 5.1.0.
* Adds more test cases and improve inline docs.

Props birgire.
Fixes #39667.

Built from https://develop.svn.wordpress.org/trunk@44481


git-svn-id: http://core.svn.wordpress.org/trunk@44312 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-08 19:56:48 +00:00
desrosj
bdaf864ec9 Docs: Improve accuracy of wp_list_sort()’s $list parameter description.
Props manikmist09.
Fixes #45766.
Built from https://develop.svn.wordpress.org/trunk@44480


git-svn-id: http://core.svn.wordpress.org/trunk@44311 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-08 19:54:50 +00:00
desrosj
58d5410ceb Docs: Fix typos in Twenty Seventeen function descriptions.
Props faisal03, mukesh27.
Fixes #45466.
Built from https://develop.svn.wordpress.org/trunk@44479


git-svn-id: http://core.svn.wordpress.org/trunk@44310 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-08 19:22:49 +00:00
desrosj
619285c34c Tests: Add missing test cases for is_serialized_string().
Also, reorganize these tests into their own class.

Props pbearne.
Fixes #42870.
Built from https://develop.svn.wordpress.org/trunk@44478


git-svn-id: http://core.svn.wordpress.org/trunk@44309 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-08 19:05:49 +00:00
desrosj
51155f3989 Docs: Specify missing global variables used in wp_print_theme_file_tree().
The `$relative_file` and `$stylesheet` variables are used in the `wp_print_theme_file_tree()` function but were not noted within the inline documentation.

Props mukesh27, desrosj,
Fixes #43682.
Built from https://develop.svn.wordpress.org/trunk@44477


git-svn-id: http://core.svn.wordpress.org/trunk@44308 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-08 18:33:49 +00:00
Felix Arntz
e08a12d020 General: Make Update PHP notice link customizable.
After [42832], [42891] and [43006], this changeset refines the core notice informing about an outdated PHP version:

* The link to the Update PHP information page can now be adjusted using either a `WP_UPDATE_PHP_URL` environment variable, or a new `wp_update_php_url` filter.
* If that URL is different from the default one that points to https://wordpress.org/support/update-php/ or its localized equivalent, a note indicates that the linked resource has not been provided by WordPress itself, and the default URL is still linked to as an additional resource.
* The URL for the default information page has been updated to use the slug `update-php` instead of `upgrade-php`.
* `@since` annotations have been updated.

Going forward, admin areas that display information related to the PHP version should use the new function `wp_get_update_php_url()`.

Props afragen, fierevere, flixos90, markjaquith, miss_jwo, nerrad, pento, schlessera, SergeyBiryukov, spacedmonkey.
Fixes #45686. See #41191.

Built from https://develop.svn.wordpress.org/trunk@44476


git-svn-id: http://core.svn.wordpress.org/trunk@44307 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-08 17:27:50 +00:00
desrosj
1f6da37438 Docs: Fix order of parameter type and variable name.
The order of the type and variable name in the `param` tags for the `wp_get_default_privacy_policy_content` filter is incorrectly reversed. This moves the two into the correct order.

Props ishitaka, mukesh27.
Fixes #45416.
Built from https://develop.svn.wordpress.org/trunk@44475


git-svn-id: http://core.svn.wordpress.org/trunk@44306 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-08 17:03:48 +00:00
desrosj
f1ea8f222f Widgets: Fix custom HTML widget editor content not updating after save.
An integer comparison is performed against `control.currentErrorAnnotations`, but `control.currentErrorAnnotations` is actually an array. This fixes that comparison so the content saves correctly.

Props barryceelen.
Fixes #43657.
Built from https://develop.svn.wordpress.org/trunk@44474


git-svn-id: http://core.svn.wordpress.org/trunk@44305 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-08 16:42:49 +00:00
Gary Pendergast
0f3835d394 Users: Add the pre_count_users filter.
Props spacedmonkey.
Fixes #43693.


Built from https://develop.svn.wordpress.org/trunk@44473


git-svn-id: http://core.svn.wordpress.org/trunk@44304 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-08 09:49:50 +00:00
Felix Arntz
ea9286844f Multisite: Introduce ms-site.php and ms-network.php files.
By providing distinct files for the site and network APIs, a better overview is provided. Prior to this change, the `ms-blogs.php` file had grown too big, mixing site APIs, network APIs and related legacy APIs that need to be maintained. Since multisite is often used in unexpected ways, backward-compatibility is ensured by including the two new files from `ms-blogs.php`, which previously contained all functions that have been moved to the new files.

This changeset does not contain any functional changes.

Fixes #40647.

Built from https://develop.svn.wordpress.org/trunk@44472


git-svn-id: http://core.svn.wordpress.org/trunk@44303 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-08 09:15:49 +00:00
Gary Pendergast
8947acbf9b Media: Add $attr to the wp_get_attachment_link filter.
Props danielbachhuber.
Fixes #40155.


Built from https://develop.svn.wordpress.org/trunk@44471


git-svn-id: http://core.svn.wordpress.org/trunk@44302 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-08 09:09:49 +00:00