Commit Graph

39139 Commits

Author SHA1 Message Date
Gary Pendergast cf5be804c7 Coding Standards: Remove an unnecessary line whitelisting.
Props jrf.
See #45934.



git-svn-id: https://develop.svn.wordpress.org/trunk@44572 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-12 04:52:53 +00:00
Gary Pendergast c1d4ff496c Coding Standards: Exclude some external files.
- `class-wp-block-parser.php` and `wp-includes/blocks/*` are imported from the Gutenberg plugin.
- `speed-trap-listener.php` is a third party library.

See #45934.



git-svn-id: https://develop.svn.wordpress.org/trunk@44571 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-12 04:00:42 +00:00
Gary Pendergast 358d65b9c7 Coding Standards: Fix an incorrect `phpcs:ignore` comment.
It's `phpcs:ignore`, not `wpcs:ignore`.

Props GaryJ.

See #45934.



git-svn-id: https://develop.svn.wordpress.org/trunk@44570 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-12 03:48:05 +00:00
Gary Pendergast ff53bd388c Coding Standards: Extract `extract()` from the codebase.
Of the last four instances of `extract()` occurring, three of them are removed by this commit, and the fourth is appropriately documented.

See #45934.



git-svn-id: https://develop.svn.wordpress.org/trunk@44569 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-12 03:19:23 +00:00
Jonathan Desrosiers 34e3de7b7f REST API: Encourage proper usage of `register_rest_route()`.
Calling `register_rest_route()` too early in the loading process has the potential to cause some unintentional problems and pitfalls. Because `register_rest_route()` calls `rest_get_server()` (which creates the `WP_REST_Server` instance), calling the function directly and/or before `rest_api_init` should be discouraged.

For example, if `register_rest_route ()` is called on `init`, the REST API server instance is set up (and all functions added to `rest_api_init` and other related hooks are invoked), even though the current request may not be a REST request. Also, if `register_rest_route()` is called even earlier (say, in an `mu-plugin` file), required endpoints may be missing since normal plugins have not yet been loaded and have not had a chance to register their own action hooks.

This adds a `_doing_it_wrong()` notice the first time `register_rest_route()` is called before `rest_api_init` in a request to encourage best practices for registering REST API routes.

Props kraftbj, desrosj, timothyblynjacobs.
Fixes #45265.

git-svn-id: https://develop.svn.wordpress.org/trunk@44568 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-11 18:18:41 +00:00
Andrea Fercia d78fa59746 Menus: Make menu items not jump while dragging items.
Props alexvorn2, welcher, afercia.
Fixes #41160.


git-svn-id: https://develop.svn.wordpress.org/trunk@44567 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-11 13:55:28 +00:00
Gary Pendergast 33caf61b8b Coding Standards: Fix the `Squiz.ControlStructures.ControlSignature.SpaceAfterCloseBrace` violations.
See #45934.



git-svn-id: https://develop.svn.wordpress.org/trunk@44566 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-11 06:39:55 +00:00
Gary Pendergast 83af0329a2 Coding Standards: Document intentional `case` block fall-throughs.
Fixes `PSR2.ControlStructures.SwitchDeclaration.TerminatingComment` violations.

See #45934.



git-svn-id: https://develop.svn.wordpress.org/trunk@44565 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-11 06:25:37 +00:00
Gary Pendergast d0f00b58e2 Coding Standards: Add exceptions for `WordPress.Files.FileName.NotHyphenatedLowercase`.
See #45934.



git-svn-id: https://develop.svn.wordpress.org/trunk@44564 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-11 06:16:35 +00:00
Gary Pendergast 6f0487c2f0 Coding Standards: Ignore the violations of `Generic.NamingConventions.UpperCaseConstantName.ConstantNotUpperCase`.
See #45934.



git-svn-id: https://develop.svn.wordpress.org/trunk@44563 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-11 06:07:50 +00:00
Gary Pendergast 8cc49330a4 Coding Standards: Fix the minor `WordPress.WP.I18n` violations.
`WordPress.WP.I18n.MissingTranslatorsComment` is in progress in #44360.

See #45934.



git-svn-id: https://develop.svn.wordpress.org/trunk@44562 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-11 06:03:46 +00:00
Gary Pendergast df771316d1 Coding Standards: `template.php` isn't a template tag file.
`WordPress.Files.FileName.InvalidTemplateTagFileName` shouldn't apply to it.

