Commit Graph

3901 Commits

Author SHA1 Message Date
Peter Wilson
c4eddfdfed 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@50659 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-06 03:22:08 +00:00
Sergey Biryukov
868081ff3a Coding Standards: Give some variables in WP_Importer a more meaningful name.
See #52627.

git-svn-id: https://develop.svn.wordpress.org/trunk@50658 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-05 10:48:11 +00:00
Sergey Biryukov
b0f74b74a5 Coding Standards: Use strict comparison in wp-admin/includes/class-wp-filesystem-*.php.
See #52627.

git-svn-id: https://develop.svn.wordpress.org/trunk@50657 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-05 10:36:17 +00:00
Sergey Biryukov
0f4d1d674c Coding Standards: Use strict comparison in wp-admin/includes/class-core-upgrader.php.
See #52627.

git-svn-id: https://develop.svn.wordpress.org/trunk@50652 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-04 16:47:48 +00:00
Sergey Biryukov
4a8aefaf72 Coding Standards: Remove some extra whitespace in _wp_translate_postdata().
See #52627.

git-svn-id: https://develop.svn.wordpress.org/trunk@50618 602fd350-edb4-49c9-b593-d223f7449a82
2021-03-30 15:17:05 +00:00
Sergey Biryukov
1dafd53d20 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@50613 602fd350-edb4-49c9-b593-d223f7449a82
2021-03-29 19:35:36 +00:00
David Baumwald
7a4d7fc045 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@50585 602fd350-edb4-49c9-b593-d223f7449a82
2021-03-25 20:19:57 +00:00
Greg Ziółkowski
4179f10b7a 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. 



git-svn-id: https://develop.svn.wordpress.org/trunk@50564 602fd350-edb4-49c9-b593-d223f7449a82
2021-03-23 09:00:03 +00:00
Sergey Biryukov
b50376d557 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@50563 602fd350-edb4-49c9-b593-d223f7449a82
2021-03-22 22:40:29 +00:00
Sergey Biryukov
4cc3f127df Coding Standards: Move some translator comments to the correct place.
Follow-up to [48172].

See #52627.

git-svn-id: https://develop.svn.wordpress.org/trunk@50561 602fd350-edb4-49c9-b593-d223f7449a82
2021-03-21 13:11:11 +00:00
Sergey Biryukov
89e6e2d31e Coding Standards: Add missing semicolon to some endif keywords.
See #52627.

git-svn-id: https://develop.svn.wordpress.org/trunk@50560 602fd350-edb4-49c9-b593-d223f7449a82
2021-03-21 13:03:14 +00:00
Sergey Biryukov
eea4f303a1 Coding Standards: Use strict comparison in wp-admin/includes/class-wp-upgrader.php.
See #52627.

git-svn-id: https://develop.svn.wordpress.org/trunk@50557 602fd350-edb4-49c9-b593-d223f7449a82
2021-03-21 12:10:55 +00:00
Sergey Biryukov
f552384ebd 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@50556 602fd350-edb4-49c9-b593-d223f7449a82
2021-03-20 18:28:32 +00:00
Sergey Biryukov
b40cf64e6a I18N: Update list of continents and cities for the timezone selection.
Props wangql, mukesh27.
Fixes #52861.

git-svn-id: https://develop.svn.wordpress.org/trunk@50555 602fd350-edb4-49c9-b593-d223f7449a82
2021-03-19 15:40:22 +00:00
Sergey Biryukov
97037b3ab8 I18N: Remove duplicate entries from the list of continents and cities.
Follow-up to [37554].

See #52861.

git-svn-id: https://develop.svn.wordpress.org/trunk@50554 602fd350-edb4-49c9-b593-d223f7449a82
2021-03-19 15:19:12 +00:00
Jake Spurlock
140bd894d6 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.



git-svn-id: https://develop.svn.wordpress.org/trunk@50552 602fd350-edb4-49c9-b593-d223f7449a82
2021-03-18 23:59:12 +00:00
Sergey Biryukov
3c85e60449 Coding Standards: Use strict comparison for JS fragment in some admin files.
Follow-up to [48083].

Props nayanchamp7, rnaby.
Fixes #52845, #41988.

