10% sm-sql-logs

Code Review | SM - SQL logs

WordPress plugin SM - SQL logs scored10%from 54 tests.

About plugin

  • Plugin page: sm-sql-logs
  • Plugin version: 1.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.8.2
  • WordPress version: 6.3.1
  • First release: Nov 8, 2017
  • Latest release: Nov 10, 2017
  • Number of updates: 9
  • Update frequency: every 0.2 days
  • Top authors: mi7osz (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /1,873 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
It is recommended to fix the following installer errors
  • This plugin did not install gracefully
    • > Warning in wp-content/plugins/sm-sql-logs/admin/partials/options_fnc.php+18
    array_merge(): Expected parameter 1 to be an array, bool given

Server metrics [RAM: ▲0.05MB] [CPU: ▼6.89ms] Passed 4 tests

Analyzing server-side resources used by SM - SQL logs
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0642.03 ▼1.35
Dashboard /wp-admin3.38 ▲0.0348.68 ▼11.69
Posts /wp-admin/edit.php3.42 ▲0.0648.54 ▲0.24
Add New Post /wp-admin/post-new.php5.98 ▲0.0983.83 ▼14.75
Media Library /wp-admin/upload.php3.28 ▲0.0537.62 ▲1.17
Logs /wp-admin/admin.php?page=sm_sql_logs-logs3.7942.63
Options /wp-admin/admin.php?page=sm_sql_logs-options3.2731.74
Home /wp-admin/admin.php?page=sm_sql_logs3.2731.59

Server storage [IO: ▲0.11MB] [DB: ▲0.14MB] Passed 3 tests

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 31 new files
Database: 1 new table, 9 new options
New tables
wp_sm_sql_logs
New WordPress options
sm_sql_logs_options
sql_logs_db_version
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
sm_sql_logs_settings
widget_recent-posts
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

SM - SQL logs: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,906 ▲14513.79 ▼0.568.64 ▲7.1344.17 ▲6.77
Dashboard /wp-admin2,214 ▲365.52 ▼0.1586.18 ▼16.6982.97 ▲38.67
Posts /wp-admin/edit.php2,131 ▲311.99 ▼0.0333.74 ▼2.1236.79 ▲5.46
Add New Post /wp-admin/post-new.php1,555 ▲2723.39 ▲0.20755.63 ▲74.8751.67 ▼5.03
Media Library /wp-admin/upload.php1,434 ▲344.14 ▼0.0499.31 ▼14.2747.71 ▼1.06
Logs /wp-admin/admin.php?page=sm_sql_logs-logs6,5102.1227.0948.80
Options /wp-admin/admin.php?page=sm_sql_logs-options9552.1724.4447.07
Home /wp-admin/admin.php?page=sm_sql_logs8252.1123.3328.00

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% from 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 9 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • sm_sql_logs_settings
    • sm_sql_logs_options
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • sql_logs_db_version

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/sm-sql-logs/admin/partials/header_html.php
    • > /wp-content/plugins/sm-sql-logs/public/partials/sm_sql_logs-public-display.php
  • 6× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/sm-sql-logs/admin/partials/logs.php:15
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/sm-sql-logs/config.php on line 5
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/sm-sql-logs/admin/partials/log_details.php:15
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/sm-sql-logs/admin/partials/main.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/sm-sql-logs/admin/partials/options_fnc.php:8
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/sm-sql-logs/admin/partials/options.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Please fix the following attributes:
  • Tags: You are using too many tags: 13 tag instead of maximum 10
The official readme.txt might help

sm-sql-logs/sm_sql_logs.php 85% from 13 tests

The entry point to "SM - SQL logs" version 1.1.1 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("sm-sql-logs.php" instead of "sm_sql_logs.php")
  • Text Domain: The text domain name should consist of only dashes and lowercase characters

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
No dangerous file extensions were detected1,591 lines of code in 23 files:
LanguageFilesBlank linesComment linesLines of code
PHP194238571,502
CSS218883
JavaScript24546

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity26.50
▷ Minimum class complexity1.00
▷ Maximum class complexity166.00
Average method complexity4.78
▷ Minimum method complexity1.00
▷ Maximum method complexity78.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods54
▷ Static methods2546.30%
▷ Public methods3259.26%
▷ Protected methods1425.93%
▷ Private methods814.81%
Functions15
▷ Named functions15100.00%
▷ Anonymous functions00.00%
Constants18
▷ Global constants316.67%
▷ Class constants1583.33%
▷ Public constants15100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
sm_sql_logs_admin_ico.png0.40KB0.29KB▼ 25.98%