84% distance-rate-shipping-for-woocommerce

Code Review | Distance Rate Shipping For WooCommerce

WordPress plugin Distance Rate Shipping For WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: distance-rate-shi...
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4-6.1.0
  • WordPress version: 6.3.1
  • First release: Jul 7, 2022
  • Latest release: Nov 2, 2022
  • Number of updates: 15
  • Update frequency: every 8.7 days
  • Top authors: tusharknovator (86.67%)mitalideva (20%)

Code review

54 tests

User reviews

6 reviews

Install metrics

200+ active /1,956 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

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

Analyzing server-side resources used by Distance Rate Shipping For WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0040.33 ▼0.70
Dashboard /wp-admin3.31 ▲0.0044.25 ▼7.38
Posts /wp-admin/edit.php3.36 ▲0.0042.90 ▼12.81
Add New Post /wp-admin/post-new.php5.89 ▲0.0080.86 ▼19.80
Media Library /wp-admin/upload.php3.23 ▲0.0033.91 ▼1.38

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 29 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Distance Rate Shipping For WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.72 ▲0.352.15 ▲0.3642.45 ▼3.55
Dashboard /wp-admin2,195 ▲275.61 ▼0.0686.12 ▼13.7436.34 ▼16.54
Posts /wp-admin/edit.php2,100 ▼02.00 ▼0.0234.98 ▼2.4831.81 ▼5.41
Add New Post /wp-admin/post-new.php1,535 ▲718.26 ▼4.75617.19 ▲7.0182.50 ▲20.23
Media Library /wp-admin/upload.php1,397 ▼04.21 ▼0.02101.61 ▼6.7143.67 ▼0.78

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

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Shipping_Method' not found in wp-content/plugins/distance-rate-shipping-for-woocommerce/woocommerce/class-distance-rate-shipping-method.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/distance-rate-shipping-for-woocommerce/backend/src/main-page.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/distance-rate-shipping-for-woocommerce/backend/src/settings-page.php:3

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

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
3 plugin tags: distance based shipping woocommerce, woocommerce table rate shipping, woocommerce distance rate shipping

distance-rate-shipping-for-woocommerce/distance-rate-shipping-for-woocommerce.php 92% from 13 tests

Analyzing the main PHP file in "Distance Rate Shipping For WooCommerce" version 1.0.0
You should first fix the following items:
  • Requires at least: Required version must be the same as the one declared in readme.txt ("4.1" instead of "5.4")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin1,045 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PHP15178802934
YAML17064
XML241247

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity7.80
▷ Minimum class complexity1.00
▷ Maximum class complexity42.00
Average method complexity1.97
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods70
▷ Static methods00.00%
▷ Public methods6998.57%
▷ Protected methods11.43%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
PNG images were not found in this plugin