84% woo-invoicing-payments-w-sprout-invoices

Code Review | WooCommerce Invoicing Payments w/ Sprout Invoices

WordPress plugin WooCommerce Invoicing Payments w/ Sprout Invoices scored84%from 54 tests.

About plugin

  • Plugin page: woo-invoicing-pay...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-6.0
  • WordPress version: 6.3.1
  • First release: Mar 21, 2018
  • Latest release: May 24, 2022
  • Number of updates: 9
  • Update frequency: every 169.6 days
  • Top authors: boldgrid (55.56%)dancameron (44.44%)wvcody (22.22%)

Code review

54 tests

User reviews

1 review

Install metrics

80+ active /4,205 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

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

Server-side resources used by WooCommerce Invoicing Payments w/ Sprout Invoices
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0138.90 ▲0.20
Dashboard /wp-admin3.31 ▼0.0349.92 ▼9.09
Posts /wp-admin/edit.php3.36 ▲0.0144.02 ▼6.26
Add New Post /wp-admin/post-new.php5.89 ▲0.0190.13 ▼10.76
Media Library /wp-admin/upload.php3.23 ▲0.0133.62 ▲0.86

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for WooCommerce Invoicing Payments w/ Sprout Invoices
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.60 ▼0.781.69 ▼0.0543.14 ▲3.40
Dashboard /wp-admin2,206 ▲185.82 ▲0.8996.24 ▼8.9441.03 ▼0.46
Posts /wp-admin/edit.php2,089 ▼02.04 ▲0.0140.55 ▼0.3536.63 ▼2.58
Add New Post /wp-admin/post-new.php1,547 ▲3318.48 ▲0.99583.90 ▼22.8666.16 ▲11.53
Media Library /wp-admin/upload.php1,388 ▼04.19 ▼0.0195.83 ▼5.0042.07 ▼3.79

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

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
Please fix the following items
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/woo-invoicing-payments-w-sprout-invoices/inc/Woo_Invoice_Payments.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/woo-invoicing-payments-w-sprout-invoices/si-woocommerce.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'SI_Controller' not found in wp-content/plugins/woo-invoicing-payments-w-sprout-invoices/inc/Woo_Tools.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need to be fixed:
  • Screenshots: Screenshot #1 (WooCommerce Geneated Invoice) image not found
You can look at the official readme.txt

woo-invoicing-payments-w-sprout-invoices/si-woocommerce.php 92% from 13 tests

"WooCommerce Invoicing Payments w/ Sprout Invoices" version 1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("woo-invoicing-payments-w-sprout-invoices.php" instead of "si-woocommerce.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
Everything looks great! No dangerous files found in this plugin402 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP56189292
JavaScript13234110

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity9.33
▷ Minimum class complexity4.00
▷ Maximum class complexity20.00
Average method complexity2.67
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods15
▷ Static methods853.33%
▷ Public methods15100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants685.71%
▷ Class constants114.29%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
4 compressed PNG files occupy 0.28MB
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png77.49KB77.57KB0.00%
screenshot-1.png47.44KB47.49KB0.00%
screenshot-4.png48.59KB48.60KB0.00%
screenshot-3.png118.17KB118.39KB0.00%