10% smart-invoice-and-billing-management

Code Review | Smart Invoice and Billing Management Plugin

WordPress plugin Smart Invoice and Billing Management Plugin scored10%from 54 tests.

About plugin

  • Plugin page: smart-invoice-and...
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.2.2
  • WordPress version: 6.3.1
  • First release: Mar 25, 2015
  • Latest release: May 15, 2015
  • Number of updates: 5
  • Update frequency: every 10.2 days
  • Top authors: sherkspear (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /1,874 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
You still need to fix the following installer errors
  • The plugin cannot be installed
    • > User deprecated in wp-includes/functions.php+5643
    File upgrade-functions.php is deprecated since version 2.5.0! Use wp-admin/includes/upgrade.php instead.

Server metrics [RAM: ▼1.97MB] [CPU: ▼58.94ms] Passed 4 tests

This is a short check of server-side resources used by Smart Invoice and Billing Management Plugin
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.434.75 ▼38.60
Dashboard /wp-admin2.05 ▼1.305.34 ▼59.04
Posts /wp-admin/edit.php2.05 ▼1.315.66 ▼46.66
Add New Post /wp-admin/post-new.php2.05 ▼3.845.21 ▼91.47
Media Library /wp-admin/upload.php2.05 ▼1.186.10 ▼29.40
How To Use /wp-admin/admin.php?page=smartinvoice_menu_page2.0510.17
Create Invoice /wp-admin/admin.php?page=invoice_menu2.056.23
Invoice Status /wp-admin/admin.php?page=invoice_status2.055.03
Add New Client /wp-admin/admin.php?page=invoice_add_client2.056.02

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 20 new files
Database: 2 new tables, 6 new options
New tables
wp_sherkinvoice
wp_sherkclient
New WordPress options
widget_theysaidso_widget
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Smart Invoice and Billing Management Plugin
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,851 ▲11614.07 ▼0.472.17 ▲0.3344.29 ▼6.44
Dashboard /wp-admin2,228 ▲515.61 ▲0.0393.45 ▼6.4441.22 ▼1.00
Posts /wp-admin/edit.php2,130 ▲332.00 ▼0.0338.63 ▲1.0334.73 ▼1.22
Add New Post /wp-admin/post-new.php1,551 ▲2522.91 ▼0.22619.26 ▼88.3257.18 ▲5.11
Media Library /wp-admin/upload.php1,430 ▲334.30 ▲0.11104.24 ▲2.0845.29 ▼0.91
How To Use /wp-admin/admin.php?page=smartinvoice_menu_page1,1222.0326.2245.30
Create Invoice /wp-admin/admin.php?page=invoice_menu7992.1524.2726.22
Invoice Status /wp-admin/admin.php?page=invoice_status8152.0224.6232.31
Add New Client /wp-admin/admin.php?page=invoice_add_client8652.0325.8029.44

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Uninstall procedure validation failed for this plugin
    • > User deprecated in wp-includes/functions.php+5643
    File upgrade-functions.php is deprecated since version 2.5.0! Use wp-admin/includes/upgrade.php instead.
  • This plugin does not fully uninstall, leaving 2 tables in the database
    • wp_sherkinvoice
    • wp_sherkclient
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 50% 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)
Please fix the following server-side errors
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=invoice_add_client
    • > User deprecated in wp-includes/functions.php+5643
    File upgrade-functions.php is deprecated since version 2.5.0! Use wp-admin/includes/upgrade.php instead.
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=invoice_add_client
    • > Deprecated in wp-includes/class-wp-hook.php+308
    Non-static method SherkInvoice::enable() should not be called statically
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=invoice_add_client
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method SherkInvoiceMenu::setupMenu() should not be called statically
  • 16 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=invoice_add_client
    • > Warning in wp-content/plugins/smart-invoice-and-billing-management/classes/Menu.php+13
    Use of undefined constant SherkInvoiceMenu - assumed 'SherkInvoiceMenu' (this will throw an Error in a future version of PHP)
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=invoice_add_client
    • > Deprecated in wp-includes/class-wp-hook.php+308
    Non-static method SherkInvoice::addJsScripts() should not be called statically
    • > GET request to /wp-admin/admin.php?page=smartinvoice_menu_page
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method SherkInvoiceMenu::smartinvoice_menu_page() should not be called statically
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=invoice_add_client
    • > Deprecated in wp-content/plugins/smart-invoice-and-billing-management/includes/addnewclient.php+5
    Non-static method SherkInvoice::getBaseDir() should not be called statically
    • > GET request to /wp-admin/admin.php?page=invoice_menu
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method SherkInvoiceMenu::create_invoice() should not be called statically
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=invoice_status
    • > Notice in wp-content/plugins/smart-invoice-and-billing-management/includes/invoicestatus.php+20
    Undefined index: submit
    • > GET request to /wp-admin/admin.php?page=invoice_menu
    • > Deprecated in wp-content/plugins/smart-invoice-and-billing-management/includes/createinvoice.php+17
    Non-static method SherkInvoiceHelperFunctions::getDefaultInvoiceValue() should not be called statically
    • > GET request to /wp-admin/admin.php?page=invoice_menu
    • > Notice in wp-content/plugins/smart-invoice-and-billing-management/classes/HelperFunctions.php+19
    Undefined offset: 0
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=invoice_status
    • > Notice in wp-content/plugins/smart-invoice-and-billing-management/includes/invoicestatus.php+32
    Undefined variable: msg
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=invoice_add_client
    • > Deprecated in wp-content/plugins/smart-invoice-and-billing-management/includes/addnewclient.php+66
    Non-static method SherkInvoiceHelperFunctions::getAllTableData() should not be called statically
    • > GET request to /wp-admin/admin.php?page=invoice_status
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method SherkInvoiceMenu::invoice_status() should not be called statically
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=invoice_add_client
    • > Notice in wp-content/plugins/smart-invoice-and-billing-management/includes/addnewclient.php+8
    Undefined index: action
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=invoice_add_client
    • > Notice in wp-content/plugins/smart-invoice-and-billing-management/includes/addnewclient.php+43
    Undefined index: id
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=invoice_status
    • > Deprecated in wp-content/plugins/smart-invoice-and-billing-management/includes/invoicestatus.php+139
    Non-static method SherkInvoiceHelperFunctions::getTableDataStatus() should not be called statically
    • > GET request to /wp-admin/admin.php?page=invoice_add_client
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method SherkInvoiceMenu::invoice_add_client() should not be called statically
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=invoice_add_client
    • > Notice in wp-content/plugins/smart-invoice-and-billing-management/includes/addnewclient.php+46
    Undefined index: name
    • > GET request to /wp-admin/admin.php?page=invoice_add_client
    • > Notice in wp-content/plugins/smart-invoice-and-billing-management/includes/addnewclient.php+49
    Undefined index: email
    • > GET request to /wp-admin/admin.php?page=invoice_add_client
    • > Notice in wp-content/plugins/smart-invoice-and-billing-management/includes/addnewclient.php+52
    Undefined index: company
    • > GET request to /wp-admin/admin.php?page=invoice_add_client
    • > Notice in wp-content/plugins/smart-invoice-and-billing-management/includes/addnewclient.php+55
    Undefined index: address

