62% expert-invoice

Code Review | Expert Invoice

WordPress plugin Expert Invoice scored62%from 54 tests.

About plugin

  • Plugin page: expert-invoice
  • Plugin version: 1.0.2
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4.1-5.1.2
  • WordPress version: 6.3.1
  • First release: May 3, 2019
  • Latest release: May 28, 2019
  • Number of updates: 15
  • Update frequency: every 1.7 days
  • Top authors: envoqon (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /806 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.62MB] [CPU: ▼38.74ms] Passed 4 tests

Server-side resources used by Expert Invoice
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.37 ▼0.1018.42 ▼20.55
Dashboard /wp-admin3.40 ▲0.0621.24 ▼39.48
Posts /wp-admin/edit.php3.41 ▲0.0518.95 ▼26.94
Add New Post /wp-admin/post-new.php3.40 ▼2.4821.45 ▼67.98
Media Library /wp-admin/upload.php3.40 ▲0.1824.44 ▼9.65
Products /wp-admin/admin.php?page=expert-invoice-product3.4119.76
Payments /wp-admin/admin.php?page=expert-invoice-payment3.4122.09
Dashboard /wp-admin/admin.php?page=expert-invoice3.4119.17
Refunds /wp-admin/admin.php?page=expert-invoice-refund3.4121.52
Customers /wp-admin/admin.php?page=expert-invoice-customer3.4120.76
Quotes /wp-admin/admin.php?page=expert-invoice-quote3.4121.40
Customer Categories /wp-admin/admin.php?page=expert-invoice-customer-category3.4118.53
Settings /wp-admin/admin.php?page=expert-invoice-option3.4119.34
Invoices /wp-admin/admin.php?page=expert-invoice-invoice3.4119.71
Email Templates /wp-admin/edit.php?post_type=expert_template3.4118.57

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 439 new files
Database: 11 new tables, 7 new options
New tables
wp_expertinvoice_payment
wp_expertinvoice_invoice
wp_expertinvoice_customer
wp_expertinvoice_stock_transaction
wp_expertinvoice_customer_category
wp_expertinvoice_invoice_item
wp_expertinvoice_refund
wp_expertinvoice_product
wp_expertinvoice_payment_method
wp_expertinvoice_tax
...
New WordPress options
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
db_upgraded
widget_theysaidso_widget
widget_recent-posts
expert-invoice

Browser metrics Passed 4 tests