git-svn-id: https://develop.svn.wordpress.org/trunk@50541 602fd350-edb4-49c9-b593-d223f7449a82
2021-03-18 14:11:55 +00:00
Sergey Biryukov
a3dd4b7d56 Site Health: Use a singular string in dashboard widget if there is only one critical issue or recommendation.
Props Presskopp, hareesh-pillai.
Fixes #52521.

git-svn-id: https://develop.svn.wordpress.org/trunk@50530 602fd350-edb4-49c9-b593-d223f7449a82
2021-03-13 10:57:27 +00:00
Greg Ziółkowski
380d0445e8 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.



git-svn-id: https://develop.svn.wordpress.org/trunk@50527 602fd350-edb4-49c9-b593-d223f7449a82
2021-03-12 13:33:21 +00:00
Sergey Biryukov
4fadd1f574 Coding Standards: Consistently format opendir() calls in get_plugins().
Props sabernhardt, subrataemfluence.
Fixes #44250.

git-svn-id: https://develop.svn.wordpress.org/trunk@50522 602fd350-edb4-49c9-b593-d223f7449a82
2021-03-11 15:17:56 +00:00
Peter Wilson
6d4739c51f Docs: Improve spelling in [50516].
Props jeremyfelt.
See #52628, #34564.


git-svn-id: https://develop.svn.wordpress.org/trunk@50517 602fd350-edb4-49c9-b593-d223f7449a82
2021-03-09 23:20:24 +00:00
Peter Wilson
bc14aea75d 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.



git-svn-id: https://develop.svn.wordpress.org/trunk@50516 602fd350-edb4-49c9-b593-d223f7449a82
2021-03-09 22:33:47 +00:00
Jonathan Desrosiers
a6f9088a35 Update $_old_files for 5.7.
Follow up to [50066].

See #52334.

git-svn-id: https://develop.svn.wordpress.org/trunk@50510 602fd350-edb4-49c9-b593-d223f7449a82
2021-03-08 18:28:35 +00:00
John Blackbourn
fa05e5e733 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


git-svn-id: https://develop.svn.wordpress.org/trunk@50505 602fd350-edb4-49c9-b593-d223f7449a82
2021-03-07 12:30:38 +00:00
Mike Schroder
ae983c3f99 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@50475 602fd350-edb4-49c9-b593-d223f7449a82
2021-03-02 17:11:35 +00:00
Sergey Biryukov
f2367e643b Docs: Clarify a comment about wp_opcache_invalidate() in _copy_dir().
Follow-up to [48160].

See #52628.

git-svn-id: https://develop.svn.wordpress.org/trunk@50460 602fd350-edb4-49c9-b593-d223f7449a82
2021-03-01 10:36:29 +00:00
Sergey Biryukov
dae8858b4a Docs: Correct function name in add_settings_field() DocBlock.
See #52628.

git-svn-id: https://develop.svn.wordpress.org/trunk@50434 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-25 12:01:00 +00:00
Sergey Biryukov
aaf3fc57fc Docs: Document the usage of $pagenow global in a few functions.
See #51800.

git-svn-id: https://develop.svn.wordpress.org/trunk@50407 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-22 19:16:07 +00:00
Peter Wilson
21ef06aee1 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.



git-svn-id: https://develop.svn.wordpress.org/trunk@50399 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-22 00:49:17 +00:00
Sergey Biryukov
d77042872c 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@50390 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-19 17:22:37 +00:00
Peter Wilson
e686cb1b0e 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.



git-svn-id: https://develop.svn.wordpress.org/trunk@50381 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-17 23:08:14 +00:00
Sergey Biryukov
2c43a12ef6 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@50374 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-17 12:43:26 +00:00
Sergey Biryukov
729873ddda Administration: Apply the months_dropdown_results filter separately from pre_months_dropdown_query.
Follow-up to [50163].

Props hellofromTonya.
Fixes #51660.

git-svn-id: https://develop.svn.wordpress.org/trunk@50362 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-16 19:56:13 +00:00
Sergey Biryukov
563ea09789 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@50355 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-16 18:40:29 +00:00
Greg Ziółkowski
e3a98e8f55 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.



git-svn-id: https://develop.svn.wordpress.org/trunk@50297 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-12 15:58:53 +00:00
Peter Wilson
f9b901549b 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.



git-svn-id: https://develop.svn.wordpress.org/trunk@50282 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-10 05:38:23 +00:00
Sergey Biryukov
a4cb795001 Docs: Update some recently added inline comments per the documentation standards.
Follow-up to [50256], [50258], [50259].

