Commit Graph

3111 Commits

Author SHA1 Message Date
Sergey Biryukov
cbbaca7ade Docs: Fix typo in a comment in WP_Site_Health::get_test_theme_version().
See #47110.

git-svn-id: https://develop.svn.wordpress.org/trunk@45733 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-04 00:47:20 +00:00
Sergey Biryukov
17d1f402e2 Site Health: If WP_DEFAULT_THEME doesn't exist, use WP_Theme::get_core_default_theme() as a fallback.
Props ajayghaghretiya1, juliobox, SergeyBiryukov.
Fixes #47299.

git-svn-id: https://develop.svn.wordpress.org/trunk@45732 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-04 00:01:14 +00:00
Aaron Jorbin
5ed5587545 PHP 7.4 compatibility fix / accessing arrays/string using curly brace syntax
PHP used to allow both square brackets and curly braces to be used interchangeably for accessing array elements and string offsets. The curly bracket syntax is only allowed in a limited set of cases and can be confusing for people not used to it.
PHP 7.4 will deprecate the curly brace syntax for accessing array elements and string offsets and it is expected that support will be completely removed in PHP 8.0.
Ref: https://wiki.php.net/rfc/deprecate_curly_braces_array_access

See #47751.
Props jrf.



git-svn-id: https://develop.svn.wordpress.org/trunk@45730 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-03 20:20:42 +00:00
Andrea Fercia
f82b40a2d2 Menus: Fix the Custom Links text fallback.
When adding a Custom Link and leaving the "Link Text" field empty, WordPress used to set a default fallback text: "Menu Item".

The changes in [36379] broke this behavior making the fallback text: ` (Pending)`, with a leading space.

Pending major refactoring of the Menus page (which is going to use a block-based user interface) this change just restores the original behavior by adding the fallback text to the related AJAX response.

Props christophherr, Fencer04, thakkarhardik, backermann1978, audrasjb.
Fixes #38415.


git-svn-id: https://develop.svn.wordpress.org/trunk@45727 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-03 12:18:50 +00:00
Sergey Biryukov
3c73c7a56f Taxonomy: Fix deprecated calls to get_terms().
The taxonomy should be passed as part of `$args`, rather than as its own argument.

Props sgastard, mukesh27, SergeyBiryukov.
Fixes #47819.

git-svn-id: https://develop.svn.wordpress.org/trunk@45723 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-03 03:34:54 +00:00
Sergey Biryukov
03122ef7e1 Users: Deprecate update_user_status() in favor of wp_update_user().
Props spacedmonkey, SergeyBiryukov.
Fixes #45747.

git-svn-id: https://develop.svn.wordpress.org/trunk@45708 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-01 11:27:28 +00:00
Sergey Biryukov
57443a60da Docs: Correct parameter documentation for bulk_edit_custom_box and quick_edit_custom_box actions.
Props abrain.
Fixes #47810.

git-svn-id: https://develop.svn.wordpress.org/trunk@45704 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-31 15:09:55 +00:00
Sergey Biryukov
4dbc842cac Coding Standards: Fix WPCS violations in wp-admin/includes/class-walker-nav-menu-edit.php.
Props sudhiryadav, audrasjb.
Fixes #46902.

git-svn-id: https://develop.svn.wordpress.org/trunk@45697 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-28 16:51:46 +00:00
Sergey Biryukov
4eabbd6949 Coding Standards: Fix WPCS violations in [45694].
See #47466.

git-svn-id: https://develop.svn.wordpress.org/trunk@45696 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-28 16:51:26 +00:00
Sergey Biryukov
f793983deb Docs: Improve the DocBlocks for got_mod_rewrite(), extract_from_markers(), insert_with_markers().
See #47110.

git-svn-id: https://develop.svn.wordpress.org/trunk@45695 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-28 16:34:58 +00:00
Sergey Biryukov
d7ec5b4ac0 Rewrite Rules: Add a comment to # BEGIN/END .htaccess markers to clarify that the directives are dynamically generated, and should only be modified via WordPress filters.
Introduce `insert_with_markers_inline_instructions` filter to modify the default instructions text.

Props bradleyt, SergeyBiryukov.
Fixes #47466.

git-svn-id: https://develop.svn.wordpress.org/trunk@45694 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-28 16:30:46 +00:00
Sergey Biryukov
df874c9858 Site Health: Consistently use wpdb::db_version() for checking the database server version, instead of partically replicating its functionality.
Props Clorith, wpfed.
Fixes #47738.

git-svn-id: https://develop.svn.wordpress.org/trunk@45691 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-28 14:54:06 +00:00
Sergey Biryukov
230960f8c0 Site Health: Show parent theme in its own accordion on Site Health Info screen; rename "Other Themes" to "Inactive Themes".
Props garrett-eclipse, mukesh27, Clorith, xkon, msaggiorato.
Fixes #46925.

