72% shipping-viet-nam-woocommerce

Code Review | Shipping Viet Nam WooCommerce

WordPress plugin Shipping Viet Nam WooCommerce scored 72% from 54 tests.

About plugin

  • Plugin page: shipping-viet-nam...
  • Plugin version: 3.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.5
  • WordPress version: 6.3.1
  • First release: May 18, 2018
  • Latest release: Nov 10, 2020
  • Number of updates: 23
  • Update frequency: every 39.4 days
  • Top authors: longbsvnu (100%)

Code review

54 tests

User reviews

20 reviews

Install metrics

500+ active / 11,993 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▼0.11MB] [CPU: ▼12.20ms] Passed 4 tests

An overview of server-side resources used by Shipping Viet Nam WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0533.53 ▼8.36
Dashboard /wp-admin3.37 ▲0.0646.26 ▼2.54
Posts /wp-admin/edit.php3.48 ▲0.1244.95 ▼4.99
Add New Post /wp-admin/post-new.php5.26 ▼0.6364.60 ▼32.92
Media Library /wp-admin/upload.php3.29 ▲0.0637.27 ▲3.14

Server storage [IO: ▲1.16MB] [DB: ▲0.03MB] Passed 3 tests

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 21 new files
Database: 1 new table, 7 new options
New tables
wp_svw_province_district_ward
New WordPress options
can_compress_scripts
theysaidso_admin_options
recovery_mode_email_last_sent
db_upgraded
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

Shipping Viet Nam WooCommerce: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,467 ▼29013.25 ▼1.130.47 ▼1.6315.81 ▼27.98
Dashboard /wp-admin2,208 ▲174.89 ▼0.03105.28 ▲4.7341.49 ▼0.03
Posts /wp-admin/edit.php2,096 ▲72.01 ▼0.0537.22 ▼2.5228.26 ▼8.72
Add New Post /wp-admin/post-new.php45 ▼1,4690.44 ▼17.030.07 ▼640.099.08 ▼47.58
Media Library /wp-admin/upload.php1,390 ▼14.21 ▲0.0299.66 ▲1.6762.82 ▲21.31

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Zombie tables were found after uninstall: 1 table
    • wp_svw_province_district_ward
  • Zombie WordPress options detected upon uninstall: 7 options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • recovery_mode_email_last_sent

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

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

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 4× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/shipping-viet-nam-woocommerce/class/shipping-custom-fields-order.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/shipping-viet-nam-woocommerce/shipping-vietnam-woocommerce.php:23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/shipping-viet-nam-woocommerce/class/shipping-custom-fields.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/shipping-viet-nam-woocommerce/class/ajax.php:23

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Please fix the following attributes:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Kích hoạt và cài đặt thông tin người gửi.), #2 (Tra cứu trạng thái vận đơn khi xem order.), #3 (Các field và tính toán chi phí GHN.), #4 (Đăng đơn lên GHN)
The official readme.txt might help

shipping-viet-nam-woocommerce/shipping-vietnam-woocommerce.php 69% from 13 tests

"Shipping Viet Nam WooCommerce" version 3.0.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Domain Path: The domain path points to an invalid folder, "/languages/" does not exist
  • Description: Please keep the plugin description shorter than 140 characters (currently 612 characters long)
  • Main file name: The principal plugin file should be the same as the plugin slug ("shipping-viet-nam-woocommerce.php" instead of "shipping-vietnam-woocommerce.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

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
Success! There were no dangerous files found in this plugin2,586 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP72141101,724
Sass1270343
CSS1315306
JavaScript2159210
JSON3003

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity22.12
▷ Minimum class complexity1.00
▷ Maximum class complexity51.00
Average method complexity3.68
▷ Minimum method complexity1.00
▷ Maximum method complexity35.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods63
▷ Static methods1726.98%
▷ Public methods63100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
4 PNG files occupy 0.69MB with 0.50MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png139.46KB38.42KB▼ 72.45%
screenshot-4.png237.63KB65.69KB▼ 72.36%
screenshot-2.png211.00KB56.64KB▼ 73.15%
screenshot-3.png114.55KB30.86KB▼ 73.06%