See #51800.

git-svn-id: https://develop.svn.wordpress.org/trunk@50264 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-09 12:32:54 +00:00
Sergey Biryukov
0b8b1f4006 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@50263 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-09 12:04:01 +00:00
Anthony Burchell
27a113951b 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@50258 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-08 23:20:56 +00:00
Dominik Schilling
df0c776d1f 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@50255 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-08 21:37:34 +00:00
Sergey Biryukov
ef0a312dc1 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@50234 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-07 12:42:06 +00:00
Sergey Biryukov
73b353ef95 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@50230 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-05 15:48:59 +00:00
John Blackbourn
df85e54119 Users: Coding standards fixes after [50228].
See #52238


git-svn-id: https://develop.svn.wordpress.org/trunk@50229 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-05 14:42:01 +00:00
John Blackbourn
a690358619 Users: Allow the role of users to be bulk changed to no role from the Users listing screen.
This option is already available when editing an individual user, but it was previously missing from the bulk actions.

Props bonniebeeman, sabernhardt, ovidiul, jeroenrotty

Fixes #52238


git-svn-id: https://develop.svn.wordpress.org/trunk@50228 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-05 14:38:15 +00:00
Anthony Burchell
26fb7c9682 Media: Consistency in logic to pass wp_getimagesize() tests.
Previously, we used `DIR_TESTDATA` to determine if a test should skip a newly silenced error in `wp_getimagesize()`.

We are now using `WP_RUN_CORE_TESTS` instead for consistency.

Props hellofromTonya, SergeyBiryukov.
See #49889.


git-svn-id: https://develop.svn.wordpress.org/trunk@50170 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-02 21:34:40 +00:00
Sergey Biryukov
f92eae92d0 Docs: Update documentation for wp_create_user_request() per the documentation standards.
Add a `@since` note for the `$send_confirmation_email` parameter.

Follow-up to [50159].

See #43890.

git-svn-id: https://develop.svn.wordpress.org/trunk@50165 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-02 20:40:53 +00:00
Jake Spurlock
0c0805bb9e Administration: New filter ahead of the months drop-down.
As this can cause large, long running queries on sites with many posts, this filter allows the query to be modified, bypassing entirely if needed. 

Fixes #51660.

Props geoffguillain, SergeyBiryukov, hareesh-pillai, hellofromTonya, TimothyBlynJacobs, whyisjake. 



git-svn-id: https://develop.svn.wordpress.org/trunk@50163 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-02 20:32:42 +00:00
Timothy Jacobs
03e81107ad Privacy: Redesign the Privacy settings pages.
The Privacy settings pages now use the same design patterns as the Site Health screen. Additionally, each privacy policy guide is now contained in an accordion to make the page easier to navigate when multiple plugins are in use.

Props xkon, hedgefield, garrett-eclipse, hellofromTonya, paaljoachim, joedolson.
Fixes #49264.


git-svn-id: https://develop.svn.wordpress.org/trunk@50161 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-02 20:12:39 +00:00
Anthony Burchell
32395325e9 Privacy: Allow Admin to Skip e-mail confirmation for Export.
This adds a form option to skip the admin email alert when exporting personal data.

Props xkon, azaozz, TZ-Media, iandunn, desrosj, iprg, allendav, wesselvandenberg, karmatosed, birgire, davidbaumwald, estelaris, paaljoachim, hellofromTonya.
Fixes #43890.


git-svn-id: https://develop.svn.wordpress.org/trunk@50159 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-02 19:43:37 +00:00
Sergey Biryukov
77a30d9def Login and Registration: Improve the UX of the Reset Password screen.
Previously, it was unclear that the displayed password is only being suggested and should be saved by clicking the Reset Password button.

This adds separate Generate Password and Save Password buttons, for clarity.

Props xkon, estelaris, jaymanpandya, hedgefield, audrasjb, erichmond, magicroundabout, lukecavanagh, knutsp, tinodidriksen, nico_martin, markhowellsmead, kara.mcnair, e_baker, pixelverbieger, souri_wpaustria, megabyterose, poena, whyisjake.
Fixes #39638.

git-svn-id: https://develop.svn.wordpress.org/trunk@50153 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-02 18:11:26 +00:00