git-svn-id: https://develop.svn.wordpress.org/trunk@45680 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-26 03:48:32 +00:00
Sergey Biryukov
004ff0e1a7 I18N: Update translator comments after [45674].
See #47771.

git-svn-id: https://develop.svn.wordpress.org/trunk@45676 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-25 22:51:53 +00:00
Sergey Biryukov
ae8a620efb General: First pass at replacing Codex URLs with a corresponding HelpHub or DevHub article.
Props ianbelanger, tobifjellner, SergeyBiryukov.
See #47771.

git-svn-id: https://develop.svn.wordpress.org/trunk@45674 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-25 22:44:48 +00:00
Sergey Biryukov
85f0ec3eba Permalinks: Update URLs for "Changing File Permissions" documentation article.
Props patilswapnilv, ianbelanger, SergeyBiryukov.
Fixes #47768.

git-svn-id: https://develop.svn.wordpress.org/trunk@45669 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-25 01:18:01 +00:00
Sergey Biryukov
e5a0610d53 Coding Standards: Rename $r variable used with wp_parse_args() to $parsed_args for clarity.
Props freewebmentor.
Fixes #45059.

git-svn-id: https://develop.svn.wordpress.org/trunk@45667 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-25 00:47:53 +00:00
Gary Pendergast
e0d8dbe350 Coding Standards: Move wp-admin/custom-background.php to wp-admin/includes/class-custom-background.php
This renames the file containing the Custom_Background class to conform to the coding standards.

This commit also includes:

- A new custom-background.php that includes the new file, for anyone that may've been including the file directly.
- Replaces a reference to the old filename with the new filename.

See #47632.


git-svn-id: https://develop.svn.wordpress.org/trunk@45662 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-19 04:01:41 +00:00
Sergey Biryukov
e6e96d0ef9 Editor: Replace external Classic Editor plugin URL with a link to Add Plugins screen with Classic Editor pre-selected.
This applies to messages displayed when JavaScript is disabled in Block Editor, or an incompatible meta box is used.

Props garrett-eclipse, derweili, afercia.
Fixes #47487.

git-svn-id: https://develop.svn.wordpress.org/trunk@45657 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-18 01:32:13 +00:00
Gary Pendergast
8416a2b410 Coding Standards: Move wp-admin/custom-header.php to wp-admin/includes/class-custom-image-header.php
This renames the file containing the `Custom_Image_Header` class to conform to the coding standards.

This commit also includes:
- A new `custom-header.php` that includes the new file, for anyone that may've been including the file directly.
- Replaces references to the old filename with the new filename.

See #47632.



git-svn-id: https://develop.svn.wordpress.org/trunk@45654 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-17 06:16:27 +00:00
Sergey Biryukov
8df86efc2b Site Health: Use consistent verbiage for "Learn more" links.
Props ronakganatra, garrett-eclipse.
Fixes #47302.

git-svn-id: https://develop.svn.wordpress.org/trunk@45649 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-16 22:27:55 +00:00
Sergey Biryukov
a65fcde5c0 I18N: Merge duplicate "Your plugins/themes/translations are all up to date" strings.
Props ramiy.
Fixes #47252.

git-svn-id: https://develop.svn.wordpress.org/trunk@45647 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-16 22:13:01 +00:00
Andrew Ozz
9d00289c60 Media: Sort the new sizes array by priority when creating image sub-sizes.
See #40439.

git-svn-id: https://develop.svn.wordpress.org/trunk@45645 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-16 21:47:35 +00:00
Sergey Biryukov
eb9f88e763 I18N: Add context for theme filter strings in WP_MS_Themes_List_Table::get_views().
Props audrasjb.
Fixes #47695.

git-svn-id: https://develop.svn.wordpress.org/trunk@45634 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-14 14:46:10 +00:00
Gary Pendergast
756e06cd94 Block Editor: Fix the link to the classic editor when incompatible meta boxen are detected.
Props tmatsuur, mukesh27.
Fixes #45935.


git-svn-id: https://develop.svn.wordpress.org/trunk@45618 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-11 06:00:39 +00:00
Sergey Biryukov
eba439f0ac Coding Standards: Remove extra whitespace in list tables' column_cb() methods.
See #47632.

git-svn-id: https://develop.svn.wordpress.org/trunk@45617 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-09 21:10:11 +00:00
Sergey Biryukov
6bee5769cb Coding Standards: Remove extra whitespace in wp-admin/includes/image-edit.php.
See #47632.

