84% woocommerce-weight-country-based-shipping

Code Review | Woocommerce Weight & Country Based Shipping

WordPress plugin Woocommerce Weight & Country Based Shipping scored84%from 54 tests.

About plugin

  • Plugin page: woocommerce-weigh...
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Apr 12, 2014
  • Latest release: May 25, 2014
  • Number of updates: 17
  • Update frequency: every 72.0 days
  • Top authors: Jeriff Cheng (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

400+ active /11,939 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
Install script ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼8.13ms] Passed 4 tests

A check of server-side resources used by Woocommerce Weight & Country Based Shipping
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0443.53 ▲0.57
Dashboard /wp-admin3.34 ▲0.0446.99 ▼3.99
Posts /wp-admin/edit.php3.40 ▲0.0444.43 ▼2.68
Add New Post /wp-admin/post-new.php5.93 ▲0.0484.49 ▼24.90
Media Library /wp-admin/upload.php3.27 ▲0.0437.27 ▼0.93

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Woocommerce Weight & Country Based Shipping
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲4313.94 ▼0.341.69 ▼0.0340.82 ▼1.90
Dashboard /wp-admin2,195 ▲185.59 ▼0.0585.19 ▼7.1341.35 ▲3.48
Posts /wp-admin/edit.php2,103 ▲61.97 ▲0.0137.68 ▲0.2035.19 ▲0.64
Add New Post /wp-admin/post-new.php1,535 ▲718.37 ▼4.95629.94 ▲17.7861.33 ▲4.02
Media Library /wp-admin/upload.php1,394 ▼64.24 ▲0.0695.46 ▼6.8241.37 ▼2.29

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

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

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
The following issues need your attention
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woocommerce-weight-country-based-shipping/woocommerce-wc-shipping.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need your attention: The official readme.txt might help

woocommerce-weight-country-based-shipping/woocommerce-wc-shipping.php 92% from 13 tests

The primary PHP file in "Woocommerce Weight & Country Based Shipping" version 1.1 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("woocommerce-weight-country-based-shipping.php" instead of "woocommerce-wc-shipping.php")

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 plugin224 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP17444224

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity33.00
▷ Minimum class complexity33.00
▷ Maximum class complexity33.00
Average method complexity3.46
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods13
▷ Static methods00.00%
▷ Public methods13100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG images were found in this plugin