Commit Graph

7519 Commits

Author SHA1 Message Date
Sergey Biryukov
32ca843154 Plugins: When loading a plugin in a "sandbox" on activation, do it once.
This avoids a fatal error if the plugin is already included, e.g. in unit tests.

Follow-up to [50787].

See #31104.

git-svn-id: https://develop.svn.wordpress.org/trunk@50788 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-25 13:19:54 +00:00
Sergey Biryukov
93290c44f6 Plugins: When loading a plugin in a "sandbox" on activation, do it in a separate function.
This avoids accidentally overriding some variables in the scope of `activate_plugin()`, e.g. `$silent` or `$network_wide`.

Plugins expecting to have access to `$network_wide` directly on inclusion should receive it as an argument of the activation hook callback instead, on any of these actions:

* `activate_plugin`
* `activate_{$plugin}`
* `activated_plugin`

Follow-up to [28644].

Props Mike_Cowobo, dd32, DrewAPicture, mensmaximus, SergeyBiryukov.
Fixes #31104.

git-svn-id: https://develop.svn.wordpress.org/trunk@50787 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-24 18:02:39 +00:00
Sergey Biryukov
edd6ec0389 Coding Standards: Use strict comparison in wp-admin/includes/update-core.php.
Includes minor code layout fixes for better readability.

See #52627.

git-svn-id: https://develop.svn.wordpress.org/trunk@50785 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-23 14:49:51 +00:00
Jonathan Desrosiers
e4bda140d4 Build/Test Tools: Remove Internet Explorer 11 from the browserslist.
This officially removes support for Internet Explorer 11 in the CSS files run through the build process in Core.

Individual tickets should be opened for removing each manually maintained area of the code base targeting IE11.

The resulting changes to CSS files are included in this commit.

Fixes #53077.

git-svn-id: https://develop.svn.wordpress.org/trunk@50784 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-22 22:56:40 +00:00
Sergey Biryukov
2464d69d8d Coding Standards: Remove loose comparison in wp-admin/includes/plugin-install.php.
This more closely represents how the active installations count is displayed in the Plugin Directory.

See #52627.

git-svn-id: https://develop.svn.wordpress.org/trunk@50783 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-22 19:16:42 +00:00
Jonathan Desrosiers
f1466b8b73 Build/Test Tools: Update the caniuse-lite database.
This updates the `caniuse-lite` database to the most recent version (`1.0.30001214`) by running `npx browserslist@latest --update-db`.

The resulting changes after running `grunt precommit:css` are also included in this commit.

See #52624.

git-svn-id: https://develop.svn.wordpress.org/trunk@50782 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-22 00:54:44 +00:00
Sergey Biryukov
5aae96ba8b Coding Standards: Use strict comparison in wp-admin/includes/class-wp-terms-list-table.php.
Includes minor code layout fixes for better readability.

See #52627.

git-svn-id: https://develop.svn.wordpress.org/trunk@50780 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-21 18:51:33 +00:00
David Baumwald
c687dc182b Coding Standards: Fix minor, inline spacing issue in wp-admin/setup-config.php.
See #52627.




git-svn-id: https://develop.svn.wordpress.org/trunk@50779 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-21 18:29:58 +00:00
Greg Ziółkowski
a19f589a5f Editor: Abstract block editor configuration
There are several WordPress hooks defined on the server that depend on $post object that isn’t present on the new screens like edit site, edit widgets, or edit navigation. This patch deprecates existing filters and introduces replacements that are context-aware.

Props azaozz, andraganescu, jeremyfelt, nosolosw, youknowriad.
See #52920.





git-svn-id: https://develop.svn.wordpress.org/trunk@50776 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-21 05:10:56 +00:00
Peter Wilson
bf637356a2 Upgrade/Install: Prevent possible type errors during installation.
Prevent a `TypeError` from occurring during installation if `wp-config.php` is not writable. In PHP 8.0 this can cause a fatal error, in earlier versions of PHP a warning would be thrown.

Account for a change in type returned by `fopen()` coming in a future version of PHP. Minor coding standards fixes in the `/wp-admin/setup-config.php` file.

Props xknown, hellofromTonya, jrf, peterwilsoncc.
See #51423.



