78% wp-unit-converter

Code Review | WP Unit Converter

WordPress plugin WP Unit Converter scored78%from 54 tests.

About plugin

  • Plugin page: wp-unit-converter
  • Plugin version: 1.0.5
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.9.2
  • WordPress version: 6.3.1
  • First release: Mar 25, 2019
  • Latest release: Mar 21, 2022
  • Number of updates: 13
  • Update frequency: every 84.2 days
  • Top authors: centangle (53.85%)shaampk1 (53.85%)

Code review

54 tests

User reviews

1 review

Install metrics

300+ active /3,229 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.11MB] [CPU: ▼1.29ms] Passed 4 tests

Server-side resources used by WP Unit Converter
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1043.37 ▼0.86
Dashboard /wp-admin3.41 ▲0.1050.73 ▼1.22
Posts /wp-admin/edit.php3.52 ▲0.1653.01 ▲2.45
Add New Post /wp-admin/post-new.php6.01 ▲0.12104.79 ▼0.90
Media Library /wp-admin/upload.php3.33 ▲0.1035.31 ▼2.17
WP Unit Converter /wp-admin/options-general.php?page=wpuc_options_submenu_page3.3036.11

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 29 new files
Database: no new tables, 8 new options
New WordPress options
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
widget_wp_unit_converter_widget
wpuc_options

Browser metrics Passed 4 tests

Checking browser requirements for WP Unit Converter
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,885 ▲12415.33 ▲0.9025.61 ▲23.7944.95 ▲1.87
Dashboard /wp-admin2,203 ▲235.67 ▼0.0085.98 ▼11.5937.83 ▼3.60
Posts /wp-admin/edit.php2,111 ▲142.00 ▲0.0640.35 ▲3.5134.81 ▼0.93
Add New Post /wp-admin/post-new.php1,533 ▲523.33 ▲0.07606.25 ▼34.2950.36 ▼16.72
Media Library /wp-admin/upload.php1,408 ▲84.13 ▼0.06100.49 ▼3.4042.78 ▲0.14
WP Unit Converter /wp-admin/options-general.php?page=wpuc_options_submenu_page9161.9424.3031.54

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_wp_unit_converter_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/wp-unit-converter/admin/partials/wp-unit-converter-admin-display.php
    • > /wp-content/plugins/wp-unit-converter/public/partials/wp-unit-converter-public-display.php
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/wp-unit-converter/admin/class-wp-unit-converter-widget.php:13

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 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed: Please take inspiration from this readme.txt

wp-unit-converter/wp-unit-converter.php 92% from 13 tests

"WP Unit Converter" version 1.0.5's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin725 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
PHP15237675420
JavaScript337131115
JSON150100
CSS2251490

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.13
Average class complexity3.00
▷ Minimum class complexity1.00
▷ Maximum class complexity9.00
Average method complexity1.53
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods38
▷ Static methods37.89%
▷ Public methods3386.84%
▷ Protected methods00.00%
▷ Private methods513.16%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
2 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/wpuc_horizontal_orientation.png7.98KB4.18KB▼ 47.57%
admin/images/wpuc_vertical_orientation.png8.67KB4.58KB▼ 47.16%