See #45934.



git-svn-id: https://develop.svn.wordpress.org/trunk@44561 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-11 04:59:23 +00:00
Gary Pendergast 65f5fcb0fb Coding Standards: Ignore the single WordPress.PHP.RestrictedPHPFunctions.create_function_create_function violation.
This is intentional, for older PHP support.

See #45934.


git-svn-id: https://develop.svn.wordpress.org/trunk@44560 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-11 03:44:20 +00:00
Gary Pendergast 63fbf4a316 Coding Standards: Remove PHPCS 2.x `@codingStandardsIgnore*` ignore syntax.
Props netweb.
Fixes #42808.



git-svn-id: https://develop.svn.wordpress.org/trunk@44559 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-11 03:03:08 +00:00
Gary Pendergast b0c61e267b Post WordPress 5.1 Beta 1 version bump.
git-svn-id: https://develop.svn.wordpress.org/trunk@44558 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-11 00:58:03 +00:00
Gary Pendergast 2792e71cec WordPress 5.1 Beta 1.
git-svn-id: https://develop.svn.wordpress.org/trunk@44557 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-11 00:41:39 +00:00
Gary Pendergast 49f5f62f30 Emoji: Fix a code formatting error introduced in [44554].
See #45930.



git-svn-id: https://develop.svn.wordpress.org/trunk@44556 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-10 23:39:19 +00:00
Gary Pendergast 1eaf7453f9 Blocks: Reverse the logic when checking the `pre_render_block` result.
We should be returning if the result isn't null, not when it is.

See #45451.



git-svn-id: https://develop.svn.wordpress.org/trunk@44555 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-10 23:31:01 +00:00
Gary Pendergast d32cead515 Emoji: Improve performance when encoding or staticizing emoji.
Both `wp_encode_emoji()` and `wp_staticize_emoji()` perform a PHP version check when deciding how to apply their behaviour, but this check only needs to happen once, rather than every time in their internal looks.

Moving the check outside of the loop reduces processing time by 50%.

Props johnbillion.
Fixes #45930.



git-svn-id: https://develop.svn.wordpress.org/trunk@44554 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-10 23:19:37 +00:00
Gary Pendergast 041471735a Blocks: Add the `pre_render_block` and `render_block_data` filters.
At the start of `render_block()`, the `pre_render_block` filter allows the function to be short-circuited, and the `render_block_data` filter is applied to the `$block` parameter before it's processed.

Props kkarpieszuk, pento.
Fixes #45451.



git-svn-id: https://develop.svn.wordpress.org/trunk@44553 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-10 23:15:49 +00:00
Jonathan Desrosiers 7508db604b Embeds: Remove Photobucket, FunnyOrDie from the list of oEmbed providers.
These services no longer support oEmbed.

Props skostadinov, notnownikki.
Fixes #45399.

git-svn-id: https://develop.svn.wordpress.org/trunk@44552 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-10 22:41:13 +00:00
Andrea Fercia b3fcb41718 Accessibility: Improve text input in the Tags meta box when using Safari + Voiceover.
Props parbaugh, konainm, wbrubaker, pento, ryelle.
Fixes #44966.


git-svn-id: https://develop.svn.wordpress.org/trunk@44551 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-10 22:29:46 +00:00
Jonathan Desrosiers 2e8b87cd83 Docs: Add missing periods to `param` annotations for `flip()` in `WP_Image_Editor_GD`.
Props hitendra-chopda.
Fixes #45208.

git-svn-id: https://develop.svn.wordpress.org/trunk@44550 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-10 22:09:26 +00:00
Andrea Fercia a0bca4f976 Accessibility: Improve color contrast ratio in the Events and News dashboard widget.
Props boemedia, lucagrandicelli.
Fixes #45280.


git-svn-id: https://develop.svn.wordpress.org/trunk@44549 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-10 22:07:42 +00:00
Jonathan Desrosiers 3a6966b69d Media: Correct `since` annotation for adding the `caption_id` attribute.
Introduced in [42704]
Fixes #34595.

git-svn-id: https://develop.svn.wordpress.org/trunk@44548 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-10 21:36:05 +00:00
Felix Arntz 6cc9452def General: Fix existing coding standard violations in bookmark tests, as outlined in [44546].
See #43977.


