84% woocommerce-invoice-payment-gateway

Code Review | WooCommerce Invoice Payment Gateway

WordPress plugin WooCommerce Invoice Payment Gateway scored 84% from 54 tests.

About plugin

  • Plugin page: woocommerce-invoi...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.5
  • WordPress version: 6.3.1
  • First release: Feb 1, 2013
  • Latest release: Mar 6, 2013
  • Number of updates: 3
  • Update frequency: every 13.7 days
  • Top authors: davidpaulsson (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active / 1,519 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼6.48ms] Passed 4 tests

An overview of server-side resources used by WooCommerce Invoice Payment Gateway
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0032.42 ▼9.72
Dashboard /wp-admin3.31 ▲0.0044.18 ▼8.20
Posts /wp-admin/edit.php3.36 ▲0.0049.14 ▲1.37
Add New Post /wp-admin/post-new.php5.89 ▲0.0081.94 ▼9.16
Media Library /wp-admin/upload.php3.23 ▲0.0035.44 ▲1.16

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 3 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
widget_recent-posts
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

WooCommerce Invoice Payment Gateway: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.16 ▼1.591.78 ▲0.0341.75 ▼6.06
Dashboard /wp-admin2,206 ▲184.84 ▼0.08110.25 ▼1.8936.78 ▼5.22
Posts /wp-admin/edit.php2,089 ▼32.05 ▼0.0139.82 ▲2.7734.19 ▼0.01
Add New Post /wp-admin/post-new.php1,537 ▼023.22 ▲0.05665.28 ▼1.4252.43 ▼5.60
Media Library /wp-admin/upload.php1,388 ▲64.20 ▼0.0395.05 ▼4.3544.16 ▲0.43

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

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

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

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
Almost there! Just fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woocommerce-invoice-payment-gateway/wc-invoice.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
4 plugin tags: gateway, payment, invoice, woocommerce

woocommerce-invoice-payment-gateway/wc-invoice.php 92% from 13 tests

Analyzing the main PHP file in "WooCommerce Invoice Payment Gateway" version 1.0
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("woocommerce-invoice-payment-gateway.php" instead of "wc-invoice.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected100 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP1385381
Markdown18019

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity6.00
▷ Minimum class complexity6.00
▷ Maximum class complexity6.00
Average method complexity1.83
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods6
▷ Static methods00.00%
▷ Public methods6100.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
PNG images were not found in this plugin