89% new-zealand-shipping-zones-for-woocommerce

Code Review | New Zealand Shipping Zones for WooCommerce

WordPress plugin New Zealand Shipping Zones for WooCommerce scored 89% from 54 tests.

About plugin

  • Plugin page: new-zealand-shipp...
  • Plugin version: 1.0.2
  • PHP compatiblity: 5.6.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 2.6.0-6.2
  • WordPress version: 6.3.1
  • First release: Oct 2, 2020
  • Latest release: Jul 11, 2023
  • Number of updates: 18
  • Update frequency: every 56.2 days
  • Top authors: chthnc (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

300+ active / 3,582 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.01MB] [CPU: ▼5.13ms] Passed 4 tests

This is a short check of server-side resources used by New Zealand Shipping Zones for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0138.85 ▼2.91
Dashboard /wp-admin3.31 ▲0.0146.04 ▼3.36
Posts /wp-admin/edit.php3.36 ▲0.0147.26 ▲7.41
Add New Post /wp-admin/post-new.php5.89 ▲0.0194.96 ▼11.38
Media Library /wp-admin/upload.php3.23 ▲0.0134.92 ▼2.87

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

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

Browser metrics Passed 4 tests

New Zealand Shipping Zones for WooCommerce: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲2913.28 ▼1.401.66 ▼0.2341.94 ▼1.47
Dashboard /wp-admin2,206 ▲175.90 ▲0.94106.33 ▼17.9237.32 ▼10.41
Posts /wp-admin/edit.php2,089 ▼01.99 ▼0.0538.94 ▼2.0133.24 ▼1.60
Add New Post /wp-admin/post-new.php1,533 ▼923.16 ▲4.91644.88 ▲36.8352.18 ▼2.50
Media Library /wp-admin/upload.php1,379 ▼94.21 ▲0.0298.85 ▼1.3844.22 ▲0.51

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

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

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

SRP Passed 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
The SRP test was a success

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

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
7 plugin tags: new zealand, woocommerce, shipping, nz, rural delivery...

new-zealand-shipping-zones-for-woocommerce/woocommerce-nz-shipping-zones.php 77% from 13 tests

The entry point to "New Zealand Shipping Zones for WooCommerce" version 1.0.2 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("new-zealand-shipping-zones-for-woocommerce.php" instead of "woocommerce-nz-shipping-zones.php")
  • Requires at least: Required version must be the same as the one declared in readme.txt ("5.0" instead of "2.6.0")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin926 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
JSON300748
PHP767342178

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity4.50
▷ Minimum class complexity1.00
▷ Maximum class complexity12.00
Average method complexity1.70
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods20
▷ Static methods00.00%
▷ Public methods1260.00%
▷ Protected methods00.00%
▷ Private methods840.00%
Functions2
▷ Named functions150.00%
▷ Anonymous functions150.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG files were detected