git-svn-id: https://develop.svn.wordpress.org/trunk@45616 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-09 21:04:41 +00:00
Sergey Biryukov
9ed8e4189a I18N: Move code out of translatable string in a _deprecated_argument() message in wp_stream_image(), wp_save_image_file(), and image_edit_apply_changes().
Props ramiy.
Fixes #47406.

git-svn-id: https://develop.svn.wordpress.org/trunk@45615 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-09 20:56:37 +00:00
Sergey Biryukov
89919f6ac4 Menus: Remove extra whitespace from URLs in Walker_Nav_Menu_Edit::start_el().
Props alexeyskr, SergeyBiryukov.
Fixes #47666.

git-svn-id: https://develop.svn.wordpress.org/trunk@45614 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-09 20:44:03 +00:00
Sergey Biryukov
40d9fdf1f9 Filesystem API: Check correct variable in WP_Filesystem_Direct::dirlist() after [45611].
Props zinigor.
Fixes #47668. See #47632.

git-svn-id: https://develop.svn.wordpress.org/trunk@45613 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-09 15:57:53 +00:00
Gary Pendergast
acf6cabe24 Coding Standards: Fix instances of WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase.
See #46732.


git-svn-id: https://develop.svn.wordpress.org/trunk@45612 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-09 06:28:09 +00:00
Gary Pendergast
d36eda33f7 Coding Standards: Fix instances of WordPress.PHP.NoSilencedErrors.Discouraged.
Noteable changes:
- The `magic_quotes_runtime` and `magic_quotes_sybase` settings were removed in PHP 5.4, so no longer need to be set.
- Some functions that use external libraries can generate errors that can't be tested for, so are globally allowed to silence errors.
- Quite a few functions would cause errors if `safe_mode` was set. This setting was removed in PHP 5.4.
- Only a handful of `header()` calls needed corresponding `headers_sent()` checks for unit tests to pass, but more may need to be added as the nightlies builds are tested.

See #46732.


git-svn-id: https://develop.svn.wordpress.org/trunk@45611 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-09 05:44:42 +00:00
Gary Pendergast
18ec05e23a Coding Standards: Fix all WordPress.DB.PreparedSQLPlaceholders issues.
See #47632.



git-svn-id: https://develop.svn.wordpress.org/trunk@45603 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-05 05:42:57 +00:00
Gary Pendergast
6acb0c6402 Coding Standards: Fix all WordPress.WhiteSpace.PrecisionAlignment issues.
See #47632.



git-svn-id: https://develop.svn.wordpress.org/trunk@45602 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-05 05:20:52 +00:00
Gary Pendergast
6b61c34ded Coding Standards: Mark the handful of hook names with uppercase characters or hyphens as ignored.
See #47632.



git-svn-id: https://develop.svn.wordpress.org/trunk@45599 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-05 01:44:41 +00:00
Gary Pendergast
9a1549767e Coding Standards: Fix the Squiz.PHP.DisallowMultipleAssignments violations in wp-admin.
See #47632.



git-svn-id: https://develop.svn.wordpress.org/trunk@45583 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-01 12:50:14 +00:00
Gary Pendergast
ef5a9dfda6 Coding Standards: Fix/ignore the WordPress.NamingConventions.ValidFunctionName violations.
See #47632



git-svn-id: https://develop.svn.wordpress.org/trunk@45580 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-01 08:00:12 +00:00
Gary Pendergast
d2c4198623 Multisite: Use size_format() in display_space_usage().
Deleted code is the best code.

Fixes #28239.



git-svn-id: https://develop.svn.wordpress.org/trunk@45579 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-01 03:46:30 +00:00
Andrea Fercia
725c77a13d Plugins: Fix the plugin details modal layout after [45520].
Props mukesh27, marybaum, audrasjb.
Fixes #47561.


git-svn-id: https://develop.svn.wordpress.org/trunk@45563 602fd350-edb4-49c9-b593-d223f7449a82
2019-06-25 14:10:29 +00:00
Sergey Biryukov
1f1cf751e5 Plugins: When validating plugin's WordPress and PHP requirements, check for Requires at least and Requires PHP headers in the plugin's main PHP file.
This allows for blocking plugin activation if it requires a higher version of PHP or WordPress, and does not have a `readme.txt` file.

If the headers are defined in both `readme.txt` and the main plugin file, precedence is given to the plugin file.

Props afragen, Otto42, Ipstenu.
Fixes #46938.

git-svn-id: https://develop.svn.wordpress.org/trunk@45546 602fd350-edb4-49c9-b593-d223f7449a82
2019-06-18 03:23:53 +00:00
Andrew Ozz
5e26728387 Media: Ignore errors coming from image_resize_dimensions() when creating sub-sizes (for now). It returns false when the requested size is larger than the original image and should be skipped. This triggers new WP_Error in WP_Image_Editor::resize().
See #40439.

