78% sliced-invoices

Code Review | Sliced Invoices - WordPress Invoice Plugin

WordPress plugin Sliced Invoices - WordPress Invoice Plugin scored78%from 54 tests.

About plugin

  • Plugin page: sliced-invoices
  • Plugin version: 3.9.2
  • PHP compatiblity: 5.5+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.4
  • WordPress version: 6.3.1
  • First release: Dec 22, 2015
  • Latest release: Nov 22, 2023
  • Number of updates: 332
  • Update frequency: every 8.7 days
  • Top authors: SlicedInvoices (100%)

Code review

54 tests

User reviews

114 reviews

Install metrics

6,000+ active /208,657 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
This plugin's installer ran successfully

Server metrics [RAM: ▲2.80MB] [CPU: ▲21.58ms] Passed 4 tests

Analyzing server-side resources used by Sliced Invoices - WordPress Invoice Plugin
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /6.00 ▲2.5352.10 ▲9.35
Dashboard /wp-admin6.21 ▲2.9169.73 ▲20.37
Posts /wp-admin/edit.php6.28 ▲2.9271.94 ▲25.18
Add New Post /wp-admin/post-new.php9.47 ▲3.58124.57 ▲31.41
Media Library /wp-admin/upload.php6.08 ▲2.8569.59 ▲33.94
Invoices /wp-admin/edit.php?post_type=sliced_invoice6.2766.86
Licenses /wp-admin/admin.php?page=sliced_licenses6.6056.59
Tools /wp-admin/admin.php?page=sliced_tools6.58431.23
Quotes /wp-admin/edit.php?post_type=sliced_quote6.2657.89
Add New Invoice /wp-admin/post-new.php?post_type=sliced_invoice7.7689.32
Add New Quote /wp-admin/post-new.php?post_type=sliced_quote7.7295.81
Extras /wp-admin/admin.php?page=sliced_extras6.6062.42
Reports /wp-admin/admin.php?page=sliced_reports6.3295.60
Settings /wp-admin/admin.php?page=sliced_invoices_settings6.6358.77

