Commit Graph

42084 Commits

Author SHA1 Message Date
Sergey Biryukov 0da858ffae Site Health: Rename `upload_max` array key in file upload checks to `max_effective_size` for clarity.
Follow-up to [48535].

See #50038.

git-svn-id: https://develop.svn.wordpress.org/trunk@48544 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-21 16:18:53 +00:00
Pascal Birchler 7bcdf886c0 Sitemaps: Replace `wp_sitemaps_register_providers` filter with more suitable `wp_sitemaps_add_provider` filter.
The previous filter failed the goal of allowing developers to filter all providers before they are registered, since it only filtered the built-in ones.

The more specific `wp_sitemaps_add_provider` filter enables exactly that, as it filters every sitemap provider right before it is added to the sitemaps registry.

Props pbiron, pfefferle, Chouby, swissspidy.
Fixes #50660.

git-svn-id: https://develop.svn.wordpress.org/trunk@48543 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-21 16:12:49 +00:00
Jonathan Desrosiers bea9ce74a7 Administration: Ensure SVG icons in admin menus are correctly colored.
Props ryelle.
Fixes #50555.

git-svn-id: https://develop.svn.wordpress.org/trunk@48542 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-21 16:08:44 +00:00
Sergey Biryukov 8c7fe179da Sitemaps: Rename `wp_get_sitemaps_providers()` to `wp_get_sitemap_providers()`.
Follow-up to [48536], [48540].

Props pbiron, swissspidy, SergeyBiryukov.
See #50724.

git-svn-id: https://develop.svn.wordpress.org/trunk@48541 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-21 16:04:35 +00:00
Pascal Birchler 83b94f5cd6 Sitemaps: Rename `wp_get_sitemaps()` to `wp_get_sitemaps_providers()`
Following [48536], rename the function to match the rest of the sitemaps logic.

Also eliminates some dead code after [48523].

Props pbiron.
See #50724. See #50643.

git-svn-id: https://develop.svn.wordpress.org/trunk@48540 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-21 15:55:21 +00:00
Sergey Biryukov 3269e83801 Site Health: Move `post_max_size` and `upload_max_filesize` out of a translatable string in file upload checks.
Simplify some other strings, use a consistent format for translator comments.

Follow-up to [48535].

See #50038.

git-svn-id: https://develop.svn.wordpress.org/trunk@48539 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-21 15:51:22 +00:00
Sergey Biryukov 0d956d4013 Site Health: Remove `parse_ini_size()`, use the existing `wp_convert_hr_to_bytes()` function instead.
Follow-up to [48535].

See #50038.

git-svn-id: https://develop.svn.wordpress.org/trunk@48538 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-21 15:38:40 +00:00
Jonathan Desrosiers 09754a7cdd Editor: Ensure the required assets for the block directory are enqueued.
This fixes an issue where the block directory appears unstyled due to the stylesheets not being enqueued.

Props ryelle, timothyblynjacobs, earnjam.
Fixes #50661.

git-svn-id: https://develop.svn.wordpress.org/trunk@48537 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-21 15:36:17 +00:00
Sergey Biryukov 383540b7c4 Sitemaps: Rename 'sitemap' to 'provider' in `WP_Sitemaps_Registry` class.
This class is for registering sitemap providers, not individual sitemaps.

Props swissspidy.
Fixes #50724.

git-svn-id: https://develop.svn.wordpress.org/trunk@48536 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-21 15:27:48 +00:00
Jake Spurlock 5ffe591bec Site Health: Include new tests to check for the ability to upload files.
Several new checks:

* `max_file_uploads`
* `file_uploads`
* `post_max_size`
* `upload_max_filesize`
* `upload_max`
* `max_file_uploads`

In addition, new function `parse_ini_size()` that converts shorthand byte strings to bytes. Useful for size comparisons.

Fixes #50038.
Props dd32, donmhico, JavierCasares, SergeyBiryukov, ayeshrajans, Clorith, ipstenu, sabernhardt, whyisjake.


git-svn-id: https://develop.svn.wordpress.org/trunk@48535 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-21 15:19:58 +00:00
Sergey Biryukov 3ef1fa5c6d Site Health: Use consistent error messages when switching plugin or theme auto-updates on or off.
Props ramiy.
Fixes #50721.

git-svn-id: https://develop.svn.wordpress.org/trunk@48534 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-21 14:40:43 +00:00
Sergey Biryukov cfb25b2e48 Block Editor: Move the `add_action()` call for `_register_core_block_patterns_and_categories()` above `check_theme_switched()`.
Follow-up to [48492], [48531].

See #50669.