git-svn-id: https://develop.svn.wordpress.org/trunk@45543 602fd350-edb4-49c9-b593-d223f7449a82
2019-06-16 01:32:16 +00:00
Andrew Ozz
815e3ffbe6 After [45538]: fix another WPCS "strict comparison" fix.
Props birgire.
See #40439.

git-svn-id: https://develop.svn.wordpress.org/trunk@45540 602fd350-edb4-49c9-b593-d223f7449a82
2019-06-15 16:23:28 +00:00
Andrew Ozz
cd86b07108 After [45538]: fix a WPCS fix and make couple of var names consistent.
See #40439.

git-svn-id: https://develop.svn.wordpress.org/trunk@45539 602fd350-edb4-49c9-b593-d223f7449a82
2019-06-15 01:31:07 +00:00
Andrew Ozz
ca84ae5030 Save progress of intermediate image creation after upload. First run.
- Introduces `wp_get_missing_image_subsizes()` and `wp_update_image_subsizes()` to generate image sub-sizes that are missing or were not created after the upload.
- Adds a way to display errors that happened while creating sub-sizes.
- Introduces `wp_create_image_subsizes()` intended for use after an image was uploaded. It saves/updates the image metadata immediately after each sub-size is created. This fixes the (long standing) problem when some of the sub-size image files were created but there was a timeout or an error and the metadata was not saved. Until now such uploads were considered "failed" which usually resulted in the user trying to upload the same image again, creating even more "orphan" image files.

Note that the patch also includes some unrelated WPCS fixes.

Props mikeschroder, azaozz.
See #40439.

git-svn-id: https://develop.svn.wordpress.org/trunk@45538 602fd350-edb4-49c9-b593-d223f7449a82
2019-06-15 01:01:48 +00:00
Sergey Biryukov
7283555663 Administration: Adjust code for "Manage widgets or menus" item on "Welcome to WordPress" panel to avoid an extra space after [42343].
Props Presskopp, davidbaumwald.
Fixes #47536.

git-svn-id: https://develop.svn.wordpress.org/trunk@45536 602fd350-edb4-49c9-b593-d223f7449a82
2019-06-14 00:28:54 +00:00
Andrew Ozz
f16752240c Add a Recovery Mode Exit button to the notice. This fixes it in responsive view.
Props desrosj, karmatosed, chetan200891, afercia, afragen, garrett-eclipse.
Fixes #47070.

git-svn-id: https://develop.svn.wordpress.org/trunk@45529 602fd350-edb4-49c9-b593-d223f7449a82
2019-06-13 15:59:58 +00:00
Andrew Ozz
f3c91893a9 Privacy tools:
- Move the (remaining) privacy tools related functions from `wp-admin/includes/file.php` to `wp-admin/includes/privacy-tools.php`.
- Move the `WP_User_Request` class to a separate file.

See #43895.

git-svn-id: https://develop.svn.wordpress.org/trunk@45519 602fd350-edb4-49c9-b593-d223f7449a82
2019-06-10 23:53:32 +00:00
Sergey Biryukov
1d9ac40038 I18N: Merge duplicate "authenticity could not be verified" strings, fix comma placement on About page.
Props pedromendonca, garrett-eclipse.
Fixes #47475.

git-svn-id: https://develop.svn.wordpress.org/trunk@45515 602fd350-edb4-49c9-b593-d223f7449a82
2019-06-10 14:13:33 +00:00
Peter Wilson
66f7cee321 Site health: Introduce view_site_health_checks capability.
Introduces the faux primitive capability `view_site_health_checks` available to single site admins and multisite super-admin to view the site health page within the admin.

The capability is mapped to the `install_plugins` capability without being dependent on the file system being writable. This fixes a bug where the feature couldn't be used by sites unable to write to the file system or managed through version control.

The capability is granted on the `user_has_cap` filter.

Props birgire, Clorith, palmiak, peterwilsoncc, spacedmonkey.
Fixes #46957.



git-svn-id: https://develop.svn.wordpress.org/trunk@45507 602fd350-edb4-49c9-b593-d223f7449a82
2019-06-10 07:41:12 +00:00
John Blackbourn
393960b182 I18N: Allow the length of automatically generated excerpts to be localized.
This introduces three new strings that can be used to control the maximum length of automatically generated excerpts for posts, comments, and draft post previews in the dashboard. Optionally combined with the existing word count type control this allows languages which include many multibyte characters to specify more appropriate maximum excerpt lengths.

Props miyauchi, birgire, johnbillion

Fixes #44541


git-svn-id: https://develop.svn.wordpress.org/trunk@45505 602fd350-edb4-49c9-b593-d223f7449a82
2019-06-08 18:41:08 +00:00