This is an overview of browser requirements for Expert Invoice
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,888 ▲11714.79 ▲0.621.99 ▲0.1843.20 ▲1.30
Dashboard /wp-admin2,272 ▲844.87 ▼1.00100.41 ▼3.4838.99 ▼4.08
Posts /wp-admin/edit.php2,152 ▲632.00 ▼0.0433.75 ▼4.3734.85 ▲3.01
Add New Post /wp-admin/post-new.php1,563 ▲3017.63 ▼5.45688.61 ▲11.5454.43 ▲2.27
Media Library /wp-admin/upload.php1,454 ▲664.28 ▼0.04103.62 ▼8.2945.99 ▼1.85
Products /wp-admin/admin.php?page=expert-invoice-product1,2603.8764.5326.44
Payments /wp-admin/admin.php?page=expert-invoice-payment1,1833.8961.7025.37
Dashboard /wp-admin/admin.php?page=expert-invoice1,4586.0281.1234.24
Refunds /wp-admin/admin.php?page=expert-invoice-refund1,1773.8452.3526.48
Customers /wp-admin/admin.php?page=expert-invoice-customer1,1873.8650.5425.65
Quotes /wp-admin/admin.php?page=expert-invoice-quote1,1743.8452.4226.28
Customer Categories /wp-admin/admin.php?page=expert-invoice-customer-category1,1713.8652.7726.10
Settings /wp-admin/admin.php?page=expert-invoice-option1,7194.8570.9556.90
Invoices /wp-admin/admin.php?page=expert-invoice-invoice1,1863.9148.9723.63
Email Templates /wp-admin/edit.php?post_type=expert_template1,8531.9833.3930.36

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/expert-invoice/envoqon/web/HttpSession.php+30
    session_start(): A session had already been started - ignoring
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Almost there, just fix the following server-side errors
  • 11 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=expert_template
    • > POST request to /wp-admin/admin-ajax.php
    • > Notice in wp-content/plugins/expert-invoice/envoqon/web/HttpSession.php+30
    session_start(): A session had already been started - ignoring

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
Please take a closer look at the following
  • 246× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/expert-invoice/application/views/report/item_sales.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'FontLib\\BinaryStream' not found in wp-content/plugins/expert-invoice/vendor/phenx/php-font-lib/src/FontLib/Table/DirectoryEntry.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Sabberworm\\CSS\\CSSList\\CSSList' not found in wp-content/plugins/expert-invoice/vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/CSSList/CSSBlockList.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'envoqon\\db\\DbMigration' not found in wp-content/plugins/expert-invoice/application/migrations/m181231_124550_initial.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Dompdf\\FrameDecorator\\AbstractFrameDecorator' not found in wp-content/plugins/expert-invoice/vendor/dompdf/dompdf/src/FrameDecorator/TableRow.php:10
    • > PHP Warning
      Use of undefined constant WP_DEBUG - assumed 'WP_DEBUG' (this will throw an Error in a future version of PHP) in wp-content/plugins/expert-invoice/envoqon/App.php on line 18
    • > PHP Fatal error
      Uncaught Error: Class 'envoqon\\base\\Component' not found in wp-content/plugins/expert-invoice/envoqon/base/Model.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'envoqon\\widgets\\Widget' not found in wp-content/plugins/expert-invoice/envoqon/widgets/ActiveForm.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'envoqon\\web\\Controller' not found in wp-content/plugins/expert-invoice/application/controllers/ProductController.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'envoqon\\base\\ApplicationComponent' not found in wp-content/plugins/expert-invoice/envoqon/web/HttpSession.php:15

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please fix the following browser errors
    • > GET request to /wp-admin/admin.php?page=expert-invoice
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: $ is not a function" "TypeError: $ is not a function\n at getSalesReport (/wp-admin/admin.php?page=expert-invoice:324:9)\n at HTMLDocument.\u003Canonymous> (/wp-admin/admin.php?page=expert-invoice:350:41)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&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&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/admin.php?page=expert-invoice
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught TypeError: $ is not a function

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
5 plugin tags: invoicing, quotes, invoice, pdf invoice, paypal

expert-invoice/expert-invoice.php Passed 13 tests

"Expert Invoice" version 1.0.2's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
47 characters long description:
A feature-packed and flexible invoicing system.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
There were no executable files found in this plugin54,461 lines of code in 377 files:
LanguageFilesBlank linesComment linesLines of code
PHP32615,17936951,206
Markdown62550909
JavaScript1773259771
CSS910871552
JSON600336
SVG713269
PO File1109145216
XML432185
HTML10017

PHP code 50% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
The following items need your attention
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 652)
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity31.00
▷ Minimum class complexity1.00
▷ Maximum class complexity765.00
Average method complexity3.64
▷ Minimum method complexity1.00
▷ Maximum method complexity652.00
Code structure
Namespaces44
Interfaces5
Traits0
Classes282
▷ Abstract classes227.80%
▷ Concrete classes26092.20%
▷ Final classes00.00%
Methods3,327
▷ Static methods3259.77%
▷ Public methods2,85385.75%
▷ Protected methods3309.92%
▷ Private methods1444.33%
Functions47
▷ Named functions612.77%
▷ Anonymous functions4187.23%
Constants205
▷ Global constants52.44%
▷ Class constants20097.56%
▷ Public constants200100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
8 PNG files occupy 0.13MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/icons/item.png1.97KB2.14KB0.00%
images/icons/favicon.png1.36KB1.35KB▼ 1.29%
images/banner-1544x500.png86.70KB30.15KB▼ 65.22%
images/icons/user.png3.55KB3.63KB0.00%
images/icon-128x128.png3.79KB2.09KB▼ 44.81%