47523 Commits

Author SHA1 Message Date
Jb Audras
250250d35e Text Changes: Typo fix in README.md.
Follow-up to [47752].

Props neychok.
Fixes #58177.


git-svn-id: https://develop.svn.wordpress.org/trunk@55690 602fd350-edb4-49c9-b593-d223f7449a82
2023-04-26 22:26:36 +00:00
Jb Audras
7a0cf18880 Editor: Improve the tag field loading spinner alignment.
This changeset improves the loading spinner alignment of the Classic Editor's tag field.

Follow-up to [19897], [31611].

Props Presskopp, SergeyBiryukov, audrasjb.
Fixes #58136.


git-svn-id: https://develop.svn.wordpress.org/trunk@55689 602fd350-edb4-49c9-b593-d223f7449a82
2023-04-26 21:36:43 +00:00
Sergey Biryukov
6d4fc50edc Coding Standards: Remove an empty else statement in dbDelta().
Use `continue` to help separate each case for better readability, instead of having a wall of `if`/`elseif`.

Includes simplifying a similar fragment in `make_site_theme_from_default()`.

Follow-up to [1575], [2037], [2040], [2044], [2346], [7999], [14080], [14485].

Props costdev, krunal265, hellofromTonya, brookedot, SergeyBiryukov.
Fixes #56982.

git-svn-id: https://develop.svn.wordpress.org/trunk@55688 602fd350-edb4-49c9-b593-d223f7449a82
2023-04-26 15:08:35 +00:00
André
9836f18614 Themes: improve performance of get_block_templates().
`get_block_templates()` is responsible for finding block templates that match a given search. The function receives a query parameter with the relevant metadata (slugs of the templates, areas of the template parts, etc) to find the user templates (database) and theme templates (file directory).

This function can be made more performant by changing how it works. Before this change, it processed all the block templates and discarded the ones that didn't match the query after it occurred. This commit makes it so it discards the templates that don't match the query before processing them. As a result, it only has to process the subset of templates that will be used, instead of all of them.

This change impacts any theme with block templates. TwentyTwentyThree reports a 15% improvement in Time To First Byte.

Props spacedmonkey, jorgefilipecosta, youknowriad, flixos90, mukesh27.
Fixes #57756.


git-svn-id: https://develop.svn.wordpress.org/trunk@55687 602fd350-edb4-49c9-b593-d223f7449a82
2023-04-26 14:38:43 +00:00
André
3c112a6e1b Themes: remove unused parameter in query for get_block_templates().
Remove the `theme` parameter from the query passed to `get_block_templates()`. It is not used or documented. This removal doesn't have any effect in the code, as the data is ignored anyway.

Props draganescu, audrasjb, davidbaumwald, hellofromTonya.
Fixes #57736.


git-svn-id: https://develop.svn.wordpress.org/trunk@55686 602fd350-edb4-49c9-b593-d223f7449a82
2023-04-26 14:25:19 +00:00
Sergey Biryukov
ed83c6aae8 General: Don't pass $action to wp_get_session_token() in wp_create_nonce().
The parameter appears to have been passed by accident, as the function does not accept any parameters.

Follow-up to [54218].

Props malavvasita, hztyfoon, dd32.
Fixes #58181.

git-svn-id: https://develop.svn.wordpress.org/trunk@55685 602fd350-edb4-49c9-b593-d223f7449a82
2023-04-25 14:55:28 +00:00
Jb Audras
26e3948fca I18N: Use correct translation function in wp-admin/includes/media.php.
This changeset replaces `echo __()` with the appropriate `_e()` function. It also ensures the punctuation is included in the translation string.

Props mujuonly, audrasjb, vladytimy, krupalpanchal, mukesh27.
Fixes #58138.


git-svn-id: https://develop.svn.wordpress.org/trunk@55684 602fd350-edb4-49c9-b593-d223f7449a82
2023-04-24 21:26:12 +00:00
Sergey Biryukov
bfdb1adc6a Coding Standards: Update code layout in default_password_nag() for readability.
This aims to better match similar fragments in other core functions.

Follow-up to [11162], [13844], [14170], [55682].

See #57839.