git-svn-id: https://develop.svn.wordpress.org/trunk@50775 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-21 01:31:45 +00:00
SergeyBiryukov
e31e5e7f4d Code Modernization: Bring consistency to preparing some fields on Network Settings screen:
* `illegal_names`
* `limited_email_domains`
* `banned_email_domains`

If any of these options have a falsey value, treat it as an empty string. This addresses a PHP 8.1+ deprecation notice when passing a `null` value to `str_replace()`.

Additionally, avoid unnecessary type casting for better performance.

Props hellofromTonya, jrf, SergeyBiryukov.
See #51423.

git-svn-id: https://develop.svn.wordpress.org/trunk@50772 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-20 14:47:02 +00:00
Sergey Biryukov
c072116d6a Coding Standards: Use strict comparison in wp-admin/includes/class-wp-media-list-table.php.
Includes minor code layout fixes for better readability.

See #52627.

git-svn-id: https://develop.svn.wordpress.org/trunk@50770 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-19 11:39:54 +00:00
Sergey Biryukov
2d7b7dd833 Docs: Correct comment format in wp-admin/edit-tags.php, remove extra space.
Props immeet94.
Fixes #46428.

git-svn-id: https://develop.svn.wordpress.org/trunk@50769 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-18 14:27:59 +00:00
Sergey Biryukov
e01bbd48f4 Coding Standards: Fix WPCS issues in wp-admin/includes/class-wp-comments-list-table.php.
* Rename method argument in `WP_Comments_List_Table::floated_admin_avatar()` per the naming conventions.
* Use strict comparison in `WP_Comments_List_Table::handle_row_actions()`.

See #52627.

git-svn-id: https://develop.svn.wordpress.org/trunk@50768 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-18 13:54:00 +00:00
Sergey Biryukov
5e8b165a54 Coding Standards: Use strict comparison in wp-admin/includes/class-walker-nav-menu-edit.php.
See #52627.

git-svn-id: https://develop.svn.wordpress.org/trunk@50767 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-17 12:20:44 +00:00
Marius L. J
337fcf6edd Site Health: Remove Ajax requests from dashboard widget.
The Site Health dashboard widget uses the same JavaScript file as the Site Health pages to generate its progress indicator.

This file was also set up to store the current Site Health check results if the current tab being shown isn't the debug information one, this had the side effect of the dashboard being seen as not the debug screen as well.

This now has a conditional making sure it's the status screen it self being displayed, before trying to do any Ajax requests.

Props arena.
Fixes #49814.

git-svn-id: https://develop.svn.wordpress.org/trunk@50766 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-17 11:27:35 +00:00
Marius L. J
05b44492c8 Site Health: Correct array key for the default tab
Use `reset` to get the label from the first tab entry as the default if no tab is defined.
This ensures even if the tab order is changed, or tabs are removed, no warnings will be thrown.

Follow-up to [50764].

See #47225.

git-svn-id: https://develop.svn.wordpress.org/trunk@50765 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-17 10:53:04 +00:00
Marius L. J
a32a192ede Site Health: Support custom sub-menus and pages.
Allow developers to extend the Site Health screen with their own custom navigation tabs and pages.

This implements a new filter, `site_health_navigation_tabs`, which takes an associated array of tab identifiers/slugs, and tab labels, allowing developers to add their own subpage to the Site Health interface as new tabs.

To output a custom page, or add to an existing page, the `site_health_tab_content` action is triggered whenever the `tab` query argument is present and not empty. This action includes the current tab as its argument, which a developer would match against to only output content when relevant.

Props ramiy for initial patch.
Fixes #47225.

git-svn-id: https://develop.svn.wordpress.org/trunk@50764 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-17 01:12:25 +00:00
Sergey Biryukov
6caebf6fc2 Coding Standards: Use strict comparison in wp-admin/includes/class-wp-automatic-updater.php.
Includes minor code layout fixes for better readability.

See #52627.

git-svn-id: https://develop.svn.wordpress.org/trunk@50762 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-16 11:59:14 +00:00
Greg Ziółkowski
4072823456 Editor: Update WordPress packages to use with WordPress 5.8
In the response to the discussion during the Dev Chat, I'm doing a first pass to keep WordPress packages up to date in the WordPress 5.8 release cycle.

