Commit Graph

7988 Commits

Author SHA1 Message Date
davidbaumwald
d6a1170c70 I18N: Add context to strings when updating a plugin or theme with a ZIP package.
After [48390], plugins and themes can be updated with an uploaded ZIP file.  Strings were added for comparing the "current" and "uploaded" versions of a plugin or theme, but lacked context for each as to the object being referenced.  This change adds a `plugin` or `theme` context to each of these strings for disambiguation.

Props dimadin, SergeyBiryukov.
Fixes #53017.
Built from https://develop.svn.wordpress.org/trunk@50705


git-svn-id: http://core.svn.wordpress.org/trunk@50314 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-13 17:38:05 +00:00
Sergey Biryukov
8e059f3657 Coding Standards: Rewrite a fragment in request_filesystem_credentials() for clarity and to avoid repetition.
Follow-up to [8540], [8865].

See #52627.
Built from https://develop.svn.wordpress.org/trunk@50701


git-svn-id: http://core.svn.wordpress.org/trunk@50310 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-12 18:34:05 +00:00
Sergey Biryukov
82042a0377 Coding Standards: Use strict comparison in wp-admin/includes/file.php.
Includes minor code layout fixes for better readability.

See #52627.
Built from https://develop.svn.wordpress.org/trunk@50700


git-svn-id: http://core.svn.wordpress.org/trunk@50309 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-12 18:19:09 +00:00
Sergey Biryukov
c569c157f0 Coding Standards: Simplify the check for parent terms in export_wp().
This is more consistent with similar checks elsewhere in core.

See #52627.
Built from https://develop.svn.wordpress.org/trunk@50699


git-svn-id: http://core.svn.wordpress.org/trunk@50308 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-11 13:44:13 +00:00
Sergey Biryukov
57da3e7813 Coding Standards: Remove unnecessary unset() calls in WP_Importer methods.
Variables created within the scope of a function are discarded automatically when PHP leaves the scope of the function, i.e. on `return`, so doing a call to `unset()` straight before a `return` statement is redundant.

Props jrf, ravipatel, rachelbaker, mukesh27.
Fixes #52996.
Built from https://develop.svn.wordpress.org/trunk@50692


git-svn-id: http://core.svn.wordpress.org/trunk@50301 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-08 11:12:08 +00:00
Sergey Biryukov
7d65ff4f7a Coding Standards: Use strict comparison in wp-admin/includes/dashboard.php.
Includes minor code layout fixes for better readability.

See #52627.
Built from https://develop.svn.wordpress.org/trunk@50689


git-svn-id: http://core.svn.wordpress.org/trunk@50298 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-07 18:34:07 +00:00
Sergey Biryukov
53c0882200 Coding Standards: Use strict comparison in wp-admin/includes/credits.php.
See #52627.
Built from https://develop.svn.wordpress.org/trunk@50665


git-svn-id: http://core.svn.wordpress.org/trunk@50277 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-06 13:47:02 +00:00
Sergey Biryukov
48cd688076 Coding Standards: Use strict comparison in wp-admin/includes/comment.php.
See #52627.
Built from https://develop.svn.wordpress.org/trunk@50664


git-svn-id: http://core.svn.wordpress.org/trunk@50276 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-06 13:45:09 +00:00
Peter Wilson
7442fe63a0 Site Health: Reduce false reports of HTTPS failures.
Reduce severity of failing HTTPS tests from critical to warning. Stop reporting failures if the site is being accessed over HTTPS but `wp_is_https_supported()` indicates a lack of support.

Props annalamprou, AnotherDave, ayeshrajans, bobbingwide, Clorith, dragongate, eatsleepcode, gab81, geoffrey1963, Ipstenu, k3nsai, mmuyskens, nicegamer7, peterwilsoncc, pwallner, SergeyBiryukov, TimothyBlynJacobs, Toru.
Fixes #52783.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50271 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-06 03:24:08 +00:00
Sergey Biryukov
b8f35c130c Coding Standards: Give some variables in WP_Importer a more meaningful name.
See #52627.
Built from https://develop.svn.wordpress.org/trunk@50658