git-svn-id: https://develop.svn.wordpress.org/trunk@55683 602fd350-edb4-49c9-b593-d223f7449a82
2023-04-24 16:55:40 +00:00
Jb Audras
c2bd49c91f Coding Standards: Escape edit profile URL in default_password_nag().
Props utsav72640, mukesh27.
Fixes #58182.


git-svn-id: https://develop.svn.wordpress.org/trunk@55682 602fd350-edb4-49c9-b593-d223f7449a82
2023-04-24 16:42:19 +00:00
Jb Audras
16f9d4d2f9 Docs: Use third-person singular verbs in various function descriptions, as per docblocks standards.
Props laurentmagnin, pouicpouic, jbcouton, audrasjb.
See #57840.


git-svn-id: https://develop.svn.wordpress.org/trunk@55681 602fd350-edb4-49c9-b593-d223f7449a82
2023-04-24 16:35:17 +00:00
Jonny Harris
201a30d387 Users: Change cache group from users-queries to user-queries.
The cache group `users-queries` was added in [55657]. This global cache group, was named to be inline with cache groups added in [55526]. However, the naming of the group does not match, as other cache groups, do not end with s at the end. This change fix this naming. 

Props spacedmonkey, SergeyBiryukov, peterwilsoncc. 
See #40613.

git-svn-id: https://develop.svn.wordpress.org/trunk@55680 602fd350-edb4-49c9-b593-d223f7449a82
2023-04-24 13:51:15 +00:00
Sergey Biryukov
588d9a85ff Coding Standards: Use strict comparison in wp-admin/includes/class-wp-site-icon.php.
Follow-up to [32994], [35299].

Props aristath, poena, afercia, SergeyBiryukov.
See #57839.

git-svn-id: https://develop.svn.wordpress.org/trunk@55678 602fd350-edb4-49c9-b593-d223f7449a82
2023-04-23 04:00:26 +00:00
Sergey Biryukov
c2f262971c Coding Standards: Use strict comparison where strtolower() is involved.
Follow-up to [649], [7736], [18821], [19444], [20886], [20893], [23303], [55642], [55652], [55653], [55654].

Props aristath, poena, afercia, SergeyBiryukov.
See #57839.

git-svn-id: https://develop.svn.wordpress.org/trunk@55677 602fd350-edb4-49c9-b593-d223f7449a82
2023-04-22 15:17:47 +00:00
Sergey Biryukov
b55b935ccb Coding Standards: Remove unused $key variable in wp-admin/network/sites.php.
Rename `$val` to `$site_id` for clarity.

Follow-up to [12603], [18562], [30020].

See #57839.

git-svn-id: https://develop.svn.wordpress.org/trunk@55676 602fd350-edb4-49c9-b593-d223f7449a82
2023-04-21 13:31:20 +00:00
zieladam
87154ab87d HTML API: Fix a case where updates are overlooked when seeking to earlier locations.
This retains the WP_HTML_Tag_Processor attribute updates applied before calling seek() – they were erroneously erased in some cases.

Props dmsnell.
Fixes #58160.





git-svn-id: https://develop.svn.wordpress.org/trunk@55675 602fd350-edb4-49c9-b593-d223f7449a82
2023-04-21 13:30:11 +00:00
zieladam
fea66becf5 HTML API: Update code style so it passes when backported into Gutenberg.
This changes the indentation of a variable in class-wp-html-tag-processor.php 
to satisfy both WordPress and Gutenberg linters.

Props dmsnell, ntsekouras.
Fixes #58170.



git-svn-id: https://develop.svn.wordpress.org/trunk@55674 602fd350-edb4-49c9-b593-d223f7449a82
2023-04-21 12:31:29 +00:00
Greg Ziółkowski
f047b94d71 Editor: Add selectors field to block type definition
Adds support for the new selectors property for block types. It adds it to the allowed metadata when registering a block type, makes the WP_Block_Type class aware of it, exposes it through the block types REST API, and the get_block_editor_server_block_settings function.

Corresponding work in the Gutenberg plugin: https://github.com/WordPress/gutenberg/pull/46496.

