84% vnshipping-for-woocommerce

Code Review | VNShipping for WooCommerce

WordPress plugin VNShipping for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: vnshipping-for-wo...
  • Plugin version: 0.2.0
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4-5.8.0
  • WordPress version: 6.3.1
  • First release: Aug 4, 2021
  • Latest release: Aug 7, 2021
  • Number of updates: 5
  • Update frequency: every 0.6 days
  • Top authors: awethemes (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /950 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.08MB] [CPU: ▼3.80ms] Passed 4 tests

Server-side resources used by VNShipping for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0941.22 ▲2.15
Dashboard /wp-admin3.40 ▲0.0551.87 ▼14.20
Posts /wp-admin/edit.php3.51 ▲0.1550.90 ▼0.73
Add New Post /wp-admin/post-new.php5.98 ▲0.0995.91 ▼2.01
Media Library /wp-admin/upload.php3.32 ▲0.0938.68 ▲1.74

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 936 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for VNShipping for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.34 ▲0.061.61 ▼0.1544.55 ▲2.98
Dashboard /wp-admin2,195 ▲155.55 ▼0.1091.15 ▲4.2546.76 ▲6.54
Posts /wp-admin/edit.php2,100 ▼31.97 ▼0.0234.84 ▼7.4337.15 ▲0.14
Add New Post /wp-admin/post-new.php1,531 ▲323.06 ▼0.13647.06 ▼55.3853.09 ▲0.29
Media Library /wp-admin/upload.php1,400 ▲34.10 ▼0.11112.96 ▲1.0048.54 ▲1.79

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 75% from 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 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 24× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WP_REST_Controller' not found in wp-content/plugins/vnshipping-for-woocommerce/inc/REST/ShippingController.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'VNShipping\\Courier\\Response\\CollectionResponseData' not found in wp-content/plugins/vnshipping-for-woocommerce/inc/Courier/Response/PaginatedResponseData.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'VNShipping\\Courier\\Exception\\InvalidParameterException' not found in wp-content/plugins/vnshipping-for-woocommerce/inc/Courier/Exception/InvalidAddressDataException.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'VNShipping\\Courier\\Response\\JsonResponseData' not found in wp-content/plugins/vnshipping-for-woocommerce/inc/Courier/Response/CollectionResponseData.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'VNShipping\\Vendor\\Symfony\\Component\\OptionsResolver\\Exception\\ExceptionInterface' not found in wp-content/plugins/vnshipping-for-woocommerce/third-party/vendor/symfony/options-resolver/Exception/NoSuchOptionException.php:23
    • > PHP Fatal error
      Uncaught Error: Interface 'VNShipping\\Vendor\\Symfony\\Component\\OptionsResolver\\Exception\\ExceptionInterface' not found in wp-content/plugins/vnshipping-for-woocommerce/third-party/vendor/symfony/options-resolver/Exception/OptionDefinitionException.php:18
    • > PHP Fatal error
      Trait 'VNShipping\\Traits\\SingletonTrait' not found in wp-content/plugins/vnshipping-for-woocommerce/inc/Plugin.php on line 8
    • > PHP Fatal error
      Uncaught Error: Class 'VNShipping\\Courier\\AbstractCourier' not found in wp-content/plugins/vnshipping-for-woocommerce/inc/Courier/GHN.php:11
    • > PHP Fatal error
      Trait 'VNShipping\\Traits\\SingletonTrait' not found in wp-content/plugins/vnshipping-for-woocommerce/inc/OrderListTable.php on line 9
    • > PHP Fatal error
      Uncaught Error: Interface 'VNShipping\\Vendor\\Symfony\\Component\\OptionsResolver\\Exception\\ExceptionInterface' not found in wp-content/plugins/vnshipping-for-woocommerce/third-party/vendor/symfony/options-resolver/Exception/NoConfigurationException.php:22

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
5 plugin tags: couriers, shipping, ghn, ghtk, viettel

vnshipping-for-woocommerce/vn-shipping.php 85% from 13 tests

The primary PHP file in "VNShipping for WooCommerce" version 0.2.0 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Main file name: The principal plugin file should be the same as the plugin slug ("vnshipping-for-woocommerce.php" instead of "vn-shipping.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected123,875 lines of code in 917 files:
LanguageFilesBlank linesComment linesLines of code
JSON7740081,926
PHP799662,20438,508
JavaScript444462542,079
Vuejs Component1218625918
Sass6720441
Markdown1102
CSS1001

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity10.13
▷ Minimum class complexity1.00
▷ Maximum class complexity125.00
Average method complexity2.50
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces14
Interfaces4
Traits2
Classes54
▷ Abstract classes11.85%
▷ Concrete classes5398.15%
▷ Final classes11.89%
Methods334
▷ Static methods5416.17%
▷ Public methods31293.41%
▷ Protected methods123.59%
▷ Private methods102.99%
Functions44
▷ Named functions1227.27%
▷ Anonymous functions3272.73%
Constants67
▷ Global constants5785.07%
▷ Class constants1014.93%
▷ Public constants990.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
3 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
resources/icons/vtp.png5.31KB3.02KB▼ 43.03%
resources/icons/ghn.png17.01KB7.19KB▼ 57.71%
resources/icons/ghtk.png19.80KB7.98KB▼ 59.69%