83% wpb-product-size-charts-for-woocommerce

Code Review | WPB Product Size Chart for WooCommerce - Product Size Guide - Size Chart in WooCommerce as PopUp and Tab

WordPress plugin WPB Product Size Chart for WooCommerce - Product Size Guide - Size Chart in WooCommerce as PopUp and Tab scored83%from 54 tests.

About plugin

  • Plugin page: wpb-product-size-...
  • Plugin version: 1.06
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3.1
  • WordPress version: 6.3.1
  • First release: Dec 30, 2020
  • Latest release: Sep 21, 2023
  • Number of updates: 27
  • Update frequency: every 36.9 days
  • Top authors: wpbean (100%)

Code review

54 tests

User reviews

1 review

Install metrics

80+ active /1,840 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.04MB] [CPU: ▼4.98ms] Passed 4 tests

A check of server-side resources used by WPB Product Size Chart for WooCommerce - Product Size Guide - Size Chart in WooCommerce as PopUp and Tab
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0537.75 ▼4.50
Dashboard /wp-admin3.35 ▲0.0549.01 ▼3.28
Posts /wp-admin/edit.php3.40 ▲0.0445.82 ▼7.54
Add New Post /wp-admin/post-new.php5.93 ▲0.0486.96 ▼4.58
Media Library /wp-admin/upload.php3.27 ▲0.0435.93 ▼1.25

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 29 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for WPB Product Size Chart for WooCommerce - Product Size Guide - Size Chart in WooCommerce as PopUp and Tab
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,809 ▲4814.69 ▲0.161.65 ▼0.2640.11 ▼2.34
Dashboard /wp-admin2,218 ▲385.59 ▼0.0393.27 ▲1.8340.28 ▼7.54
Posts /wp-admin/edit.php2,124 ▲212.06 ▲0.0936.63 ▼7.3436.95 ▼0.96
Add New Post /wp-admin/post-new.php1,543 ▲1723.28 ▲0.46685.31 ▲48.3958.78 ▲6.40
Media Library /wp-admin/upload.php1,417 ▲204.12 ▼0.03112.23 ▲7.6147.14 ▲3.52

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
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
Please fix the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/wpb-product-size-charts-for-woocommerce/includes/admin/size-table/size-table-new.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that need to be fixed:
  • Tags: Too many tags (20 tag instead of maximum 10); only the first 5 tags are used in your directory listing
Please take inspiration from this readme.txt

wpb-product-size-charts-for-woocommerce/main.php 85% from 13 tests

Analyzing the main PHP file in "WPB Product Size Chart for WooCommerce - Product Size Guide - Size Chart in WooCommerce as PopUp and Tab" version 1.06
You should first fix the following items:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Main file name: The principal plugin file should be the same as the plugin slug ("wpb-product-size-charts-for-woocommerce.php" instead of "main.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected2,826 lines of code in 26 files:
LanguageFilesBlank linesComment linesLines of code
PHP145434011,920
CSS5196619
JavaScript77350287

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.51
Average class complexity32.00
▷ Minimum class complexity1.00
▷ Maximum class complexity144.00
Average method complexity3.73
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods85
▷ Static methods22.35%
▷ Public methods85100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions27
▷ Named functions2281.48%
▷ Anonymous functions518.52%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.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.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
includes/admin/assets/images/icon.png11.11KB8.59KB▼ 22.66%