Commit Graph

41435 Commits

Author SHA1 Message Date
Sergey Biryukov 0206900cff Canonical: Only redirect non-existing page requests to the post permalink if the post is found.
Follow-up to [47760].

See #45337, #40773, #28081, #11694.

git-svn-id: https://develop.svn.wordpress.org/trunk@47761 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-04 10:47:05 +00:00
Sergey Biryukov de14ea86bf Canonical: Redirect paged requests for a static page assigned as the "Posts page".
This avoids displaying duplicate content of the home page under different URLs with appended page numbers.

This change only affects the `<!--nextpage-->` pagination (`page` query variable) and not the regular multiple posts pagination (`paged` query variable).

The posts page does not support the `<!--nextpage-->` pagination, so requests for invalid page numbers should be redirected to the page permalink, applying the logic previously implemented for single posts or pages.

Follow-up to [34492], [47727].

Props jeremyfelt, sachit.tandukar, SergeyBiryukov.
Fixes #45337. See #40773, #28081, #11694.

git-svn-id: https://develop.svn.wordpress.org/trunk@47760 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-04 10:40:06 +00:00
Sergey Biryukov 54c8470bd6 Coding Standards: Fix WPCS issues in `wp-includes/canonical.php`.
Reformat long conditions and dense code blocks for better readability.

See #49542.

git-svn-id: https://develop.svn.wordpress.org/trunk@47759 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-04 09:03:11 +00:00
Timothy Jacobs 8153d15f09 REST API: Support more JSON Schemas when filtering a response by context.
The array type, multi-types, and the additional properties keyword are now supported. Additionally, the filter recurses to an infinite depth.

Fixes #48819.


git-svn-id: https://develop.svn.wordpress.org/trunk@47758 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-04 02:44:44 +00:00
Timothy Jacobs 9a903f7e73 Tests: Update wp-api-generated.js.
[47755] and [47756] caused a schema change, so the wp-api-generated.js file needs to be updated.


git-svn-id: https://develop.svn.wordpress.org/trunk@47757 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-04 00:26:52 +00:00
Timothy Jacobs 5460e0df1e REST API: Accept POST requests in the block renderer endpoint.
Rendering a block is idempotent, so a GET is the most natural request method. However, the maximum length of URLs prevented blocks with large attributes from being rendered.

Props ryankienstra.
Fixes #49680.


git-svn-id: https://develop.svn.wordpress.org/trunk@47756 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-03 22:56:01 +00:00
Timothy Jacobs 6ab90a209d REST API: Validate that the oembed url parameter is a string.
This prevents a PHP warning from being issued by esc_url_raw when a non-string value is provided.

Props dd32.
Fixes #49991.


git-svn-id: https://develop.svn.wordpress.org/trunk@47755 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-03 22:40:53 +00:00
John Blackbourn 7d24075a26 Docs: Misc docblock corrections and improvements.
See #49572

git-svn-id: https://develop.svn.wordpress.org/trunk@47754 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-03 19:36:06 +00:00
Timothy Jacobs ef05acdfaa REST API: Support the uuid JSON Schema format.
This accepts a uuid of any version. A future commit could add support for restricting uuids to a specific version.

Props johnwatkins0.
Fixes #50053.


git-svn-id: https://develop.svn.wordpress.org/trunk@47753 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-03 19:18:40 +00:00
John Blackbourn d8371d2134 Build/Test Tools: Further enhancements to the local development environment readme.
Props desrosj, donmhico

See #50058

git-svn-id: https://develop.svn.wordpress.org/trunk@47752 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-03 14:41:03 +00:00
Andrea Fercia 6e181e8823 File Editor: Remove CSS exceptions for the "Select plugin/theme to edit" and documentation "Look Up" buttons.
Buttons should use the default buttons styles, no exceptions.

Props passoniate, garethgillman.
See #49197.
Fixes #49353.


git-svn-id: https://develop.svn.wordpress.org/trunk@47751 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-03 14:19:51 +00:00
Andrea Fercia 8f1d4525c2 Upload: Improve file input and button alignment in plugin/theme upload form.
Resets flexbox on smaller screens. Improves vertical alignment on large screens.
Follow-up to [47599] and [47271].

Props mukesh27, DarkoG.
See #48859, #49914.
Fixes #49951.


git-svn-id: https://develop.svn.wordpress.org/trunk@47750 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-03 13:34:26 +00:00
Sergey Biryukov 5dbed96333 Docs: Further update inline documentation for the `wpdb` class per the documentation standards.
Restore some previous edits from [46696], [47060], [47122], [47230] that were accidentally reverted in [47740].

See #49572.