SRP 50% 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
  • 14× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/upgrade-functions.php' (include_path='.:/usr/share/php') in wp-content/plugins/smart-invoice-and-billing-management/database/Install.php on line 3
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/smart-invoice-and-billing-management/includes/Constants.php on line 9
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/smart-invoice-and-billing-management/includes/Constants.php on line 10
    • > PHP Fatal error
      Uncaught Error: Class 'SherkInvoice' not found in wp-content/plugins/smart-invoice-and-billing-management/templates/smartinvoice_dashboard.php:60
    • > PHP Fatal error
      Uncaught Error: Class 'SherkInvoice' not found in wp-content/plugins/smart-invoice-and-billing-management/includes/createinvoice.php:5
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/smart-invoice-and-billing-management/database/Install.php on line 3
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/smart-invoice-and-billing-management/database/Install.php on line 3
    • > PHP Warning
      require_once(ABSPATHwp-admin/upgrade-functions.php): failed to open stream: No such file or directory in wp-content/plugins/smart-invoice-and-billing-management/database/Install.php on line 3
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/upgrade-functions.php' (include_path='.:/usr/share/php') in wp-content/plugins/smart-invoice-and-billing-management/database/Install.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'SherkInvoice' not found in wp-content/plugins/smart-invoice-and-billing-management/includes/invoicestatus.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that require attention:
  • Tags: There are too many tags (11 tag instead of maximum 10)
The official readme.txt might help

smart-invoice-and-billing-management/SherkInvoice.php 92% from 13 tests

"Smart Invoice and Billing Management Plugin" version 1.2's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("smart-invoice-and-billing-management.php" instead of "SherkInvoice.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected1,104 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP1119855660
JavaScript13329421
CSS15123

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity3.00
▷ Minimum class complexity1.00
▷ Maximum class complexity7.00
Average method complexity1.43
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods28
▷ Static methods13.57%
▷ Public methods28100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants7100.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
5 PNG files occupy 0.10MB with 0.06MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
files/invoicestatus.png18.10KB7.14KB▼ 60.57%
files/createinvoice.png7.75KB2.52KB▼ 67.45%
files/addclient.png15.15KB5.12KB▼ 66.25%
images/logo.png49.81KB14.78KB▼ 70.33%
files/sherkspear.png8.81KB3.86KB▼ 56.22%