git-svn-id: http://core.svn.wordpress.org/trunk@50270 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-05 10:50:03 +00:00
Sergey Biryukov
a338f84f32 Coding Standards: Use strict comparison in wp-admin/includes/class-wp-filesystem-*.php.
See #52627.
Built from https://develop.svn.wordpress.org/trunk@50657


git-svn-id: http://core.svn.wordpress.org/trunk@50269 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-05 10:38:07 +00:00
Sergey Biryukov
907bfe74cd Coding Standards: Use strict comparison in wp-admin/includes/class-core-upgrader.php.
See #52627.
Built from https://develop.svn.wordpress.org/trunk@50652


git-svn-id: http://core.svn.wordpress.org/trunk@50264 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-04 16:49:09 +00:00
Sergey Biryukov
f701ad4999 Coding Standards: Remove some extra whitespace in _wp_translate_postdata().
See #52627.
Built from https://develop.svn.wordpress.org/trunk@50618


git-svn-id: http://core.svn.wordpress.org/trunk@50231 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-30 15:19:03 +00:00
Sergey Biryukov
69a7063a49 Code Modernization: Check if the _export_data_grouped post meta is an array when generating a personal data export file.
This avoids a fatal error on PHP 8 in `wp_privacy_generate_personal_data_export_file()` if the `_export_data_grouped` post meta exists but is not an array.

Additionally, refactor unit tests for the function to:
* Reduce redundant code
* Switch to data provider
* Test on the full HTML output instead of select pieces of the output
* Expand unhappy path coverage

Follow-up to [43012], [44786], [47146], [47278].

Props hellofromTonya, jrf, xknown.
See #51423.
Built from https://develop.svn.wordpress.org/trunk@50613


git-svn-id: http://core.svn.wordpress.org/trunk@50226 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-29 19:37:04 +00:00
davidbaumwald
9b8c498eea Privacy: Print screen reader text for the "Copy suggested policy text..." action button.
This change switches out `sprintf` for `printf` on the "Copy suggested policy text from..." button screen reader text.  Also, wrap the actual button text in a `<span aria-hidden="true">` to prevent both the button text and the screen reader text from being spoken.

Props mukesh27, SergeyBiryukov, sabernhardt.
Fixes #52891.
Built from https://develop.svn.wordpress.org/trunk@50585


git-svn-id: http://core.svn.wordpress.org/trunk@50198 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-25 20:21:04 +00:00
gziolo
3bd08d3bd4 Editor: Add new theme category for block types
Related: https://github.com/WordPress/gutenberg/pull/30020.

Introduces a new "theme" category to the default set to use with template-parts and other FSE blocks.

Props matveb.
Fixes #52883. 


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


git-svn-id: http://core.svn.wordpress.org/trunk@50177 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-23 09:02:06 +00:00
Sergey Biryukov
0ee244739a Code Modernization: Correct expected data type for WP_User_Search::$page property.
This fixes erroneous parentheses placement and applies the type cast to the variable it was intended for.

Follow-up to [3864].

Props hellofromTonya, jrf, xknown.
See #51423.
Built from https://develop.svn.wordpress.org/trunk@50563


git-svn-id: http://core.svn.wordpress.org/trunk@50176 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-22 22:42:04 +00:00
Sergey Biryukov
590d59e92f Coding Standards: Move some translator comments to the correct place.
Follow-up to [48172].

See #52627.
Built from https://develop.svn.wordpress.org/trunk@50561


git-svn-id: http://core.svn.wordpress.org/trunk@50174 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-21 13:13:03 +00:00
Sergey Biryukov
a885f914e4 Coding Standards: Add missing semicolon to some endif keywords.
See #52627.
Built from https://develop.svn.wordpress.org/trunk@50560


git-svn-id: http://core.svn.wordpress.org/trunk@50173 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-21 13:05:04 +00:00
Sergey Biryukov
d72f4e0e48 Coding Standards: Use strict comparison in wp-admin/includes/class-wp-upgrader.php.
See #52627.
Built from https://develop.svn.wordpress.org/trunk@50557