git-svn-id: https://develop.svn.wordpress.org/trunk@47749 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-03 11:43:14 +00:00
John Blackbourn 84772cc608 Media: Ensure a consistent structure for the array returned by `wp_get_attachment_image_src()`.
The array returned by this function previously included a fourth element only when an intermediate image size was used. This change ensures a consistent structure in the returned array regardless of the function's internal behaviour.

Props wido, joemcgill, johnbillion

Fixes #46113

git-svn-id: https://develop.svn.wordpress.org/trunk@47748 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-02 22:55:17 +00:00
John Blackbourn 4889e7a8d2 Menus: Allow empty taxonomy terms to be surfaced when searching for items.
This brings the behaviour inline with that of browsing terms or using the All Items tab, which correctly shows empty terms.

Props birgire, audrasjb

Fixes #45298

git-svn-id: https://develop.svn.wordpress.org/trunk@47747 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-02 22:34:50 +00:00
John Blackbourn 1510f69d69 Upgrade/Install: Unlink the logo on the installation and config setup screens.
This allows for a natural tab order during installation, without negatively impacting users who use the keyboard for navigation, those who use a screen reader, or those who use neither.

Props lwill, afercia, audrasjb.

Fixes #47759

git-svn-id: https://develop.svn.wordpress.org/trunk@47746 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-02 21:44:48 +00:00
John Blackbourn 8eab1eb9a9 Administration: Reduce the chance that a PHP error message that occurs before the admin menu gets output is covered by the admin menu.
Props EmpireOfLight, afercia, Mte90, audrasjb, sunnyratilal

Fixes #35155

git-svn-id: https://develop.svn.wordpress.org/trunk@47745 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-02 20:59:31 +00:00
John Blackbourn d250cbcfee Build/Test Tools: Add information regarding the default credentials for the local development environment to the project readme.
Props bookdude13

Fixes #49273

git-svn-id: https://develop.svn.wordpress.org/trunk@47744 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-02 20:17:38 +00:00
John Blackbourn b9f6cf083a Build/Test Tools: Add more comprehensive instructions to the readme for the local development environment.
See #50058

git-svn-id: https://develop.svn.wordpress.org/trunk@47743 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-02 19:14:24 +00:00
John Blackbourn 578956abf6 Build/Test Tools: Exclude plugins and themes within `src`.
Just like the `build` directory, `src` can include plugins and themes which shouldn't be linted by PHPCS.

Fixes #49781

git-svn-id: https://develop.svn.wordpress.org/trunk@47742 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-02 18:15:30 +00:00
John Blackbourn 09e61958b3 Build/Test Tools: Remove unnecessary formatting before linting on Travis CI.
Fixes #49722

git-svn-id: https://develop.svn.wordpress.org/trunk@47741 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-02 17:44:11 +00:00
John Blackbourn c570d4409f Docs: Update inline documentation for the wpdb class.
Props theMikeD

Fixes #49477

git-svn-id: https://develop.svn.wordpress.org/trunk@47740 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-02 17:23:28 +00:00
Dominik Schilling c09e2d21a7 Users: Don't reset user language preference on user update.
Props johnbillion.
Fixes #38665.

git-svn-id: https://develop.svn.wordpress.org/trunk@47739 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-02 16:27:34 +00:00
Sergey Biryukov b7a8094d32 Query: Simplify the logic in `WP::handle_404()` to allow for easier modifications.
See #45337.

git-svn-id: https://develop.svn.wordpress.org/trunk@47738 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-02 08:46:39 +00:00
Jonathan Desrosiers 7e0a63f8c5 General: More PHP compatibility adjustments.
In this round:
- Removed references to `safe_mode` in `class-php3.php`. This was removed in PHP 5.4.
- Add inline exclude comments for compatibility checks in getID3.

Follow up of [47735-47736].

See #49922.

git-svn-id: https://develop.svn.wordpress.org/trunk@47737 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-01 20:10:58 +00:00
Jonathan Desrosiers 627b93f54d General: Fix typo within `phpcs:ignore` inline comment.
Follow up of [47735].

See #49922.

git-svn-id: https://develop.svn.wordpress.org/trunk@47736 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-01 19:34:05 +00:00
Jonathan Desrosiers 8e2de8212b General: Fix various issues flagged by the PHPCompatibilityWP PHPCS ruleset.
As part of the continued effort to improve PHP compatibility, the following improvments are being made:

- Removing deprecated PHP `safe_mode` checks not found in bundled external libraries.
- Change the remaining `while` loops using `each()` to `foreach` loops.
- Prevent false positives from being flagged for the `sodium_compat` library being caused by loading this in a non-standard way.
- Add inline comments to not flag deprecated PHP directives in the getID3 library.

Props desrosj, earnjam, dryanpress.
See #49922.

