66% invoice-king-pro

Code Review | Invoice King Pro

WordPress plugin Invoice King Pro scored 66% from 54 tests.

About plugin

  • Plugin page: invoice-king-pro
  • Plugin version: 1.1.7
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.9.1
  • WordPress version: 5.8.1
  • First release: Jul 3, 2013
  • Latest release: Jul 17, 2014
  • Number of updates: 23
  • Update frequency: every 16.5 days
  • Top authors: ashdurham (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

90+ active / 12,091 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
Installer ran successfully

Server metrics [RAM: ▲0.45MB] [CPU: ▼134.20ms] Passed 4 tests

A check of server-side resources used by Invoice King Pro
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.24 ▲0.5237.62 ▲15.39
Dashboard /wp-admin3.50 ▲0.4453.16 ▲10.17
Posts /wp-admin/edit.php3.61 ▲0.5051.38 ▲8.14
Add New Post /wp-admin/post-new.php5.85 ▲0.4294.53 ▼561.29
Media Library /wp-admin/upload.php3.44 ▲0.4338.33 ▲6.17
Add New /wp-admin/post-new.php?post_type=invkp_invoices3.5251.17
Invoice King Pro /wp-admin/admin.php?page=invoicekingpro3.7448.91
King Pro Plugins /wp-admin/admin.php?page=kpp_menu3.4650.20
All Clients /wp-admin/edit.php?post_type=invkp_clients3.5251.59
All Invoices /wp-admin/edit.php?post_type=invkp_invoices3.5239.46

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 88 new files
Database: no new tables, 44 new options
New WordPress options
invkp_invoice_no_gen
invkp_email_subject
invkp_revenue_currency
invkp_phone
invkp_paid_invoice_type
invkp_bcc
invkp_open_content_2
invkp_email_message
invkp_invoice_no_gen_incr
invkp_comany_name
...

Browser metrics Passed 4 tests

An overview of browser requirements for Invoice King Pro
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,768 ▲17215.86 ▲0.387.33 ▼1.1245.26 ▼8.19
Dashboard /wp-admin3,054 ▲1235.92 ▼0.05134.19 ▼5.00112.37 ▼4.84
Posts /wp-admin/edit.php2,817 ▲782.71 ▲0.0275.55 ▲9.0984.37 ▼11.84
Add New Post /wp-admin/post-new.php1,726 ▲22818.78 ▼0.07363.48 ▲2.98107.79 ▲1.22
Media Library /wp-admin/upload.php1,894 ▲845.02 ▼0.03150.61 ▲4.51121.51 ▲3.22
Add New /wp-admin/post-new.php?post_type=invkp_invoices2,4824.90105.6688.51
Invoice King Pro /wp-admin/admin.php?page=invoicekingpro3,2034.1276.37165.50
King Pro Plugins /wp-admin/admin.php?page=kpp_menu1,5864.0383.66115.81
All Clients /wp-admin/edit.php?post_type=invkp_clients1,7424.2694.2775.88
All Invoices /wp-admin/edit.php?post_type=invkp_invoices1,7954.3080.7664.99

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
Please fix the following items
  • This plugin did not uninstall successfully, leaving 44 options in the database
    • invkp_postcode
    • invkp_tax_label
    • invkp_paid_email_message
    • invkp_safe_theme
    • invkp_paid_email_subject
    • invkp_attn_name_label
    • invkp_open_content_1
    • invkp_total_label
    • invkp_calculate_rows
    • invkp_calculate_subtotal
    • ...

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Almost there, just fix the following server-side errors
  • 43 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=invkp_invoices
    • > Warning in wp-content/plugins/invoice-king-pro/includes/admin_area.php+895
    Use of undefined constant option_name - assumed 'option_name' (this will throw an Error in a future version of PHP)
  • 43 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=invkp_invoices
    • > Warning in wp-content/plugins/invoice-king-pro/includes/admin_area.php+895
    Use of undefined constant option_value - assumed 'option_value' (this will throw an Error in a future version of PHP)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=invkp_invoices
    • > Notice in wp-content/plugins/invoice-king-pro/includes/admin_area.php+947
    Undefined offset: 12
    • > GET request to /wp-admin/admin.php?page=invoicekingpro
    • > User deprecated in wp-includes/functions.php+5221
    screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/admin.php?page=invoicekingpro
    • > User deprecated in wp-includes/functions.php+5221
    get_screen_icon is deprecated since version 3.8.0 with no alternative available.

SRP 0% 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
Almost there! Just fix the following items
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/invoice-king-pro/includes/invoice_html.php
    • > /wp-content/plugins/invoice-king-pro/themes/default/invoice_html.php
  • 187× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/invoice-king-pro/themes/default/invoice_html.php on line 40
    • > PHP Notice
      Undefined variable: custom_fields in wp-content/plugins/invoice-king-pro/includes/invoice_html.php on line 11
    • > PHP Notice
      Undefined variable: custom_fields in wp-content/plugins/invoice-king-pro/includes/invoice_html.php on line 12
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/invoice-king-pro/themes/default/invoice_html.php on line 23
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/invoice-king-pro/themes/default/invoice_html.php on line 11
    • > PHP Notice
      Undefined variable: custom_fields in wp-content/plugins/invoice-king-pro/includes/invoice_html.php on line 12
    • > PHP Notice
      Undefined variable: custom_fields in wp-content/plugins/invoice-king-pro/includes/invoice_html.php on line 126
    • > PHP Notice
      Undefined variable: custom_fields in wp-content/plugins/invoice-king-pro/themes/default/invoice_html.php on line 12
    • > PHP Notice
      Undefined variable: custom_fields in wp-content/plugins/invoice-king-pro/themes/default/invoice_html.php on line 126
    • > PHP Notice
      Undefined variable: custom_fields in wp-content/plugins/invoice-king-pro/includes/invoice_html.php on line 28

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There are user-side issues you should fix
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=invkp_invoices
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=5.8.1 1:31592 "jQuery.Deferred exception: $(...).live is not a function" "TypeError: $(...).live is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/invoice-king-pro/js/invoicekingpro-admin-functions.js?ver=1.0.0:10:31)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=5.8.1:2:30038)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=5.8.1:2:30340)" undefined
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=invkp_invoices
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=5.8.1 1:31702 Uncaught TypeError: $(...).live is not a function

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% 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
Please fix the following attributes:
  • Tags: Too many tags (13 tag instead of maximum 10); only the first 5 tags are used in your directory listing
Please take inspiration from this readme.txt

invoice-king-pro/invoicekingpro.php 85% from 13 tests

The principal PHP file in "Invoice King Pro" v. 1.1.7 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("invoice-king-pro.php" instead of "invoicekingpro.php")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 173 characters long)

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
Good job! No executable or dangerous file extensions detected6,289 lines of code in 33 files:
LanguageFilesBlank linesComment linesLines of code
PHP264313274,436
CSS4133491,205
SVG100399
JavaScript24742249

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity105.00
▷ Minimum class complexity3.00
▷ Maximum class complexity309.00
Average method complexity4.85
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods81
▷ Static methods00.00%
▷ Public methods81100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions51
▷ Named functions51100.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
13 PNG files occupy 0.12MB with 0.06MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/clean-invoice-theme.png54.41KB15.60KB▼ 71.34%
images/invkp-icon_16x16_sat.png1.43KB0.75KB▼ 47.92%
images/default-with-image-invoice-theme.png49.95KB14.44KB▼ 71.10%
images/cross.png0.67KB0.64KB▼ 4.93%
images/kpp-icon_32x32.png2.87KB1.59KB▼ 44.69%