git-svn-id: https://develop.svn.wordpress.org/trunk@44547 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-10 21:16:49 +00:00
Felix Arntz 08564b5a80 General: Fix problematic string to array parsing.
WordPress has historically often used code like `preg_split( '/[\s,]+/', $var )` to parse a string of comma-separated values into an array. However, this approach was causing an empty string to not be parsed into an empty array as expected, but rather into an array with the empty string as its sole element.

This was among other areas causing problems in the REST API where passing an empty request parameter could cause that request to fail because, instead of it being ignored, that parameter would be compared against the valid values for it, which typically do not include an empty string.

Props david.binda, sstoqnov.
Fixes #43977.


git-svn-id: https://develop.svn.wordpress.org/trunk@44546 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-10 21:05:50 +00:00
Andrea Fercia 238e8991f8 Accessibility: Remove negative tabindex from the login, install, and setup pages header.
Props bamadesigner, rishishah, jainnidhi.
Fixes #42632.


git-svn-id: https://develop.svn.wordpress.org/trunk@44545 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-10 17:20:59 +00:00
Andrea Fercia 2d4ae6ce6d Accessibility: Add focus styles for Windows High Contrast mode.
Introduces in core new focus styles dedicated to Windows High Contrast mode. The 
new styles use a transparent CSS outline as already explored in the Block Editor.
This first part covers some of the main user interface controls like buttons, links,
and media views elements. Other parts will be addressed in the next future.

Fixes #41286.


git-svn-id: https://develop.svn.wordpress.org/trunk@44544 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-10 16:46:44 +00:00
Andrea Fercia 3b3808feeb Accessibility: Improve the way Safari and VoiceOver read out the screen reader text.
Sometimes, Safari and VoiceOver read out the text hidden with `screen-reader-text`
in a wrong order. While there's no known, full, solution, it is possible to make 
them respect the correct order reliably at least within buttons.

Fixes #42006.


git-svn-id: https://develop.svn.wordpress.org/trunk@44543 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-10 16:30:03 +00:00
Jonathan Desrosiers ba6f1ff56e Media: Introduce the `has_post_thumbnail` filter.
Props rzen, desrosj.
Fixes #44859.

git-svn-id: https://develop.svn.wordpress.org/trunk@44542 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-10 15:27:09 +00:00
Felix Arntz 9b19f2eea4 I18n: Add missing translator comments in `wp-admin/includes/class-wp-plugins-list-table.php`.
Fixes #45898.


git-svn-id: https://develop.svn.wordpress.org/trunk@44541 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-10 10:45:13 +00:00
Jonathan Desrosiers 399048fa0e Docs: Correct `since` annotation for `_wp_get_allowed_postdata()`.
This function was introduced in 5.0.1, not 4.9.9 as currently indicated. Introduced in [44047].

git-svn-id: https://develop.svn.wordpress.org/trunk@44540 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-10 03:30:42 +00:00
Gary Pendergast fa886b237f Admin: Don't use the `keyup` event in addition to the `input` event.
The `keyup` event was used to provide support for IE8, where which doesn't support the `input` event. As we dropped IE8 support some time ago, this was simply adding unnecessary complexity and double-event triggers.

Props dlh, afercia.
Fixes #32882.



git-svn-id: https://develop.svn.wordpress.org/trunk@44539 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-10 02:56:24 +00:00
Jonathan Desrosiers 1f13137463 Docs: Restore `output` annotation in `tags-suggest.js`.
This was mistakenly removed in [44537].

See #38922.

git-svn-id: https://develop.svn.wordpress.org/trunk@44538 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-10 02:49:23 +00:00
Jonathan Desrosiers 2fe6670aff REST API: Restore use of `wp_ajax_ajax_tag_search()` for tag search.
This solution does not work with custom taxonomies in the current state.

Reverts [42614,42619,42737].

Props danielbachhuber.
See #38922.

git-svn-id: https://develop.svn.wordpress.org/trunk@44537 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-10 02:36:40 +00:00
Gary Pendergast 0394aab7a8 Tests: Add support for a `WP_TESTS_SKIP_INSTALL` environment variable.
Defining `WP_TESTS_SKIP_INSTALL=1` when running tests will skip the install step. While this shouldn't be used for full test runs, it's useful for saving time when running small groups of tests.

Props soulseekah.
Fixes #43432.



