94% woocommerce-invoice-sharing

Code Review | WooCommerce Invoice Sharing

WordPress plugin WooCommerce Invoice Sharing scored 94% from 54 tests.

About plugin

  • Plugin page: woocommerce-invoi...
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 2.3-3.8
  • WordPress version: 5.8.1
  • First release: Jan 21, 2014
  • Latest release: Feb 17, 2014
  • Number of updates: 4
  • Update frequency: every 7.5 days
  • Top authors: jtwiest (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,260 total downloads

Benchmarks

Plugin footprint Passed 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 gracefully, with no errors

Server metrics [RAM: ▲0.05MB] [CPU: ▼144.31ms] Passed 4 tests

Analyzing server-side resources used by WooCommerce Invoice Sharing
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.88 ▲0.1643.42 ▲18.51
Dashboard /wp-admin3.11 ▲0.0644.54 ▼3.83
Posts /wp-admin/edit.php3.16 ▲0.0648.20 ▲0.59
Add New Post /wp-admin/post-new.php5.48 ▲0.0595.96 ▼566.37
Media Library /wp-admin/upload.php3.06 ▲0.0534.82 ▼7.63

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 10 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for WooCommerce Invoice Sharing
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,702 ▲10615.79 ▲0.549.39 ▼0.1453.45 ▲1.50
Dashboard /wp-admin2,973 ▲425.88 ▼0.17165.22 ▲20.75112.89 ▼7.22
Posts /wp-admin/edit.php2,739 ▼02.68 ▼0.0170.44 ▼4.0699.69 ▲5.34
Add New Post /wp-admin/post-new.php1,683 ▼018.74 ▲0.05381.17 ▲2.12109.73 ▲1.33
Media Library /wp-admin/upload.php1,807 ▼05.00 ▼0.01157.13 ▼6.26127.04 ▼3.41
Invoice Sharing /wp-admin/share-order-admin.php260.900.0512.43

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Uninstaller ran successfully

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 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
Everything seems fine, however this is by no means an exhaustive test

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please fix the following browser errors
    • > GET request to /wp-admin/share-order-admin.php
    • > Network (severe)
    wp-admin/share-order-admin.php - Failed to load resource: the server responded with a status of 404 (Not Found)

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
Attributes that require attention:
  • Screenshots: Screenshot #1 (screenshot-3.png) image required
The official readme.txt is a good inspiration

woocommerce-invoice-sharing/share-order-invoices.php 92% from 13 tests

"WooCommerce Invoice Sharing" version 1.0.2's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("woocommerce-invoice-sharing.php" instead of "share-order-invoices.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin482 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP3121179416
JavaScript1191338
CSS25028

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity8.00
▷ Minimum class complexity8.00
▷ Maximum class complexity8.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods7
▷ Static methods00.00%
▷ Public methods7100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions17
▷ Named functions17100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
3 PNG files occupy 0.24MB with 0.16MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png106.93KB37.43KB▼ 64.99%
screenshot-1.png28.61KB10.39KB▼ 63.68%
screenshot-2.png109.96KB36.13KB▼ 67.14%