Uncached database calls, and loose comparison warnings
-
Hi, while running the WordPress VIP code analysis bot against this plugin I found a bunch of uncached database calls and loose comparison operators. Both of these were middle tier warnings. I’m hoping this can get added to your task backlog and get updated in the plugin in the near future! Thanks!
Here’s more info on the bot: https://docs.wpvip.com/vip-code-analysis-bot/
Here are the warnings:
plugins/wordpress-popular-posts/src/Image.php
Warning( severity 5 ): Use of a direct database call is discouraged (WordPress.DB.DirectDatabaseQuery.DirectQuery).
line 484, 572, 632
Warning( severity 5 ): Direct database call without caching detected. Consider using wp_cache_get() / wp_cache_set() or wp_cache_delete() (WordPress.DB.DirectDatabaseQuery.NoCaching).
line 572, 632 plugins/wordpress-popular-posts/src/Query.php
Warning( severity 5 ): Direct database call without caching detected. Consider using wp_cache_get() / wp_cache_set() or wp_cache_delete() (WordPress.DB.DirectDatabaseQuery.NoCaching).
line 502 plugins/wordpress-popular-posts/src/Rest/ViewLoggerEndpoint.php
Warning( severity 5 ): Use of a direct database call is discouraged (WordPress.DB.DirectDatabaseQuery.DirectQuery).
line 226, 227
Warning( severity 5 ): Attempting a database schema change is discouraged (WordPress.DB.DirectDatabaseQuery.SchemaChange).
line 77 plugins/wordpress-popular-posts/src/template-tags.php
Warning( severity 5 ): Direct database call without caching detected. Consider using wp_cache_get() / wp_cache_set() or wp_cache_delete() (WordPress.DB.DirectDatabaseQuery.NoCaching).
line 146
Warning( severity 5 ): Use of a direct database call is discouraged (WordPress.DB.DirectDatabaseQuery.DirectQuery).
line 146 plugins/wordpress-popular-posts/src/Admin/Admin.php
Warning( severity 5 ): Direct database call without caching detected. Consider using wp_cache_get() / wp_cache_set() or wp_cache_delete() (WordPress.DB.DirectDatabaseQuery.NoCaching).
line 249, 379, 952
Warning( severity 5 ): Use of a direct database call is discouraged (WordPress.DB.DirectDatabaseQuery.DirectQuery).
line 249, 379, 952 plugins/wordpress-popular-posts/src/Admin/screen-debug.php
Warning( severity 5 ): Direct database call without caching detected. Consider using wp_cache_get() / wp_cache_set() or wp_cache_delete() (WordPress.DB.DirectDatabaseQuery.NoCaching).
line 62, 63
Warning( severity 5 ): Use of a direct database call is discouraged (WordPress.DB.DirectDatabaseQuery.DirectQuery).
line 62, 63 plugins/wordpress-popular-posts/src/Widget/form.php
Warning( severity 3 ): Loose comparisons are not allowed. Expected: "==="; Found: "==" (Universal.Operators.StrictComparisons.LooseEqual).
line 22, 23, 24, 35, 36, 37, 38, 41, 45, 46, 47, 165, 166, 167, 168, 178, 182, 231, 233 plugins/wordpress-popular-posts/src/Widget/form.php
Warning( severity 3 ): Loose comparisons are not allowed. Expected: "==="; Found: "==" (Universal.Operators.StrictComparisons.LooseEqual).
line 125, 138, 163, 164
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Uncached database calls, and loose comparison warnings’ is closed to new replies.