Commit Graph

8778 Commits

Author SHA1 Message Date
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