git-svn-id: https://develop.svn.wordpress.org/trunk@47735 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-01 19:05:04 +00:00
Sergey Biryukov 05423578d7 Taxonomy: Restore (un-deprecate) the `tag_row_actions` filter.
The filter provides a simple way for plugin authors to add actions generically for all taxonomy list tables without looping through each taxonomy individually.

Props joemcgill, delowardev.
Fixes #49808.

git-svn-id: https://develop.svn.wordpress.org/trunk@47734 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-01 16:43:46 +00:00
Jonathan Desrosiers d12ad5050b External Libraries: Update the SimplePie library to the latest version (1.5.5).
This brings SimplePie in sync with the most up to date version, 1.5.5.

This update brings many bug fixes, small enhancements, and PHP compatibility fixes for newer versions of PHP.

For a full list of changes, see https://github.com/simplepie/simplepie/blob/master/CHANGELOG.md#155-may-1-2020.

Props dshanske, slushman, etruel, wpshades, dmenard, desrosj, hareesh-pillai, stevenkword, jrf, Ipstenu, johnbillion.
Fixes #36669.

git-svn-id: https://develop.svn.wordpress.org/trunk@47733 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-01 14:24:42 +00:00
Jonathan Desrosiers aef50f979d Build/Test Tools: Introduce a command for restarting the local Docker environment.
This change introduces the `env:restart` command for easier restarting of the local Docker environment.

Props desrosj, ianbelanger.
Fixes #50039.


git-svn-id: https://develop.svn.wordpress.org/trunk@47730 602fd350-edb4-49c9-b593-d223f7449a82
2020-04-30 20:20:18 +00:00
Jonathan Desrosiers 13d382f1ff Reverting [47728].
Unprops desrosj.
See #50039.

git-svn-id: https://develop.svn.wordpress.org/trunk@47729 602fd350-edb4-49c9-b593-d223f7449a82
2020-04-30 20:16:00 +00:00
Jonathan Desrosiers 29563e5721 -username=desrosj
git-svn-id: https://develop.svn.wordpress.org/trunk@47728 602fd350-edb4-49c9-b593-d223f7449a82
2020-04-30 19:53:02 +00:00
Sergey Biryukov af596bcc5b Canonical: Redirect paged requests for non-paginated posts to the post permalink.
This avoids displaying duplicate content of the same post under different URLs and ensures the canonical URL is correct.

Previously, requests for invalid page numbers were only redirected to the post permalink if the post was actually paginated using the `<!--nextpage-->` marker.

Follow-up to [34492].

Props jeremyfelt, prografika, sachit.tandukar, subrataemfluence, hronak, ekatherine, henry.wright, chesio, dd32, SergeyBiryukov.
Fixes #40773. See #45337, #28081, #11694.

git-svn-id: https://develop.svn.wordpress.org/trunk@47727 602fd350-edb4-49c9-b593-d223f7449a82
2020-04-30 12:03:11 +00:00
Sergey Biryukov be8b8baec9 Help/About: Revert [47699] from trunk.
git-svn-id: https://develop.svn.wordpress.org/trunk@47706 602fd350-edb4-49c9-b593-d223f7449a82
2020-04-29 18:41:12 +00:00
whyisjake d27a3718d5 Update the about page for WordPress 5.4.1
git-svn-id: https://develop.svn.wordpress.org/trunk@47699 602fd350-edb4-49c9-b593-d223f7449a82
2020-04-29 18:35:02 +00:00
Ian Belanger 8ba39ba9f6 Bundled Themes: Twenty Twenty image caption is not aligned center when image is, on the front-end.
Fixes the image caption alignment issue by adding `text-align: center;` to `.wp-block-image .aligncenter figcaption`.

Props markusthiel, SergeyBiryukov, garethgillman.
Fixes #49320.

git-svn-id: https://develop.svn.wordpress.org/trunk@47689 602fd350-edb4-49c9-b593-d223f7449a82
2020-04-29 18:17:11 +00:00
Sergey Biryukov c61e42db64 Coding Standards: Fix WPCS issues in `tests/formatting/SanitizeFileName.php`.
Follow-up to [47638].

git-svn-id: https://develop.svn.wordpress.org/trunk@47664 602fd350-edb4-49c9-b593-d223f7449a82
2020-04-29 17:23:30 +00:00
Sergey Biryukov 514f7c4cc9 Docs: Correct `@since` versions, remove duplicate comment.
Follow-up to [47633].

git-svn-id: https://develop.svn.wordpress.org/trunk@47663 602fd350-edb4-49c9-b593-d223f7449a82
2020-04-29 17:23:21 +00:00
Jake Spurlock 74d6f9613b Formatting: Expand `sanitize_file_name` to have better support for utf8 characters.
Props: xknown, peterwilsoncc.


