77% ecpay-logistics-for-woocommerce

Code Review | ECPay Logistics for WooCommerce

WordPress plugin ECPay Logistics for WooCommerce scored77%from 54 tests.

About plugin

  • Plugin page: ecpay-logistics-f...
  • Plugin version: 2.0.2107060
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-5.7.1
  • WordPress version: 6.3.1
  • First release: Mar 28, 2018
  • Latest release: Jul 16, 2021
  • Number of updates: 35
  • Update frequency: every 34.5 days
  • Top authors: ecpaytechsupport (100%)

Code review

54 tests

User reviews

1 review

Install metrics

1,000+ active /19,293 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.25MB] [CPU: ▼13.49ms] Passed 4 tests

Analyzing server-side resources used by ECPay Logistics for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.95 ▲0.4939.22 ▼1.45
Dashboard /wp-admin3.61 ▲0.2633.53 ▼30.89
Posts /wp-admin/edit.php3.74 ▲0.3841.74 ▼1.07
Add New Post /wp-admin/post-new.php5.85 ▼0.0469.43 ▼19.86
Media Library /wp-admin/upload.php3.62 ▲0.3830.48 ▼1.75

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

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

Browser metrics Passed 4 tests

Checking browser requirements for ECPay Logistics for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.40 ▼0.971.61 ▼0.2443.93 ▼7.21
Dashboard /wp-admin2,206 ▲155.88 ▼0.05103.98 ▼10.9340.52 ▼4.59
Posts /wp-admin/edit.php2,089 ▼01.99 ▼0.0441.24 ▲5.5336.26 ▼3.66
Add New Post /wp-admin/post-new.php1,530 ▼1223.37 ▲5.09637.92 ▼21.1343.15 ▼16.09
Media Library /wp-admin/upload.php1,388 ▼04.18 ▼0.0498.05 ▲0.8843.30 ▼3.69

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 25× PHP files perform the action of outputting non-empty strings when accessed directly (only 10 are shown):
    • > /wp-content/plugins/ecpay-logistics-for-woocommerce/vendor/ecpay/sdk/example/Payment/CreateWebAtmOrder.php
    • > /wp-content/plugins/ecpay-logistics-for-woocommerce/vendor/ecpay/sdk/example/Payment/GetCheckoutResponse.php
    • > /wp-content/plugins/ecpay-logistics-for-woocommerce/vendor/ecpay/sdk/example/Payment/DownloadCreditReconcileCsv.php
    • > /wp-content/plugins/ecpay-logistics-for-woocommerce/vendor/ecpay/sdk/example/Payment/DownloadReconcileCsv.php
    • > /wp-content/plugins/ecpay-logistics-for-woocommerce/vendor/ecpay/sdk/example/Logistics/CrossBorder/CreateUnimartCvsOrder.php
    • > /wp-content/plugins/ecpay-logistics-for-woocommerce/vendor/ecpay/sdk/example/Payment/CreateInstallmentOrder.php
    • > /wp-content/plugins/ecpay-logistics-for-woocommerce/vendor/ecpay/sdk/example/Payment/Capture.php
    • > /wp-content/plugins/ecpay-logistics-for-woocommerce/vendor/ecpay/sdk/example/Logistics/CrossBorder/Print.php
    • > /wp-content/plugins/ecpay-logistics-for-woocommerce/vendor/ecpay/sdk/example/Payment/QueryCreditTrade.php
    • > /wp-content/plugins/ecpay-logistics-for-woocommerce/vendor/ecpay/sdk/example/Payment/CreateAtmOrder.php
  • 45× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Ecpay\\Sdk\\Interfaces\\Response\\ResponseInterface' not found in wp-content/plugins/ecpay-logistics-for-woocommerce/vendor/ecpay/sdk/src.copy/Abstracts/AbstractResponse.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Ecpay\\Sdk\\Abstracts\\AbstractResponse' not found in wp-content/plugins/ecpay-logistics-for-woocommerce/vendor/ecpay/sdk/src.copy/Response/EncodedStrResponse.php:6
    • > PHP Warning
      Use of undefined constant ECPAY_PLUGIN_PATH - assumed 'ECPAY_PLUGIN_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/ecpay-logistics-for-woocommerce/ECPayLogisticsHelper.php on line 5
    • > PHP Fatal error
      Uncaught Error: Interface 'Ecpay\\Sdk\\Interfaces\\Services\\HttpClientInterface' not found in wp-content/plugins/ecpay-logistics-for-woocommerce/vendor/ecpay/sdk/src/Services/CurlService.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Ecpay\\Sdk\\Abstracts\\AbstractVerifiedResponse' not found in wp-content/plugins/ecpay-logistics-for-woocommerce/vendor/ecpay/sdk/src/Response/VerifiedEncodedStrResponse.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/ecpay-logistics-for-woocommerce/vendor/ecpay/sdk/src/TestCase/SingleServiceTestCase.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'Ecpay\\Sdk\\Interfaces\\Request\\RequestInterface' not found in wp-content/plugins/ecpay-logistics-for-woocommerce/vendor/ecpay/sdk/src.copy/Request/AesRequest.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Ecpay\\Sdk\\Abstracts\\AbstractVerifiedResponse' not found in wp-content/plugins/ecpay-logistics-for-woocommerce/vendor/ecpay/sdk/src/Response/VerifiedArrayResponse.php:6
    • > PHP Fatal error
      Trait 'Ecpay\\Sdk\\Traits\\HashInfo' not found in wp-content/plugins/ecpay-logistics-for-woocommerce/vendor/ecpay/sdk/src/Services/AesService.php on line 8
    • > PHP Fatal error
      Uncaught Error: Class 'Ecpay\\Sdk\\Abstracts\\AbstractResponse' not found in wp-content/plugins/ecpay-logistics-for-woocommerce/vendor/ecpay/sdk/src.copy/Response/ArrayResponse.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that require attention: You can take inspiration from this readme.txt

ecpay-logistics-for-woocommerce/ECPay-shipping-integration.php 85% from 13 tests

The main file in "ECPay Logistics for WooCommerce" v. 2.0.2107060 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Requires at least: Required version must match the one declared in readme.txt ("4.5" instead of "3.1")
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("ecpay-logistics-for-woocommerce.php" instead of "ECPay-shipping-integration.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 plugin6,335 lines of code in 102 files:
LanguageFilesBlank linesComment linesLines of code
PHP951,2922,6335,976
JavaScript37532230
JSON20063
CSS11042
Markdown14024

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity5.74
▷ Minimum class complexity1.00
▷ Maximum class complexity145.00
Average method complexity2.36
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces15
Interfaces10
Traits4
Classes95
▷ Abstract classes2829.47%
▷ Concrete classes6770.53%
▷ Final classes34.48%
Methods412
▷ Static methods419.95%
▷ Public methods37991.99%
▷ Protected methods143.40%
▷ Private methods194.61%
Functions15
▷ Named functions1173.33%
▷ Anonymous functions426.67%
Constants130
▷ Global constants64.62%
▷ Class constants12495.38%
▷ Public constants124100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There are no PNG files in this plugin