git-svn-id: https://develop.svn.wordpress.org/trunk@48533 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-21 14:35:13 +00:00
Pascal Birchler 38cade3b07 Sitemaps: Correctly enforce maximum number of sitemaps in index.
Before this change, the limit of 50k entries was enforced for the number of providers, not the amount of sitemaps all providers add to the index in total.

Props pbiron, swissspidy.
Fixes #50666.

git-svn-id: https://develop.svn.wordpress.org/trunk@48532 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-21 13:55:45 +00:00
Sergey Biryukov fd9f7232e5 Block Editor: Move the `add_action()` call for `_register_core_block_patterns_and_categories()` to `wp-includes/default-filters.php`.
Follow-up to [48492].

Props desrosj.
Fixes #50669.

git-svn-id: https://develop.svn.wordpress.org/trunk@48531 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-21 13:13:54 +00:00
Sergey Biryukov 99f5b6019a Mail: Make sure the `PHPMailer` class is only required once if a plugin requires `wp-includes/class-phpmailer.php` directly.
Follow-up to [48033].

Props david.binda.
Fixes #50716. See #41750.

git-svn-id: https://develop.svn.wordpress.org/trunk@48530 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-21 12:56:40 +00:00
Sergey Biryukov ea352ee2ab Docs: Improve description for `edit_post()`.
Props stevenlinx.
Fixes #50713.

git-svn-id: https://develop.svn.wordpress.org/trunk@48529 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-21 12:47:58 +00:00
Sergey Biryukov 0f86642b82 Site Health: Correct the message for snoozed email verifications.
Follow-up to [48522].

Fixes #48333.

git-svn-id: https://develop.svn.wordpress.org/trunk@48528 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-21 12:35:32 +00:00
Ella van Durpe 69ec4264dc Editor: update packages for Beta 3
Fixes #50712.



git-svn-id: https://develop.svn.wordpress.org/trunk@48527 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-21 12:12:43 +00:00
Timothy Jacobs 74cc64d74e REST API: Issue a _doing_it_wrong when registering a route without a permission callback.
The REST API treats routes without a permission_callback as public. Because this happens without any warning to the user, if the permission callback is unintentionally omitted or misspelled, the endpoint can end up being available to the public. Such a scenario has happened multiple times in the wild, and the results can be catostrophic when it occurs.

For REST API routes that are intended to be public, it is recommended to set the permission callback to the `__return_true` built in function.

Fixes #50075.
Props rmccue, sorenbronsted, whyisjake, SergeyBiryukov, TimothyBlynJacobs.


git-svn-id: https://develop.svn.wordpress.org/trunk@48526 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-21 12:01:10 +00:00
Andrew Ozz fcc52436cb REST API, Media: Add `X-WP-Upload-Attachment-ID` HTTP header to enable retrying of post-processing of edited images if the server runs out of resources. This is the same as after uploading a new image, will do up to five additional requests to let the server create all image sub-sizes.
Fixes #50711.

git-svn-id: https://develop.svn.wordpress.org/trunk@48525 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-21 02:59:00 +00:00
Timothy Jacobs 2daa951685 REST API: Make plugin installation tests more robust on alternate test environments.
The REST API plugin installation tests use the `upgrader_pre_download` filter to avoid downloading the test plugin from WordPress.org. Previously, this would apply to any upgrader, which caused issues if the testing environment required a language update.

Now, the filter only overwrites the file if the `Plugin_Upgrader` is being used which should hopefully prevent the issue.

Props pfefferle, TimothyBlynJacobs.
Fixes #50671.


git-svn-id: https://develop.svn.wordpress.org/trunk@48524 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-21 01:36:16 +00:00
Jake Spurlock 60d339cfde Sitemaps: Ensure correct HTTP status when sitemaps are disabled
If sitemaps are disabled, previously there would be a rewrite rule for the sitemap endpoint. This endpoint would display the homepage since there was a rewrite rule. Now, Sitemaps are loaded, and the proper HTTP headers are returned.

Fixes #50643.
Props swissspidy, kraftbj, donmhico.



git-svn-id: https://develop.svn.wordpress.org/trunk@48523 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-21 00:55:20 +00:00
Jake Spurlock bd67e31f4b Site Health: Ensure that there is a human readable time for snoozed email verifications.
This will be the time the was proposed, added to the reminder interval.

Fixes #48333.
Props SergeyBiryukov, desrosj.



git-svn-id: https://develop.svn.wordpress.org/trunk@48522 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-21 00:41:35 +00:00
Jake Spurlock 4ba60208d4 Comments: Don't show the filter/pagination actions if there are no comments to list.
It doesn't make sense to be able to filter the comments list table when there are are no (trashed/spam) comments available.

