73% wp-invoice-ultimate

Code Review | WP Invoices Ultimate

WordPress plugin WP Invoices Ultimate scored73%from 54 tests.

About plugin

  • Plugin page: wp-invoice-ultimate
  • Plugin version: 0.1.6
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-3.3
  • WordPress version: 6.3.1
  • First release: Dec 30, 2011
  • Latest release: Feb 24, 2012
  • Number of updates: 17
  • Update frequency: every 3.3 days
  • Top authors: nohalfpixels (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /8,780 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.09MB] [CPU: ▼1.80ms] Passed 4 tests

Analyzing server-side resources used by WP Invoices Ultimate
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0840.88 ▼1.41
Dashboard /wp-admin3.39 ▲0.0945.90 ▼3.79
Posts /wp-admin/edit.php3.51 ▲0.1649.66 ▲3.28
Add New Post /wp-admin/post-new.php6.00 ▲0.1282.61 ▼5.27
Media Library /wp-admin/upload.php3.32 ▲0.0938.26 ▲5.04
Invoices /wp-admin/edit.php?post_type=wpiu-invoices3.3736.12
Add New /wp-admin/post-new.php?post_type=wpiu-invoices3.4043.11
Invoice IPN Log /wp-admin/edit.php?post_type=wpiu-invoices&page=wp_iu_log3.2931.72
Invoice Options /wp-admin/edit.php?post_type=wpiu-invoices&page=wp_iu3.2629.93

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 35 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for WP Invoices Ultimate
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,837 ▲8013.24 ▼1.514.23 ▲2.1240.59 ▼6.03
Dashboard /wp-admin2,243 ▲555.79 ▲0.92102.98 ▼11.3277.98 ▲35.21
Posts /wp-admin/edit.php2,126 ▲372.01 ▼0.0538.69 ▲2.4134.21 ▲0.81
Add New Post /wp-admin/post-new.php1,554 ▲4017.74 ▲0.14687.47 ▲4.6254.51 ▼4.45
Media Library /wp-admin/upload.php1,419 ▲284.14 ▼0.02114.93 ▲14.4446.56 ▲2.14
Invoices /wp-admin/edit.php?post_type=wpiu-invoices1,2622.0235.0032.36
Add New /wp-admin/post-new.php?post_type=wpiu-invoices2,7887.96198.50132.66
Invoice IPN Log /wp-admin/edit.php?post_type=wpiu-invoices&page=wp_iu_log9531.6926.5728.24
Invoice Options /wp-admin/edit.php?post_type=wpiu-invoices&page=wp_iu2,2257.94145.47127.55

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These errors were triggered by the plugin
    • > GET request to /wp-admin/post-new.php?post_type=wpiu-invoices
    • > Warning in wp-content/plugins/wp-invoice-ultimate/wp-invoice-metaboxes.php+164
    Illegal string offset '_wpiu_invoice_meta_due_date'
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=wpiu-invoices
    • > Notice in wp-content/plugins/wp-invoice-ultimate/wp-invoice-metaboxes.php+223
    Uninitialized string offset: 0
    • > GET request to /wp-admin/post-new.php?post_type=wpiu-invoices
    • > Warning in wp-content/plugins/wp-invoice-ultimate/wp-invoice-metaboxes.php+169
    Illegal string offset '_wpiu_invoice_meta_job_number'
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=wpiu-invoices
    • > Warning in wp-content/plugins/wp-invoice-ultimate/wp-invoice-metaboxes.php+185
    Illegal string offset '_wpiu_invoice_meta_paid'
    • > GET request to /wp-admin/post-new.php?post_type=wpiu-invoices
    • > Warning in wp-content/plugins/wp-invoice-ultimate/wp-invoice-metaboxes.php+223
    Illegal string offset '_wpiu_invoice_meta_client'
    • > GET request to /wp-admin/post-new.php?post_type=wpiu-invoices
    • > Deprecated in wp-content/plugins/wp-invoice-ultimate/wp-invoice-metaboxes.php+255
    Non-static method WPIU_Options::get_currency() should not be called statically
  • 27 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=wpiu-invoices&page=wp_iu
    • > Notice in wp-content/plugins/wp-invoice-ultimate/wp-invoice-options.php+437
    Trying to access array offset on value of type bool
    • > GET request to /wp-admin/post-new.php?post_type=wpiu-invoices
    • > Notice in wp-content/plugins/wp-invoice-ultimate/wp-invoice-options.php+565
    Undefined index:

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
The following issues need your attention
  • 9× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'WPIU' not found in wp-content/plugins/wp-invoice-ultimate/gateways/paypal.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WPIU' not found in wp-content/plugins/wp-invoice-ultimate/wp-invoice-help.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WPIU' not found in wp-content/plugins/wp-invoice-ultimate/wp-invoice-client.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_die() in wp-content/plugins/wp-invoice-ultimate/wp-invoice-ultimate.php:58
    • > PHP Fatal error
      Uncaught Error: Class 'WPIU' not found in wp-content/plugins/wp-invoice-ultimate/wp-invoice-metaboxes.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WPIU' not found in wp-content/plugins/wp-invoice-ultimate/wp-invoice-options.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WPIU' not found in wp-content/plugins/wp-invoice-ultimate/wp-invoice-notifications.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function have_posts() in wp-content/plugins/wp-invoice-ultimate/template/single-wpiu-invoices.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WPIU' not found in wp-content/plugins/wp-invoice-ultimate/wp-invoice-ipn-log.php:2

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following browser errors
    • > GET request to /wp-admin/post-new.php?post_type=wpiu-invoices
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,jquery-ui-core&ver=6.3.1 1:28609 "jQuery.Deferred exception: jQuery(...).live is not a function" "TypeError: jQuery(...).live is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/wp-invoice-ultimate/includes/js/admin-js.js?ver=6.3.1:16:30)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,jquery-ui-core&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,jquery-ui-core&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/post-new.php?post_type=wpiu-invoices
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,jquery-ui-core&ver=6.3.1 1:28721 Uncaught TypeError: jQuery(...).live is not a function

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that need to be fixed:
  • Screenshots: Add images for these screenshots: #1 (The invoice page seen by the client. Simple styling, options to pay invoice and to view previous transactions.), #2 (The list of invoices, can be filtered like normal post by date created and invoice title.), #3 (The invoice edit screen, containing all invoice data and options, all the same as a normal post.), #4 (The invoicing system options panel, kept as simple as possible.)
