You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There three queries used within the Comment Hacks plugin which:
a) make direct database calls instead of using any of the various DB call abstraction functions offered by WP.
b) are not caching the results
If after careful reviewing it is determined for any of these queries that they really REALLY are ok the way they are and should not be cached or changed to use a WP DB abstractions, that particular query can be whitelisted using the following flags:
or for both: // phpcs:ignore WordPress.DB.DirectDatabaseQuery
Issue details
FILE: admin\class-comment-parent.php
----------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------
76 | WARNING | Usage of a direct database call is discouraged.
76 | WARNING | Direct database call without caching detected. Consider using wp_cache_get() /
| | wp_cache_set() or wp_cache_delete().
----------------------------------------------------------------------------------------------------
FILE: inc\class-clean-emails.php
----------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------
214 | WARNING | Usage of a direct database call is discouraged.
214 | WARNING | Direct database call without caching detected. Consider using wp_cache_get() /
| | wp_cache_set() or wp_cache_delete().
----------------------------------------------------------------------------------------------------
FILE: inc\class-comment-email-links.php
----------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------
55 | WARNING | Usage of a direct database call is discouraged.
55 | WARNING | Direct database call without caching detected. Consider using wp_cache_get() /
| | wp_cache_set() or wp_cache_delete().
----------------------------------------------------------------------------------------------------
To retrieve an up-to-date list, run the following from the repo root:
There three queries used within the Comment Hacks plugin which:
a) make direct database calls instead of using any of the various DB call abstraction functions offered by WP.
b) are not caching the results
Recommended reading for potential refactoring:
If after careful reviewing it is determined for any of these queries that they really REALLY are ok the way they are and should not be cached or changed to use a WP DB abstractions, that particular query can be whitelisted using the following flags:
// phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery
// phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching
// phpcs:ignore WordPress.DB.DirectDatabaseQuery
Issue details
To retrieve an up-to-date list, run the following from the repo root:
phpcs -p . --standard=WordPress --sniffs=WordPress.DB.DirectDatabaseQuery
The text was updated successfully, but these errors were encountered: