Commit Graph

8870 Commits

Author SHA1 Message Date
Pascal Birchler d5f0448e78 Coding Standards: Rename the `$postid` parameter to `$post_id` in `has_meta().
Props mujuonly.
Fixes #60810.
See #60700.
Built from https://develop.svn.wordpress.org/trunk@57860


git-svn-id: http://core.svn.wordpress.org/trunk@57361 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-20 19:07:12 +00:00
audrasjb fc2935aa80 Docs: Update various HelpHub links to avoid unnecessary redirections.
This updates various WP-Admin related links that have been redirected to new HelpHub pages, to avoid unnecessary redirections.

Props mkismy.
See #60732, #60699.




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


git-svn-id: http://core.svn.wordpress.org/trunk@57294 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-08 22:38:08 +00:00
Sergey Biryukov 3a16fb0695 Docs: Add a description for the `$table_prefix` global.
Follow-up to [57748].

See #60699.
Built from https://develop.svn.wordpress.org/trunk@57787


git-svn-id: http://core.svn.wordpress.org/trunk@57288 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-07 06:11:11 +00:00
desrosj 316d1efa23 Upload: Add links back to installer pages.
This adds a link back to the plugin or theme installers when an incompatible archive error message is encountered.

Props Presskopp, swissspidy, smub, pmbaldha, aneeshd16.
Fixes #60578.
Built from https://develop.svn.wordpress.org/trunk@57786


git-svn-id: http://core.svn.wordpress.org/trunk@57287 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-07 05:58:15 +00:00
Sergey Biryukov 4d6941a48b Docs: Add a description for the `$wp_embed` global.
Follow-up to [57748].

See #60699.
Built from https://develop.svn.wordpress.org/trunk@57785


git-svn-id: http://core.svn.wordpress.org/trunk@57286 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-06 05:05:12 +00:00
audrasjb c624bd4dbb Plugins: Fix an overlap issue with plugin cards dependencies notice.
This changeset fixes an issue where plugin card dependencies notice and plugin icon were overlapping in some cases.

Props costdev, euthelup, shailu25, desrosj, swissspidy, audrasjb.
Fixes #60501.




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


git-svn-id: http://core.svn.wordpress.org/trunk@57277 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-05 14:27:10 +00:00
Sergey Biryukov c774332090 Coding Standards: Remove some extra trailing spaces.
Follow-up to [57772].

See #60021.
Built from https://develop.svn.wordpress.org/trunk@57773


git-svn-id: http://core.svn.wordpress.org/trunk@57274 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-05 11:54:13 +00:00
Sergey Biryukov 6e89ac85c6 Docs: Document the usage of `$_paused_plugins` and `$_paused_themes` globals.
Follow-up to [44973].

Props upadalavipul, sabernhardt.
See #60021.
Built from https://develop.svn.wordpress.org/trunk@57772


git-svn-id: http://core.svn.wordpress.org/trunk@57273 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-05 11:43:13 +00:00
desrosj f66211dafc Plugins: Improve plugin dependency related error messages.
This makes several refinements to the various error messages displayed throughout the WordPress admin related to plugin dependencies. Additionally, it adds some conditions to display more appropriate messages for multisite installs with proper context to the user’s capabilities.

Props costdev, swissspidy, afragen, huzaifaalmesbah, knutsp.
Fixes #60465.
Built from https://develop.svn.wordpress.org/trunk@57770


git-svn-id: http://core.svn.wordpress.org/trunk@57271 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-05 06:48:07 +00:00
desrosj 20e57dca02 Plugins: Improve plugin dependency admin notices.
This makes several refinements to the various notices displayed in the WordPress admin related to plugin dependencies. Additionally, it adds some conditions to display more appropriate messages for multisite installs with proper context to the user’s capabilities.

Props costdev, joedolson, afragen, swissspidy, peterwilsoncc, euthelup.
Fixes #60465.
Built from https://develop.svn.wordpress.org/trunk@57769


git-svn-id: http://core.svn.wordpress.org/trunk@57270 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-05 06:27:09 +00:00
joedolson c7a48687b5 Media: Accessibility: Copy attachment properties on site icon crop.
Add parity between site icon, custom header, and default image crop behaviors. [53027] fixed a bug where alt text and caption were not copied on custom headers, but did not apply that change in any other context.

Deprecate the `create_attachment_object` method in the `Wp_Site_Icon` and `Custom_Image_Header` classes and replace that functionality with the new function `wp_copy_parent_attachment_properties()` to improve consistency.

Props afercia, rcreators, jorbin, joedolson, huzaifaalmesbah, shailu25, swissspidy, mukesh27.
Fixes #60524.
Built from https://develop.svn.wordpress.org/trunk@57755


git-svn-id: http://core.svn.wordpress.org/trunk@57256 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-02 20:15:13 +00:00
Pascal Birchler 2cf42cec66 Privacy: Update default privacy page content to use latest block markup.
Avoids “Updated Block” warnings being logged to the console.

Props 254volkan, swissspidy.
Fixes #60530.
Built from https://develop.svn.wordpress.org/trunk@57741


git-svn-id: http://core.svn.wordpress.org/trunk@57242 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-29 12:17:08 +00:00
Pascal Birchler 8cdbaf4aeb Upgrade/Install: Improve localized strings related to plugin/theme installation and activation.
Adds context to strings where applicable to disambiguate them, coherently throughout the admin. Also improves some of the strings introduced in [57545] to ease localization.

Props swissspidy, costdev.
Fixes #60630. See #22316.
Built from https://develop.svn.wordpress.org/trunk@57714


git-svn-id: http://core.svn.wordpress.org/trunk@57215 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-26 20:35:08 +00:00
Aaron Jorbin 7173bb9a94 Site icon: Polish up Site Icon on the general settings screen.
This fixes a number of issues, chief among them:
- Updates to the site title are reflected in the preview.
- Improve alt text for preview
- Make string describing site icon more succinct.
- Add inline documentation to JavaScript

Props kebbet, jorbin, swissspidy, afercia, mukesh27, alexstine, jameskoster, andraganescu.
Fixes #54370.


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


git-svn-id: http://core.svn.wordpress.org/trunk@57214 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-26 20:18:09 +00:00
Joe McGill 716b7d4d26 Themes: Use original template paths when switching blogs.
This fixes a bug introduced by [57129] and [56635] in which deprecating the previous  `TEMPLATEPATH` and `STYLESHEETPATH` constants in favor of `get_template_directory()` and `get_stylesheet_directory()` functions caused the active theme template path to change when using `switch_to_blog()`.

This introduces a new function, `wp_set_template_globals()`, which is called during the bootstrap process to store the template paths to new globals values `$wp_template_path` and `$wp_stylesheet_path`. This restores behavior to how things worked prior to [56635] but retains the ability for template values to be reset for better testability.

Related #18298, #60025.

Props joemcgill, flixos90, mukesh27, swissspidy, manfcarlo, metropolis_john, jeremyfelt.
Fixes #60290.

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


git-svn-id: http://core.svn.wordpress.org/trunk@57186 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-21 19:26:08 +00:00
hellofromTonya 6d1ed1715b Export: Include featured image for posts or pages.
This bugfix resolves an issue in `export_wp()` with featured images.

When using Tools > Export and selecting either Posts or Pages (with or without a specific author), the resulting XML file now includes a XML item for each post|page's featured image attachment and its metadata.

Uses same chunking (for performance) and code patterns from existing code in the same file.

Adds a new test class for `export_wp()` with code coverage specific to this bugfix.

Follow-up to [34326], [14444], [6375], [6335].

Props billseymour, nateallen, petitphp, hellofromTonya, duck_, jane, rcain, jghazally, jghazally, smub, batmoo, axwax, creativeslice, dlocc, nacin, wonderboymusic, ganon, SergeyBiryukov, hlashbrooke, chriscct7, fischfood, hifidesign, ankit-k-gupta, 5um17, shailu25, huzaifaalmesbah, mukesh27.
Fixes #17379.
Built from https://develop.svn.wordpress.org/trunk@57681


git-svn-id: http://core.svn.wordpress.org/trunk@57182 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-21 18:15:14 +00:00
costdev f023a4a635 Plugins: Output plugin card elements in the order they're displayed.
Previously, the notice for listing dependencies in a plugin card was styled with the CSS `order` properties. This created a mismatch between the visual order and DOM order of elements in the plugin card.

For accessibility, visual order and DOM order must always match when they affect meaning and functionality.

This removes the CSS `order` properties and outputs the dependencies notice later, making the visual and DOM order match. Some unused/empty CSS is also removed.

Follow-up to [57545].

Props afercia, afragen, bosskhj, huzaifaalmesbah, mukesh27, costdev.
Fixes #60488.
Built from https://develop.svn.wordpress.org/trunk@57679


git-svn-id: http://core.svn.wordpress.org/trunk@57180 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-21 17:34:13 +00:00
costdev 69d6a9e5a0 Plugin Dependencies: Remove auto-deactivation and bootstrapping logic.
Automatic deactivation of dependents with unmet dependencies requires a write operation to the database. This was performed during Core's bootstrap, which risked the database and cache becoming out-of-sync on sites with heavy traffic.

No longer loading plugins that have unmet requirements has not had a final approach decided core-wide, and is still in discussion in #60491 to be handled in a future release.

The `plugin_data` option, used to persistently store plugin data for detecting unmet dependencies during Core's bootstrap, is no longer needed.

Follow-up to [57545], [57592], [57606], [57617].

Props dd32, azaozz, swissspidy, desrosj, afragen, pbiron, zunaid321, costdev.
Fixes #60457. See #60491, #60510, #60518.
Built from https://develop.svn.wordpress.org/trunk@57658


git-svn-id: http://core.svn.wordpress.org/trunk@57159 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-20 07:27:06 +00:00
Pascal Birchler f76da9b636 Canonical: Rename `admin_canonical_url` filter to `wp_admin_canonical_url`.
This improves consistency as it matches the name of the function it is used in.

Props peterwilsoncc, shailu25.
Fixes #59545.
Built from https://develop.svn.wordpress.org/trunk@57651


git-svn-id: http://core.svn.wordpress.org/trunk@57152 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-18 14:45:13 +00:00
Pascal Birchler f97698702d General: Consistently cast return value to `int` in functions that use `ceil()`.
The return value of `ceil()` is still of type `float` as the value range of `float` is usually bigger than that of `int`.

Props crstauf, audrasjb.
Fixes #58683.
Built from https://develop.svn.wordpress.org/trunk@57648


git-svn-id: http://core.svn.wordpress.org/trunk@57149 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-17 15:24:08 +00:00
John Blackbourn eadb61542a Docs: Various improvements and corrections to inline documentation.
See #59651

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


git-svn-id: http://core.svn.wordpress.org/trunk@57145 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-16 21:47:12 +00:00
costdev b927ce0028 Plugins: Disable bulk actions for dependencies.
The intended behaviour of Plugin Dependencies is that dependencies cannot be deleted until their dependents are deleted.

While the 'Delete' link was removed from the plugin row, the bulk actions checkbox remained enabled, allowing for deletion of dependencies through bulk actions.

This was unintended behaviour and the bulk actions checkbox is now disabled as intended.

Follow-up to [57545].

Props johnbillion, afragen, knutsp, huzaifaalmesbah, mukesh27, costdev.
Fixes #60471.
Built from https://develop.svn.wordpress.org/trunk@57620


git-svn-id: http://core.svn.wordpress.org/trunk@57121 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-13 13:24:10 +00:00
Pascal Birchler 47df0cc10e Permalinks: Detect Caddy web server support.
Support pretty permalinks when Caddy server is detected.

Props swissspidy, mukesh27, sadpencil, cfinnberg, viliamkopecky.
Fixes #41877.
Built from https://develop.svn.wordpress.org/trunk@57612


git-svn-id: http://core.svn.wordpress.org/trunk@57113 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-13 10:08:14 +00:00
davidbaumwald 3fae0d4fe5 Upgrade/Install: Remove unnecessary individual subfiles from `$_old_files` array.
On upgrade, the `$_old_files` array is used to cleanup any files that exist in a previous version of core but are no longer present in the current version.  Sometimes, an entire directory should be removed.  In the past, when a parent directory was included in the array, subfiles were also included for good measure.  

However, the code that removes the old files uses `$wp_filesystem->delete()` with the `$recursive` parameter set to `true`.  With this setup, individual subfiles are not required to be individually listed when their parent directory is already included in the `$_old_files` array.

This commit removes all individual subfiles from the `$_old_files` array when their parent directory is already included.

Props SergeyBiryukov, mhshohel, pbiron, oglekler.
Fixes #58995.
Built from https://develop.svn.wordpress.org/trunk@57598


git-svn-id: http://core.svn.wordpress.org/trunk@57099 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-12 16:53:13 +00:00
audrasjb d3d9374e06 Canonical: Introduce `admin_canonical_url` filter.
This changeset introduces the new `admin_canonical_url` hook to help developers and extenders to modify the admin canonical url value.

Props prionkor, audrasjb.
Fixes #59545.




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


git-svn-id: http://core.svn.wordpress.org/trunk@57096 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-12 15:26:10 +00:00
costdev c04996591b Upgrade/Install: Avoid `update_option()` calls during bootstrap.
[57545] introduced the Plugin Dependencies feature, which contains a new `plugin_data` option.

Previously, the `plugin_data` option was being updated during bootstrap and in `get_plugins()`, causing an error when using the install script as the options database table does not yet exist, and also risked an "out of sync" issue between the database and the cache on websites with heavy traffic.

This removes the calls to `update_option()` during Core's bootstrap, and guards the call in `get_plugins()` to ensure that it doesn't run when WordPress is installing.

Follow-up to [57545].

Props desrosj, swisspidy, huzaifaalmesbah, afragen, dd32, azaozz, costdev.
Fixes #60461. See #60457, #60491.
Built from https://develop.svn.wordpress.org/trunk@57592


git-svn-id: http://core.svn.wordpress.org/trunk@57093 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-12 12:33:10 +00:00
costdev c309be74be Filesystem API: Fix typo in `ftp_base::restore()`.
The `ftp_base::restore()` method contained a typo internally: "resore" should be "restore".

Follow-up to [7126].

Props benniledl, hellofromTonya, audrasjb.
Fixes #60497.
Built from https://develop.svn.wordpress.org/trunk@57591


git-svn-id: http://core.svn.wordpress.org/trunk@57092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-12 12:07:10 +00:00
joedolson 5940784180 Quick/Bulk Edit: Pre-fill category fields with their status.
Pre-fill category fields in the Quick/Bulk Edit form with their current status.

When bulk editing, if only some of the selected items are in a given category, the category's checkbox will display a line to indicate an indeterminate status.

Originally committed in [56172], but reverted due to a bug that removed all categories. Updated commit fixes the bug, adds unit tests, and improves the accessibility of the indeterminate state checkboxes.

Props pavelevap, scribu, chasedsiedu, helen, joshcanhelp, ubernaut, Cyberchicken, laumindproductscomau, SergeyBiryukov, Marcoevich, tomybyte, thinkluke, virtality-marketing-solutions, Michalooki, dmsnell, itecrs, pannelars, WHSajid, samba45, Mte90, johnbillion, tomluckies, soulseekah, francina, oglekler, ajmcfadyen, mukesh27, costdev, hellofromTonya, peterwilsoncc, joedolson, pbiron, oglekler, webcommsat, jorbin, ajmcfadyen, huzaifaalmesbah.
Fixes #11302.
Built from https://develop.svn.wordpress.org/trunk@57580


git-svn-id: http://core.svn.wordpress.org/trunk@57081 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-09 19:50:14 +00:00
youknowriad f7c63b630c Editor: Update the WordPress packages to Gutenberg 17.7RC1.
This brings the latest and greatest from Gutenberg.
The full changelog is available here 
https://github.com/WordPress/gutenberg/releases/tag/v17.7.0-rc.1

Props youknowriad, get_dave.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57578


git-svn-id: http://core.svn.wordpress.org/trunk@57079 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-09 18:22:22 +00:00
joedolson 962f2a1508 Users: Replace table tags for color palettes in profiles.
Replace the `table` element used to present color palette selection in the user profile screen with generic elements. The extra semantics of a table are at best unhelpful and have some potential to great extraneous verbosity for screen readers.

Props sabernhardt, desrosj.
Fixes #53157.
Built from https://develop.svn.wordpress.org/trunk@57572


git-svn-id: http://core.svn.wordpress.org/trunk@57073 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-08 23:31:16 +00:00
Aaron Jorbin 27ba6d5b6b I18N: Add Translator comments for Planet URLs.
Props oglekler, zodiac1978, audrasjb, jorbin.
Fixes #58010.


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


git-svn-id: http://core.svn.wordpress.org/trunk@57072 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-08 20:36:14 +00:00
costdev c60fc98b33 Upgrade/Install: Introduce Plugin Dependencies.
Introduces a new "Requires Plugins" plugin header so that plugin developers can list the slugs of the plugins theirs depends on.

This will inform users of the requirements, and provide links to the WordPress.org Plugins Repository that they can click to install and activate the dependencies first.

Plugins whose requirements are not met cannot be installed or activated, and they will be deactivated automatically if their requirements become unmet.
Plugins that others rely on cannot be deactivated or deleted until their dependent plugins are deactivated or deleted.

In memory of Alex Mills and Alex King.
WordPress Remembers.

Props ahoereth, afragen, alanfuller, alexkingorg, amykamala, anonymized_10690803, apeatling, ashfame, atimmer, audrasjb, aristath, azaozz, batmoo, beaulebens, blobaugh, bobbingwide, boonebgorges, brianhenryie, chanthaboune, chrisdavidmiles, coolmann, costdev, courane01, danielbachhuber, davidperez, dd32, Denis-de-Bernardy, dingo_d, DJPaul, dougal, DrewAPicture, ethitter, filosofo, georgestephanis, giuseppemazzapica-1, goldenapples, griffinjt, hellofromTonya, husobj, ideag, jarednova, jbobich, jbrinley, jltallon, joedolson, johnciacia, johnjamesjacoby, joppuyo, jsmoriss, karmatosed, kebbet, knutsp, kraftbj, kraftner, kurtpayne, lkraav, logikal16, luisherranz, man4toman, markjaquith, matt, mbijon, megphillips91, mikeschinkel, mordauk, morehawes, mrwweb, mte90, mukesh27, mzaweb, nacin, norcross, nvwd, nwjames, obliviousharmony, ocean90, oglekler, paaljoachim, pauldewouters, pbaylies, pbiron, peterwilsoncc, Philipp15b, poena, pogidude, retlehs, rmccue, ryan, sabreuse, sc0ttkclark, scribu, sereedmedia, SergeyBiryukov, ShaneF, shidouhikari, soean, spacedmonkey, stephenh1988, swissspidy, taylorde, tazotodua, threadi, TimothyBlynJacobs, TJNowell, tollmanz, toscho, tropicalista, Viper007Bond, westi, whiteshadow, williamsba1, wpsmith, ZaneMatthew.
Fixes #22316.
Built from https://develop.svn.wordpress.org/trunk@57545


git-svn-id: http://core.svn.wordpress.org/trunk@57046 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-06 23:46:14 +00:00
Peter Wilson 6309a41a68 Upload: Fallback to `PclZip` to validate ZIP file uploads.
`ZipArchive` can fail to validate ZIP files correctly and report valid files as invalid. This introduces a fallback to `PclZip` to check validity of files if `ZipArchive` fails them.

This introduces the new function `wp_zip_file_is_valid()` to validate archives.

Follow up to [57388].

Props audunmb, azaozz, britner, cdevroe, colorful-tones, costdev, courane01, endymion00, feastdesignco, halounsbury, jeffpaul, johnbillion, jorbin, jsandtro, karinclimber, kevincoleman, koesper, maartenbelmans, mathewemoore, melcarthus, mujuonly, nerdpressteam, olegfuture, otto42, peterwilsoncc, room34, sayful, schutzsmith, stephencronin, svitlana41319, swissspidy, tnolte, tobiasbg, vikram6, welaunchio.
Fixes #60398.

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


git-svn-id: http://core.svn.wordpress.org/trunk@57038 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-05 22:23:06 +00:00
Adam Silverstein f94f194552 Media: enable AVIF support.
Add support for uploading, editing and saving AVIF images when supported by the server.

Add 'image/avif' to supported mime types. Correctly identify AVIF images and sizes even when PHP doesn't support AVIF. Resize uploaded AVIF files (when supported) and use for front end markup.

Props adamsilverstein, lukefiretoss, ayeshrajans, navjotjsingh, Tyrannous, jb510, gregbenz, nickpagz, JavierCasares, mukesh27, yguyon, swissspidy.
Fixes #51228.


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


git-svn-id: http://core.svn.wordpress.org/trunk@57025 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-02 17:48:15 +00:00
gziolo 86121f4f25 Editor: Add `allowed_blocks` field to block registration and REST API
There is a new block.json field called allowedBlocks, added in Gutenberg in https://github.com/WordPress/gutenberg/pull/58262. This adds support for this new field also on the server. 

Props: gziolo, jsnajdr.
Fixes #60403.



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


git-svn-id: http://core.svn.wordpress.org/trunk@57022 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-02 13:01:21 +00:00
Aaron Jorbin fced238f35 Install: When populating options, maybe_serialize instead of always serialize.
Props xknown, peterwilsoncc, jorbin, desrosj.

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


git-svn-id: http://core.svn.wordpress.org/trunk@56895 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-30 14:25:08 +00:00
Aaron Jorbin a9b81d3527 Uploads: Check for and verify ZIP archives.
Props costdev, peterwilsoncc, azaozz, tykoted, johnbillion, desrosj, afragen, jorbin.

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


git-svn-id: http://core.svn.wordpress.org/trunk@56894 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-30 14:23:12 +00:00
youknowriad 45fc776d33 Editor: Update the minimum compatible version of Gutenberg.
Previous Gutenberg versions are not compatible with recent trunk because of the
WP_Navigation_Block_Renderer classname. It's present in both.

Gutenberg has been updated to avoid the use of this class but we need to auto-disable 
old plugins to avoid fatals.

Props hellofromtonya.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57384


git-svn-id: http://core.svn.wordpress.org/trunk@56890 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-30 11:41:17 +00:00
Pascal Birchler 24565dc6b7 I18N: Delete `.l10n.php` files when deleting a theme.
Follow-up to [57337] where this was already added for plugins.

See #59656.
Built from https://develop.svn.wordpress.org/trunk@57382


git-svn-id: http://core.svn.wordpress.org/trunk@56888 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-30 10:32:12 +00:00
Pascal Birchler 2e7358dec6 I18N: Ensure `.l10n.php` files are deleted when upgrading language packs.
Props amieiro.
See #59656.
Built from https://develop.svn.wordpress.org/trunk@57381


git-svn-id: http://core.svn.wordpress.org/trunk@56887 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-30 10:30:20 +00:00
Sergey Biryukov cdbe6c71a5 Coding Standards: Add missing escaping in `Custom_Image_Header::step_2()`.
Follow-up to [4673], [14907].

Props nareshbheda, audrasjb, kebbet.
Fixes #59278.
Built from https://develop.svn.wordpress.org/trunk@57364


git-svn-id: http://core.svn.wordpress.org/trunk@56870 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-26 14:20:12 +00:00
Pascal Birchler c6ccfb1242 I18N: Introduce a more performant localization library.
This introduces a more lightweight library for loading `.mo` translation files which offers increased speed and lower memory usage.
It also supports loading multiple locales at the same time, which makes locale switching faster too.

For plugins interacting with the `$l10n` global variable in core, a shim is added to retain backward compatibility with the existing `pomo` library.

In addition to that, this library supports translations contained in PHP files, avoiding a binary file format and leveraging OPCache if available.
If an `.mo` translation file has a corresponding `.l10n.php` file, the latter will be loaded instead.
This behavior can be adjusted using the new `translation_file_format` and `load_translation_file` filters.

PHP translation files will be typically created by downloading language packs, but can also be generated by plugins.
See https://make.wordpress.org/core/2023/11/08/merging-performant-translations-into-core/ for more context.

Props dd32, swissspidy, flixos90, joemcgill, westonruter, akirk, SergeyBiryukov.
Fixes #59656.
Built from https://develop.svn.wordpress.org/trunk@57337


git-svn-id: http://core.svn.wordpress.org/trunk@56843 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-23 13:34:11 +00:00
Peter Wilson 2590eeb14c Docs: Format `new_admin_email_content` placeholders as a list.
Format the email placeholders for the `new_admin_email_content` hook as a list for clarity and to avoid parsing errors in docblock consumers.

Props dd32, shooper, stevenlinx.
Fixes #60262.

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


git-svn-id: http://core.svn.wordpress.org/trunk@56795 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-16 04:06:18 +00:00
Sergey Biryukov 50670cd102 Comments: Use `post_password_required()` for comment capability checks.
Follow-up to [56836], [57123].

Fixes #59929.
Built from https://develop.svn.wordpress.org/trunk@57285


git-svn-id: http://core.svn.wordpress.org/trunk@56791 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-15 17:42:18 +00:00
audrasjb f16bd4cac4 Administration: Introduce `new_admin_email_subject` filter.
This changeset introduces the `new_admin_email_subject` hook which allow developers to filter the subject of the email sent when a change of site admin email address is attempted.

Props MadtownLems, johnbillion, alexanderkoledov, shooper, Marc_J, nikmeyer, xlthlx, devmuhib, nuhel, audrasjb.
Fixes #59250.




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


git-svn-id: http://core.svn.wordpress.org/trunk@56789 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-14 11:01:17 +00:00
audrasjb b6d3cb0838 Docs: Fix wrong inline comment in `delete_theme()`.
Props wildworks.
Fixes #60246.
See #59651.




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


git-svn-id: http://core.svn.wordpress.org/trunk@56786 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-14 10:06:18 +00:00
joedolson 1ee473633a Administration: Remove invalid attribute `maxlength` on `number` input.
Remove the `maxlength` attribute on screen options number of items per page input. Previously kept due to input inconsistencies in IE 11 and Edge, this invalid usage is no longer needed. IE 11 is no longer supported, and Edge now behaves according to specifications.

Props Arena94, afercia, joedolson.
Fixes #40610.
Built from https://develop.svn.wordpress.org/trunk@57272


git-svn-id: http://core.svn.wordpress.org/trunk@56778 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-11 17:44:12 +00:00
joedolson bcb0f74678 Media: Fix handling of multibyte exif description metadata.
The exif standards expect the UserComment field to be used as a substitute for ImageDescription if multibyte characters are needed. WordPress media only mapped the ImageDescription field and did not correctly handle descriptions with multibyte characters.

Fix metadata saving to better handle media with multibyte characters in metadata and update unit tests.

Props fotodrachen, antpb, joedolson, mikinc860, azaozz, nicolefurlan.
Fixes #58082.
Built from https://develop.svn.wordpress.org/trunk@57267


git-svn-id: http://core.svn.wordpress.org/trunk@56773 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-10 21:59:13 +00:00
costdev 28331b7aae Docs: Correct some typos in docblocks and inline comments.
This corrects several typos in documentation, including:
- "imput" -> "input"
- "proessing" -> "processing"
- "instantating" -> "instantiating"
- "filtersing" -> "filtering"
- "officaly" -> "officially"

Follow-up to [8852], [25307], [26191], [37488], [54416].

Props benniledl, mukesh27, jayadevankbh, Presskopp.
Fixes #60069. See #59651.
Built from https://develop.svn.wordpress.org/trunk@57263


git-svn-id: http://core.svn.wordpress.org/trunk@56769 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-10 11:57:15 +00:00
Aaron Jorbin c59c7d90c4 Upgrade/Install: Check theme compatibility during bulk upgrades.
Previously, bulk upgrades did not verify that a theme package was compatible with the site's WordPress version or the server's PHP version.

This was previusly done for plugins in #59198, but themes were missed.

Follow-up to: [56525].

Props salcode, lakshmananphp.
Fixes #59758.

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


git-svn-id: http://core.svn.wordpress.org/trunk@56758 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-08 23:19:16 +00:00
Sergey Biryukov 45df401868 Site Health: Include site ID in debug data on multisite installations.
Follow-up to [44986].

Props sebastienserre, mukesh27.
Fixes #60081.
Built from https://develop.svn.wordpress.org/trunk@57245


git-svn-id: http://core.svn.wordpress.org/trunk@56751 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-07 16:09:21 +00:00
hellofromTonya d30fe43245 Docs: Replace "sanity" with "confidence" for inclusive language.
The phrase "sanity check" unnecessarily references mental health. It's an old phrase used to denote an extra step in verifying code works as expected.

“The WordPress open source community cares about diversity. We strive to maintain a welcoming environment where everyone can feel included.”

While "sanity check" is a well-known phrase with a specific meaning, "confidence check" is a direct replacement that is more clear of its intent while being more inclusive.

Words matter.

Follow-up to [49216], [46271], [40583], [38832], [38637], [37409], [33359], [32162], [30346], [30345], [30238], [30055], [29902], [28763], [26141], [25002], [22227], [13428], [12148], [11025], [8927].

Props dartiss, hellofromTonya.
Fixes #60187.
Built from https://develop.svn.wordpress.org/trunk@57239


git-svn-id: http://core.svn.wordpress.org/trunk@56745 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-03 21:59:19 +00:00
Sergey Biryukov a2bcc36278 Docs: Consistently document the `$body_id` global as a string.
Includes declaring the global at the beginning of `wp_iframe()` and `iframe_header()`.

Follow-up to [32642], [32643].

Props mukesh27, upadalavipul.
Fixes #60032.
Built from https://develop.svn.wordpress.org/trunk@57181


git-svn-id: http://core.svn.wordpress.org/trunk@56692 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-11 12:11:22 +00:00
Sergey Biryukov 1c7d7a09aa Upload: Add missing escaping in `upload_space_setting()`.
Follow-up to [https://mu.trac.wordpress.org/changeset/1088 mu:1088], [https://mu.trac.wordpress.org/changeset/1095 mu:1095], [12603].

Props utsav72640.
Fixes #58514.
Built from https://develop.svn.wordpress.org/trunk@57175


git-svn-id: http://core.svn.wordpress.org/trunk@56686 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-08 21:26:29 +00:00
Sergey Biryukov f402ce754d Docs: Improve documentation for `Custom_Image_Header` and `Custom_Background` constructors.
Follow-up to [4673], [8656], [12890], [13041].

Props faisalahammad, cadic.
Fixes #58049.
Built from https://develop.svn.wordpress.org/trunk@57169


git-svn-id: http://core.svn.wordpress.org/trunk@56680 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-07 15:14:27 +00:00
Felix Arntz 04152c0b91 Themes: Clean up inactive themes' theme mods from being autoloaded as part of upcoming 6.5 upgrade routine.
Alongside [57153], this reduces unnecessarily autoloaded data from inactive themes, which can contribute to slow database performance as part of excessive autoloading. This changeset specifically resolves the issue for existing sites.

Props mukesh27, joemcgill, swissspidy, westonruter, flixos90.
Fixes #59975.
See #39537.

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


git-svn-id: http://core.svn.wordpress.org/trunk@56666 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-04 19:51:23 +00:00
Sergey Biryukov db7cb1dea2 Upgrade/Install: Add port number to target origin when decrementing update counts.
This ensures that the update counter bubble in the admin menu is properly decreased after a successful plugin or theme update from within the update iframe when the site uses a non-standard port number.

Follow-up to [27280], [29357].

Props TobiasBg.
Fixes #59987.
Built from https://develop.svn.wordpress.org/trunk@57148


git-svn-id: http://core.svn.wordpress.org/trunk@56659 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-01 01:35:28 +00:00
Sergey Biryukov 1df0bee7ec Site Health: Remove unused `$wpdb` global in `utf8mb4` support test.
Follow-up to [44984], [56475].

Props upadalavipul, mukesh27.
Fixes #59977.
Built from https://develop.svn.wordpress.org/trunk@57141


git-svn-id: http://core.svn.wordpress.org/trunk@56652 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-11-28 20:24:22 +00:00
Pascal Birchler eb5c155700 I18N: Improve translator comments for strings containing date formats.
Adds translator comments where absent and changes code style so that
comments are attached to the right strings during string extraction.

Props NekoJonez.
Fixes #59947
Built from https://develop.svn.wordpress.org/trunk@57136


git-svn-id: http://core.svn.wordpress.org/trunk@56647 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-11-26 16:43:30 +00:00
Sergey Biryukov a0504e8091 Text Changes: Update mentions of “web site” to “website” for consistency.
While “web site” was the original spelling, this variant has become rarely used, and “website” is now the standard spelling, already used throughout most of the WordPress core.

Reference: [https://en.wikipedia.org/wiki/Website Wikipedia: Website].

Props LiamMcArthur, cafenoirdesign, sabbirshouvo, sabernhardt, ironprogrammer, mukesh27.
Fixes #59853, #54276.
Built from https://develop.svn.wordpress.org/trunk@57131


git-svn-id: http://core.svn.wordpress.org/trunk@56642 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-11-22 17:44:24 +00:00
Sergey Biryukov 2f4ffff0fb Administration: Standardize default values in `submit_button()`.
This commit updates the `submit_button()` function to standardize the default values of `$text` and `$other_attributes` parameters. Previously set to `null`, these defaults have now been changed to an empty string (`''`), bringing consistency with the `get_submit_button()` function, which `submit_button()` wraps.

The change maintains backward compatibility, as `get_submit_button()` does not perform strict type-checking on these parameters. This update aligns with the ongoing effort to standardize function parameters across the WordPress codebase, improving the readability and predictability of the core functions.

Follow-up to [31446].

Props andbalashov.
Fixes #59921.
Built from https://develop.svn.wordpress.org/trunk@57128


git-svn-id: http://core.svn.wordpress.org/trunk@56639 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-11-20 00:08:25 +00:00
Sergey Biryukov 8673b86258 Coding Standards: Rewrite a few capability checks for clarity and readability.
This aims to:
* Perform the checks as early as possible to avoid redundant function calls.
* Remove an empty conditiaonal branch and make the exit conditions clearer.
* Bring the formatting in line with other multi-line conditionals in core.

Follow-up to [56836].

See #59650.
Built from https://develop.svn.wordpress.org/trunk@57123


git-svn-id: http://core.svn.wordpress.org/trunk@56634 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-11-17 17:11:21 +00:00
Sergey Biryukov d7a1816bf1 Docs: Improve some DocBlocks and inline comments per the documentation standards.
Follow-up to [56834], [56836], [56837], [56838].

Props kebbet, costdev, mukesh27, SergeyBiryukov.
See #59651.
Built from https://develop.svn.wordpress.org/trunk@57120


git-svn-id: http://core.svn.wordpress.org/trunk@56631 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-11-17 13:29:26 +00:00
Sergey Biryukov 222813317f Docs: Replace `tabindex` example in submit button functions documentation.
Most of the `tabindex` attributes across the admin were removed in [21311].

This commit updates the example for the `$other_attributes` parameter to use the `id` attribute instead.

Includes synchronizing documentation between `submit_button()` and `get_submit_button()`.

Follow-up to [15810], [16061], [21311], [27136], [31599].

Props benjaminknox, sabernhardt, fushar, SergeyBiryukov.
Fixes #59768.
Built from https://develop.svn.wordpress.org/trunk@57114


git-svn-id: http://core.svn.wordpress.org/trunk@56625 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-11-16 17:02:25 +00:00
Sergey Biryukov 812b1e296c Docs: Fix typo in the `ms_user_list_site_class` filter description.
Follow-up to [44977].

Props nithins53, shailu25, sabernhardt.
Fixes #59907.
Built from https://develop.svn.wordpress.org/trunk@57111


git-svn-id: http://core.svn.wordpress.org/trunk@56622 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-11-15 09:33:26 +00:00
Sergey Biryukov f3a843e952 Docs: Replace miscellaneous incorrect PHPDoc tags.
* `@contrib` is not a valid tag.
* `@origin` is not a valid tag.
* `@ref` is not a valid tag.
* `@blessed` is not a valid tag and doesn't convey any meaningful information.
* `@issue` is not a valid tag.

Reference: [https://developer.wordpress.org/coding-standards/inline-documentation-standards/php/#phpdoc-tags PHP Documentation Standards: PHPDoc Tags].

Follow-up to [8852], [34754], [38832], [43808].

Props jrf.
See #59651.
Built from https://develop.svn.wordpress.org/trunk@57108


git-svn-id: http://core.svn.wordpress.org/trunk@56619 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-11-13 11:13:27 +00:00
Peter Wilson c4b64359d6 Quick/Bulk Edit: Prevent assigning posts to default categories during bulk edit.
During a bulk edit of posts with different categories, the categories for the edited posts would be reset to the default category: uncategorized by default.

This reverts [56712] to resolve the issue.

Props peterwilsoncc, hellofromtonya, jorbin.
Fixes #59837.
See #11302.

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


git-svn-id: http://core.svn.wordpress.org/trunk@56604 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-11-08 23:22:25 +00:00
Sergey Biryukov ca4aed3083 Administration: Fix typos in `wp_admin_notice()` arguments in a few instances.
Follow-up to [56570], [56599].

Props dlh, mukesh27, sumitbagthariya16.
Fixes #59830.
Built from https://develop.svn.wordpress.org/trunk@57084


git-svn-id: http://core.svn.wordpress.org/trunk@56595 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-11-08 11:06:22 +00:00
hellofromTonya 9c8d8c260a Upgrade/Install: Update $_old_files for 6.4.
Props davidbaumwald.
Fixes #59817.
Built from https://develop.svn.wordpress.org/trunk@57075


git-svn-id: http://core.svn.wordpress.org/trunk@56586 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-11-06 17:49:25 +00:00
Sergey Biryukov 747b2c9f11 Docs: Replace incorrect `@private` tags.
The `@private` tag does not exist and is not supported. To indicate that something is private when in the global namespace, `@access private` should be used instead.

Reference: [https://developer.wordpress.org/coding-standards/inline-documentation-standards/php/#phpdoc-tags PHP Documentation Standards: PHPDoc tags].

Props jrf.
See #59651.
Built from https://develop.svn.wordpress.org/trunk@57065


git-svn-id: http://core.svn.wordpress.org/trunk@56576 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-11-06 09:27:23 +00:00
Sergey Biryukov 522656ed2b Coding Standards: Remove unnecessary ignore annotations in `dbDelta()`.
It is perfectly possible to write a commented regex with layout for readability by using the `x` modifier.

As per the manual:
> x (`PCRE_EXTENDED`)
>
> If this modifier is set, whitespace data characters in the pattern are totally ignored except when escaped or inside a character class, and characters between an unescaped # outside a character class and the next newline character, inclusive, are also ignored. This is equivalent to Perl's /x modifier, and makes it possible to include commentary inside complicated patterns.
>
> Note, however, that this applies only to data characters. Whitespace characters may never appear within special character sequences in a pattern, for example within the sequence (?( which introduces a conditional subpattern.

Reference: [https://www.php.net/manual/en/reference.pcre.pattern.modifiers.php PHP Manual: Pattern Modifiers].

This commit rewrites these two regexes to use the `x` modifier and gets rid of the unnecessary `phpcs:disable` comments.

The tests in the `tests/phpunit/tests/db/dbDelta.php` file cover this change.

Follow-up to [42249].

Props jrf.
See #59650.
Built from https://develop.svn.wordpress.org/trunk@57061


git-svn-id: http://core.svn.wordpress.org/trunk@56572 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-11-04 00:26:20 +00:00
Sergey Biryukov 61296195f8 Docs: Improve documentation for `wp_tempnam()` and `download_url()`.
Instead of mentioning the `unlink()` function specifically, the DocBlock should state that the calling function must delete or move the temporary file.

Follow-up to [6779], [12151].

Props bedas.
Fixes #59761.
Built from https://develop.svn.wordpress.org/trunk@57027


git-svn-id: http://core.svn.wordpress.org/trunk@56538 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-29 00:16:26 +00:00
Sergey Biryukov ad9048c923 General: Bump the recommended MySQL version in `readme.html`.
MySQL 5.7 reaches EOL (“End of Life”) in October 2023. The recommended minimum is bumped to 8.0 for now.

References:
* [https://www.mysql.com/support/ MySQL Support Policies]
* [https://make.wordpress.org/hosting/handbook/server-environment/#database Hosting team handbook: Server Environment: Database]

Follow-up to [31291], [33946], [35759], [52420], [52421], [54069].

Props swissspidy, SergeyBiryukov.
See #59701.
Built from https://develop.svn.wordpress.org/trunk@56982


git-svn-id: http://core.svn.wordpress.org/trunk@56493 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-22 09:05:25 +00:00
Sergey Biryukov 163f5e566f Media: Consistently call the `wp_create_file_in_uploads` hook as a filter.
The filter was initially introduced for file replication purposes. Since the returned value is not always used directly, some instances were later converted to an action as part of removing unused variables, and the hook was documented as an action while still being called as a filter in other instances.

This commit aims to correct the discrepancy between the code and the documentation.

Follow-up to [4673], [4817], [4818], [6363], [6551], [13041], [25821], [33154], [33280].

Props Howdy_McGee, nicolefurlan, johnbillion, mhshujon, SergeyBiryukov.
Fixes #57775.
Built from https://develop.svn.wordpress.org/trunk@56929


git-svn-id: http://core.svn.wordpress.org/trunk@56440 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-13 12:20:20 +00:00
audrasjb f3ccbed586 Shortcodes: Restrict ajax handler for media shortcode.
Props tykoted, xknown, peterwilsoncc, antpb, jorbin.




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


git-svn-id: http://core.svn.wordpress.org/trunk@56350 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-12 12:47:21 +00:00
Aaron Jorbin bd5486577c Application Passwords: Prevent the use of some pseudo protocols in application passwords.
Props tykoted, xknown, peterwilsoncc, jorbin, timothyblynjacobs, martinkrcho, paulkevan, dd32, ehtis.

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


git-svn-id: http://core.svn.wordpress.org/trunk@56349 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-12 12:41:18 +00:00
audrasjb 4f5be9b7de Comments: Prevent users who can not see a post from seeing comments on it.
Props peterwilsoncc, jorbin, audrasjb.




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


git-svn-id: http://core.svn.wordpress.org/trunk@56348 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-12 12:38:21 +00:00
costdev ecd4a277b7 Docs: Use US spelling and correct a typing mistake.
This changes two inline comments and a docblock so that they use US spelling as advised by the Core Handbook's Best Practices. A typing mistake is also corrected.

Reference:
- [https://make.wordpress.org/core/handbook/best-practices/spelling/ Core Handbook - Best Practices - Spelling].

Follow-up to [18632], [38120], [44954].

Props kebbet, mukesh27.
See #58833.
Built from https://develop.svn.wordpress.org/trunk@56825


git-svn-id: http://core.svn.wordpress.org/trunk@56337 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-11 07:05:25 +00:00
costdev b8b4a92895 Plugins: Fix broken `sprintf()` call in plugins list table.
In [56599], a `sprintf()` call was modified which resulted in an insufficient number of arguments.
This caused a Fatal Error when an incompatible plugin notice was displayed.

This fixes the `sprintf()` call.

Follow-up to [56599].

Props petitphp, TobiasBg, sabernhardt, mukesh27.
Fixes #59590. See #57791.
Built from https://develop.svn.wordpress.org/trunk@56824


git-svn-id: http://core.svn.wordpress.org/trunk@56336 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-11 04:33:32 +00:00
hellofromTonya 86dd8154df Update/Install: Deactivate Gutenberg plugin version older than 16.5.
This commit changes the Gutenberg minimum compatible version number from 14.1 (introduced in [54790]) to 16.5. For versions older than 16.5, the plugin will deactivate when upgrading WordPress to 6.4-beta3 or newer.

Changes are done within Core's `_upgrade_core_deactivate_incompatible_plugins()` which is invoked during WordPress' upgrade process.

Follow-up to [54790].

Props hellofromTonya, spacedmonkey.
Fixes #59584.
Built from https://develop.svn.wordpress.org/trunk@56820


git-svn-id: http://core.svn.wordpress.org/trunk@56332 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-10 15:07:24 +00:00
joedolson 074d2adb95 Quick/Bulk Edit: Fix inability to quick edit draft post date.
Follow up to [56022] to fix inability to set a date/time in quick editing. Allow a user to set a quick/edit date while preventing accidental date assignments per the original intent.

Props tristanleboss, ivanzhuck, tibbsa, sabernhardt, sergeybiryukov, oandregal, khokansardar, joedolson, shailu25.
Fixes #59125. See #19907.
Built from https://develop.svn.wordpress.org/trunk@56802


git-svn-id: http://core.svn.wordpress.org/trunk@56314 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-08 20:10:25 +00:00
Sergey Biryukov 5c4f902c20 Editor: Move `wp_navigation` schema updating to `WP_Navigation_Fallback` class.
This aims to better align the navigation fallback implementation with core architecture and best practices.

The function that updates the `wp_navigation` post response schema is now a public method of the `WP_Navigation_Fallback` class, so an extra file previously used for that specific function is no longer necessary.

Follow-up to [56052].

Props ramonopoly, scruffian, isabel_brison, mukesh27, swissspidy, rajinsharwar, afercia, audrasjb, mikeschroder, JeffPaul, johnjamesjacoby, TimothyBlynJacobs, oglekler, SergeyBiryukov.
Fixes #58910.
Built from https://develop.svn.wordpress.org/trunk@56793


git-svn-id: http://core.svn.wordpress.org/trunk@56305 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-06 14:06:22 +00:00
spacedmonkey b0872b005d Editor: Improve performance of _register_theme_block_patterns function.
The `_register_theme_block_patterns` function imposed a significant resource overhead. This issue primarily stems from themes, such as TT4, that register a substantial number of block patterns. These patterns necessitate numerous file operations, including file lookups, file reading into memory, and related processes. To provide an overview, the _register_theme_block_patterns function performed the following file operations:

- is_dir
- is_readable
- file_exists
- glob
- file_get_contents (utilized via get_file_data)

To address these issues, caching using a transient has been added to a new function call `_wp_get_block_patterns`. If theme development mode is disabled and theme exists, the block patterns are saved in a transient cache. This cache is used all requests after that, saving file lookups and reading files into memory. Cache invalidation is done, when themes are switched, deleted or updated. Meaning that block patterns are not stored in the cache incorrectly. 

Props flixos90, joemcgill, peterwilsoncc, costdev, swissspidy, aristath, westonruter, spacedmonkey.
Fixes #59490
Built from https://develop.svn.wordpress.org/trunk@56765


git-svn-id: http://core.svn.wordpress.org/trunk@56277 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-03 15:18:19 +00:00
Sergey Biryukov aaba77b577 Coding Standards: Remove redundant ignore annotations, take 4.
This removes ignore annotations related to sniffs which are not used by WP Core (like sniffs in the `WordPress-Extra` ruleset).

Follow-up to [48072], [51003], [55204], [56714].

Props jrf.
See #59161.
Built from https://develop.svn.wordpress.org/trunk@56752


git-svn-id: http://core.svn.wordpress.org/trunk@56264 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-01 00:22:27 +00:00
spacedmonkey 8aca3fdc68 Comments: Improve WP_Comment_Query count query performance by setting 'order by' to 'none'.
In cases where `WP_Comment_Query` or `get_comments` is employed with the 'count' parameter set to true, specify 'order by' as 'none'. Since these queries serve solely to determine the count of comments matching specific query parameters, the 'order by' clause becomes redundant and places unnecessary strain on the database server, resulting in slower query execution. Given that count queries are executed on every admin request to retrieve comment counts, this change enhances the performance of the wp-admin interface.

Props guss77, davidbaumwald, SergeyBiryukov, westonruter, peterwilsoncc, foliovision, hareesh-pillai, spacedmonkey.
Fixes #58368
Built from https://develop.svn.wordpress.org/trunk@56747


git-svn-id: http://core.svn.wordpress.org/trunk@56259 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-09-29 17:13:24 +00:00
Sergey Biryukov 440b8c2aba Coding Standards: Remove redundant ignore annotations, take 2.
This removes ignore annotations which are unnecessary due to the configuration in the `phpcs.xml.dist` ruleset already taking care of this.

Follow-up to [45611], [50146], [50148], [50586], [50822], [56738].

Props jrf.
See #59161.
Built from https://develop.svn.wordpress.org/trunk@56743


git-svn-id: http://core.svn.wordpress.org/trunk@56255 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-09-29 12:21:24 +00:00
costdev 872ad9e0b8 Filesystem API: Free the archive in `_unzip_file_ziparchive()`.
There are several early returns in `_unzip_file_ziparchive()` which don't close the archive prior to returning.

As this function is used in installation and upgrade processes which are memory-intensive, this calls `ZipArchive::close()` to free the archive prior to each early return. This excludes the first return which is a result of a failure to open the archive, which is [https://github.com/nih-at/libzip/blob/main/lib/zip_open.c#L62-L73 freed internally] when the failure occurs.

References:
- PHP.net: [https://www.php.net/manual/en/ziparchive.open.php ZipArchive::open()] and [https://www.php.net/manual/en/ziparchive.close.php ZipArchive::close()]
- libzip: [https://libzip.org/documentation/zip_open.html zip_open()] and [https://libzip.org/documentation/zip_close.html zip_close()]

Follow-up to: [13005], [13006], [13015], [13221], [14346] [25779].

Props azaozz, afragen, joemcgill, costdev.
Fixes #59467
Built from https://develop.svn.wordpress.org/trunk@56735


git-svn-id: http://core.svn.wordpress.org/trunk@56247 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-09-27 16:31:19 +00:00
Tammie Lister 7df8ec6846 Bundled Themes: Twenty Twenty-Four is now the default theme.
Follow up to [56716].
Props desrosj.

See #59447.

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


git-svn-id: http://core.svn.wordpress.org/trunk@56239 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-09-26 17:33:20 +00:00
Adam Silverstein 89a99dba2f Revisions: framework for storing post meta revisions.
Enable the storing of post meta in revisions including autosaves and previews:

Add a new argument `revisions_enabled` to the `register_meta` function which enables storing meta in revisions.

Add a new `wp_post_revision_meta_keys` filter which developers can use to control which meta is revisioned - it passes an array of the meta keys with revisions enabled as well as the post type.

Meta keys with revisions enabled are also stored for autosaves, and are restored when a revision or autosave is restored. In addition, meta values are now stored with the autosave revision used for previews. Changes to meta can now be previewed correctly without overwriting the published meta (see #20299) or passing data as a query variable, as the editor currently does to preview changes to the featured image.

Changes to meta with revisions enabled are considered when determining if a new revision should be created. A new revision is created if the meta value has changed since the last revision.

Revisions are now saved on the `wp_after_insert_post` hook instead of `post_updated`. The `wp_after_insert_post` action is fired after post meta has been saved by the REST API which enables attaching meta to the revision. To ensure backwards compatibility with existing action uses, `wp_save_post_revision_on_insert` function exits early if plugins have removed the previous `do_action( 'post_updated', 'wp_save_post_revision' )` call.

Props: alexkingorg, johnbillion, markjaquith, WraithKenny, kovshenin, azaozz, tv-productions, p51labs, mattheu, mikeschroder, Mamaduka, ellatrix, timothyblynjacobs, jakemgold, bookwyrm, ryanduff, mintindeed, wonderboymusic, sanchothefat, westonruter, spacedmonkey, hellofromTonya, drewapicture, adamsilverstein, swisspiddy.
Fixes #20564, #20299.



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


git-svn-id: http://core.svn.wordpress.org/trunk@56226 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-09-26 15:32:19 +00:00
costdev 61cef87240 Quick/Bulk Edit: Pre-fill category fields with their status.
This pre-fills category fields in the Quick/Bulk Edit form with their current status.

When bulk editing, if only some of the selected items are in a given category, the category's checkbox will display a line to indicate an indeterminate status.

Props pavelevap, scribu, chasedsiedu, helen, joshcanhelp, ubernaut, Cyberchicken, laumindproductscomau, SergeyBiryukov, Marcoevich, tomybyte, thinkluke, virtality-marketing-solutions, Michalooki, dmsnell, itecrs, pannelars, WHSajid, samba45, Mte90, johnbillion, tomluckies, soulseekah, francina, oglekler, ajmcfadyen, mukesh27, costdev.
Fixes #11302.
Built from https://develop.svn.wordpress.org/trunk@56712


git-svn-id: http://core.svn.wordpress.org/trunk@56224 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-09-26 15:05:21 +00:00
Peter Wilson 109f531fbf Administration: Add event type to Events and News widget.
Add the event type (WordCamp, Meetup, etc) to the nearby events listing within the Dashboard's Events and News widget.

Props renyot, audrasjb, ankit-k-gupta, oglekler, devmuhib, dhruvishah2203, JeffPaul, anveshika, sarahwilliams889, ajakaroth.
Fixes #58947.

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


git-svn-id: http://core.svn.wordpress.org/trunk@56209 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-09-26 03:54:20 +00:00
Sergey Biryukov 114a672cfa Coding Standards: Upgrade WPCS to version 3.0.0.
This is an important release which makes significant changes to improve the accuracy, performance, stability and maintainability of all sniffs, as well as making WordPressCS much better at handling modern PHP.

WordPressCS 3.0.0 contains breaking changes, both for people using ignore annotations, people maintaining custom rulesets, as well as for sniff developers who maintain a custom PHPCS standard based on WordPressCS.

If you are an end-user or maintain a custom WordPressCS based ruleset, please start by reading the [https://github.com/WordPress/WordPress-Coding-Standards/wiki/Upgrade-Guide-to-WordPressCS-3.0.0-for-ruleset-maintainers Upgrade Guide to WordPressCS 3.0.0 for ruleset maintainers] which lists the most important changes and contains a step by step guide for upgrading.

If you are a maintainer of an external standard based on WordPressCS and any of your custom sniffs are based on or extend WordPressCS sniffs, please read the [https://github.com/WordPress/WordPress-Coding-Standards/wiki/Upgrade-Guide-to-WordPressCS-3.0.0-for-Developers-of-external-standards Upgrade Guide to WordPressCS 3.0.0 for Developers].

In all cases, please read the complete changelog carefully before you upgrade.

This commit:
* Updates the Composer dependencies to use the new version, including updating the underlying PHP_CodeSniffer dependency to the new minimum supported version for WPCS.[[BR]] Note: the Composer PHPCS installer plugin is no longer explicitly required as it is now a dependency of WPCS, so the dependency is inherited automatically.
* Updates the ruleset for WPCS 3.0.0. This includes:
 * Raising the memory limit to be on the safe side as WPCS 3.0.0 contains a lot more sniffs.
 * Removing explicit inclusions of extra rules, which have now been added to the `WordPress-Core` ruleset..
 * Updating property names for select sniffs.
 * Updating one exclusion — the `WordPress.CodeAnalysis.AssignmentInCondition` sniff has been (partially) replaced by the `Generic.CodeAnalysis.AssignmentInCondition` sniff.
 * Adding one new exclusion.
* Downgrades one new error to a warning.[[BR]] The `Generic.Files.OneObjectStructurePerFile` sniff enforces that there is only one OO structure declaration per file. At this time, this sniff would yield 29 errors. By downgrading the sniff to a ''warning'', the build can pass and the issues can be fixed in due time. For now, the test directory will be excluded until the issues are fixed (as the test directory CS run does not allow for warnings).
* Updates ignore annotations for WPCS 3.0.0.

Reference: [https://github.com/WordPress/WordPress-Coding-Standards/releases/tag/3.0.0 WPCS 3.0.0 release notes].

Follow-up to [43571], [44574], [45600], [47927].

Props jrf, jorbin, desrosj.
See #59161.
Built from https://develop.svn.wordpress.org/trunk@56695


git-svn-id: http://core.svn.wordpress.org/trunk@56207 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-09-26 00:27:12 +00:00
costdev 36e754b5c3 Filesystem API: Introduce filters for before/after unzipping archives.
This introduces the following new filters which wrap the process of unzipping an archive:
- `pre_unzip_file` - Filters archive unzipping to allow an override with a custom process.
- `unzip_file` - Filters the result of unzipping an archive.

Both filters pass the following:
- `string $file` - Full path and filename of ZIP archive.
- `string $to` - Full path on the filesystem to extract archive to.
- `string[] $needed_dirs` - A full list of required folders that need to be created.
- `float|false $required_space` - The space required to unzip the file and copy its contents, with a 10% buffer.

Props dfavor, azaozz, oglekler, afragen, costdev.
Fixes #37719.
Built from https://develop.svn.wordpress.org/trunk@56689


git-svn-id: http://core.svn.wordpress.org/trunk@56201 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-09-25 22:16:17 +00:00
spacedmonkey 72f19abd94 Script Loader: Replace hardcoded output of style tags with calls to `wp_add_inline_style`.
In this commit, enhancements have been made by replacing manually constructed style tags with calls to `wp_add_inline_style`. Previously, numerous style tags were generated and output directly in the header, resulting in redundant code and bypassing the core's style enqueueing system. This approach made it challenging for third-party developers to manage and control the output of these style tags.

To ensure backward compatibility, the following functions have been deprecated and replaced:

- print_embed_styles
- print_emoji_styles
- wp_admin_bar_header
- _admin_bar_bump_cb

Backward compatibility shims have also been added, ensuring that if these functions were previously unhooked from there actions, they will continue to not output a style tag.

However, for the following functions, conversion to use inline styles was not feasible due to the potential disruption it might cause by changing the style tag IDs, potentially breaking JavaScript functionality for a number of plugins in the repository:

- custom-background
- wp-custom

These changes improve code maintainability and enhance the flexibility and control available to developers when managing style outputs within WordPress core.

Props spacedmonkey, hlunter, westonruter, flixos90.
Fixes #58775.
Built from https://develop.svn.wordpress.org/trunk@56682


git-svn-id: http://core.svn.wordpress.org/trunk@56194 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-09-25 17:06:34 +00:00
joedolson 5d6106539e Administration: Switch order of label/checkbox in `WP_List_Table`.
Move the label after the checkbox in `WP_List_Table` instances. Resolve a false positive that will be presented by automated accessibility testing tools. Follow up to [55954].

Props dimitrism, joedolson, sabernhardt, oglekler, marybaum, tobiasbg.
Fixes #58703.
Built from https://develop.svn.wordpress.org/trunk@56665


git-svn-id: http://core.svn.wordpress.org/trunk@56177 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-09-22 19:58:16 +00:00
Adam Silverstein 77582c4be9 Security: remove the cron event that checked for https support.
Fix an issue where a cron job ran every 12 hours to check for https support - even when https support was already enabled. The check is now run only when the user visits the Site Health page. Reducing the unneeded requests lowers the impact and load of hosting WordPress sites.

The `wp_update_https_detection_errors` function is deprecated and the `https_detection_errors` option that was previously set by the cron job is no longer maintained. The `pre_wp_update_https_detection_errors` filter is deprecated and replaced by the `pre_wp_get_https_detection_errors` filter  which serves the same function.

Props audrasjb, johnbillion, Michi91.
Fixes #58494.


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


git-svn-id: http://core.svn.wordpress.org/trunk@56176 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-09-22 19:08:19 +00:00
Sergey Biryukov 2d7e5afa3e Media: Use correct option name for attachment pages in `upgrade_640()`.
Follow-up to [56657].

See #57913.
Built from https://develop.svn.wordpress.org/trunk@56658


git-svn-id: http://core.svn.wordpress.org/trunk@56170 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-09-22 01:18:18 +00:00
Sergey Biryukov 229d32f6d7 Media: Disable attachment pages for new installations.
WordPress creates attachment pages by default for every attachment uploaded. On the vast majority of sites, these attachment pages don't contain any meaningful information. They do however exist, get indexed by search engines, and sometimes even rank in search results, leading to bad results for users and site owners.

This commit introduces a `wp_attachment_pages_enabled` database option to control the attachment pages behavior:

* On existing sites, the option is set to `1` on upgrade, so that attachment pages continue to work as is.
* For new sites, the option is set to to `0` by default, which means attachment pages are redirected to the attachment URL.
* Sites that want to enable or disable the attachment pages can set the option to `1` or `0`, respectively.

Follow-up to [2958], [3303], [7149], [34690].

Props aristath, poena, afercia, joostdevalk, jonoaldersonwp, azaozz, johnbillion, joedolson, basiliskan, audrasjb, davelo, rilwis, manfcarlo, tyxla, garrett-eclipse, seedsca, eatingrules, matveb, antpb, zodiac1978, oglekler, zunaid321, costdev, SergeyBiryukov.
Fixes #57913.
Built from https://develop.svn.wordpress.org/trunk@56657


git-svn-id: http://core.svn.wordpress.org/trunk@56169 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-09-22 00:04:41 +00:00
joedolson 491a21da64 Login and Registration: Improve HTML for errors and notices.
Improve markup on Login and Registration errors. Use list markup for multiple issues, paragraph when only one to reduce semantic burden in the most common case. Normalize classes and markup for wrapper using `wp_admin_notice()` and `wp_get_admin_notice()` functions. Move definition of those functions from `wp-admin\includes\misc.php` to `wp-includes\functions.php`. Move tests to functions group. 

Props extendwings, sabernhardt, afercia, lukecavanagh, rianrietveld, oglekler, sergeybiryukov, costdev, joedolson.
Fixes #30685.
Built from https://develop.svn.wordpress.org/trunk@56654


git-svn-id: http://core.svn.wordpress.org/trunk@56166 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-09-21 18:24:15 +00:00
joedolson 198543cf2f Coding Standards: Remove unused variable `el` in monitorPopup.
Remove an unused variable to resolves coding standards failure. Follow up to [56651].

Props joedolson.
See #58756.
Built from https://develop.svn.wordpress.org/trunk@56653


git-svn-id: http://core.svn.wordpress.org/trunk@56165 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-09-21 18:04:16 +00:00