See https://github.com/WordPress/wordpress-develop/pull/1176 for more details.

Props youknowriad, aristath, andraganescu.
See #52991.



git-svn-id: https://develop.svn.wordpress.org/trunk@50761 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-15 14:41:38 +00:00
Sergey Biryukov
fd6ccf4540 Coding Standards: Give a variable in WP_Automatic_Updater::after_core_update() a more meaningful name.
Follow-up to [25841], [25873], [25882].

See #52627.

git-svn-id: https://develop.svn.wordpress.org/trunk@50759 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-15 10:29:21 +00:00
David Baumwald
f7799b9455 Privacy: Ensure "Export Personal Data" does not generate invalid JSON.
Previously, when exporting personal data, if the JSON encoding of the data failed, the invalid JSON was still written to `export.json`.  This change captures the JSON encoding failure and adds a notice to the UI.  

Props hellofromTonya, jrf, SergeyBiryukov.
Fixes #52892.

git-svn-id: https://develop.svn.wordpress.org/trunk@50713 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-14 21:26:58 +00:00
Jonathan Desrosiers
d60ad57e47 Upgrade/Install: Correct the alignment of error messages for the language installer.
This makes the CSS selector used to right align certain form related elements more specific. This prevents any error messages from being right aligned.

Props sabernhardt, audrasjb.
Fixes #52989.

git-svn-id: https://develop.svn.wordpress.org/trunk@50712 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-14 14:09:31 +00:00
Sergey Biryukov
83b4b89c5a Site Health: Correct test result status for the HTTPS test.
The supported status values for Site Health tests are `good`, `recommended`, and `critical`.

Follow-up to [50660].

Props TimothyBlynJacobs.
Fixes #52783.

git-svn-id: https://develop.svn.wordpress.org/trunk@50710 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-14 13:00:52 +00:00
Sergey Biryukov
66b035ab3b Coding Standards: Use strict comparison in wp-admin/includes/class-custom-image-header.php.
Includes minor code layout fixes for better readability.

See #52627.

git-svn-id: https://develop.svn.wordpress.org/trunk@50707 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-13 19:03:07 +00:00
Sergey Biryukov
27ddc687c4 Coding Standards: Use strict comparison in wp-admin/includes/class-custom-background.php.
Includes minor code layout fixes for better readability.

See #52627.

git-svn-id: https://develop.svn.wordpress.org/trunk@50706 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-13 17:59:45 +00:00
David Baumwald
8b74b031c5 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@50705 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-13 17:36:39 +00:00
David Baumwald
b18a87c9ce Feeds: Rename "Summary" to "Excerpt" in Reading Settings.
On the "Reading Settings" page, the post excerpt was referred to as a "Summary".  For consistency with the rest of Core, this change updates "summary" to "excerpt" both in the setting and the relevant help tab.

Props SergeyBiryukov, ravipatel, mukesh27.
Fixes #52987.

git-svn-id: https://develop.svn.wordpress.org/trunk@50702 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-12 22:32:11 +00:00
Sergey Biryukov
69d11640be Coding Standards: Rewrite a fragment in request_filesystem_credentials() for clarity and to avoid repetition.
Follow-up to [8540], [8865].

See #52627.

git-svn-id: https://develop.svn.wordpress.org/trunk@50701 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-12 18:32:39 +00:00
Sergey Biryukov
94a8a4c5ec Coding Standards: Use strict comparison in wp-admin/includes/file.php.
Includes minor code layout fixes for better readability.

See #52627.

git-svn-id: https://develop.svn.wordpress.org/trunk@50700 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-12 18:17:37 +00:00
Sergey Biryukov
d2c95cede3 Coding Standards: Simplify the check for parent terms in export_wp().
This is more consistent with similar checks elsewhere in core.

See #52627.

git-svn-id: https://develop.svn.wordpress.org/trunk@50699 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-11 13:42:25 +00:00
Sergey Biryukov
b394d5a7cf Coding Standards: Give a variable in wp-admin/themes.php a more meaningful name.
Follow-up to [20029].

See #52627.

git-svn-id: https://develop.svn.wordpress.org/trunk@50696 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-10 11:59:19 +00:00
Sergey Biryukov
234c2b52cc Themes: Remove unused code fragment from wp-admin/themes.php.
Follow-up to [25666], [26141].

