89% ecpay-invoice-for-woocommerce

Code Review | ECPay Invoice for WooCommerce

WordPress plugin ECPay Invoice for WooCommerce scored 89% from 54 tests.

About plugin

  • Plugin page: ecpay-invoice-for...
  • Plugin version: 1.1.2107130
  • PHP version: 7.4.16
  • WordPress compatibility: 3-5.7
  • WordPress version: 6.3.1
  • First release: Mar 26, 2018
  • Latest release: Jul 16, 2021
  • Number of updates: 20
  • Update frequency: every 60.6 days
  • Top authors: ecpaytechsupport (100%)

Code review

54 tests

User reviews

1 review

Install metrics

500+ active / 6,469 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.42MB] [CPU: ▼1.10ms] Passed 4 tests

A check of server-side resources used by ECPay Invoice for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.92 ▲0.4644.15 ▲1.24
Dashboard /wp-admin3.76 ▲0.4548.33 ▼1.35
Posts /wp-admin/edit.php3.81 ▲0.4549.89 ▲5.79
Add New Post /wp-admin/post-new.php6.28 ▲0.3984.57 ▼3.10
Media Library /wp-admin/upload.php3.62 ▲0.3938.29 ▼1.19

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

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

Browser metrics Passed 4 tests

A check of browser resources used by ECPay Invoice for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.20 ▼1.151.79 ▼0.2942.47 ▼3.78
Dashboard /wp-admin2,206 ▲154.85 ▼0.01110.46 ▼3.2441.08 ▼6.66
Posts /wp-admin/edit.php2,092 ▲32.04 ▼0.0940.28 ▲3.8634.88 ▼1.01
Add New Post /wp-admin/post-new.php1,535 ▲223.43 ▲2.46644.98 ▼36.0352.46 ▲7.20
Media Library /wp-admin/upload.php1,385 ▼34.22 ▼0.04102.64 ▼3.8552.60 ▲4.23

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
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

SRP Passed 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
No output text or server-side errors detected on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need to be fixed: Please take inspiration from this readme.txt

ecpay-invoice-for-woocommerce/woocommerce-ecpayinvoice.php 85% from 13 tests

The entry point to "ECPay Invoice for WooCommerce" version 1.1.2107130 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("ecpay-invoice-for-woocommerce.php" instead of "woocommerce-ecpayinvoice.php")
  • Requires at least: Please use periods and digits for the required version (ex. "7.0" instead of "3")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected2,937 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP48438612,682
JavaScript38921213
CSS11042

PHP code 50% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
It is recommended to fix the following
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 104)
Cyclomatic complexity
Average complexity per logical line of code0.60
Average class complexity16.46
▷ Minimum class complexity1.00
▷ Maximum class complexity132.00
Average method complexity8.73
▷ Minimum method complexity1.00
▷ Maximum method complexity104.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes39
▷ Abstract classes1641.03%
▷ Concrete classes2358.97%
▷ Final classes14.35%
Methods78
▷ Static methods1620.51%
▷ Public methods7191.03%
▷ Protected methods67.69%
▷ Private methods11.28%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants54
▷ Global constants11.85%
▷ Class constants5398.15%
▷ Public constants53100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There are no PNG files in this plugin