Fixes #40188.
Props swissspidy, Jim_Panse, menakas, akbarhusen429, dinhtungdu, birgire, SergeyBiryukov, davidbaumwald, rebasaurus, whyisjake.



git-svn-id: https://develop.svn.wordpress.org/trunk@48521 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-21 00:27:46 +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
Sergey Biryukov 364759ecb2 I18N: Mark the strings with plugin and theme names in email notifications for translation.
Follow-up to [48517].

See #50350.

git-svn-id: https://develop.svn.wordpress.org/trunk@48519 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-20 21:23:26 +00:00
Andrew Ozz 8406d5104c REST API, Media: Fix/improve the inline docs and name of the new `wp_edited_image_metadata` filter.
Props desrosj, azaozz.

See #44405.

git-svn-id: https://develop.svn.wordpress.org/trunk@48518 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-20 21:02:13 +00:00
Jonathan Desrosiers 83e78d8cdd Administration: Include the new plugin and theme versions in email notifications.
This helps administrators keep track of which versions of plugins and themes are running on their site when auto-updates occur.

Props audrasjb, pbiron.
Fixes #50350.

git-svn-id: https://develop.svn.wordpress.org/trunk@48517 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-20 18:26:18 +00:00
Sergey Biryukov fa7b1bbb99 Tests: Simplify some assertions in `phpunit/tests/media.php`.
Correct comments per the documentation standards.

Follow-up to [48496].

See #22101.

git-svn-id: https://develop.svn.wordpress.org/trunk@48516 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-20 15:47:37 +00:00
Jonathan Desrosiers e80b4f64bf Build/Test Tools: Update NPM packages in Twenty Nineteen.
This updates three packages:
- `@wordpress/browserslist-config` from `2.5.0` to `2.7.0`
- `autoprefixer` from `9.6.0` to `9.8.5`.
- `chokidar-cli` from `2.0.0` to `2.1.0`

See #49768.

git-svn-id: https://develop.svn.wordpress.org/trunk@48515 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-20 13:39:34 +00:00
Jonathan Desrosiers 167a8769e7 Bundled Themes: Rebuild Twenty Nineteen’s RTL stylesheet.
This adds the changes from [48073] to the `style-rtl.css` file.

See #45912.

git-svn-id: https://develop.svn.wordpress.org/trunk@48514 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-20 13:27:58 +00:00
Jonathan Desrosiers b98a607ca5 Embeds: Correct the version number when Hulu was deprecated.
Follow up of [48512]
See #50676.

git-svn-id: https://develop.svn.wordpress.org/trunk@48513 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-20 13:12:22 +00:00
Jonathan Desrosiers 0713ca14f9 Embeds: Remove Hulu from the list of supported oEmbed providers.
The oEmbed service for Hulu no longer works and appears to have been silently disabled.

Props tacitonic, talldanwp, youknowriad, bph.
Fixes #50676.

git-svn-id: https://develop.svn.wordpress.org/trunk@48512 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-20 13:10:36 +00:00
Sergey Biryukov 0c19e1abd0 Docs: Improve description for `add_user_to_blog()`.
Props stevenlinx.
Fixes #50701.

git-svn-id: https://develop.svn.wordpress.org/trunk@48511 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-20 11:52:59 +00:00
Andrew Ozz 030f2a4eee Media: Migrate the data from the attachment post of the parent image when saving an edited image. Copy:
- `post_title`,
- `post_content` (image description),
- `post_excerpt` (image caption as saved in the DB),
- `_wp_attachment_image_alt` meta (alt text for the img tag as saved in the DB).

Props spacedmonkey, joedolson, TimothyBlynJacobs, azaozz.
Fixes #50675.

git-svn-id: https://develop.svn.wordpress.org/trunk@48510 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-19 21:17:55 +00:00
Andrew Ozz b39df4606a Upgrade/install: Fix/clarify the "Upload in a zip format" string.
Props greenshady, mariovalney.
See #9757.

git-svn-id: https://develop.svn.wordpress.org/trunk@48509 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-19 17:09:43 +00:00
John Blackbourn d10a86ad1d Docs: Miscellaneous docblock corrections.
See #49572

git-svn-id: https://develop.svn.wordpress.org/trunk@48508 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-18 22:09:57 +00:00
Sergey Biryukov 9331f7a73f Coding Standards: Use strict comparison in `wp-includes/wp-db.php`.
Props jenilk.
Fixes #49453.

