79% hdinvoice

Code Review | HDInvoice | Create Invoices

WordPress plugin HDInvoice | Create Invoices scored79%from 54 tests.

About plugin

  • Plugin page: hdinvoice
  • Plugin version: 0.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8.0-5.2
  • WordPress version: 6.3.1
  • First release: Oct 6, 2018
  • Latest release: Feb 7, 2020
  • Number of updates: 8
  • Update frequency: every 61.1 days
  • Top authors: Harmonic_Design (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /789 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
Install script ran successfully

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

A check of server-side resources used by HDInvoice | Create Invoices
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.67 ▲0.2139.72 ▼0.06
Dashboard /wp-admin3.51 ▲0.2050.04 ▲1.20
Posts /wp-admin/edit.php3.62 ▲0.2744.79 ▼3.02
Add New Post /wp-admin/post-new.php6.09 ▲0.2082.84 ▼18.02
Media Library /wp-admin/upload.php3.43 ▲0.2034.77 ▲4.07

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 152 new files
Database: no new tables, 8 new options
New WordPress options
db_upgraded
widget_recent-comments
hdv_PLUGIN_VERSION
hdv_dashboard
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by HDInvoice | Create Invoices
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,836 ▲10113.27 ▼1.161.98 ▲0.3043.42 ▲2.37
Dashboard /wp-admin2,205 ▲175.87 ▼0.03112.54 ▲12.6567.41 ▲23.49
Posts /wp-admin/edit.php2,097 ▲82.13 ▲0.1033.64 ▼7.8931.57 ▼4.17
Add New Post /wp-admin/post-new.php1,524 ▼1823.51 ▲5.30762.99 ▲155.6853.37 ▲3.03
Media Library /wp-admin/upload.php1,399 ▲114.13 ▼0.0692.85 ▼6.9966.46 ▲22.33

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
  • This plugin does not fully uninstall, leaving 8 options in the database
    • theysaidso_admin_options
    • hdv_PLUGIN_VERSION
    • widget_recent-comments
    • widget_theysaidso_widget
    • hdv_dashboard
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 50% 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 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 7× PHP files output text when accessed directly:
    • > /wp-content/plugins/hdinvoice/includes/templates/settings/global.php
    • > /wp-content/plugins/hdinvoice/hdinvoice.php
    • > /wp-content/plugins/hdinvoice/includes/templates/settings/eCommerce.php
    • > /wp-content/plugins/hdinvoice/includes/templates/tools.php
    • > /wp-content/plugins/hdinvoice/includes/templates/add-new-customer.php
    • > /wp-content/plugins/hdinvoice/includes/templates/help.php
    • > /wp-content/plugins/hdinvoice/includes/templates/view-customer.php
  • 55× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/hdinvoice/includes/templates/settings/company.php:83
    • > PHP Fatal error
      Uncaught Error: Call to undefined function sanitize_text_field() in wp-content/plugins/hdinvoice/includes/templates/save-new-customer.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function hdv_get_settings_values() in wp-content/plugins/hdinvoice/includes/templates/save-current-invoice.php:9
    • > PHP Notice
      Undefined index: hdv_customer_id in wp-content/plugins/hdinvoice/includes/templates/view-customer.php on line 7
    • > PHP Notice
      Trying to get property 'currency_position' of non-object in wp-content/plugins/hdinvoice/includes/templates/settings/global.php on line 20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/hdinvoice/includes/templates/settings/customizer.php:16
    • > PHP Notice
      Undefined variable: hdv_setting in wp-content/plugins/hdinvoice/includes/templates/settings/customizer.php on line 12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function hdv_get_tax_percent() in wp-content/plugins/hdinvoice/includes/templates/add-invoice.php:8
    • > PHP Notice
      Trying to get property 'state' of non-object in wp-content/plugins/hdinvoice/includes/templates/settings/company.php on line 66
    • > PHP Notice
      Trying to get property 'currency_symbol' of non-object in wp-content/plugins/hdinvoice/includes/templates/settings/global.php on line 13

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
6 plugin tags: invoices, ecommerce, send invoice, invoice, hdinvoice...

hdinvoice/hdinvoice.php Passed 13 tests

The main PHP script in "HDInvoice | Create Invoices" version 0.2 is automatically included on every request by WordPress
32 characters long description:
The ultimate invoicing solution.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin12,432 lines of code in 144 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript896028256,470
PHP313333873,049
CSS16274991,972
Sass71141940
SVG1001

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.33
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%
Functions52
▷ Named functions5096.15%
▷ Anonymous functions23.85%
Constants5
▷ Global constants5100.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
2 compressed PNG files occupy 0.00MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/logo.png2.96KB2.09KB▼ 29.35%
images/logo-16.png0.44KB0.44KB0.00%