Server storage [IO: ▲9.87MB] [DB: ▲0.01MB] Passed 3 tests

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 476 new files
Database: no new tables, 19 new options
New WordPress options
can_compress_scripts
sliced_business
sliced_unlocked
db_upgraded
sliced_tax
sliced_general
sliced_emails
sliced_payments
theysaidso_admin_options
sliced_last_lock_time
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Sliced Invoices - WordPress Invoice Plugin
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,891 ▲12914.67 ▼0.071.62 ▼0.3636.85 ▼11.22
Dashboard /wp-admin2,287 ▲1105.64 ▲0.0891.90 ▼1.0642.96 ▲4.11
Posts /wp-admin/edit.php2,225 ▲1252.25 ▲0.1639.25 ▼3.1436.09 ▼0.20
Add New Post /wp-admin/post-new.php1,629 ▲10323.10 ▲0.09698.20 ▲86.9837.00 ▼17.51
Media Library /wp-admin/upload.php1,510 ▲1104.23 ▲0.03100.67 ▲5.2048.35 ▲5.95
Invoices /wp-admin/edit.php?post_type=sliced_invoice1,4942.4743.8437.37
Licenses /wp-admin/admin.php?page=sliced_licenses1,0742.3742.2458.26
Tools /wp-admin/admin.php?page=sliced_tools9462.1632.1228.94
Quotes /wp-admin/edit.php?post_type=sliced_quote1,5542.3741.3929.48
Add New Invoice /wp-admin/post-new.php?post_type=sliced_invoice4,85515.85313.8896.08
Add New Quote /wp-admin/post-new.php?post_type=sliced_quote4,82415.64268.2077.35
Extras /wp-admin/admin.php?page=sliced_extras1,1892.4138.4039.17
Reports /wp-admin/admin.php?page=sliced_reports1,2784.83121.9436.53
Settings /wp-admin/admin.php?page=sliced_invoices_settings1,2092.1134.7233.01

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 19 options
    • sliced_quotes
    • quote_status_children
    • widget_recent-posts
    • invoice_status_children
    • theysaidso_admin_options
    • sliced_last_lock_time
    • widget_theysaidso_widget
    • sliced_unlocked
    • sliced_general
    • sliced_payments
    • ...

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)
These errors were triggered by the plugin
    • > GET request to /wp-admin/admin.php?page=sliced_tools
    • > Warning in wp-content/plugins/sliced-invoices/admin/includes/sliced-admin-tools.php+295
    Invalid argument supplied for foreach()

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
Please fix the following
  • 38× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_File_Base' not found in wp-content/plugins/sliced-invoices/includes/vendor/cmb2/includes/types/CMB2_Type_File_List.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Taxonomy_Base' not found in wp-content/plugins/sliced-invoices/includes/vendor/cmb2/includes/types/CMB2_Type_Taxonomy_Multicheck.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_File_Base' not found in wp-content/plugins/sliced-invoices/includes/vendor/cmb2/includes/types/CMB2_Type_File.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Picker_Base' not found in wp-content/plugins/sliced-invoices/includes/vendor/cmb2/includes/types/CMB2_Type_Text_Datetime_Timestamp.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Picker_Base' not found in wp-content/plugins/sliced-invoices/includes/vendor/cmb2/includes/types/CMB2_Type_Text_Date.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Taxonomy_Base' not found in wp-content/plugins/sliced-invoices/includes/vendor/cmb2/includes/types/CMB2_Type_Taxonomy_Select.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Textarea' not found in wp-content/plugins/sliced-invoices/includes/vendor/cmb2/includes/types/CMB2_Type_Textarea_Code.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function cmb2_dir() in wp-content/plugins/sliced-invoices/includes/vendor/cmb2/includes/rest-api/CMB2_REST_Controller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Taxonomy_Radio' not found in wp-content/plugins/sliced-invoices/includes/vendor/cmb2/includes/types/CMB2_Type_Taxonomy_Radio_Hierarchical.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sliced-invoices/includes/vendor/cmb2/includes/helper-functions.php:131

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed:
  • Tags: There are too many tags (21 tag instead of maximum 10)
You can look at the official readme.txt

sliced-invoices/sliced-invoices.php Passed 13 tests

The main PHP file in "Sliced Invoices - WordPress Invoice Plugin" ver. 3.9.2 adds more information about the plugin and also serves as the entry point for this plugin
70 characters long description:
Create professional Quotes & Invoices that clients can pay for online.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin97,972 lines of code in 281 files:
LanguageFilesBlank linesComment linesLines of code
PO File12919,17525,23747,000
PHP965,61811,55721,294
JavaScript155,0665,03820,678
CSS203031,2496,175
Sass17306291,411
SVG200658
Markdown11610640
JSON100116

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity30.56
▷ Minimum class complexity1.00
▷ Maximum class complexity299.00
Average method complexity3.79
▷ Minimum method complexity1.00
▷ Maximum method complexity62.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes96
▷ Abstract classes99.38%
▷ Concrete classes8790.62%
▷ Final classes11.15%
Methods1,022
▷ Static methods22021.53%
▷ Public methods89987.96%
▷ Protected methods969.39%
▷ Private methods272.64%
Functions152
▷ Named functions152100.00%
▷ Anonymous functions00.00%
Constants17
▷ Global constants1164.71%
▷ Class constants635.29%
▷ Public constants6100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
19 PNG files occupy 0.56MB with 0.14MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/vendor/cmb2/images/ico-delete.png0.70KB0.72KB0.00%
admin/img/sliced-invoices-logo.png7.95KB3.94KB▼ 50.45%
includes/vendor/cmb2/images/ui-bg_flat_75_ffffff_40x100.png0.17KB0.08KB▼ 51.12%
includes/vendor/cmb2/images/ui-icons_888888_256x240.png5.23KB4.11KB▼ 21.49%
includes/vendor/cmb2/images/ui-bg_glass_55_fbf9ee_1x400.png0.12KB0.14KB0.00%