git-svn-id: https://develop.svn.wordpress.org/trunk@47638 602fd350-edb4-49c9-b593-d223f7449a82
2020-04-29 15:38:43 +00:00
Jake Spurlock 935ab39e8e Cache API: Ensure proper escaping around the stats method in the cache API.
Props: nickdaugherty, batmoo, whyisjake, westi.


git-svn-id: https://develop.svn.wordpress.org/trunk@47637 602fd350-edb4-49c9-b593-d223f7449a82
2020-04-29 15:34:55 +00:00
Jake Spurlock ec05c8b897 Block Editor: Coding standards, properly escape class names.
Props: aduth, noisysocks, pento, talldanwp, jorgefilipecosta, whyisjake, ellatrix, ehti.


git-svn-id: https://develop.svn.wordpress.org/trunk@47636 602fd350-edb4-49c9-b593-d223f7449a82
2020-04-29 15:32:19 +00:00
Jake Spurlock 8e11facb67 Query: Ensure that only a single post can be returned on date/time based queries.
Props: sstoqnov, peterwilsoncc.


git-svn-id: https://develop.svn.wordpress.org/trunk@47635 602fd350-edb4-49c9-b593-d223f7449a82
2020-04-29 15:26:56 +00:00
Jake Spurlock 4354d1fc5c User: Invalidate `user_activation_key` on password update.
Props: sstoqnov, sergeybiryukov.



git-svn-id: https://develop.svn.wordpress.org/trunk@47634 602fd350-edb4-49c9-b593-d223f7449a82
2020-04-29 15:23:37 +00:00
Jake Spurlock cfb690cb8e Customize: Add additional filters to Customizer to prevent JSON corruption.
This solution extends the wp_insert_post_data filter to pass in addition to the slashed/sanitized/processed data, and the slashed/sanitized/unprocessed data, to also pass the initial slashed/unsanitized/unprocessed data which was passed into wp_insert_post(). This then allows plugins to have complete control over how sanitization is performed based on the post type.

Props westonruter, peterwilsoncc, sstoqnov, whyisjake, xknown.
 


git-svn-id: https://develop.svn.wordpress.org/trunk@47633 602fd350-edb4-49c9-b593-d223f7449a82
2020-04-29 15:12:50 +00:00
Sergey Biryukov 833ce3b15b Networks and Sites: Link to Nginx documentation on Network Setup screen when Nginx is in use.
Props lipathor, audrasjb, johnbillion, flixos90.
Fixes #41166.

git-svn-id: https://develop.svn.wordpress.org/trunk@47632 602fd350-edb4-49c9-b593-d223f7449a82
2020-04-29 14:41:42 +00:00
Sergey Biryukov 3d932981e2 Docs: Correct `@return` type for `WP_Theme::get_post_templates()`.
The method returns an array of strings, not a single string.

Props mayankmajeji, salvatore.formisano.
Fixes #50020.

git-svn-id: https://develop.svn.wordpress.org/trunk@47631 602fd350-edb4-49c9-b593-d223f7449a82
2020-04-28 15:00:30 +00:00
Sergey Biryukov e46d1cfc84 Site Health: Avoid a PHP notice in `WP_Site_Health::wp_cron_scheduled_check()` if async test response does not contain the expected result.
Additionally, avoid a PHP notice in `::get_test_php_version()` if the minimum recommended version of PHP could not be determined.

Props schlessera, oakesjosh.
Fixes #49943.

git-svn-id: https://develop.svn.wordpress.org/trunk@47628 602fd350-edb4-49c9-b593-d223f7449a82
2020-04-27 21:59:10 +00:00
Timothy Jacobs 86cbde382a REST API: Support the (min|max)Length JSON Schema keywords.
Props sorenbronsted.
Fixes #48820.


git-svn-id: https://develop.svn.wordpress.org/trunk@47627 602fd350-edb4-49c9-b593-d223f7449a82
2020-04-27 02:27:02 +00:00
Sergey Biryukov 3a229d0b47 Comments: Ensure that inserting a comment with an empty type results in correct `comment` type.
Add unit tests for `wp_handle_comment_submission()` and `wp_insert_comment()` receiving an empty type.

Follow-up to [47597].

Props ocean90, imath.
Fixes #49236.

git-svn-id: https://develop.svn.wordpress.org/trunk@47626 602fd350-edb4-49c9-b593-d223f7449a82
2020-04-26 13:42:03 +00:00
Sergey Biryukov aff2844d75 Comments: Restore inclusion of an empty comment type when building the `WHERE` clause in `WP_Comment_Query::get_comment_ids()`.
This ensures that `get_comments( array( 'type' => 'comment' ) )` still includes comments that have not yet migrated to the `comment` type.

Follow-up to [47597].

Props ocean90.
See #49236.

git-svn-id: https://develop.svn.wordpress.org/trunk@47625 602fd350-edb4-49c9-b593-d223f7449a82
2020-04-26 13:12:04 +00:00