78% shipping-zones-by-drawing-for-woocommerce

Code Review | Shipping Zones by Drawing for WooCommerce

WordPress plugin Shipping Zones by Drawing for WooCommerce scored78%from 54 tests.

About plugin

  • Plugin page: shipping-zones-by...
  • Plugin version: 2.8.12
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 7.0-6.3
  • WordPress version: 6.3.1
  • First release: Feb 18, 2019
  • Latest release: Oct 14, 2023
  • Number of updates: 106
  • Update frequency: every 16.0 days
  • Top authors: arosoft (100%)

Code review

54 tests

User reviews

18 reviews

Install metrics

1,000+ active /49,647 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.01MB] [CPU: ▼7.06ms] Passed 4 tests

An overview of server-side resources used by Shipping Zones by Drawing for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0236.68 ▼4.20
Dashboard /wp-admin3.33 ▼0.0245.97 ▼17.64
Posts /wp-admin/edit.php3.38 ▲0.0247.95 ▲5.52
Add New Post /wp-admin/post-new.php5.91 ▲0.0291.03 ▼11.92
Media Library /wp-admin/upload.php3.25 ▲0.0234.66 ▲5.51

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Shipping Zones by Drawing for WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.34 ▼0.011.59 ▼0.1338.23 ▼4.59
Dashboard /wp-admin2,195 ▲275.62 ▲0.0491.59 ▼9.9242.06 ▼5.12
Posts /wp-admin/edit.php2,100 ▲31.97 ▼0.0238.71 ▲2.6134.62 ▲1.37
Add New Post /wp-admin/post-new.php1,526 ▼023.56 ▲0.35603.53 ▼60.1047.73 ▼8.07
Media Library /wp-admin/upload.php1,394 ▼34.17 ▼0.0594.90 ▼11.5342.20 ▼0.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
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP 0% 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 items
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/shipping-zones-by-drawing-for-woocommerce/includes/shortcode-map-template.php
    • > /wp-content/plugins/shipping-zones-by-drawing-for-woocommerce/includes/admin-map-template.php
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Notice
      Undefined variable: token in wp-content/plugins/shipping-zones-by-drawing-for-woocommerce/includes/shortcode-map-template.php on line 1

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 on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
9 plugin tags: shipping, map, woocommerce, restrict, radius...

shipping-zones-by-drawing-for-woocommerce/shipping-zones-by-drawing.php 77% from 13 tests

The main PHP script in "Shipping Zones by Drawing for WooCommerce" version 2.8.12 is automatically included on every request by WordPress
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("shipping-zones-by-drawing-for-woocommerce.php" instead of "shipping-zones-by-drawing.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Requires at least: Required version does not match the one declared in readme.txt ("5.0" instead of "7.0")

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
Good job! No executable or dangerous file extensions detected9,726 lines of code in 37 files:
LanguageFilesBlank linesComment linesLines of code
PHP137761333,098
SVG2003,031
JavaScript1378302,534
JSON100982
CSS810781

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.63
Average class complexity46.50
▷ Minimum class complexity4.00
▷ Maximum class complexity206.00
Average method complexity6.07
▷ Minimum method complexity1.00
▷ Maximum method complexity41.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods89
▷ Static methods2325.84%
▷ Public methods8696.63%
▷ Protected methods22.25%
▷ Private methods11.12%
Functions13
▷ Named functions1184.62%
▷ Anonymous functions215.38%
Constants7
▷ Global constants342.86%
▷ Class constants457.14%
▷ Public constants4100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There were not PNG files found in your plugin