git-svn-id: https://develop.svn.wordpress.org/trunk@48507 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-18 11:37:59 +00:00
Jonathan Desrosiers d54b8f7335 Administration: Reverse the arrow direction for database import/export icons.
In [48456], database import and export icons were introduced. However, the arrows were pointing in the wrong directions. This reverses the arrows to be pointing correctly based on the action described in the name.

Props johnbillion, joen, desrosj, empireoflight.
Fixes #49913.

git-svn-id: https://develop.svn.wordpress.org/trunk@48506 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-17 17:09:37 +00:00
Sergey Biryukov 3b5d373043 Options, Meta APIs: Reorder the parameters of `default_{$meta_type}_metadata` filter.
This brings consistency with the `get_{$meta_type}_metadata` filter and more closely matches the `get_metadata_default()` function signature.

Follow-up to [48502].

Props spacedmonkey.
See #43941.

git-svn-id: https://develop.svn.wordpress.org/trunk@48505 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-17 15:14:00 +00:00
Sergey Biryukov 2d0e9b1057 Docs: Correct documentation for the `$meta_key` parameter of `get_metadata_default()`.
The parameter is required, not optional.

Follow-up to [48502].

See #43941.

git-svn-id: https://develop.svn.wordpress.org/trunk@48504 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-17 13:47:23 +00:00
Jake Spurlock 1c1a9de834 Plugins: Update the height of the Install Now button for new plugins.
Due to Thickbox shenanigans, the buttons height needed to be shrunk a little to center properly in the iframe.

Fixes #49828.

Props ibachal, Otto42, afercia.


git-svn-id: https://develop.svn.wordpress.org/trunk@48503 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-17 06:27:09 +00:00
Timothy Jacobs d525642dd1 Meta: Reorder the get_metadata_default() signature to match get_metadata().
The order of parameters in `get_metadata_default()` did not match the signature of `get_metadata()`. This could be confusing for developers who are familiar with the existing metadata API.

Fixes #43941.
Props SergeyBiryukov, spacedmonkey, johnjamesjacoby.


git-svn-id: https://develop.svn.wordpress.org/trunk@48502 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-17 02:57:04 +00:00
Jake Spurlock f75522ecfc Build/Test Tools: Bump lodash in twentytwenty as part of a security audit.
lodash: 4.17.15 👉 4.17.19

See #49768.
Props: dependabot.



git-svn-id: https://develop.svn.wordpress.org/trunk@48501 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-16 22:22:05 +00:00
Jake Spurlock 162afe2451 Administration: Fix an index inconsistency in `get_admin_page_title()` function.
Ensure that `get_admin_page_title()` returns a value from pages registered using `add_menu_page()`.

Fixes #46081.

Props grapestain, valentinbora, SergeyBiryukov, audrasjb.



git-svn-id: https://develop.svn.wordpress.org/trunk@48500 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-16 22:13:54 +00:00
Jake Spurlock e7671336a4 Code Formatting: Fix some formatting around `WP_REST_Attachments_Controller` tests.
See #50565.



git-svn-id: https://develop.svn.wordpress.org/trunk@48499 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-16 22:09:35 +00:00
Andrew Ozz 0aab2584a0 REST API: Prevent attachment ID/image source mismatch when editing an image.
Fixes #50565.

git-svn-id: https://develop.svn.wordpress.org/trunk@48498 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-16 21:54:37 +00:00
Jake Spurlock 082cb0ab20 Posts, Post Types: Ensure that all post stati are countable in `wp_count_posts`.
When `wp_count_posts()` is cached, it does so with all statuses defaulted to 0. The problem is however, if this is called before all plugins have registered their desired statuses, they won't have that default.

Fixes #49685.

Props obliviousharmony, SergeyBiryukov.



git-svn-id: https://develop.svn.wordpress.org/trunk@48497 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-16 21:42:48 +00:00
Jake Spurlock ceccb7b3b1 Feeds: Ensure that galleries can be output as a list of links in feeds.
Adjusts the gallery shortcode handler to check for the `link` attribute when outputting to a feed.

Fixes #22101.

Props ifrins, mdgl, SergeyBiryukov, chriscct7, stevenkword, iworks, DrewAPicture, birgire, whyisjake.


git-svn-id: https://develop.svn.wordpress.org/trunk@48496 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-16 21:29:05 +00:00
Jake Spurlock 0fa4801a88 Coding Standards: Update the docblock to remove superflous `since`.
The `@deprecated` DocBlock tag should start with the version followed by the description of what to use instead.

Fixes #44959.

Props keesiemeijer, sabernhardt.



git-svn-id: https://develop.svn.wordpress.org/trunk@48495 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-16 21:10:03 +00:00