The official readme.txt might help

wp-invoice-ultimate/wp-invoice-ultimate.php Passed 13 tests

The primary PHP file in "WP Invoices Ultimate" version 0.1.6 is used by WordPress to initiate all plugin functionality
90 characters long description:
Simple to use invoicing system that can intergrate with Paypal. Very simple, very flexble.

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 plugin2,181 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP98195861,461
CSS238152398
JavaScript24093322

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity17.25
▷ Minimum class complexity3.00
▷ Maximum class complexity40.00
Average method complexity3.00
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods65
▷ Static methods00.00%
▷ Public methods6295.38%
▷ Protected methods00.00%
▷ Private methods34.62%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants11
▷ Global constants11100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
20 compressed PNG files occupy 0.84MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/css/ui/custom-theme/images/ui-icons_454545_256x240.png4.27KB4.11KB▼ 3.78%
includes/css/ui/custom-theme/images/ui-bg_glass_55_fbf9ee_1x400.png0.12KB0.14KB0.00%
images/16/delete.png0.68KB0.53KB▼ 22.16%
includes/css/ui/custom-theme/images/ui-bg_inset-soft_95_fef1ec_1x100.png0.12KB0.16KB0.00%
includes/css/ui/custom-theme/images/ui-bg_glass_65_ffffff_1x400.png0.10KB0.10KB▼ 5.71%