Fixes #57585.
Props aaronrobertshaw, hellofromTonya.



git-svn-id: https://develop.svn.wordpress.org/trunk@55673 602fd350-edb4-49c9-b593-d223f7449a82
2023-04-21 10:41:58 +00:00
Sergey Biryukov
fa92c3fcf2 Networks and Sites: Use is_main_site() in a few more places.
This updates some more instances of comparing site IDs on Sites and Users screens in network admin to use `is_main_site()` for clarity.

Follow-up to [12603], [13918], [22064], [38814], [41131], [55666].

See #58150.

git-svn-id: https://develop.svn.wordpress.org/trunk@55672 602fd350-edb4-49c9-b593-d223f7449a82
2023-04-21 09:48:41 +00:00
Jonny Harris
2c6bf77a9e Taxonomy: Always lazily load term meta.
In [34529] introduced lazy loading of term meta. However, this was only in the context of `WP_Query`. Other parts of the codebase, like `WP_Term_Query` did not lazily load term meta. In this change, calls to `update_termmeta_cache` are now replaced with `wp_lazyload_term_meta`, that instead of priming term meta caches, just adds them to the queue to be primed it ever called. This results in far less database queries, as there a number of places where term meta is being primed unnecessarily and never used. Adding everything to the term meta queue, also means that if term meta is used, that is all loaded in a single database / cache call.

Props spacedmonkey, mukesh27, peterwilsoncc. 
Fixes #57645.

