94% generate-user-invoices

Code Review | Generate User Invoices

WordPress plugin Generate User Invoices scored 94% from 54 tests.

About plugin

  • Plugin page: generate-user-inv...
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.0.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-4.9.7
  • WordPress version: 5.8.1
  • First release: Aug 1, 2018
  • Latest release: Aug 1, 2018
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: wpza (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 349 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▼0.20MB] [CPU: ▼151.29ms] Passed 4 tests

Analyzing server-side resources used by Generate User Invoices
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.95 ▲0.2334.92 ▲13.67
Dashboard /wp-admin3.20 ▲0.1543.79 ▼3.40
Posts /wp-admin/edit.php3.29 ▲0.1842.45 ▼4.42
Add New Post /wp-admin/post-new.php4.18 ▼1.2546.89 ▼601.45
Media Library /wp-admin/upload.php3.14 ▲0.1434.99 ▲4.12
Invoice Settings /wp-admin/edit.php?post_type=wpza_gui__invoice&page=wpza_gui__plugin_settings3.1837.45
All Invoices /wp-admin/edit.php?post_type=wpza_gui__invoice3.1936.47
Generate Invoices /wp-admin/edit.php?post_type=wpza_gui__invoice&page=wpza_gui__generate_invoice3.1131.47

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 15 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for Generate User Invoices
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,740 ▲14415.82 ▲0.328.99 ▼0.0744.18 ▼0.67
Dashboard /wp-admin3,028 ▲945.94 ▲0.01165.78 ▲21.59108.28 ▼3.54
Posts /wp-admin/edit.php2,800 ▲612.70 ▲0.0163.27 ▼1.8188.08 ▼0.65
Add New Post /wp-admin/post-new.php1,695 ▲1218.99 ▲0.22373.19 ▼18.98112.36 ▲6.86
Media Library /wp-admin/upload.php1,872 ▲595.04 ▲0.05148.65 ▼5.12105.86 ▼6.55
Invoice Settings /wp-admin/edit.php?post_type=wpza_gui__invoice&page=wpza_gui__plugin_settings2,0487.09155.29121.44
All Invoices /wp-admin/edit.php?post_type=wpza_gui__invoice1,4862.6461.1073.90
Generate Invoices /wp-admin/edit.php?post_type=wpza_gui__invoice&page=wpza_gui__generate_invoice1,0602.1054.5761.07

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
This plugin's uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/generate-user-invoices/templates/single-invoice.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/generate-user-invoices/templates/archive-invoice.php:1

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 96% from 29 tests

readme.txt Passed 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
5 plugin tags: multiple invoices, user invoices, generate invoices, bulk invoices, invoice

generate-user-invoices/wpza_gui.php 92% from 13 tests

Analyzing the main PHP file in "Generate User Invoices" version 1.0.0
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("generate-user-invoices.php" instead of "wpza_gui.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin815 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP145112815

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity6.00
▷ Minimum class complexity6.00
▷ Maximum class complexity6.00
Average method complexity2.67
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes1100.00%
Methods3
▷ Static methods00.00%
▷ Public methods133.33%
▷ Protected methods00.00%
▷ Private methods266.67%
Functions22
▷ Named functions22100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
There were not PNG files found in your plugin