83% invoice-creator

Code Review | Invoice Generator

WordPress plugin Invoice Generator scored83%from 54 tests.

About plugin

  • Plugin page: invoice-creator
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-5.3.2
  • WordPress version: 6.3.1
  • First release: Feb 18, 2020
  • Latest release: Feb 18, 2020
  • Number of updates: 4
  • Update frequency: every 5.3 days
  • Top authors: pravel (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /621 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.24MB] [CPU: ▼4.90ms] Passed 4 tests

Analyzing server-side resources used by Invoice Generator
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.72 ▲0.2542.19 ▼11.84
Dashboard /wp-admin3.55 ▲0.2450.12 ▼3.78
Posts /wp-admin/edit.php3.66 ▲0.3052.49 ▲1.93
Add New Post /wp-admin/post-new.php6.13 ▲0.2498.64 ▼4.06
Media Library /wp-admin/upload.php3.47 ▲0.2439.40 ▲0.07
Add New /wp-admin/post-new.php?post_type=pravel_shop_product3.5148.07
All Product /wp-admin/edit.php?post_type=pravel_shop_product3.5138.34
All Invoice /wp-admin/edit.php?post_type=pravel_invoice3.5140.53
Add New /wp-admin/post-new.php?post_type=pravel_invoice3.5950.54

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 25 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
widget_recent-comments
plugin_error
widget_recent-posts
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

Invoice Generator: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,029 ▲26814.47 ▲0.0722.01 ▲20.1038.26 ▼5.69
Dashboard /wp-admin2,248 ▲715.53 ▼0.0584.51 ▼20.4941.51 ▼2.25
Posts /wp-admin/edit.php2,162 ▲621.99 ▼0.0040.20 ▲4.3235.85 ▼0.34
Add New Post /wp-admin/post-new.php1,577 ▲4923.61 ▲0.41669.25 ▼24.2956.72 ▼1.40
Media Library /wp-admin/upload.php1,459 ▲594.12 ▲0.02105.33 ▼11.2344.39 ▼4.88
Add New /wp-admin/post-new.php?post_type=pravel_shop_product1,6292.5453.5053.58
All Product /wp-admin/edit.php?post_type=pravel_shop_product1,1371.9531.3630.37
All Invoice /wp-admin/edit.php?post_type=pravel_invoice1,1131.9631.2228.44
Add New /wp-admin/post-new.php?post_type=pravel_invoice2,3187.66174.2363.63

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 7 options
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • plugin_error
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 10× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/invoice-creator/template/invoice-form.php:333
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/invoice-creator/template/registration.php:96
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/invoice-creator/template/forgot-password.php:90
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/invoice-creator/lib/user-manage-function.php:25
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/invoice-creator/template/shop-product.php:161
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/invoice-creator/lib/core-function.php:25
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/invoice-creator/index.php:62
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/invoice-creator/lib/new-post-type.php:42
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/invoice-creator/template/login.php:40
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/invoice-creator/template/edit-account.php:121

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: Please add descriptions for these screenshots #1, #2, #3, #4, #5 in invoice-creator/assets to your readme.txt
  • Tags: There are too many tags (17 tag instead of maximum 10)
You can look at the official readme.txt

invoice-creator/index.php 92% from 13 tests

"Invoice Generator" version 1.0.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("invoice-creator.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin8,444 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript51,9936,9996,452
PHP10205261,576
CSS2330416

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.15
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions29
▷ Named functions29100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.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
5 PNG files occupy 0.04MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/css/images/ui-icons_454545_256x240.png3.69KB4.18KB0.00%
assets/css/images/ui-icons_ffffff_256x240.png6.15KB4.17KB▼ 32.13%
assets/css/images/print-icon.png16.17KB5.80KB▼ 64.15%
assets/image/logo.png9.05KB3.36KB▼ 62.86%
assets/css/images/ui-icons_222222_256x240.png3.69KB4.18KB0.00%