git-svn-id: http://core.svn.wordpress.org/trunk@50170 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-21 12:12:07 +00:00
Sergey Biryukov
d3d78e755b Coding Standards: Add a space before / character in some self-closing HTML tags.
While this has no effect on the code, it fixes a minor inconsistency with the rest of core.

Props laxman-prajapati.
Fixes #52870.
Built from https://develop.svn.wordpress.org/trunk@50556


git-svn-id: http://core.svn.wordpress.org/trunk@50169 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-20 18:30:08 +00:00
Sergey Biryukov
643888dfc6 I18N: Update list of continents and cities for the timezone selection.
Props wangql, mukesh27.
Fixes #52861.
Built from https://develop.svn.wordpress.org/trunk@50555


git-svn-id: http://core.svn.wordpress.org/trunk@50168 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-19 15:42:04 +00:00
Sergey Biryukov
b4c09beba8 I18N: Remove duplicate entries from the list of continents and cities.
Follow-up to [37554].

See #52861.
Built from https://develop.svn.wordpress.org/trunk@50554


git-svn-id: http://core.svn.wordpress.org/trunk@50167 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-19 15:21:08 +00:00
whyisjake
471fc1e913 Media: Pass the appropriate reference into wp_getimagesize.
With changes that were introduced in [49889] the second parameter for getimagesize() function is expecting a a reference.

Previously, most calls did not pass the 2nd param, and as a result, we are getting unexpected results.

This was only a problem with applications that are using a custom stream wrapper, and the image contained EXIF data.

For more see:

* https://github.com/humanmade/S3-Uploads/issues/496
* https://github.com/aws/aws-sdk-php/issues/1923

Fixes #52826.
Props terriann, SergeyBiryukov, Mista-Flo, hellofromTonya, rinatkhaziev, whyisjake.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50165 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-19 00:01:03 +00:00
Sergey Biryukov
bf29bb4441 Coding Standards: Use strict comparison for JS fragment in some admin files.
Follow-up to [48083].

Props nayanchamp7, rnaby.
Fixes #52845, #41988.
Built from https://develop.svn.wordpress.org/trunk@50541


git-svn-id: http://core.svn.wordpress.org/trunk@50154 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-18 14:13:08 +00:00
Sergey Biryukov
3f03bb352e Site Health: Use a singular string in dashboard widget if there is only one critical issue or recommendation.
Props Presskopp, hareesh-pillai.
Fixes #52521.
Built from https://develop.svn.wordpress.org/trunk@50530


git-svn-id: http://core.svn.wordpress.org/trunk@50143 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-13 10:59:02 +00:00
gziolo
f27c179afc Editor: Make block type aware of variations
Currently block variations are only defined on the client. In some cases, creating block variations on the server can be very useful, especially when needed data is not exposed in the REST APIs.

Related to https://github.com/WordPress/gutenberg/pull/29095.

Props: gwwar, timothyblynjacobs.
Fixes: #52688.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50140 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-12 13:35:09 +00:00
Sergey Biryukov
88df1ef431 Coding Standards: Consistently format opendir() calls in get_plugins().
Props sabernhardt, subrataemfluence.
Fixes #44250.
Built from https://develop.svn.wordpress.org/trunk@50522


git-svn-id: http://core.svn.wordpress.org/trunk@50135 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-11 15:19:08 +00:00
Peter Wilson
0b75f9557e Docs: Improve spelling in [50516].
Props jeremyfelt.
See #52628, #34564.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50130 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-09 23:22:06 +00:00
Peter Wilson
fb1857def8 Docs: Improve compatibility comment in WP_List_Table.
Improve comment explaining backward compatibility check for the primary column in `WP_List_Table::get_column_info()`.

Unprops helen, markjaquith.
See #52628, #34564.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50129 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-09 22:35:06 +00:00
desrosj
a8b7cd17e0 Update $_old_files for 5.7.
Follow up to [50066].

See #52334.
Built from https://develop.svn.wordpress.org/trunk@50510


git-svn-id: http://core.svn.wordpress.org/trunk@50123 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-08 18:30:07 +00:00
John Blackbourn
52679edbff Docs: Add examples of possible names for various hooks whose name contains a dynamic portion.
This provides greater discoverability of such hooks in search results on the Code Reference site as well as increased clarity when reading the source.