git-svn-id: https://develop.svn.wordpress.org/trunk@55671 602fd350-edb4-49c9-b593-d223f7449a82
2023-04-21 09:22:04 +00:00
Peter Wilson
70054b77af Security: Update GitHub security policy to refer to H1.
Update the security policy displayed on GitHub, `SECURITY.md`, to refer visitors to the [https://hackerone.com/wordpress HackerOne WordPress program] for the full policy.

This allows the project to maintain a single source of truth and avoid the potential for conflicting information across the two sites.

Props desrosj, hellofromTonya, costdev.
Fixes #57937.


git-svn-id: https://develop.svn.wordpress.org/trunk@55670 602fd350-edb4-49c9-b593-d223f7449a82
2023-04-21 03:17:29 +00:00
Andrew Ozz
4ff67caa58 Script Loader: Improve code style and readability in _wp_normalize_relative_css_links().
Props: westonruter.
See: 58069.

git-svn-id: https://develop.svn.wordpress.org/trunk@55669 602fd350-edb4-49c9-b593-d223f7449a82
2023-04-21 03:11:46 +00:00
Bernie Reiter
bbe7290f29 HTML API: Add support for a few invalid HTML comment forms.
- Comments created by means of a tag closer with an invalid tag name, e.g. `</3>`.
 - Comments closed with the invalid `--!>` closer. (Comments should be closed by `-->` but if the `!` appears it will also close it, in error.)
 - Empty tag name elements, which are technically skipped over and aren't comments, e.g. `</>`.

Props dmsnell, costdev.
Fixes #58007.

git-svn-id: https://develop.svn.wordpress.org/trunk@55667 602fd350-edb4-49c9-b593-d223f7449a82
2023-04-20 17:08:47 +00:00
Sergey Biryukov
0f28f4cf1a Networks and Sites: Simplify the check for main site on Network Admin → Sites screen.
This replaces a site ID comparison when displaying action links in `WP_MS_Sites_List_Table::handle_row_actions()` with a dedicated function call, `is_main_site()`, for clarity.

Follow-up to [13918], [25125], [26120], [32644], [38814].

Props ecorica, spacedmonkey, SergeyBiryukov.
Fixes #58150.

git-svn-id: https://develop.svn.wordpress.org/trunk@55666 602fd350-edb4-49c9-b593-d223f7449a82
2023-04-20 14:28:50 +00:00
Sergey Biryukov
39f4a27610 Site Health: Bump the recommended MariaDB version to 10.4.
MariaDB 10.3 reaches EOL (“End of Life”) in May 2023. The recommended minimum is bumped to 10.4 for now.

References:
* [https://mariadb.org/about/#maintenance-policy MariaDB Maintenance policy]
* [https://make.wordpress.org/hosting/handbook/server-environment/#database Hosting team handbook: Server Environment: Database]

Follow-up to [52420], [53435], [54069], [54076].

Props JavierCasares.
See #58158.

git-svn-id: https://develop.svn.wordpress.org/trunk@55665 602fd350-edb4-49c9-b593-d223f7449a82
2023-04-20 13:52:46 +00:00
Jb Audras
23c430610a Docs: Use third-person singular verbs for WP_Importer related function descriptions, as per docblocks standards.
Props pouicpouic.
See #57840.


git-svn-id: https://develop.svn.wordpress.org/trunk@55664 602fd350-edb4-49c9-b593-d223f7449a82
2023-04-20 10:39:05 +00:00
Sergey Biryukov
bc28f52762 Tests: Correct the expected quotes in get_comment_author_url_link() tests.
Follow-up to [55660].

See #57839.

git-svn-id: https://develop.svn.wordpress.org/trunk@55661 602fd350-edb4-49c9-b593-d223f7449a82
2023-04-19 14:49:51 +00:00
Sergey Biryukov
219c661ef2 Coding Standards: Use more meaningful variable names in various comment functions.
This aims to bring more consistency between the functions, as well as in filter parameters.

Includes minor code layout fixes for better readability.

Follow-up to [45667], [47287], [48579], [53719], [53723], [55308].

See #57839.

git-svn-id: https://develop.svn.wordpress.org/trunk@55660 602fd350-edb4-49c9-b593-d223f7449a82
2023-04-19 14:38:34 +00:00
Bernie Reiter
9400453eac HTML API: Ensure attribute updates happen only once for case variants.
When setting a new value for an attribute multiple times and providing
multiple case variations of the attribute name the Tag Processor has
been appending multiple copies of the attribute into the updated HTML.

This means that only the first attribute set determines the value in
the final output, plus the output will //appear// wrong.

In this patch we're adding a test to catch the situation and resolving it
by using the appropriate comparable attribute name as a key for storing
the updates as we go. Previously we stored updates to the attribute by
its given `$name`, but when a new update of the same name with a
case variant was queued, it would not override the previously-enqueued
value as it out to have.

Props dmsnell, zieladam.
Fixes #58146.

git-svn-id: https://develop.svn.wordpress.org/trunk@55659 602fd350-edb4-49c9-b593-d223f7449a82
2023-04-19 09:25:32 +00:00
Weston Ruter
8465dec59a Script Loader: Optimize performance of _wp_normalize_relative_css_links() by more than 2x.
* Replace `preg_match_all()` and its secondary `str_replace()` call with `preg_replace_callback()`.
* Fix case where paths beginning with `http` and `https` (but not `http:` and `https:`) were erroneously not counted as relative.
* Improve code style and readability by consolidating conditions and returning once.
* Use `str_starts_with()` consistently instead of `strpos()`.

Follow-up to [52036], [52695], and [52754].

Fixes #58069.
See #54243.


git-svn-id: https://develop.svn.wordpress.org/trunk@55658 602fd350-edb4-49c9-b593-d223f7449a82
2023-04-19 01:24:40 +00:00
Jonny Harris
19bd759db5 Users: Cache database queries within WP_User_Query class.
Cache the results of database queries within `WP_User_Query` class. Only cache queries that are requesting 3 or less fields so that caches are not storing full user objects. Cache results are stored in a new global cache group named `users-queries`. Add a new parameter to `WP_User_Query` called `cache_results` to allow developers to opt out of a receiving cached results. `cache_results` parameter defaults to true. Also add a new helper function called `wp_cache_set_users_last_changed`, similar to `wp_cache_set_posts_last_changed` that incroments last changed value in cache group `users`.  Ensure that `wp_cache_set_users_last_changed` is called whenever user / user meta is modified for proper cache invalidation. 

Props johnjamesjacoby, spacedmonkey, westi, dd32, strategio, srikanthmeenakshi, OllieJones, khoipro, rjasdfiii, flixos90, mukesh27, peterwilsoncc. 
Fixes #40613.

git-svn-id: https://develop.svn.wordpress.org/trunk@55657 602fd350-edb4-49c9-b593-d223f7449a82
2023-04-18 11:48:46 +00:00
Sergey Biryukov
e5057af16e Coding Standards: Use strict comparison in wp-admin/includes/class-wp-ms-sites-list-table.php.
Includes minor code layout fixes for better readability.

Follow-up to [12603], [32630], [32755], [46441].

Props mujuonly, audrasjb, jankyz, krupalpanchal, SergeyBiryukov.
Fixes #58139.

git-svn-id: https://develop.svn.wordpress.org/trunk@55656 602fd350-edb4-49c9-b593-d223f7449a82
2023-04-18 08:35:11 +00:00
Jb Audras
b343a7c049 Twenty Nineteen: Fix a translation issue in Comments navigation text.
This changeset combines text strings for "Previous Comments" and "Next Comments" links to ensure translators can control word order in each string. The `span` tags are included in the translation to give more control over what is hidden on small screens.

Props sabernhardt.
Fixes #58149.


git-svn-id: https://develop.svn.wordpress.org/trunk@55655 602fd350-edb4-49c9-b593-d223f7449a82
2023-04-18 08:22:08 +00:00
Sergey Biryukov
b24f990f4f Coding Standards: Use strict comparison where trim() is involved.
Follow-up to [17189], [24623], [55642], [55652], [55653].

Props aristath, poena, afercia, SergeyBiryukov.
See #57839.

git-svn-id: https://develop.svn.wordpress.org/trunk@55654 602fd350-edb4-49c9-b593-d223f7449a82
2023-04-17 16:59:57 +00:00
Sergey Biryukov
0276bfdd6d Coding Standards: Use strict comparison where substr() is involved.
Follow-up to [3606], [10738], [33359], [55642], [55652].

Props aristath, poena, afercia, SergeyBiryukov.
See #57839.

git-svn-id: https://develop.svn.wordpress.org/trunk@55653 602fd350-edb4-49c9-b593-d223f7449a82
2023-04-16 10:46:17 +00:00
Sergey Biryukov
760728c92f Coding Standards: Use strict comparison where strlen() is involved.
Follow-up to [649], [1345], [3034], [6132], [6314], [6974], [55642].

Props aristath, poena, afercia, SergeyBiryukov.
See #57839.

git-svn-id: https://develop.svn.wordpress.org/trunk@55652 602fd350-edb4-49c9-b593-d223f7449a82
2023-04-15 12:09:08 +00:00
Sergey Biryukov
94f1eb31c4 Coding Standards: Rename the $myHTML parameter to $text in htmlentities2().
This resolves a WPCS warning:
{{{
Variable "$myHTML" is not in valid snake_case format, try "$my_h_t_m_l"
}}}

It also matches other formatting functions with the `$text` parameter, e.g. `esc_html()`, `ent2ncr()`, etc.

Follow-up to [1727], [3717], [8662], [8743], [54927].

Props victoranto, audrasjb, jrf.
Fixes #58129.

git-svn-id: https://develop.svn.wordpress.org/trunk@55651 602fd350-edb4-49c9-b593-d223f7449a82
2023-04-14 01:25:36 +00:00
Sergey Biryukov
e0005a5788 Coding Standards: Use strict comparison in wp-includes/http.php.
Follow-up to [17914], [55642].

Props aristath, poena, afercia, SergeyBiryukov.
See #57839.

git-svn-id: https://develop.svn.wordpress.org/trunk@55650 602fd350-edb4-49c9-b593-d223f7449a82
2023-04-13 15:41:18 +00:00
Joe Dolson
ce28deee43 Media: Render attachment custom fields for new uploads.
Initialize attachment custom fields during the `add` callback, so that fields are present as soon as an attachment is uploaded but do not refresh when field values are changed. Follow up to #40909.

Props trepmal, adamsilverstein, joedolson.
Fixes #58051.

git-svn-id: https://develop.svn.wordpress.org/trunk@55649 602fd350-edb4-49c9-b593-d223f7449a82
2023-04-12 23:42:20 +00:00
Sergey Biryukov
68514c5136 Coding Standards: Rename the $qtInit and $mceInit variables in _WP_Editors.
This resolves 37 WPCS warnings along the lines of:
{{{
Variable "$qtInit" is not in valid snake_case format, try "$qt_init"
Variable "$mceInit" is not in valid snake_case format, try "$mce_init"
}}}

Follow-up to [18498].

See #57839.

git-svn-id: https://develop.svn.wordpress.org/trunk@55648 602fd350-edb4-49c9-b593-d223f7449a82
2023-04-12 09:41:21 +00:00
Jb Audras
0c52802f69 Media: Deprecate wp-admin/media.php.
The `wp-admin/media.php` file was introduced in [7262], then removed from the Media workflow in [21948].
This changeset finally deprecates it as it is not used anymore.

Follow-up to [7262], [21948].

Props kebbet, costdev, SergeyBiryukov, jrf, antpb, audrasjb.
Fixes #57612.
See #6181, #21391, #57608.


git-svn-id: https://develop.svn.wordpress.org/trunk@55647 602fd350-edb4-49c9-b593-d223f7449a82
2023-04-11 22:24:35 +00:00
Jb Audras
5792276ddc Docs: Revise comments using “we” in various docblocks.
This updates some inline comments to better match the guidelines and recommendations set forth in the make/core and make/docs handbooks:

> In general, use second person in your documentation. Second person depicts a friendly tone, with a perfect focus on the reader. In addition to this, directly addressing the reader helps avoid passive voice; thereby preventing unwanted confusion. The word “we” should be avoided (...) unless its made very clear which group is speaking.

References:
- [https://make.wordpress.org/docs/style-guide/language-grammar/grammatical-person/ Style Guide: Grammatical person]
- [https://make.wordpress.org/docs/handbook/documentation-team-handbook/handbooks-style-and-formatting-guide/ Handbooks & HelpHub Style and Formatting Guide]
- [https://make.wordpress.org/core/handbook/best-practices/post-comment-guidelines/#style-and-substance Post & Comment Guidelines: Style and Substance]

Follow-up to [2176], [3430], [4676], [6009], [7991], [12688], [12762], [26008], [28978], [44488], [44962], [51979], [53131], [53132], [53156], [53131], [54200], [54866].

Props majaloncar, leamcaleese, annebovelett.
Fixes #57052.


git-svn-id: https://develop.svn.wordpress.org/trunk@55646 602fd350-edb4-49c9-b593-d223f7449a82
2023-04-11 22:04:58 +00:00
Sergey Biryukov
ca2db43d6a Coding Standards: Use strict comparison in wp-admin/maint/repair.php.
Follow-up to [12092], [19757].

Props azouamauriac, aristath, poena, afercia, SergeyBiryukov.
See #57839.

git-svn-id: https://develop.svn.wordpress.org/trunk@55645 602fd350-edb4-49c9-b593-d223f7449a82
2023-04-11 16:28:51 +00:00
Jb Audras
e4419d727c Docs: Fix a typo in wp-includes/rss.php inline comments.
This changeset replaces "wc3dtf" with "W3C date/time formats" to fix a typo and to provide a better description of the related code.

Props lanacodes, sabernhardt, nithins53.
Fixes #57467.


git-svn-id: https://develop.svn.wordpress.org/trunk@55644 602fd350-edb4-49c9-b593-d223f7449a82
2023-04-10 19:29:15 +00:00
Jb Audras
16e6c71bb5 Twenty Twenty-Three: Add style-variations tag in style.css.
The `style-variations` tag was recently added on the Theme repository. As Twenty Twenty-Three proposes several Style variations, let's add a `style-variations` tag to the header of its stylesheet.

Props kafleg, SergeyBiryukov, mukesh27.
Fixes #58110.
See meta#6545.


git-svn-id: https://develop.svn.wordpress.org/trunk@55643 602fd350-edb4-49c9-b593-d223f7449a82
2023-04-10 18:37:24 +00:00
Sergey Biryukov
81598dd34f Coding Standards: Use strict comparison where count() is involved.
Follow-up to [1636], [6974], [8114], [10322], [13326], [14760], [18006], [18541], [19743], [23249], [24115], [33359].

Props aristath, poena, afercia, SergeyBiryukov.
See #57839.

git-svn-id: https://develop.svn.wordpress.org/trunk@55642 602fd350-edb4-49c9-b593-d223f7449a82
2023-04-10 12:54:28 +00:00
Sergey Biryukov
ba2f30e4dc Coding Standards: Replace include_once with require_once for required files.
Per [https://developer.wordpress.org/coding-standards/wordpress-coding-standards/php/#writing-include-require-statements WordPress PHP coding standards], it is ''strongly recommended'' to use `require[_once]` for unconditional includes. When using `include[_once]`, PHP will throw a warning when the file is not found but will continue execution, which will almost certainly lead to other errors/warnings/notices being thrown if your application depends on the file loaded, potentially leading to security leaks. For that reason, `require[_once]` is generally the better choice as it will throw a `Fatal Error` if the file cannot be found.

Follow-up to [1674], [1812], [1964], [6779], [8540], [10521], [11005], [11911], [16065], [16149], [25421], [25466], [25823], [37714], [42981], [45448], [47198], [54276], [55633].

Props kausaralm, SergeyBiryukov.
See #57839.

git-svn-id: https://develop.svn.wordpress.org/trunk@55641 602fd350-edb4-49c9-b593-d223f7449a82
2023-04-09 11:55:37 +00:00
Jb Audras
2ff42bcb5b Networks and Sites: Fix incorrect color for Theme enabling admin notices.
This changeset replaces a `notice-updated` class with `notice-success` to fix an issue where the notices were using a gray border color instead of green when enabling or disabling a theme for a network.

Follow-up to [55418].

Props ocean90, audrasjb, marineevain, SergeyBiryukov, dhrumilk, chiragrathod103.
Fixes #58096.


git-svn-id: https://develop.svn.wordpress.org/trunk@55637 602fd350-edb4-49c9-b593-d223f7449a82
2023-04-08 09:29:28 +00:00
Sergey Biryukov
9dec7ae0a8 Twenty Twenty-One: Replace include_once with require_once for required classes.
Per [https://developer.wordpress.org/coding-standards/wordpress-coding-standards/php/#writing-include-require-statements WordPress PHP coding standards], it is ''strongly recommended'' to use `require[_once]` for unconditional includes. When using `include[_once]`, PHP will throw a warning when the file is not found but will continue execution, which will almost certainly lead to other errors/warnings/notices being thrown if your application depends on the file loaded, potentially leading to security leaks. For that reason, `require[_once]` is generally the better choice as it will throw a `Fatal Error` if the file cannot be found.

Follow-up to [49216], [49633].

Props wpfy.
See #57839.

git-svn-id: https://develop.svn.wordpress.org/trunk@55633 602fd350-edb4-49c9-b593-d223f7449a82
2023-04-08 09:03:08 +00:00
Sergey Biryukov
e30ce9d4b5 Comments: Add missing arguments for get_comment_time() in comment_time().
In a recent change, `comment_time()` was updated to accept a `$comment_id` parameter for consistency with `comment_date()`, following a similar change for `get_comment_time()`.

However, the new parameter was not correctly passed to `get_comment_time()` inside the function. It should be passed as the fourth parameter after `$format`, `$gmt` and `$translate`, not the second.

This commit adds the missing arguments and a few unit tests to confirm the correct behavior.

Follow-up to [55284], [55287], [55308].

Props costdev, tmatsuur, ugyensupport, johnbillion.
Fixes #58064.

git-svn-id: https://develop.svn.wordpress.org/trunk@55632 602fd350-edb4-49c9-b593-d223f7449a82
2023-04-07 14:34:51 +00:00
Sergey Biryukov
353921c119 Coding Standards: Correct sprintf() calls for messages in wp-admin/upload.php.
This ensures that `sprintf()` is not unnecessarily applied to strings without any placeholders.

Follow-up to [31941], [31619], [36328], [55178].

See #57839.

git-svn-id: https://develop.svn.wordpress.org/trunk@55631 602fd350-edb4-49c9-b593-d223f7449a82
2023-04-06 17:37:45 +00:00