83% product-size-charts-for-woocommerce

Code Review | Product Size charts for Woocommerce

WordPress plugin Product Size charts for Woocommerce scored83%from 54 tests.

About plugin

  • Plugin page: product-size-char...
  • Plugin version: 3.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.6.0-5.6
  • WordPress version: 6.3.1
  • First release: Dec 30, 2015
  • Latest release: Dec 28, 2020
  • Number of updates: 116
  • Update frequency: every 15.7 days
  • Top authors: phoeniixx (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

200+ active /11,796 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.00MB] [CPU: ▼3.87ms] Passed 4 tests

A check of server-side resources used by Product Size charts for Woocommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0039.18 ▼2.66
Dashboard /wp-admin3.31 ▲0.0043.23 ▼8.56
Posts /wp-admin/edit.php3.36 ▲0.0046.26 ▲0.75
Add New Post /wp-admin/post-new.php5.89 ▲0.0084.96 ▼4.99
Media Library /wp-admin/upload.php3.23 ▲0.0036.57 ▲1.62

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 69 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Product Size charts for Woocommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.23 ▼0.931.60 ▼0.3139.66 ▼13.97
Dashboard /wp-admin2,206 ▲185.87 ▲0.03106.48 ▲3.9837.04 ▼6.04
Posts /wp-admin/edit.php2,092 ▲32.05 ▲0.0540.66 ▲5.5235.28 ▼2.20
Add New Post /wp-admin/post-new.php1,514 ▼1923.40 ▲0.52620.50 ▼36.4053.07 ▼2.34
Media Library /wp-admin/upload.php1,388 ▼34.22 ▼0.0691.86 ▼12.8341.16 ▼0.89

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
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP 50% 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
Almost there! Just fix the following items
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function did_action() in wp-content/plugins/product-size-charts-for-woocommerce/libs/tgm/class-tgm-plugin-activation.php:2109
    • > PHP Fatal error
      Uncaught Error: Call to undefined function did_action() in wp-content/plugins/product-size-charts-for-woocommerce/libs/tgm/class-tgm-plugin-activation.php:2109
    • > PHP Fatal error
      Uncaught Error: Call to undefined function did_action() in wp-content/plugins/product-size-charts-for-woocommerce/libs/tgm/class-tgm-plugin-activation.php:2109

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need to be fixed:
  • Tags: There are too many tags (22 tag instead of maximum 10)
The official readme.txt is a good inspiration

product-size-charts-for-woocommerce/size-chart-for-woocommerce.php 77% from 13 tests

The primary PHP file in "Product Size charts for Woocommerce" version 3.0 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Requires at least: The required version number did not match the one declared in readme.txt ("4.0" instead of "2.6.0")
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("product-size-charts-for-woocommerce.php" instead of "size-chart-for-woocommerce.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin3,268 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP118411,6663,150
JavaScript131285
CSS14433

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity48.14
▷ Minimum class complexity1.00
▷ Maximum class complexity206.00
Average method complexity4.27
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods101
▷ Static methods54.95%
▷ Public methods7877.23%
▷ Protected methods2322.77%
▷ Private methods00.00%
Functions16
▷ Named functions16100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants125.00%
▷ Class constants375.00%
▷ Public constants3100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
53 PNG files occupy 0.67MB with 0.37MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/Untitled.png16.21KB7.57KB▼ 53.30%
assets/images/premium-head.png6.61KB5.20KB▼ 21.37%
images/screen-3.png23.33KB8.07KB▼ 65.43%
images/download (6).png20.93KB6.53KB▼ 68.79%
assets/images/screen-6.png16.55KB5.46KB▼ 67.04%