See #50734, #52628

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


git-svn-id: http://core.svn.wordpress.org/trunk@50118 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-07 12:32:09 +00:00
Mike Schroder
34b0dc8023 Upgrade/Install: Invalidate OPcache for version.php during update.
Invalidate OPcache for `wp-content/version.php` on update individually, since it’s copied separately.

Props stodorovic, krstarica, cenay, desrosj, pbiron, sergeybiryukov, mikeschroder.
Fixes #51686, #51281.
See #36455.
Built from https://develop.svn.wordpress.org/trunk@50475


git-svn-id: http://core.svn.wordpress.org/trunk@50086 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-02 17:13:03 +00:00
Sergey Biryukov
69a0a68817 Docs: Clarify a comment about wp_opcache_invalidate() in _copy_dir().
Follow-up to [48160].

See #52628.
Built from https://develop.svn.wordpress.org/trunk@50460


git-svn-id: http://core.svn.wordpress.org/trunk@50071 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-01 10:38:05 +00:00
Sergey Biryukov
74e0d8ba54 Docs: Correct function name in add_settings_field() DocBlock.
See #52628.
Built from https://develop.svn.wordpress.org/trunk@50434


git-svn-id: http://core.svn.wordpress.org/trunk@50045 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-02-25 12:02:03 +00:00
Sergey Biryukov
ddca2ed164 Docs: Document the usage of $pagenow global in a few functions.
See #51800.
Built from https://develop.svn.wordpress.org/trunk@50407


git-svn-id: http://core.svn.wordpress.org/trunk@50018 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-02-22 19:18:12 +00:00
Peter Wilson
0b9c7b7cdf Site Health: Update loopback test to POST to wp-cron.
Replace loopback health check URL with a `POST` request to `wp-cron.php` in the WordPress install directory. This more closely represents how WordPress uses loopback requests.

A `POST` request is used to cause `wp-cron.php` to exit prior to running any cron jobs. This allows the test to indicate success quicker and accounts for sites that set the `DISABLE_WP_CRON` constant to avoid running cron jobs on loopback requests.

Props clorith, peterwilsoncc, TimothyBlynJacobs.
Fixes #52547.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50010 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-02-22 00:51:09 +00:00
Sergey Biryukov
50f8dafe17 Users: Correctly display an error message after clicking the "Send Reset Link" button.
The `addInlineNotice()` function expects a single string as a success or error message, not an array of strings.

Follow-up to [50129].

Props audrasjb.
Fixes #52573.
Built from https://develop.svn.wordpress.org/trunk@50390


git-svn-id: http://core.svn.wordpress.org/trunk@50001 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-02-19 17:24:05 +00:00
Peter Wilson
c6af819b3a Site Health: Use home page for loopback test.
Use `home_url()` for asynchronous loopback test to ensure correct results on sites with WordPress installed elsewhere, for example WordPress in a sub-directory.

Props Levdbas.
Fixes #52547.


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


git-svn-id: http://core.svn.wordpress.org/trunk@49992 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-02-17 23:10:04 +00:00
Sergey Biryukov
dcbe3cb7b8 Privacy: Suggest wp_add_privacy_policy_content() as an alternative for the deprecated wp_get_default_privacy_policy_content hook.
Follow-up to [50161].

See #49264.
Built from https://develop.svn.wordpress.org/trunk@50374


git-svn-id: http://core.svn.wordpress.org/trunk@49985 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-02-17 12:45:04 +00:00
Sergey Biryukov
e99d544215 Administration: Apply the months_dropdown_results filter separately from pre_months_dropdown_query.
Follow-up to [50163].

Props hellofromTonya.
Fixes #51660.
Built from https://develop.svn.wordpress.org/trunk@50362


git-svn-id: http://core.svn.wordpress.org/trunk@49973 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-02-16 19:58:05 +00:00
Sergey Biryukov
dbaee6b550 Filesystem API: Make sure to only call fread() on non-empty files in the PclZip library.
This avoids a fatal error on PHP 8 caused by passing a zero value to `fread()` as the `$length` argument, which must be greater than zero.

