wordpress-develop/tests/phpunit/tests/comment
Jonny Harris 3114eda235 Comments: Always lazily load comment meta.
In [34270] introduced lazy loading of comment meta. However, this was only in the context of `WP_Query`. Other parts of the codebase, like `WP_Comment_Query` did not lazily load comment meta. In this change, calls to `update_meta_cache` are now replaced with `wp_lazyload_comment_meta`, that instead of priming comment 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 comment meta is being primed unnecessarily and never used. Adding everything to the comment meta queue, also means that if comment meta is used, that is all loaded in a single database / cache call.

Follow on from [55671], [55747].

Props spacedmonkey, peterwilsoncc, flixos90, mukesh27.
Fixes #57801.

git-svn-id: https://develop.svn.wordpress.org/trunk@55749 602fd350-edb4-49c9-b593-d223f7449a82
2023-05-11 12:25:51 +00:00
..
checkComment.php Comments: Make moderated or disallowed key check case-insensitive for non-Latin words. 2022-11-28 19:42:56 +00:00
commentForm.php Comments: Return early from comment_form() if an invalid post ID is passed. 2022-10-11 15:43:04 +00:00
commentsOpen.php Tests: Use the factory method instead of the property. 2022-09-06 22:09:49 +00:00
commentsTemplate.php Build/Test Tools: Add @covers tags to the comments tests. 2022-08-08 23:12:30 +00:00
commentTime.php Comments: Add missing arguments for get_comment_time() in comment_time(). 2023-04-07 14:34:51 +00:00
dateQuery.php Build/Test Tools: Add @covers tags to the comments tests. 2022-08-08 23:12:30 +00:00
getCommentAuthorEmailLink.php Build/Test Tools: Add @covers tags to the comments tests. 2022-08-08 23:12:30 +00:00
getCommentAuthorUrl.php Tests: Rename classes in phpunit/tests/comment/ per the naming conventions. 2022-10-27 15:53:08 +00:00
getCommentAuthorUrlLink.php Tests: Correct the expected quotes in get_comment_author_url_link() tests. 2023-04-19 14:49:51 +00:00
getCommentClass.php Build/Test Tools: Add @covers tags to the comments tests. 2022-08-08 23:12:30 +00:00
getCommentCount.php Tests: Rename classes in phpunit/tests/comment/ per the naming conventions. 2022-10-27 15:53:08 +00:00
getCommentExcerpt.php Tests: Rename classes in phpunit/tests/comment/ per the naming conventions. 2022-10-27 15:53:08 +00:00
getCommentLink.php Build/Test Tools: Add @covers tags to the comments tests. 2022-08-08 23:12:30 +00:00
getCommentReplyLink.php Build/Test Tools: Add @covers tags to the comments tests. 2022-08-08 23:12:30 +00:00
getCommentsPagesCount.php Tests: Replace some occurrences of assertEquals() with assertSame(). 2022-10-07 01:02:07 +00:00
getLastCommentModified.php Tests: Rename classes in phpunit/tests/comment/ per the naming conventions. 2022-10-27 15:53:08 +00:00
getPageOfComment.php Tests: Use the function get_num_queries across all unit tests. 2023-05-11 10:05:51 +00:00
isAvatarCommentType.php Tests: Merge file-level and class-level DocBlocks in various unit test files. 2023-02-14 16:10:13 +00:00
metaCache.php Comments: Always lazily load comment meta. 2023-05-11 12:25:51 +00:00
pingsOpen.php Tests: Use the factory method instead of the property. 2022-09-06 22:09:49 +00:00
query.php Tests: Use the function get_num_queries across all unit tests. 2023-05-11 10:05:51 +00:00
slashes.php Build/Test Tools: Add @covers tags to the comments tests. 2022-08-08 23:12:30 +00:00
template.php Tests: Use the factory method instead of the property. 2022-09-06 22:09:49 +00:00
walker.php Code Modernization: Remove dynamic properties in Tests_Comment_Walker. 2022-08-24 14:03:12 +00:00
wpAllowComment.php Build/Test Tools: Add @covers tags to the comments tests. 2022-08-08 23:12:30 +00:00
wpBatchUpdateCommentType.php Tests: Rename classes in phpunit/tests/comment/ per the naming conventions. 2022-10-27 15:53:08 +00:00
wpCheckCommentDisallowedList.php Comments: Make moderated or disallowed key check case-insensitive for non-Latin words. 2022-11-28 19:42:56 +00:00
wpComment.php Tests: Rename classes in phpunit/tests/comment/ per the naming conventions. 2022-10-27 15:53:08 +00:00
wpCommentsPersonalDataEraser.php Comments: Use correct orderby parameter name in personal data exporter and eraser. 2023-02-13 22:03:30 +00:00
wpCommentsPersonalDataExporter.php Comments: Use correct orderby parameter name in personal data exporter and eraser. 2023-02-13 22:03:30 +00:00
wpCountComments.php Tests: Rename classes in phpunit/tests/comment/ per the naming conventions. 2022-10-27 15:53:08 +00:00
wpHandleCommentSubmission.php Comments: Prevent replying to unapproved comments. 2023-02-21 01:43:33 +00:00
wpListComments.php Build/Test Tools: Add @covers tags to the comments tests. 2022-08-08 23:12:30 +00:00
wpUpdateCommentCountNow.php Tests: Use the function get_num_queries across all unit tests. 2023-05-11 10:05:51 +00:00