89% weight-based-pricing-for-woocommerce

Code Review | Weight Based Pricing for WooCommerce

WordPress plugin Weight Based Pricing for WooCommerce scored89%from 54 tests.

About plugin

  • Plugin page: weight-based-pric...
  • Plugin version: 1.1.5
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9.0-6.3
  • WordPress version: 6.3.1
  • First release: Aug 19, 2021
  • Latest release: Sep 27, 2023
  • Number of updates: 22
  • Update frequency: every 35.0 days
  • Top authors: themeparrot (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

500+ active /4,164 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼5.34ms] Passed 4 tests

An overview of server-side resources used by Weight Based Pricing for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0040.46 ▲1.61
Dashboard /wp-admin3.31 ▲0.0048.72 ▲0.07
Posts /wp-admin/edit.php3.36 ▲0.0044.59 ▼3.85
Add New Post /wp-admin/post-new.php5.89 ▲0.0081.08 ▼19.20
Media Library /wp-admin/upload.php3.23 ▲0.0035.61 ▲1.90

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 35 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Weight Based Pricing for WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.39 ▼0.201.65 ▲0.0643.76 ▲5.79
Dashboard /wp-admin2,195 ▲145.52 ▼0.1689.10 ▼17.3137.64 ▼4.46
Posts /wp-admin/edit.php2,100 ▲32.01 ▲0.0132.93 ▼5.6634.59 ▲1.37
Add New Post /wp-admin/post-new.php1,526 ▼222.98 ▼0.13669.76 ▲53.9659.95 ▲3.78
Media Library /wp-admin/upload.php1,403 ▼04.09 ▼0.09106.65 ▲1.2945.07 ▲2.15

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP Passed 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
No output text or server-side errors detected on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
8 plugin tags: weight, weight based shipping, woocommerce, unit, pricing...

weight-based-pricing-for-woocommerce/weight-based-pricing-woocommerce.php 85% from 13 tests

The main PHP script in "Weight Based Pricing for WooCommerce" version 1.1.5 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("weight-based-pricing-for-woocommerce.php" instead of "weight-based-pricing-woocommerce.php")

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
There were no executable files found in this plugin2,223 lines of code in 32 files:
LanguageFilesBlank linesComment linesLines of code
PHP273773961,890
JavaScript28267251
CSS216081
JSON1001

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity14.91
▷ Minimum class complexity1.00
▷ Maximum class complexity53.00
Average method complexity4.64
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces8
Interfaces0
Traits0
Classes22
▷ Abstract classes00.00%
▷ Concrete classes22100.00%
▷ Final classes00.00%
Methods88
▷ Static methods3539.77%
▷ Public methods8798.86%
▷ Protected methods00.00%
▷ Private methods11.14%
Functions5
▷ Named functions120.00%
▷ Anonymous functions480.00%
Constants11
▷ Global constants11100.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
No PNG images were found in this plugin