git-svn-id: https://develop.svn.wordpress.org/trunk@44536 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-10 02:18:19 +00:00
Jonathan Desrosiers 0161a5b70f Privacy: Add unit tests for privacy erasure fulfillment notifications.
Adds appropriate unit tests for `_wp_privacy_send_erasure_fulfillment_notification()`.

Props birgire, desrosj.
Fixes #44234.

git-svn-id: https://develop.svn.wordpress.org/trunk@44535 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-10 02:06:44 +00:00
Gary Pendergast e88eb4a63f Build/Tests: Allow running unit tests from `src`.
This is a partial recommit of [44509]: it allows running unit tests from `src` (which is useful), but doesn't make it the default (which Travis is having issues with).

See #45863.



git-svn-id: https://develop.svn.wordpress.org/trunk@44534 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-10 02:03:25 +00:00
Gary Pendergast ac47db26bc Block Editor: Upgrade the `@wordpress/` packages.
This brings the block editor in core up to date with the Gutenberg 4.8 plugin release.

Props aduth, gziolo, youknowriad, mkaz, jorgefilipecosta, swissspidy, iseulde, soean, noisysocks, joen, brentswisher, dekervit, dimadin, zebulan, johnny5, nosolosw, netweb, ryelle, etoledom, mzorz, desrosj, mmtr86, tinkerbelly, ocean90, earnjam, ajitbohra, talldanwp, notnownikki, mcsf, afercia, adamsilverstein, gutendev, naoki0h, miyauchi, aldavigdis.
Fixes #45885.



git-svn-id: https://develop.svn.wordpress.org/trunk@44533 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-10 01:53:38 +00:00
Jonathan Desrosiers 986c85c586 PHPCS: Fix formatting issues.
Fixes formatting issues introduced in [44528].

See #42017.

git-svn-id: https://develop.svn.wordpress.org/trunk@44532 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-10 01:51:39 +00:00
Jonathan Desrosiers 98e1564942 Docs: Update `since` annotation for `text-transform` support in `safecss_filter_attr()`.
Introduced in [42880].

Fixes #42729.

git-svn-id: https://develop.svn.wordpress.org/trunk@44531 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-10 01:42:54 +00:00
Jonathan Desrosiers bb3872522a Docs: Update `since` annotation for `comments_list_table_query_args`.
Introduced in [42420].

Fixes #42997.

git-svn-id: https://develop.svn.wordpress.org/trunk@44530 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-10 01:39:20 +00:00
Gary Pendergast 3e5aa4d4a5 Build Tools: Copy unminified JS files to `src`.
This allows `SCRIPT_DEBUG` to be set to `true` when running from `src`.

Fixes #45869.


git-svn-id: https://develop.svn.wordpress.org/trunk@44529 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-10 01:38:22 +00:00
Jonathan Desrosiers 25e9a6d249 Media: Store audio creation date in meta.
In [41746], `wp_get_media_creation_timestamp()` was introduced to read the created timestamp for videos from `getID3` in meta whenever possible. This information is useful separately from the dates on the file itself.

This adds the same support audio files by utilizing `wp_get_media_creation_timestamp()` in `wp_read_audio_metadata()`.

Props blob folio, desrosj.
Fixes #42017.

git-svn-id: https://develop.svn.wordpress.org/trunk@44528 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-10 01:31:52 +00:00
Jonathan Desrosiers da6021b4f9 Docs: Update `since` annotations `WP_Error::has_errors()`
Introduced in [42761].

Fixes #42742.

git-svn-id: https://develop.svn.wordpress.org/trunk@44527 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-09 22:41:32 +00:00
Felix Arntz d50afa97a3 Upgrade/Install: Add missing call to clear site meta cache in `populate_site_meta()`.
See #44896.


git-svn-id: https://develop.svn.wordpress.org/trunk@44526 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-09 21:28:21 +00:00
Felix Arntz ffd2a4bd16 Bootstrap/Load: Fix missing object argument for singular capability checks and support capability tests overlooked in [44524].
See #44458.


git-svn-id: https://develop.svn.wordpress.org/trunk@44525 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-09 20:43:57 +00:00
Felix Arntz fc37b1746e 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@44524 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-09 20:04:55 +00:00
Boone Gorges 493b90cde1 Taxonomy: Update `@since` annotations for `meta_box_sanitize_cb` arg.
Introduced in [42211].

Fixes #36514.

git-svn-id: https://develop.svn.wordpress.org/trunk@44519 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-09 15:10:17 +00:00