Props yakimun, fierevere, jrf, DavidAnderson, SergeyBiryukov.
Fixes #52018.
Built from https://develop.svn.wordpress.org/trunk@50355


git-svn-id: http://core.svn.wordpress.org/trunk@49966 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-02-16 18:42:03 +00:00
gziolo
135a35fd04 Blocks: Add missing apiVersion field when preparing server-registered blocks for the block editor
When working on changes to @wordpress/create-block tool (https://github.com/WordPress/gutenberg/pull/28883) to use register_block_type_from_metadata with block.json file in the templates for scaffolded blocks I run into this issue where apiVersion wasn't exposed from the server.

Fixes #52512.


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


git-svn-id: http://core.svn.wordpress.org/trunk@49942 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-02-12 16:00:06 +00:00
Peter Wilson
0f251cdd90 Canonical: Rename wp_force_plain_ugly_permalink() to match UI terminology.
Rename `wp_force_plain_ugly_permalink()` to `wp_force_plain_post_permalink()` to match terminology used in the WordPress dashboard.

Follow up to [50132].
Props SergeyBiryukov.
Fixes #5272.


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


git-svn-id: http://core.svn.wordpress.org/trunk@49927 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-02-10 05:40:07 +00:00
Sergey Biryukov
19ce835654 Docs: Update some recently added inline comments per the documentation standards.
Follow-up to [50256], [50258], [50259].

See #51800.
Built from https://develop.svn.wordpress.org/trunk@50264


git-svn-id: http://core.svn.wordpress.org/trunk@49909 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-02-09 12:34:06 +00:00
Sergey Biryukov
ea2ff553e9 Site Health: Clarify the recommendation in file uploads test when post_max_size is defined as 0.
This adds a more descriptive text in scenarios where `post_max_size` and `upload_max_filesize` differ, and `post_max_size` is set to a value of `0`.

In some scenarios, PHP may read `0` as a literal zero size, and not as unlimited, which it also means in other scenarios.

See https://www.php.net/manual/en/ini.core.php#ini.post-max-size for details, as PHP 5.3.4 introduced this behavior for literal zero interpretation when the content type of a request is `application/x-www-form-urlencoded` or is not registered with PHP.

Props Clorith, pixolin, helen, ratneshk.
Fixes #51466.
Built from https://develop.svn.wordpress.org/trunk@50263


git-svn-id: http://core.svn.wordpress.org/trunk@49908 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-02-09 12:05:07 +00:00
antpb
19dbb952f3 Media: Allow post_date to be respected in media_handle_sideload().
Previously, date information was unable to be changed when using `media_handle_sideload()`. 

Now you can override the date for a media item using `$post_data['post_date']` before using the function.

Props jamesgol, mukesh27, SergeyBiryukov, hellofromTonya, Mista-Flo.
Fixes #50972.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49903 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-02-08 23:22:04 +00:00
Dominik Schilling
219d92f75b Block Editor: Use a unique name for the nonce of the custom fields toggle form.
Avoids a browser warning for having two elements with a non-unique id `#_wpnonce` on the post edit screen.

See #23165.
Fixes #51483.
Props vandestouwe, Mista-Flo.
Built from https://develop.svn.wordpress.org/trunk@50255


git-svn-id: http://core.svn.wordpress.org/trunk@49900 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-02-08 21:39:16 +00:00
Sergey Biryukov
b88325dbc6 I18N: Use the actual placeholder instead of a number in translator comments if the corresponding string does not use numbered placeholders.
Adjust some newly introduced strings to remove unnecessary numbered placeholders for consistency.

Follow-up to [42827].

See #51800.
Built from https://develop.svn.wordpress.org/trunk@50234


git-svn-id: http://core.svn.wordpress.org/trunk@49895 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-02-07 12:44:04 +00:00
Sergey Biryukov
a80f705d97 Privacy: Rename the $send_confirmation_email parameter of wp_create_user_request() to $status, for clarity.
Follow-up to [50159], [50165].

Props xkon, TimothyBlynJacobs.
Fixes #52430. See #43890.
Built from https://develop.svn.wordpress.org/trunk@50230


git-svn-id: http://core.svn.wordpress.org/trunk@49891 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-02-05 15:50:05 +00:00