Props mukesh27, rkradadiya.
Fixes #53005.

git-svn-id: https://develop.svn.wordpress.org/trunk@50694 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-09 11:47:46 +00:00
Sergey Biryukov
c00ba50d59 Editor: Use a consistent way to retrieve post ID on Edit Post screens.
Props mukesh27, ravipatel, davidbaumwald.
Fixes #52995.

git-svn-id: https://develop.svn.wordpress.org/trunk@50693 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-09 11:29:58 +00:00
Sergey Biryukov
4e5569ddd3 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@50692 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-08 11:10:16 +00:00
Sergey Biryukov
ab3dbadec4 Coding Standards: Use strict comparison in wp-admin/includes/dashboard.php.
Includes minor code layout fixes for better readability.

See #52627.

git-svn-id: https://develop.svn.wordpress.org/trunk@50689 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-07 18:32:01 +00:00
Kelly Choyce-Dwan
d198f25c13 Accessibility: Administration: Update various background colors for increased contrast.
This ensures that contrast between text color and background meets the WCAG 2.0 AA recommended value. The following locations were changed:

- Network List Tables: Use lighter background colors for site status indicator.
- Nav Menus: Use a lighter background color for invalid menu items.
- Pointers: Use a darker background for pointer header.
- Themes: Use darker background on filter button hover.
- Customizer: Use darker background for selected widget.

Follow-up to [50025], [50571].
Props kebbet, melchoyce, peterwilsoncc.
Fixes #52760.



git-svn-id: https://develop.svn.wordpress.org/trunk@50687 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-07 16:36:16 +00:00
Sergey Biryukov
6b8d5df24e Coding Standards: Use strict comparison in wp-admin/includes/credits.php.
See #52627.

git-svn-id: https://develop.svn.wordpress.org/trunk@50665 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-06 13:45:47 +00:00
Sergey Biryukov
4ca1ee8c0e Coding Standards: Use strict comparison in wp-admin/includes/comment.php.
See #52627.

git-svn-id: https://develop.svn.wordpress.org/trunk@50664 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-06 13:43:56 +00:00
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
David Baumwald
57a7ad689b Editor: Update the default writing prompt to match the block editor.
Recently merged, https://github.com/WordPress/gutenberg/pull/29611, changed the default writing prompt text.  WordPress core offers the `write_your_story` filter with a default value using the same text.  This change updates the default text to match the recent change in the block editor.

Props Joen, SergeyBiryukov.
Fixes #52948.

git-svn-id: https://develop.svn.wordpress.org/trunk@50647 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-02 16:06:37 +00:00
David Baumwald
4cb15f9e78 Coding Standards: Removing unnecessary parentheses from require_once in wp-admin/options-privacy.php.
In [47198], parentheses were removed from `include` and `require` statements, as they are language constructs, not function calls.  However, [50161] introduced a new `require_once` instance in `wp-admin/options-privacy.php`.  This change removes the unnecessary parentheses.

See #53627.

git-svn-id: https://develop.svn.wordpress.org/trunk@50631 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-01 15:34:32 +00:00
Greg Ziółkowski
0df28171ed Editor: Enqueue assets for format library for the block editor
Ensures that `wp-format-library` assets are always loaded for the block editor. Otherwise, they have to be loaded individually for every screen that needs it. It's similar to how `wp-block-directory` assets are handled.

Props ellatrix.
See #52920.



git-svn-id: https://develop.svn.wordpress.org/trunk@50620 602fd350-edb4-49c9-b593-d223f7449a82
2021-03-31 05:50:50 +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
David Baumwald
22eb45a644 Posts, Post Types: Remove / from non-self-closing "clear" div tags.
In [49178], self-closing `br` tags were switched to non-self-closing `div` elements for "clearing" purposes, but the self-closing "/" remained in place.  This fix removes the unnecessary slash.

Props pavelvisualcomposer, audrasjb, sabernhardt, akabarikalpesh, SergeyBiryukov.
Fixes #52878.

git-svn-id: https://develop.svn.wordpress.org/trunk@50582 602fd350-edb4-49c9-b593-d223f7449a82
2021-03-25 19:31:49 +00:00