83% calculate-price-by-weightdimension-for-woocommerce

Code Review | Calculate price by weight/dimension for WooCommerce

WordPress plugin Calculate price by weight/dimension for WooCommerce scored 83% from 54 tests.

About plugin

  • Plugin page: calculate-price-b...
  • Plugin version: 1.2.2
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3
  • WordPress version: 6.3.1
  • First release: Oct 3, 2022
  • Latest release: Aug 29, 2023
  • Number of updates: 16
  • Update frequency: every 20.8 days
  • Top authors: elpap (68.75%)gkastorinis (37.5%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 771 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼0.99ms] Passed 4 tests

An overview of server-side resources used by Calculate price by weight/dimension for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0444.62 ▲0.07
Dashboard /wp-admin3.34 ▲0.0347.09 ▼0.80
Posts /wp-admin/edit.php3.39 ▲0.0353.53 ▲2.88
Add New Post /wp-admin/post-new.php5.92 ▲0.0396.95 ▼1.84
Media Library /wp-admin/upload.php3.26 ▲0.0334.92 ▼1.40

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

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

Browser metrics Passed 4 tests

Calculate price by weight/dimension for WooCommerce: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.55 ▼0.771.79 ▼0.5846.91 ▲1.06
Dashboard /wp-admin2,203 ▲125.80 ▲0.9197.91 ▼7.0738.64 ▼4.92
Posts /wp-admin/edit.php2,089 ▼02.03 ▲0.0440.20 ▼0.8036.06 ▼1.05
Add New Post /wp-admin/post-new.php1,533 ▼523.22 ▼0.02603.94 ▼12.4463.70 ▲13.23
Media Library /wp-admin/upload.php1,382 ▼34.20 ▲0.03100.05 ▼36.4241.65 ▼15.40

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
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts

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

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 4× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Wecom_Product_Dimensions\\add_action() in wp-content/plugins/calculate-price-by-weightdimension-for-woocommerce/classes/class-backoffice.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Wecom_Product_Dimensions\\add_filter() in wp-content/plugins/calculate-price-by-weightdimension-for-woocommerce/classes/class-frontend.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Wecom_Product_Dimensions\\add_action() in wp-content/plugins/calculate-price-by-weightdimension-for-woocommerce/classes/class-ajax.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Wecom_Product_Dimensions\\add_action() in wp-content/plugins/calculate-price-by-weightdimension-for-woocommerce/classes/class-prices.php:10

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
8 plugin tags: price, size, calculator, dimensions, woocommerce...

calculate-price-by-weightdimension-for-woocommerce/wecom-product-dimensions.php 77% from 13 tests

The main file in "Calculate price by weight/dimension for WooCommerce" v. 1.2.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Requires at least: Required version does not match the one declared in readme.txt ("4.7" instead of "5.0")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: The principal plugin file should be the same as the plugin slug ("calculate-price-by-weightdimension-for-woocommerce.php" instead of "wecom-product-dimensions.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin865 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP615458591
JavaScript2610124
PO File1354480
CSS112070

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity16.40
▷ Minimum class complexity3.00
▷ Maximum class complexity29.00
Average method complexity3.24
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods35
▷ Static methods720.00%
▷ Public methods3497.14%
▷ Protected methods00.00%
▷ Private methods12.86%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There are no PNG files in this plugin