78% sqlog

Code Review | SQLog

WordPress plugin SQLog scored78%from 54 tests.

About plugin

  • Plugin page: sqlog
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-6.0
  • WordPress version: 6.3.1
  • First release: Jun 16, 2022
  • Latest release: Jun 16, 2022
  • Number of updates: 4
  • Update frequency: N/A
  • Top authors: xuxu.fr (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /223 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

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

Server-side resources used by SQLog
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0440.05 ▼4.54
Dashboard /wp-admin3.36 ▲0.0649.34 ▼1.10
Posts /wp-admin/edit.php3.48 ▲0.1346.08 ▼1.77
Add New Post /wp-admin/post-new.php5.94 ▲0.0689.69 ▼3.58
Media Library /wp-admin/upload.php3.27 ▲0.0438.70 ▲8.39

Server storage [IO: ▲0.04MB] [DB: ▲0.00MB] 67% from 3 tests

Input-output and database impact of this plugin
Please fix the following
  • There were 2 files (0.86KB) illegally modified outside of "wp-content/plugins/sqlog/" and "wp-content/uploads/"
    • (new file) wp-content/mu-plugins/sqlog.php
    • (modified) .htaccess
Filesystem: 13 new files
Database: no new tables, 11 new options
New WordPress options
widget_recent-posts
sqlog_purge_interval
sqlog_install
can_compress_scripts
db_upgraded
widget_recent-comments
sqlog_plugin_version
sqlog_install_date
theysaidso_admin_options
widget_theysaidso_widget
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for SQLog
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,076 ▲33015.09 ▲0.675.64 ▲3.4041.80 ▼11.91
Dashboard /wp-admin2,368 ▲1776.48 ▲0.62127.52 ▲21.5939.35 ▼0.14
Posts /wp-admin/edit.php2,280 ▲1913.41 ▲1.4153.58 ▲11.1531.20 ▼3.63
Add New Post /wp-admin/post-new.php1,689 ▲15622.28 ▼0.86549.26 ▼131.1029.38 ▼21.83
Media Library /wp-admin/upload.php1,413 ▲254.12 ▼0.1181.39 ▼15.1842.52 ▲0.71

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • This plugin did not uninstall successfully, leaving 11 options in the database
    • widget_theysaidso_widget
    • sqlog_install
    • can_compress_scripts
    • sqlog_purge_interval
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • sqlog_uninstall_date
    • sqlog_plugin_version
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/sqlog/rewrites/sqlog.php
  • 5× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Warning
      Use of undefined constant SQLOG_PLUGIN_VERSION - assumed 'SQLOG_PLUGIN_VERSION' (this will throw an Error in a future version of PHP) in wp-content/plugins/sqlog/rewrites/sqlog.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/sqlog/mu-plugin-template/sqlog.php:3
    • > PHP Warning
      Use of undefined constant SQLOG_SLUG_CAMELCASE - assumed 'SQLOG_SLUG_CAMELCASE' (this will throw an Error in a future version of PHP) in wp-content/plugins/sqlog/rewrites/sqlog-process.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/sqlog/sqlog.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_query_var() in wp-content/plugins/sqlog/rewrites/sqlog-process.php:1

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
8 plugin tags: sql, csv, log, queries, mysql...

sqlog/sqlog.php Passed 13 tests

The entry point to "SQLog" version 1.0.0 is a PHP file that has certain tags in its header comment area
123 characters long description:
Log WordPress MySQL queries in csv file (and log file). Useful when you need to improve the performance or debug something.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected982 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP7166130973
Markdown1506
JavaScript2002
CSS2101

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity122.00
▷ Minimum class complexity122.00
▷ Maximum class complexity122.00
Average method complexity3.76
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods40
▷ Static methods1435.00%
▷ Public methods40100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions00.00%
▷ Anonymous functions2100.00%
Constants9
▷ Global constants9100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG files were detected