84% jkl-unit-converter

Code Review | JKL Unit Converter

WordPress plugin JKL Unit Converter scored84%from 54 tests.

About plugin

  • Plugin page: jkl-unit-converter
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.5
  • WordPress version: 6.3.1
  • First release: Apr 20, 2016
  • Latest release: Apr 20, 2016
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: jekkilekki (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /2,924 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.04MB] [CPU: ▼6.73ms] Passed 4 tests

This is a short check of server-side resources used by JKL Unit Converter
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0438.24 ▼1.04
Dashboard /wp-admin3.34 ▲0.0449.65 ▲1.18
Posts /wp-admin/edit.php3.45 ▲0.1048.15 ▼1.51
Add New Post /wp-admin/post-new.php5.92 ▲0.0481.86 ▼25.56
Media Library /wp-admin/upload.php3.26 ▲0.0336.55 ▲2.04

Server storage [IO: ▲0.13MB] [DB: ▲0.00MB] Passed 3 tests

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 32 new files
Database: no new tables, 7 new options
New WordPress options
widget_jkl_unit_converter_widget
widget_recent-comments
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for JKL Unit Converter
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲7914.48 ▼0.111.96 ▼0.1340.64 ▼3.34
Dashboard /wp-admin2,203 ▲125.86 ▲0.97101.02 ▼3.0437.67 ▼6.56
Posts /wp-admin/edit.php2,089 ▼02.06 ▲0.0633.90 ▼5.3135.99 ▲3.50
Add New Post /wp-admin/post-new.php1,528 ▼518.32 ▼4.69588.76 ▼45.0848.81 ▲2.88
Media Library /wp-admin/upload.php1,382 ▼34.19 ▼0.0497.27 ▼2.9541.03 ▼0.58

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin does not fully uninstall, leaving 7 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_jkl_unit_converter_widget
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 75% 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 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/jkl-unit-converter/inc/view-jkl-unit-converter.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed:
  • Tags: You are using too many tags: 16 tag instead of maximum 10
Please take inspiration from this readme.txt

jkl-unit-converter/jkl-unit-converter.php Passed 13 tests

"JKL Unit Converter" version 1.0.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
111 characters long description:
A simple Unit Converter widget that allows you to between various units. (Inspired by Google's Unit Converter.)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin1,555 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
PHP19192545794
JavaScript36442436
CSS1472234
Markdown142091

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity4.00
▷ Minimum class complexity2.00
▷ Maximum class complexity5.00
Average method complexity1.75
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods13
▷ Static methods00.00%
▷ Public methods861.54%
▷ Protected methods538.46%
▷ Private methods00.00%
Functions43
▷ Named functions4297.67%
▷ Anonymous functions12.33%
Constants0
▷ Global constants00.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
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
img/up-down-arrow.png0.11KB0.11KB▼ 2.61%